Docs / Infrastructure
Core utilities
Shared overlay, keyboard, a11y, and surface-variant primitives for @artificialsenselabs/ui. Kept on the public barrel on purpose — this is the CDK-style contract apps and nested overlays share, not convenience re-exports.
Overview
Import from the package root:
import {
SenseFocusTrap,
SenseLiveAnnouncerService,
SenseAnnounceDirective,
KEYBOARD_KEYS,
claimOverlayZIndex,
claimBodyScrollLock,
pushModalLayer,
SENSE_SURFACE_VARIANTS,
normalizeFeedbackSeverity,
} from '@artificialsenselabs/ui'; SCSS helpers (focus-ring, reduced-motion, surface-variant, forced-colors, pointer) are for component authors via @use — they are not TypeScript exports. There is no showcase demo; core is infrastructure exercised by dialogs, drawers, and feedback surfaces.
Public API
| Export | Role |
|---|---|
SenseFocusTrap | Tab-cycle containment with optional focus restore for modal surfaces. |
SenseLiveAnnouncerService | Programmatic aria-live announcements (SSR-safe via DOCUMENT). |
SenseAnnounceDirective | Announces a bound message via the live announcer whenever it changes. |
SenseAnnounceOnChangeDirective | Announces the host data-announce-message attribute on input/change. Prefer SenseAnnounceDirective for signal-bound messages. |
KEYBOARD_KEYS | Shared KeyboardEvent.key constants for overlay and listbox handlers. |
claimOverlayZIndex / releaseOverlayZIndex | Monotonic z-index stacking for nested overlays. |
claimBodyScrollLock / releaseBodyScrollLock | Refcounted body overflow lock for nested modals. |
pushModalLayer / popModalLayer / isTopModalLayer | Topmost-only Escape / focus-trap stack for nested modals. |
SENSE_SURFACE_VARIANTS + normalizers | ADR-0030 filled / outlined / ghost helpers (plus legacy aliases). |
normalizeFeedbackSeverity | Canonical success / info / warning / danger vocabulary. |
Test-only resetOverlayUtilsForTests is not on the public barrel — import it from the monorepo testing helpers when writing specs.