/**
 * Convention used across Base UI: given a root id, the field's label id is
 * `${id}-label`. Returns `undefined` when the root id is absent so callers
 * can feed the result directly into an optional `aria-labelledby`.
 */
export function getDefaultLabelId(id) {
  return id == null ? undefined : `${id}-label`;
}

/**
 * Prefers the field-provided label id (when the component is inside a
 * `<Field.Root>`) over the locally-registered one. Mirrors React's rule:
 * if both are present, the field wins because its label wraps the entire
 * control, while the local label might just be ancillary.
 */
export function resolveAriaLabelledBy(fieldLabelId, localLabelId) {
  return fieldLabelId ?? localLabelId;
}
//# sourceMappingURL=resolve-aria-labelled-by.jsx.map
