@aortl/admin-react 0.7.0 → 0.8.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,10 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Container that Base UI popups (Select, Tooltip, etc.) should portal into.
4
+ * When a `<Dialog>` ancestor publishes its `<dialog>` element through this
5
+ * context, popups render inside that top-layer dialog so they paint above
6
+ * the backdrop and escape its `overflow: hidden`. Outside a dialog the
7
+ * context is null and popups portal to `document.body` as before.
8
+ */
9
+ export declare const PortalContainerContext: import('react').Context<RefObject<HTMLElement | null> | null>;
10
+ //# sourceMappingURL=portal-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal-context.d.ts","sourceRoot":"","sources":["../src/portal-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,+DAA4D,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { HotkeyHandler } from './hotkey-registry';
2
+ export interface HotkeyOptions {
3
+ /** When false, the binding is not registered. Defaults to true. */
4
+ enabled?: boolean;
5
+ }
6
+ export interface HotkeyInfo {
7
+ /**
8
+ * Pre-serialized `aria-keyshortcuts` attribute value (e.g. `"Control+S"`).
9
+ * Undefined when `keys` is nullish. Apply to the element that owns the
10
+ * binding so screen readers announce the shortcut alongside the name.
11
+ */
12
+ ariaKeyShortcuts: string | undefined;
13
+ /**
14
+ * Canonical form of the first alternative — feed to `<Kbd keys={primaryChord} />`
15
+ * to render the matching visual chip. Undefined when `keys` is nullish.
16
+ */
17
+ primaryChord: string | undefined;
18
+ /** All canonical chord strings, used internally for registration. */
19
+ canonicalChords: readonly string[];
20
+ }
21
+ /**
22
+ * Register a keyboard shortcut. The handler is latched in a ref internally so
23
+ * callers don't need to memoize it. Passing nullish `keys` is a no-op, so
24
+ * the hook is safe to call unconditionally from components that may or may
25
+ * not have a binding (e.g. the `hotkey` prop on `<Button>`).
26
+ *
27
+ * @example
28
+ * useHotkey("mod+s", save);
29
+ * useHotkey(["mod+s", "mod+enter"], save, { enabled: !isLoading });
30
+ *
31
+ * Returns derived strings for rendering — see {@link HotkeyInfo}.
32
+ */
33
+ export declare function useHotkey(keys: string | readonly string[] | null | undefined, handler: HotkeyHandler, options?: HotkeyOptions): HotkeyInfo;
34
+ //# sourceMappingURL=useHotkey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHotkey.d.ts","sourceRoot":"","sources":["../src/useHotkey.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEnF,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC;;;OAGG;IACH,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,qEAAqE;IACrE,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EACnD,OAAO,EAAE,aAAa,EACtB,OAAO,CAAC,EAAE,aAAa,GACtB,UAAU,CA+BZ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aortl/admin-react",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "React component library for the admin design system. Pairs with @aortl/admin-css.",
5
5
  "keywords": [
6
6
  "components",
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "@base-ui/react": "1.4.1",
44
44
  "clsx": "2.1.1",
45
- "@aortl/admin-css": "0.7.0"
45
+ "@aortl/admin-css": "0.8.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@testing-library/dom": "10.4.1",