@acusti/dropdown 1.0.0-rc.2 → 1.0.0-rc.4

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/dist/Menubar.d.ts CHANGED
@@ -1,7 +1,12 @@
1
- import { type CSSProperties, type ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
+ import type { StyleWithCustomProperties } from './Dropdown.js';
2
3
  export type MenubarProps = {
3
4
  children: ReactNode;
4
5
  className?: string;
5
- style?: CSSProperties;
6
+ /**
7
+ * Applied to the menubar root element. Also accepts the component’s CSS
8
+ * custom properties (e.g. `--uktdd-menubar-trigger-bg-color-active`).
9
+ */
10
+ style?: StyleWithCustomProperties;
6
11
  };
7
12
  export default function Menubar({ children, className, style }: MenubarProps): import("react").JSX.Element;
package/dist/helpers.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { type ReactNode, type SyntheticEvent } from 'react';
2
2
  import { type Item } from './Dropdown.js';
3
+ export declare const BODY_SELECTOR = ".uktdropdown-body";
3
4
  export declare const ITEM_SELECTOR = "[data-ukt-item], [data-ukt-value]";
4
5
  export declare const SUBMENU_SELECTOR = "[data-ukt-submenu]";
6
+ export declare const LIST_CONTAINER_SELECTOR = "menu, ol, ul";
5
7
  export declare const FOCUSABLE_SELECTOR = "a[href], button, input, select, textarea, [tabindex]";
6
8
  export type OnToggleSubmenu = (item: HTMLElement, isExpanded: boolean) => void;
7
9
  type MaybeHTMLElement = HTMLElement | null;
@@ -21,8 +23,7 @@ export declare const getTriggerElement: (dropdownElement: MaybeHTMLElement) => M
21
23
  export declare const ensureItemId: (dropdownElement: MaybeHTMLElement, item: HTMLElement) => string;
22
24
  export declare const syncActiveDescendant: (dropdownElement: MaybeHTMLElement) => void;
23
25
  export declare const clearActiveItems: (dropdownElement: MaybeHTMLElement, scopes: Array<HTMLElement> | HTMLElement) => void;
24
- export declare const annotateParentItems: (bodyElement: MaybeHTMLElement) => void;
25
- export declare const annotateItemRoles: (bodyElement: MaybeHTMLElement, popupRole: 'listbox' | 'menu') => void;
26
+ export declare const annotateSubtree: (root: MaybeHTMLElement, popupRole: 'dialog' | 'listbox' | 'menu') => void;
26
27
  export declare const expandItem: (item: HTMLElement, onToggleSubmenu?: OnToggleSubmenu) => void;
27
28
  export declare const collapseItem: (item: HTMLElement, onToggleSubmenu?: OnToggleSubmenu) => void;
28
29
  export declare const collapseItemsOutsidePath: (dropdownElement: MaybeHTMLElement, element: MaybeHTMLElement, onToggleSubmenu?: OnToggleSubmenu) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acusti/dropdown",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.4",
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",
@@ -51,12 +51,13 @@
51
51
  "@testing-library/react": "^16.3.2",
52
52
  "@testing-library/user-event": "^14.6.1",
53
53
  "@types/react": "^19.2.17",
54
+ "@types/react-dom": "^19",
54
55
  "happy-dom": "^20.4.0",
55
56
  "react": "^19",
56
57
  "react-dom": "^19",
57
58
  "typescript": "^7",
58
59
  "vite": "^8.0.0-0",
59
- "vitest": "^4"
60
+ "vitest": "^5"
60
61
  },
61
62
  "peerDependencies": {
62
63
  "react": "^19 || ~0.0.0-experimental < 0.0.0-f",