@ariakit/react-core 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/cjs/__chunks/{VEG6PRAG.cjs → 3WCBE6SU.cjs} +3 -1
- package/cjs/__chunks/{45RPYV4J.cjs → EQ4A5RPW.cjs} +2 -2
- package/cjs/__chunks/{CILQPSH2.cjs → FA25CV2I.cjs} +2 -2
- package/cjs/__chunks/{RRW7YVFR.cjs → IPYAEPOT.cjs} +17 -6
- package/cjs/__chunks/{AYDXWQBF.cjs → L3WS5HGI.cjs} +2 -0
- package/cjs/__chunks/{QU2266CJ.cjs → WH4I6OSN.cjs} +12 -4
- package/cjs/__chunks/{LVOI2KVN.cjs → XGKLTARH.cjs} +2 -2
- package/cjs/__chunks/{4GLXDOKG.cjs → YAPOM5RT.cjs} +2 -2
- package/cjs/checkbox/checkbox-provider.cjs +2 -2
- package/cjs/combobox/combobox-cancel.cjs +2 -2
- package/cjs/combobox/combobox-context.cjs +4 -2
- package/cjs/combobox/combobox-context.d.cts +6 -5
- package/cjs/combobox/combobox-context.d.ts +6 -5
- package/cjs/combobox/combobox-disclosure.cjs +2 -2
- package/cjs/combobox/combobox-item-check.cjs +50 -0
- package/cjs/combobox/combobox-item-check.d.cts +60 -0
- package/cjs/combobox/combobox-item-check.d.ts +60 -0
- package/cjs/combobox/combobox-item-value.cjs +3 -3
- package/cjs/combobox/combobox-item.cjs +47 -10
- package/cjs/combobox/combobox-item.d.cts +31 -13
- package/cjs/combobox/combobox-item.d.ts +31 -13
- package/cjs/combobox/combobox-label.cjs +55 -0
- package/cjs/combobox/combobox-label.d.cts +42 -0
- package/cjs/combobox/combobox-label.d.ts +42 -0
- package/cjs/combobox/combobox-list.cjs +3 -3
- package/cjs/combobox/combobox-popover.cjs +7 -7
- package/cjs/combobox/combobox-provider.cjs +4 -4
- package/cjs/combobox/combobox-provider.d.cts +8 -4
- package/cjs/combobox/combobox-provider.d.ts +8 -4
- package/cjs/combobox/combobox-row.cjs +2 -2
- package/cjs/combobox/combobox-separator.cjs +2 -2
- package/cjs/combobox/combobox-store.cjs +2 -2
- package/cjs/combobox/combobox-store.d.cts +28 -9
- package/cjs/combobox/combobox-store.d.ts +28 -9
- package/cjs/combobox/combobox.cjs +28 -14
- package/cjs/combobox/combobox.d.cts +2 -1
- package/cjs/combobox/combobox.d.ts +2 -1
- package/cjs/composite/composite-hover.cjs +2 -2
- package/cjs/composite/composite-hover.d.cts +9 -0
- package/cjs/composite/composite-hover.d.ts +9 -0
- package/cjs/composite/composite-item.d.cts +3 -0
- package/cjs/composite/composite-item.d.ts +3 -0
- package/cjs/composite/composite-overflow.cjs +2 -2
- package/cjs/disclosure/disclosure-content.d.cts +3 -1
- package/cjs/disclosure/disclosure-content.d.ts +3 -1
- package/cjs/disclosure/disclosure.d.cts +3 -0
- package/cjs/disclosure/disclosure.d.ts +3 -0
- package/cjs/focusable/focusable.d.cts +2 -1
- package/cjs/focusable/focusable.d.ts +2 -1
- package/cjs/form/form-checkbox.cjs +1 -1
- package/cjs/hovercard/hovercard-anchor.d.cts +3 -0
- package/cjs/hovercard/hovercard-anchor.d.ts +3 -0
- package/cjs/hovercard/hovercard.cjs +3 -3
- package/cjs/menu/menu-button.cjs +33 -21
- package/cjs/menu/menu-item-checkbox.cjs +4 -4
- package/cjs/menu/menu-item-radio.cjs +3 -3
- package/cjs/menu/menu-item.cjs +3 -3
- package/cjs/menu/menu-provider.cjs +3 -3
- package/cjs/menu/menu-store.cjs +3 -3
- package/cjs/menu/menu-store.d.cts +7 -55
- package/cjs/menu/menu-store.d.ts +7 -55
- package/cjs/menu/menu.cjs +3 -3
- package/cjs/popover/popover.cjs +2 -2
- package/cjs/popover/popover.d.cts +4 -0
- package/cjs/popover/popover.d.ts +4 -0
- package/cjs/portal/portal.d.cts +5 -1
- package/cjs/portal/portal.d.ts +5 -1
- package/cjs/select/select-item.cjs +5 -5
- package/cjs/select/select-label.cjs +1 -1
- package/cjs/select/select-popover.cjs +2 -2
- package/cjs/select/select-provider.cjs +3 -3
- package/cjs/select/select-store.cjs +3 -3
- package/cjs/select/select-store.d.cts +1 -7
- package/cjs/select/select-store.d.ts +1 -7
- package/cjs/tooltip/tooltip.cjs +3 -3
- package/combobox/combobox-item-check/package.json +8 -0
- package/combobox/combobox-label/package.json +8 -0
- package/esm/__chunks/{KFUKDUTY.js → 4AMOOZBQ.js} +10 -2
- package/esm/__chunks/{PHTJ3BCW.js → 7HYEBVZE.js} +1 -1
- package/esm/__chunks/{YGJUONJM.js → BONLQCKO.js} +1 -1
- package/esm/__chunks/{BRO2JF5P.js → G6ONQ5EH.js} +20 -9
- package/esm/__chunks/{W3TC4TID.js → JRUYDVPB.js} +1 -1
- package/esm/__chunks/{NE6JAKK6.js → P3UZS6BC.js} +1 -1
- package/esm/__chunks/{MTC2KUZZ.js → W76OTZCC.js} +3 -1
- package/esm/__chunks/{24AKC2LC.js → ZETMAOTK.js} +2 -0
- package/esm/checkbox/checkbox-provider.js +3 -3
- package/esm/combobox/combobox-cancel.js +1 -1
- package/esm/combobox/combobox-context.d.ts +6 -5
- package/esm/combobox/combobox-context.js +3 -1
- package/esm/combobox/combobox-disclosure.js +1 -1
- package/esm/combobox/combobox-item-check.d.ts +60 -0
- package/esm/combobox/combobox-item-check.js +50 -0
- package/esm/combobox/combobox-item-value.js +1 -1
- package/esm/combobox/combobox-item.d.ts +31 -13
- package/esm/combobox/combobox-item.js +45 -8
- package/esm/combobox/combobox-label.d.ts +42 -0
- package/esm/combobox/combobox-label.js +55 -0
- package/esm/combobox/combobox-list.js +2 -2
- package/esm/combobox/combobox-popover.js +3 -3
- package/esm/combobox/combobox-provider.d.ts +8 -4
- package/esm/combobox/combobox-provider.js +2 -2
- package/esm/combobox/combobox-row.js +1 -1
- package/esm/combobox/combobox-separator.js +1 -1
- package/esm/combobox/combobox-store.d.ts +28 -9
- package/esm/combobox/combobox-store.js +1 -1
- package/esm/combobox/combobox.d.ts +2 -1
- package/esm/combobox/combobox.js +28 -14
- package/esm/composite/composite-hover.d.ts +9 -0
- package/esm/composite/composite-hover.js +1 -1
- package/esm/composite/composite-item.d.ts +3 -0
- package/esm/composite/composite-overflow.js +1 -1
- package/esm/disclosure/disclosure-content.d.ts +3 -1
- package/esm/disclosure/disclosure.d.ts +3 -0
- package/esm/focusable/focusable.d.ts +2 -1
- package/esm/form/form-checkbox.js +1 -1
- package/esm/hovercard/hovercard-anchor.d.ts +3 -0
- package/esm/hovercard/hovercard.js +2 -2
- package/esm/menu/menu-button.js +33 -21
- package/esm/menu/menu-item-checkbox.js +3 -3
- package/esm/menu/menu-item-radio.js +2 -2
- package/esm/menu/menu-item.js +2 -2
- package/esm/menu/menu-provider.js +2 -2
- package/esm/menu/menu-store.d.ts +7 -55
- package/esm/menu/menu-store.js +2 -2
- package/esm/menu/menu.js +2 -2
- package/esm/popover/popover.d.ts +4 -0
- package/esm/popover/popover.js +1 -1
- package/esm/portal/portal.d.ts +5 -1
- package/esm/select/select-item.js +4 -4
- package/esm/select/select-label.js +2 -2
- package/esm/select/select-popover.js +1 -1
- package/esm/select/select-provider.js +2 -2
- package/esm/select/select-store.d.ts +1 -7
- package/esm/select/select-store.js +2 -2
- package/esm/tooltip/tooltip.js +2 -2
- package/package.json +16 -2
- package/cjs/collection/collection-context.d.cts +0 -34
- package/cjs/collection/collection-context.d.ts +0 -34
- package/cjs/composite/utils.d.cts +0 -69
- package/cjs/composite/utils.d.ts +0 -69
- package/cjs/tab/tab-store.d.cts +0 -74
- package/cjs/tab/tab-store.d.ts +0 -74
- package/esm/collection/collection-context.d.ts +0 -34
- package/esm/composite/utils.d.ts +0 -69
- package/esm/tab/tab-store.d.ts +0 -74
- package/cjs/__chunks/{ISGOCBDC.cjs → RIZYIKBE.cjs} +1 -1
- package/esm/__chunks/{KB2HXEVC.js → WBQC3LL4.js} +1 -1
package/esm/tooltip/tooltip.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
useHovercard
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/BONLQCKO.js";
|
|
5
5
|
import "../__chunks/YMV43K4F.js";
|
|
6
|
-
import "../__chunks/
|
|
6
|
+
import "../__chunks/WBQC3LL4.js";
|
|
7
7
|
import {
|
|
8
8
|
createDialogComponent
|
|
9
9
|
} from "../__chunks/U7WGY7YX.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ariakit/react-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "Ariakit React core",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"core"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@ariakit/core": "0.3.
|
|
33
|
+
"@ariakit/core": "0.3.7",
|
|
34
34
|
"@floating-ui/dom": "^1.0.0",
|
|
35
35
|
"use-sync-external-store": "^1.2.0"
|
|
36
36
|
},
|
|
@@ -1320,6 +1320,13 @@
|
|
|
1320
1320
|
"default": "./cjs/combobox/combobox-list.cjs"
|
|
1321
1321
|
}
|
|
1322
1322
|
},
|
|
1323
|
+
"./combobox/combobox-label": {
|
|
1324
|
+
"import": "./esm/combobox/combobox-label.js",
|
|
1325
|
+
"require": {
|
|
1326
|
+
"types": "./cjs/combobox/combobox-label.d.cts",
|
|
1327
|
+
"default": "./cjs/combobox/combobox-label.cjs"
|
|
1328
|
+
}
|
|
1329
|
+
},
|
|
1323
1330
|
"./combobox/combobox-item": {
|
|
1324
1331
|
"import": "./esm/combobox/combobox-item.js",
|
|
1325
1332
|
"require": {
|
|
@@ -1334,6 +1341,13 @@
|
|
|
1334
1341
|
"default": "./cjs/combobox/combobox-item-value.cjs"
|
|
1335
1342
|
}
|
|
1336
1343
|
},
|
|
1344
|
+
"./combobox/combobox-item-check": {
|
|
1345
|
+
"import": "./esm/combobox/combobox-item-check.js",
|
|
1346
|
+
"require": {
|
|
1347
|
+
"types": "./cjs/combobox/combobox-item-check.d.cts",
|
|
1348
|
+
"default": "./cjs/combobox/combobox-item-check.cjs"
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1337
1351
|
"./combobox/combobox-group": {
|
|
1338
1352
|
"import": "./esm/combobox/combobox-group.js",
|
|
1339
1353
|
"require": {
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { CollectionStore } from "./collection-store.js";
|
|
2
|
-
/**
|
|
3
|
-
* Returns the collection store from the nearest collection container.
|
|
4
|
-
* @example
|
|
5
|
-
* function CollectionItem() {
|
|
6
|
-
* const store = useCollectionContext();
|
|
7
|
-
*
|
|
8
|
-
* if (!store) {
|
|
9
|
-
* throw new Error("CollectionItem must be wrapped in CollectionProvider");
|
|
10
|
-
* }
|
|
11
|
-
*
|
|
12
|
-
* // Use the store...
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export declare const useCollectionContext: () => CollectionStore<{
|
|
16
|
-
id: string;
|
|
17
|
-
element?: HTMLElement | null | undefined;
|
|
18
|
-
}> | undefined;
|
|
19
|
-
export declare const useCollectionScopedContext: (onlyScoped?: boolean) => CollectionStore<{
|
|
20
|
-
id: string;
|
|
21
|
-
element?: HTMLElement | null | undefined;
|
|
22
|
-
}> | undefined;
|
|
23
|
-
export declare const useCollectionProviderContext: () => CollectionStore<{
|
|
24
|
-
id: string;
|
|
25
|
-
element?: HTMLElement | null | undefined;
|
|
26
|
-
}> | undefined;
|
|
27
|
-
export declare const CollectionContextProvider: (props: import("react").ProviderProps<CollectionStore<{
|
|
28
|
-
id: string;
|
|
29
|
-
element?: HTMLElement | null | undefined;
|
|
30
|
-
}> | undefined>) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
export declare const CollectionScopedContextProvider: (props: import("react").ProviderProps<CollectionStore<{
|
|
32
|
-
id: string;
|
|
33
|
-
element?: HTMLElement | null | undefined;
|
|
34
|
-
}> | undefined>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { CollectionStore } from "./collection-store.js";
|
|
2
|
-
/**
|
|
3
|
-
* Returns the collection store from the nearest collection container.
|
|
4
|
-
* @example
|
|
5
|
-
* function CollectionItem() {
|
|
6
|
-
* const store = useCollectionContext();
|
|
7
|
-
*
|
|
8
|
-
* if (!store) {
|
|
9
|
-
* throw new Error("CollectionItem must be wrapped in CollectionProvider");
|
|
10
|
-
* }
|
|
11
|
-
*
|
|
12
|
-
* // Use the store...
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export declare const useCollectionContext: () => CollectionStore<{
|
|
16
|
-
id: string;
|
|
17
|
-
element?: HTMLElement | null | undefined;
|
|
18
|
-
}> | undefined;
|
|
19
|
-
export declare const useCollectionScopedContext: (onlyScoped?: boolean) => CollectionStore<{
|
|
20
|
-
id: string;
|
|
21
|
-
element?: HTMLElement | null | undefined;
|
|
22
|
-
}> | undefined;
|
|
23
|
-
export declare const useCollectionProviderContext: () => CollectionStore<{
|
|
24
|
-
id: string;
|
|
25
|
-
element?: HTMLElement | null | undefined;
|
|
26
|
-
}> | undefined;
|
|
27
|
-
export declare const CollectionContextProvider: (props: import("react").ProviderProps<CollectionStore<{
|
|
28
|
-
id: string;
|
|
29
|
-
element?: HTMLElement | null | undefined;
|
|
30
|
-
}> | undefined>) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
export declare const CollectionScopedContextProvider: (props: import("react").ProviderProps<CollectionStore<{
|
|
32
|
-
id: string;
|
|
33
|
-
element?: HTMLElement | null | undefined;
|
|
34
|
-
}> | undefined>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { CompositeStore, CompositeStoreItem } from "./composite-store.js";
|
|
2
|
-
/**
|
|
3
|
-
* Moves all the items before the passed `id` to the end of the array. This is
|
|
4
|
-
* useful when we want to loop through the items in the same row or column as
|
|
5
|
-
* the first items will be placed after the last items.
|
|
6
|
-
*
|
|
7
|
-
* The null item that's inserted when `shouldInsertNullItem` is set to `true`
|
|
8
|
-
* represents the composite container itself. When the active item is null, the
|
|
9
|
-
* composite container has focus.
|
|
10
|
-
*/
|
|
11
|
-
export declare function flipItems(items: CompositeStoreItem[], activeId: string, shouldInsertNullItem?: boolean): {
|
|
12
|
-
id: string;
|
|
13
|
-
}[];
|
|
14
|
-
/**
|
|
15
|
-
* Finds the first enabled item.
|
|
16
|
-
*/
|
|
17
|
-
export declare function findFirstEnabledItem(items: CompositeStoreItem[], excludeId?: string): ({
|
|
18
|
-
id: string;
|
|
19
|
-
element?: HTMLElement | null | undefined;
|
|
20
|
-
} & {
|
|
21
|
-
rowId?: string | undefined;
|
|
22
|
-
disabled?: boolean | undefined;
|
|
23
|
-
children?: string | undefined;
|
|
24
|
-
}) | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* Finds the first enabled item by its id.
|
|
27
|
-
*/
|
|
28
|
-
export declare function getEnabledItem(store: CompositeStore, id?: string | null): ({
|
|
29
|
-
id: string;
|
|
30
|
-
element?: HTMLElement | null | undefined;
|
|
31
|
-
} & {
|
|
32
|
-
rowId?: string | undefined;
|
|
33
|
-
disabled?: boolean | undefined;
|
|
34
|
-
children?: string | undefined;
|
|
35
|
-
}) | null;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a two-dimensional array with items grouped by their rowId's.
|
|
38
|
-
*/
|
|
39
|
-
export declare function groupItemsByRows(items: CompositeStoreItem[]): ({
|
|
40
|
-
id: string;
|
|
41
|
-
element?: HTMLElement | null | undefined;
|
|
42
|
-
} & {
|
|
43
|
-
rowId?: string | undefined;
|
|
44
|
-
disabled?: boolean | undefined;
|
|
45
|
-
children?: string | undefined;
|
|
46
|
-
})[][];
|
|
47
|
-
/**
|
|
48
|
-
* Selects text field contents even if it's a content editable element.
|
|
49
|
-
*/
|
|
50
|
-
export declare function selectTextField(element: HTMLElement, collapseToEnd?: boolean): void;
|
|
51
|
-
declare const FOCUS_SILENTLY: unique symbol;
|
|
52
|
-
type FocusSilentlyElement = HTMLElement & {
|
|
53
|
-
[FOCUS_SILENTLY]?: boolean;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Focus an element with a flag. The `silentlyFocused` function needs to be
|
|
57
|
-
* called later to check if the focus was silenced and to reset this state.
|
|
58
|
-
*/
|
|
59
|
-
export declare function focusSilently(element: FocusSilentlyElement): void;
|
|
60
|
-
/**
|
|
61
|
-
* Checks whether the element has been focused with the `focusSilently` function
|
|
62
|
-
* and resets the state.
|
|
63
|
-
*/
|
|
64
|
-
export declare function silentlyFocused(element: FocusSilentlyElement): boolean | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Determines whether the element is a composite item.
|
|
67
|
-
*/
|
|
68
|
-
export declare function isItem(store: CompositeStore, element?: Element | null, exclude?: Element): boolean;
|
|
69
|
-
export {};
|
package/cjs/composite/utils.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { CompositeStore, CompositeStoreItem } from "./composite-store.js";
|
|
2
|
-
/**
|
|
3
|
-
* Moves all the items before the passed `id` to the end of the array. This is
|
|
4
|
-
* useful when we want to loop through the items in the same row or column as
|
|
5
|
-
* the first items will be placed after the last items.
|
|
6
|
-
*
|
|
7
|
-
* The null item that's inserted when `shouldInsertNullItem` is set to `true`
|
|
8
|
-
* represents the composite container itself. When the active item is null, the
|
|
9
|
-
* composite container has focus.
|
|
10
|
-
*/
|
|
11
|
-
export declare function flipItems(items: CompositeStoreItem[], activeId: string, shouldInsertNullItem?: boolean): {
|
|
12
|
-
id: string;
|
|
13
|
-
}[];
|
|
14
|
-
/**
|
|
15
|
-
* Finds the first enabled item.
|
|
16
|
-
*/
|
|
17
|
-
export declare function findFirstEnabledItem(items: CompositeStoreItem[], excludeId?: string): ({
|
|
18
|
-
id: string;
|
|
19
|
-
element?: HTMLElement | null | undefined;
|
|
20
|
-
} & {
|
|
21
|
-
rowId?: string | undefined;
|
|
22
|
-
disabled?: boolean | undefined;
|
|
23
|
-
children?: string | undefined;
|
|
24
|
-
}) | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* Finds the first enabled item by its id.
|
|
27
|
-
*/
|
|
28
|
-
export declare function getEnabledItem(store: CompositeStore, id?: string | null): ({
|
|
29
|
-
id: string;
|
|
30
|
-
element?: HTMLElement | null | undefined;
|
|
31
|
-
} & {
|
|
32
|
-
rowId?: string | undefined;
|
|
33
|
-
disabled?: boolean | undefined;
|
|
34
|
-
children?: string | undefined;
|
|
35
|
-
}) | null;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a two-dimensional array with items grouped by their rowId's.
|
|
38
|
-
*/
|
|
39
|
-
export declare function groupItemsByRows(items: CompositeStoreItem[]): ({
|
|
40
|
-
id: string;
|
|
41
|
-
element?: HTMLElement | null | undefined;
|
|
42
|
-
} & {
|
|
43
|
-
rowId?: string | undefined;
|
|
44
|
-
disabled?: boolean | undefined;
|
|
45
|
-
children?: string | undefined;
|
|
46
|
-
})[][];
|
|
47
|
-
/**
|
|
48
|
-
* Selects text field contents even if it's a content editable element.
|
|
49
|
-
*/
|
|
50
|
-
export declare function selectTextField(element: HTMLElement, collapseToEnd?: boolean): void;
|
|
51
|
-
declare const FOCUS_SILENTLY: unique symbol;
|
|
52
|
-
type FocusSilentlyElement = HTMLElement & {
|
|
53
|
-
[FOCUS_SILENTLY]?: boolean;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Focus an element with a flag. The `silentlyFocused` function needs to be
|
|
57
|
-
* called later to check if the focus was silenced and to reset this state.
|
|
58
|
-
*/
|
|
59
|
-
export declare function focusSilently(element: FocusSilentlyElement): void;
|
|
60
|
-
/**
|
|
61
|
-
* Checks whether the element has been focused with the `focusSilently` function
|
|
62
|
-
* and resets the state.
|
|
63
|
-
*/
|
|
64
|
-
export declare function silentlyFocused(element: FocusSilentlyElement): boolean | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Determines whether the element is a composite item.
|
|
67
|
-
*/
|
|
68
|
-
export declare function isItem(store: CompositeStore, element?: Element | null, exclude?: Element): boolean;
|
|
69
|
-
export {};
|
package/cjs/tab/tab-store.d.cts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as Core from "@ariakit/core/tab/tab-store";
|
|
2
|
-
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
|
|
3
|
-
import type { Store } from "../utils/store.js";
|
|
4
|
-
type Item = Core.TabStoreItem;
|
|
5
|
-
export declare function useTabStoreProps<T extends Core.TabStore>(store: T, update: () => void, props: TabStoreProps): T & {
|
|
6
|
-
panels: import("@ariakit/core/collection/collection-store").CollectionStoreFunctions<{
|
|
7
|
-
id: string;
|
|
8
|
-
element?: HTMLElement | null | undefined;
|
|
9
|
-
} & {
|
|
10
|
-
tabId?: string | null | undefined;
|
|
11
|
-
}> & import("@ariakit/core/utils/store").Store<import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
12
|
-
id: string;
|
|
13
|
-
element?: HTMLElement | null | undefined;
|
|
14
|
-
} & {
|
|
15
|
-
tabId?: string | null | undefined;
|
|
16
|
-
}>> & {
|
|
17
|
-
useState: {
|
|
18
|
-
(): import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
19
|
-
id: string;
|
|
20
|
-
element?: HTMLElement | null | undefined;
|
|
21
|
-
} & {
|
|
22
|
-
tabId?: string | null | undefined;
|
|
23
|
-
}>;
|
|
24
|
-
<K extends keyof import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
25
|
-
id: string;
|
|
26
|
-
element?: HTMLElement | null | undefined;
|
|
27
|
-
} & {
|
|
28
|
-
tabId?: string | null | undefined;
|
|
29
|
-
}>>(key: K): import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
30
|
-
id: string;
|
|
31
|
-
element?: HTMLElement | null | undefined;
|
|
32
|
-
} & {
|
|
33
|
-
tabId?: string | null | undefined;
|
|
34
|
-
}>[K];
|
|
35
|
-
<V>(selector: (state: import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
36
|
-
id: string;
|
|
37
|
-
element?: HTMLElement | null | undefined;
|
|
38
|
-
} & {
|
|
39
|
-
tabId?: string | null | undefined;
|
|
40
|
-
}>) => V): V;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Creates a tab store.
|
|
46
|
-
* @see https://ariakit.org/components/tab
|
|
47
|
-
* @example
|
|
48
|
-
* ```jsx
|
|
49
|
-
* const tab = useTabStore();
|
|
50
|
-
* <TabList store={tab}>
|
|
51
|
-
* <Tab>Tab 1</Tab>
|
|
52
|
-
* <Tab>Tab 2</Tab>
|
|
53
|
-
* </TabList>
|
|
54
|
-
* <TabPanel store={tab}>Panel 1</TabPanel>
|
|
55
|
-
* <TabPanel store={tab}>Panel 2</TabPanel>
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
export declare function useTabStore(props?: TabStoreProps): TabStore;
|
|
59
|
-
export type TabStoreItem = Item;
|
|
60
|
-
export interface TabStoreState extends Core.TabStoreState, CompositeStoreState<Item> {
|
|
61
|
-
}
|
|
62
|
-
export interface TabStoreFunctions extends Core.TabStoreFunctions, CompositeStoreFunctions<Item> {
|
|
63
|
-
panels: Store<Core.TabStoreFunctions["panels"]>;
|
|
64
|
-
}
|
|
65
|
-
export interface TabStoreOptions extends Core.TabStoreOptions, CompositeStoreOptions<Item> {
|
|
66
|
-
/**
|
|
67
|
-
* Function that will be called when the `selectedId` state changes.
|
|
68
|
-
* @param selectedId The new selected id.
|
|
69
|
-
*/
|
|
70
|
-
setSelectedId?: (selectedId: TabStoreState["selectedId"]) => void;
|
|
71
|
-
}
|
|
72
|
-
export type TabStoreProps = TabStoreOptions & Core.TabStoreProps;
|
|
73
|
-
export type TabStore = TabStoreFunctions & Store<Core.TabStore>;
|
|
74
|
-
export {};
|
package/cjs/tab/tab-store.d.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as Core from "@ariakit/core/tab/tab-store";
|
|
2
|
-
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
|
|
3
|
-
import type { Store } from "../utils/store.js";
|
|
4
|
-
type Item = Core.TabStoreItem;
|
|
5
|
-
export declare function useTabStoreProps<T extends Core.TabStore>(store: T, update: () => void, props: TabStoreProps): T & {
|
|
6
|
-
panels: import("@ariakit/core/collection/collection-store").CollectionStoreFunctions<{
|
|
7
|
-
id: string;
|
|
8
|
-
element?: HTMLElement | null | undefined;
|
|
9
|
-
} & {
|
|
10
|
-
tabId?: string | null | undefined;
|
|
11
|
-
}> & import("@ariakit/core/utils/store").Store<import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
12
|
-
id: string;
|
|
13
|
-
element?: HTMLElement | null | undefined;
|
|
14
|
-
} & {
|
|
15
|
-
tabId?: string | null | undefined;
|
|
16
|
-
}>> & {
|
|
17
|
-
useState: {
|
|
18
|
-
(): import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
19
|
-
id: string;
|
|
20
|
-
element?: HTMLElement | null | undefined;
|
|
21
|
-
} & {
|
|
22
|
-
tabId?: string | null | undefined;
|
|
23
|
-
}>;
|
|
24
|
-
<K extends keyof import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
25
|
-
id: string;
|
|
26
|
-
element?: HTMLElement | null | undefined;
|
|
27
|
-
} & {
|
|
28
|
-
tabId?: string | null | undefined;
|
|
29
|
-
}>>(key: K): import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
30
|
-
id: string;
|
|
31
|
-
element?: HTMLElement | null | undefined;
|
|
32
|
-
} & {
|
|
33
|
-
tabId?: string | null | undefined;
|
|
34
|
-
}>[K];
|
|
35
|
-
<V>(selector: (state: import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
36
|
-
id: string;
|
|
37
|
-
element?: HTMLElement | null | undefined;
|
|
38
|
-
} & {
|
|
39
|
-
tabId?: string | null | undefined;
|
|
40
|
-
}>) => V): V;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Creates a tab store.
|
|
46
|
-
* @see https://ariakit.org/components/tab
|
|
47
|
-
* @example
|
|
48
|
-
* ```jsx
|
|
49
|
-
* const tab = useTabStore();
|
|
50
|
-
* <TabList store={tab}>
|
|
51
|
-
* <Tab>Tab 1</Tab>
|
|
52
|
-
* <Tab>Tab 2</Tab>
|
|
53
|
-
* </TabList>
|
|
54
|
-
* <TabPanel store={tab}>Panel 1</TabPanel>
|
|
55
|
-
* <TabPanel store={tab}>Panel 2</TabPanel>
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
export declare function useTabStore(props?: TabStoreProps): TabStore;
|
|
59
|
-
export type TabStoreItem = Item;
|
|
60
|
-
export interface TabStoreState extends Core.TabStoreState, CompositeStoreState<Item> {
|
|
61
|
-
}
|
|
62
|
-
export interface TabStoreFunctions extends Core.TabStoreFunctions, CompositeStoreFunctions<Item> {
|
|
63
|
-
panels: Store<Core.TabStoreFunctions["panels"]>;
|
|
64
|
-
}
|
|
65
|
-
export interface TabStoreOptions extends Core.TabStoreOptions, CompositeStoreOptions<Item> {
|
|
66
|
-
/**
|
|
67
|
-
* Function that will be called when the `selectedId` state changes.
|
|
68
|
-
* @param selectedId The new selected id.
|
|
69
|
-
*/
|
|
70
|
-
setSelectedId?: (selectedId: TabStoreState["selectedId"]) => void;
|
|
71
|
-
}
|
|
72
|
-
export type TabStoreProps = TabStoreOptions & Core.TabStoreProps;
|
|
73
|
-
export type TabStore = TabStoreFunctions & Store<Core.TabStore>;
|
|
74
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { CollectionStore } from "./collection-store.js";
|
|
2
|
-
/**
|
|
3
|
-
* Returns the collection store from the nearest collection container.
|
|
4
|
-
* @example
|
|
5
|
-
* function CollectionItem() {
|
|
6
|
-
* const store = useCollectionContext();
|
|
7
|
-
*
|
|
8
|
-
* if (!store) {
|
|
9
|
-
* throw new Error("CollectionItem must be wrapped in CollectionProvider");
|
|
10
|
-
* }
|
|
11
|
-
*
|
|
12
|
-
* // Use the store...
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export declare const useCollectionContext: () => CollectionStore<{
|
|
16
|
-
id: string;
|
|
17
|
-
element?: HTMLElement | null | undefined;
|
|
18
|
-
}> | undefined;
|
|
19
|
-
export declare const useCollectionScopedContext: (onlyScoped?: boolean) => CollectionStore<{
|
|
20
|
-
id: string;
|
|
21
|
-
element?: HTMLElement | null | undefined;
|
|
22
|
-
}> | undefined;
|
|
23
|
-
export declare const useCollectionProviderContext: () => CollectionStore<{
|
|
24
|
-
id: string;
|
|
25
|
-
element?: HTMLElement | null | undefined;
|
|
26
|
-
}> | undefined;
|
|
27
|
-
export declare const CollectionContextProvider: (props: import("react").ProviderProps<CollectionStore<{
|
|
28
|
-
id: string;
|
|
29
|
-
element?: HTMLElement | null | undefined;
|
|
30
|
-
}> | undefined>) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
export declare const CollectionScopedContextProvider: (props: import("react").ProviderProps<CollectionStore<{
|
|
32
|
-
id: string;
|
|
33
|
-
element?: HTMLElement | null | undefined;
|
|
34
|
-
}> | undefined>) => import("react/jsx-runtime").JSX.Element;
|
package/esm/composite/utils.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { CompositeStore, CompositeStoreItem } from "./composite-store.js";
|
|
2
|
-
/**
|
|
3
|
-
* Moves all the items before the passed `id` to the end of the array. This is
|
|
4
|
-
* useful when we want to loop through the items in the same row or column as
|
|
5
|
-
* the first items will be placed after the last items.
|
|
6
|
-
*
|
|
7
|
-
* The null item that's inserted when `shouldInsertNullItem` is set to `true`
|
|
8
|
-
* represents the composite container itself. When the active item is null, the
|
|
9
|
-
* composite container has focus.
|
|
10
|
-
*/
|
|
11
|
-
export declare function flipItems(items: CompositeStoreItem[], activeId: string, shouldInsertNullItem?: boolean): {
|
|
12
|
-
id: string;
|
|
13
|
-
}[];
|
|
14
|
-
/**
|
|
15
|
-
* Finds the first enabled item.
|
|
16
|
-
*/
|
|
17
|
-
export declare function findFirstEnabledItem(items: CompositeStoreItem[], excludeId?: string): ({
|
|
18
|
-
id: string;
|
|
19
|
-
element?: HTMLElement | null | undefined;
|
|
20
|
-
} & {
|
|
21
|
-
rowId?: string | undefined;
|
|
22
|
-
disabled?: boolean | undefined;
|
|
23
|
-
children?: string | undefined;
|
|
24
|
-
}) | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* Finds the first enabled item by its id.
|
|
27
|
-
*/
|
|
28
|
-
export declare function getEnabledItem(store: CompositeStore, id?: string | null): ({
|
|
29
|
-
id: string;
|
|
30
|
-
element?: HTMLElement | null | undefined;
|
|
31
|
-
} & {
|
|
32
|
-
rowId?: string | undefined;
|
|
33
|
-
disabled?: boolean | undefined;
|
|
34
|
-
children?: string | undefined;
|
|
35
|
-
}) | null;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a two-dimensional array with items grouped by their rowId's.
|
|
38
|
-
*/
|
|
39
|
-
export declare function groupItemsByRows(items: CompositeStoreItem[]): ({
|
|
40
|
-
id: string;
|
|
41
|
-
element?: HTMLElement | null | undefined;
|
|
42
|
-
} & {
|
|
43
|
-
rowId?: string | undefined;
|
|
44
|
-
disabled?: boolean | undefined;
|
|
45
|
-
children?: string | undefined;
|
|
46
|
-
})[][];
|
|
47
|
-
/**
|
|
48
|
-
* Selects text field contents even if it's a content editable element.
|
|
49
|
-
*/
|
|
50
|
-
export declare function selectTextField(element: HTMLElement, collapseToEnd?: boolean): void;
|
|
51
|
-
declare const FOCUS_SILENTLY: unique symbol;
|
|
52
|
-
type FocusSilentlyElement = HTMLElement & {
|
|
53
|
-
[FOCUS_SILENTLY]?: boolean;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Focus an element with a flag. The `silentlyFocused` function needs to be
|
|
57
|
-
* called later to check if the focus was silenced and to reset this state.
|
|
58
|
-
*/
|
|
59
|
-
export declare function focusSilently(element: FocusSilentlyElement): void;
|
|
60
|
-
/**
|
|
61
|
-
* Checks whether the element has been focused with the `focusSilently` function
|
|
62
|
-
* and resets the state.
|
|
63
|
-
*/
|
|
64
|
-
export declare function silentlyFocused(element: FocusSilentlyElement): boolean | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Determines whether the element is a composite item.
|
|
67
|
-
*/
|
|
68
|
-
export declare function isItem(store: CompositeStore, element?: Element | null, exclude?: Element): boolean;
|
|
69
|
-
export {};
|
package/esm/tab/tab-store.d.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as Core from "@ariakit/core/tab/tab-store";
|
|
2
|
-
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
|
|
3
|
-
import type { Store } from "../utils/store.js";
|
|
4
|
-
type Item = Core.TabStoreItem;
|
|
5
|
-
export declare function useTabStoreProps<T extends Core.TabStore>(store: T, update: () => void, props: TabStoreProps): T & {
|
|
6
|
-
panels: import("@ariakit/core/collection/collection-store").CollectionStoreFunctions<{
|
|
7
|
-
id: string;
|
|
8
|
-
element?: HTMLElement | null | undefined;
|
|
9
|
-
} & {
|
|
10
|
-
tabId?: string | null | undefined;
|
|
11
|
-
}> & import("@ariakit/core/utils/store").Store<import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
12
|
-
id: string;
|
|
13
|
-
element?: HTMLElement | null | undefined;
|
|
14
|
-
} & {
|
|
15
|
-
tabId?: string | null | undefined;
|
|
16
|
-
}>> & {
|
|
17
|
-
useState: {
|
|
18
|
-
(): import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
19
|
-
id: string;
|
|
20
|
-
element?: HTMLElement | null | undefined;
|
|
21
|
-
} & {
|
|
22
|
-
tabId?: string | null | undefined;
|
|
23
|
-
}>;
|
|
24
|
-
<K extends keyof import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
25
|
-
id: string;
|
|
26
|
-
element?: HTMLElement | null | undefined;
|
|
27
|
-
} & {
|
|
28
|
-
tabId?: string | null | undefined;
|
|
29
|
-
}>>(key: K): import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
30
|
-
id: string;
|
|
31
|
-
element?: HTMLElement | null | undefined;
|
|
32
|
-
} & {
|
|
33
|
-
tabId?: string | null | undefined;
|
|
34
|
-
}>[K];
|
|
35
|
-
<V>(selector: (state: import("@ariakit/core/collection/collection-store").CollectionStoreState<{
|
|
36
|
-
id: string;
|
|
37
|
-
element?: HTMLElement | null | undefined;
|
|
38
|
-
} & {
|
|
39
|
-
tabId?: string | null | undefined;
|
|
40
|
-
}>) => V): V;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Creates a tab store.
|
|
46
|
-
* @see https://ariakit.org/components/tab
|
|
47
|
-
* @example
|
|
48
|
-
* ```jsx
|
|
49
|
-
* const tab = useTabStore();
|
|
50
|
-
* <TabList store={tab}>
|
|
51
|
-
* <Tab>Tab 1</Tab>
|
|
52
|
-
* <Tab>Tab 2</Tab>
|
|
53
|
-
* </TabList>
|
|
54
|
-
* <TabPanel store={tab}>Panel 1</TabPanel>
|
|
55
|
-
* <TabPanel store={tab}>Panel 2</TabPanel>
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
export declare function useTabStore(props?: TabStoreProps): TabStore;
|
|
59
|
-
export type TabStoreItem = Item;
|
|
60
|
-
export interface TabStoreState extends Core.TabStoreState, CompositeStoreState<Item> {
|
|
61
|
-
}
|
|
62
|
-
export interface TabStoreFunctions extends Core.TabStoreFunctions, CompositeStoreFunctions<Item> {
|
|
63
|
-
panels: Store<Core.TabStoreFunctions["panels"]>;
|
|
64
|
-
}
|
|
65
|
-
export interface TabStoreOptions extends Core.TabStoreOptions, CompositeStoreOptions<Item> {
|
|
66
|
-
/**
|
|
67
|
-
* Function that will be called when the `selectedId` state changes.
|
|
68
|
-
* @param selectedId The new selected id.
|
|
69
|
-
*/
|
|
70
|
-
setSelectedId?: (selectedId: TabStoreState["selectedId"]) => void;
|
|
71
|
-
}
|
|
72
|
-
export type TabStoreProps = TabStoreOptions & Core.TabStoreProps;
|
|
73
|
-
export type TabStore = TabStoreFunctions & Store<Core.TabStore>;
|
|
74
|
-
export {};
|
|
@@ -357,9 +357,9 @@ var usePopover = _RNZNGEL4cjs.createHook.call(void 0,
|
|
|
357
357
|
props = _XFPRAS3Jcjs.useDialog.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
|
|
358
358
|
store,
|
|
359
359
|
modal,
|
|
360
|
+
portal,
|
|
360
361
|
preserveTabOrder,
|
|
361
362
|
preserveTabOrderAnchor: disclosureElement || anchorElement,
|
|
362
|
-
portal,
|
|
363
363
|
autoFocusOnShow: positioned && autoFocusOnShow
|
|
364
364
|
}, props), {
|
|
365
365
|
portalRef
|
|
@@ -357,9 +357,9 @@ var usePopover = createHook(
|
|
|
357
357
|
props = useDialog(__spreadProps(__spreadValues({
|
|
358
358
|
store,
|
|
359
359
|
modal,
|
|
360
|
+
portal,
|
|
360
361
|
preserveTabOrder,
|
|
361
362
|
preserveTabOrderAnchor: disclosureElement || anchorElement,
|
|
362
|
-
portal,
|
|
363
363
|
autoFocusOnShow: positioned && autoFocusOnShow
|
|
364
364
|
}, props), {
|
|
365
365
|
portalRef
|