@foris/avocado-suite 1.14.2 → 1.16.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.
@@ -0,0 +1,2 @@
1
+ /** Joins the ids an `aria-describedby`-like attribute references; with none, the attribute is left out. */
2
+ export declare const mergeIds: (...ids: (string | false | null | undefined)[]) => string | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { KeyboardEvent } from 'react';
2
+ /** Resolves the current tab order so conditional controls cannot leave stale boundaries. */
3
+ export declare function getTabStops(panel: HTMLElement): HTMLElement[];
4
+ /** Wraps Tab at the panel boundaries without moving focus on mount or mode changes. */
5
+ export declare function containTab(event: KeyboardEvent<HTMLDivElement>): void;
@@ -0,0 +1,13 @@
1
+ import { type RefObject } from 'react';
2
+ /** The element to focus, as a ref or as a function read when the dialog opens. */
3
+ export type FocusTarget = RefObject<HTMLElement> | (() => HTMLElement | null);
4
+ interface DialogFocusOptions {
5
+ active: boolean;
6
+ containerRef: RefObject<HTMLElement>;
7
+ initialFocus?: FocusTarget;
8
+ /** Focus target on close when the opener is no longer in the document. */
9
+ finalFocus?: () => HTMLElement | null;
10
+ }
11
+ /** Moves focus into a dialog when it opens and back to its opener when it closes. */
12
+ export declare function useDialogFocus({ active, containerRef, initialFocus, finalFocus, }: DialogFocusOptions): void;
13
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foris/avocado-suite",
3
- "version": "1.14.2",
3
+ "version": "1.16.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,8 +39,8 @@
39
39
  "react-toastify": "9.0.3",
40
40
  "remark-gfm": "4.0.1",
41
41
  "zustand": "4.5.4",
42
- "@foris/avocado-core": "1.3.4",
43
- "@foris/avocado-icons": "1.20.0"
42
+ "@foris/avocado-icons": "1.20.0",
43
+ "@foris/avocado-core": "1.3.4"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@testing-library/jest-dom": "6.4.0",
@@ -1,3 +0,0 @@
1
- import type { KeyboardEvent } from 'react';
2
- /** Wraps Tab at the panel boundaries without moving focus on mount or mode changes. */
3
- export declare function containDrawerTab(event: KeyboardEvent<HTMLDivElement>): void;