declare const process: {env: {NODE_ENV?: string}}; // Copyright (c) Meta Platforms, Inc. and affiliates. /** * @file devWarning.ts * @input A component/hook name and a message * @output Standardized `Component: message` console warnings and errors * @position Shared dev-logging utility used across components and hooks * * Standardizes how the design system surfaces information to the builder: * every message reads `Component: message` (e.g. `Field: isOptional and * isRequired are mutually exclusive.`), so the source is always obvious in * the console. * * Prefer the `useDevWarning` hook inside components — it guards against * repeating a warning on every render. These imperative helpers exist for * the non-render contexts a hook can't cover: plain functions, module * initialization, and inside effects. * * SYNC: When modified, update: * - /packages/core/src/utils/index.ts * - /packages/core/src/hooks/useDevWarning.ts (the render-path counterpart) */ const isDev = process.env.NODE_ENV !== 'production'; /** Format a message as `Component: message`. */ export function formatDevMessage(component: string, message: string): string { return `${component}: ${message}`; } /** * Dev-only `console.warn` in the standardized `Component: message` format. * A no-op in production — warnings are builder guardrails, not shipped noise. * Extra args (e.g. an offending value) are forwarded to `console.warn`. * * @example * ``` * devWarn('Popover', 'children must contain a