// Copyright (c) Meta Platforms, Inc. and affiliates. 'use client'; /** * @file useInputStatusIcon.tsx * @input Input status, statusVariant, and InputGroup awareness * @output The on-field status icon element (with tooltip) and aria-describedby wiring * @position Shared hook for bordered inputs that render a status affordance inside the control * * SYNC: When modified, update: * - /packages/core/src/hooks/index.ts (exports) * * Centralizes the on-field status icon across the bordered inputs (TextInput, * TextArea, NumberInput, DateInput, DateTimeInput, DateRangeInput, TimeInput, * FileInput) so the three statusVariants behave consistently: * * - `attached` → icon sits inside the control; the message box below carries * the text. * - `detached` → the detached message box renders its OWN leading icon, so the * on-field icon is suppressed here to avoid a duplicate glyph. * - `tooltip` → no message box renders; the status is surfaced through an * info-tip on the on-field icon. The icon is a real focusable ` {tooltip.renderTooltip(status.message)} , describedBy: tooltip.describedBy }; }