@acusti/dropdown 1.0.0-beta.1 → 1.0.0-rc.0
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/README.md +129 -7
- package/dist/Dropdown.d.ts +10 -0
- package/dist/Dropdown.js +683 -518
- package/dist/Dropdown.js.map +1 -1
- package/dist/context.d.ts +3 -0
- package/dist/helpers.d.ts +5 -0
- package/package.json +2 -2
package/dist/context.d.ts
CHANGED
|
@@ -15,11 +15,14 @@ export type MenubarContextValue = {
|
|
|
15
15
|
notifyClosed: (element: HTMLElement) => void;
|
|
16
16
|
notifyOpened: (element: HTMLElement) => void;
|
|
17
17
|
registerMember: (member: MenubarMember) => () => void;
|
|
18
|
+
tabbableElement: HTMLElement | null;
|
|
18
19
|
};
|
|
19
20
|
export type MenubarMember = {
|
|
20
21
|
close: () => void;
|
|
21
22
|
element: HTMLElement;
|
|
22
23
|
focusTrigger: () => void;
|
|
24
|
+
isDisabled: () => boolean;
|
|
25
|
+
isMenuPopup: () => boolean;
|
|
23
26
|
isOpen: () => boolean;
|
|
24
27
|
open: () => void;
|
|
25
28
|
};
|
package/dist/helpers.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type ReactNode, type SyntheticEvent } from 'react';
|
|
|
2
2
|
import { type Item } from './Dropdown.js';
|
|
3
3
|
export declare const ITEM_SELECTOR = "[data-ukt-item], [data-ukt-value]";
|
|
4
4
|
export declare const SUBMENU_SELECTOR = "[data-ukt-submenu]";
|
|
5
|
+
export declare const FOCUSABLE_SELECTOR = "a[href], button, input, select, textarea, [tabindex]";
|
|
5
6
|
export type OnToggleSubmenu = (item: HTMLElement, isExpanded: boolean) => void;
|
|
6
7
|
type MaybeHTMLElement = HTMLElement | null;
|
|
7
8
|
export declare const getLevelRoot: (element: HTMLElement) => MaybeHTMLElement;
|
|
@@ -16,6 +17,10 @@ export declare const getActiveItemElements: (dropdownElement: MaybeHTMLElement)
|
|
|
16
17
|
export declare const getActiveItemElement: (dropdownElement: MaybeHTMLElement) => HTMLElement | null;
|
|
17
18
|
export declare const getDeepestExpandedItem: (dropdownElement: MaybeHTMLElement) => MaybeHTMLElement;
|
|
18
19
|
export declare const isItemExpanded: (item: HTMLElement) => boolean;
|
|
20
|
+
export declare const getTriggerElement: (dropdownElement: MaybeHTMLElement) => MaybeHTMLElement;
|
|
21
|
+
export declare const ensureItemId: (dropdownElement: MaybeHTMLElement, item: HTMLElement) => string;
|
|
22
|
+
export declare const syncActiveDescendant: (dropdownElement: MaybeHTMLElement) => void;
|
|
23
|
+
export declare const clearActiveItems: (dropdownElement: MaybeHTMLElement, scopes: Array<HTMLElement> | HTMLElement) => void;
|
|
19
24
|
export declare const annotateParentItems: (bodyElement: MaybeHTMLElement) => void;
|
|
20
25
|
export declare const annotateItemRoles: (bodyElement: MaybeHTMLElement, popupRole: 'listbox' | 'menu') => void;
|
|
21
26
|
export declare const expandItem: (item: HTMLElement, onToggleSubmenu?: OnToggleSubmenu) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acusti/dropdown",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-rc.0",
|
|
4
4
|
"description": "React component that renders a dropdown with a trigger and supports searching, keyboard access, and more",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"a11y",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@acusti/matchmaking": "^0.10.0",
|
|
46
|
-
"@acusti/use-keyboard-events": "^0.
|
|
46
|
+
"@acusti/use-keyboard-events": "^0.12.0",
|
|
47
47
|
"clsx": "^2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|