/** * Keyboard-modality tracker for manual focus-ring painting (web only). * * Group widgets built on roving/redirected focus (tamagui Tabs, ToggleGroup, * Group-wrapped button strips) move focus from the container to the current * item inside a focusin handler. Chromium drops keyboard modality on that * script-initiated focus, so neither CSS :focus-visible nor tamagui's * focusVisibleStyle fire for the redirected item — keyboard users get no * ring (DG-A11Y-01). Components track modality with these helpers and paint * the ring themselves on keyboard-origin focus. */ /** * Install the global modality listeners. Call during render of any component * that uses `wasKeyboardFocus`, so the tracker is live before the first * keystroke reaches the widget. Idempotent; no-op on native/SSR. */ export declare function ensureKeyboardModalityTracking(): void; /** * True when the most recent user input was a key press. Call from onFocus to * decide whether the focused element should paint a keyboard focus ring. * Installs the global listeners on first use; safe to call on native (always * false) and during SSR. */ export declare function wasKeyboardFocus(): boolean; /** * Standard manual ring props — the INSET ring geometry * (`FOCUS_VISIBLE_RING_INSET`: 2px solid `$outlineColor`, offset −2), spread * here so manually-painted rings can never drift from the theme contract. * Manual painting exists for roving-focus / activedescendant composites * (ToggleGroup segments inside a clipped Group, menu/listbox rows under a * clipped overlay, table rows and cells) — items inside clipping ancestors, * which is exactly the LC-71 §4 inset carve-out; an offset-0 band there * would be severed by the clip. Standalone controls take the offset-0 * `FOCUS_VISIBLE_RING` via `focusVisibleStyle` / `ensureFocusVisibleRing()`. */ export declare const keyboardFocusRingProps: { readonly outlineOffset: number; readonly outlineWidth: number; readonly outlineStyle: "solid"; readonly outlineColor: string; }; /** * LC-71 RING-ANATOMY — CSS-synchronous ring on a composite's outer boundary. * * `:has(:focus-visible)` paints the same frame the keyboard heuristic would, * with zero React latency (the prior `focused` JS path lagged one frame and * spawned the inner-Area ring cascade). Inner targets suppress their own * outline so the box carries exactly one ring. Class: `mp-composite-ring`. */ export declare const compositeFocusRingCss = "/* LC-71: ring on the composite outer box; never on the inner field.\n Inset (\u22122px): these frames use overflow:hidden to clip children to radius,\n which severs an outer ring. Do NOT use :has(:focus-visible) on every\n descendant \u2014 that would ring the whole SearchInput when the clear \u2715 is\n focused (two focusables \u2192 two rings, chip-dismiss rule). */\n.mp-composite-ring:focus-visible,\n.mp-composite-ring:has(input:focus),\n.mp-composite-ring:has(textarea:focus),\n.mp-composite-ring:has(.mp-input-area:focus) {\n outline: 2px solid var(--outlineColor, var(--c-outlineColor, CanvasText));\n outline-offset: -2px;\n}\n.mp-composite-ring-deep:has(:focus-visible) {\n outline: 2px solid var(--outlineColor, var(--c-outlineColor, CanvasText));\n outline-offset: -2px;\n}\n.mp-composite-ring input,\n.mp-composite-ring textarea,\n.mp-composite-ring [contenteditable],\n.mp-input-area,\n.mp-input-area:focus,\n.mp-input-area:focus-visible {\n outline: none !important;\n box-shadow: none !important;\n}\n.mp-chip-dismiss:focus-visible {\n outline: none !important;\n}\n.mp-chip-dismiss:focus-visible .mp-chip-dismiss-ring {\n outline: 2px solid var(--outlineColor, var(--c-outlineColor, CanvasText));\n outline-offset: 0;\n}"; /** Idempotently mount the composite-boundary focus-ring stylesheet. */ export declare function ensureCompositeFocusRing(): void; //# sourceMappingURL=keyboardFocusRing.d.ts.map