import { jsx, Fragment } from 'react/jsx-runtime';

const ARIA_LIVE_ROLE_MAP = {
  assertive: 'alert',
  polite: 'status'
};
/**
 * Renders an ARIA live region with the correct implicit role.
 *
 * - `aria-live="polite"` → `role="status"`
 * - `aria-live="assertive"` → `role="alert"`
 * - `aria-live="off"` → no live region
 *
 * The `role` prop is intentionally excluded from the public API
 * to prevent mismatches between `aria-live` and `role`.
 */
const LiveRegion = ({
  'aria-live': ariaLive,
  children,
  ...props
}) => {
  if (ariaLive === 'off') {
    return /*#__PURE__*/jsx(Fragment, {
      children: children
    });
  }
  return /*#__PURE__*/jsx("div", {
    role: ARIA_LIVE_ROLE_MAP[ariaLive],
    "aria-live": ariaLive,
    "aria-atomic": "true",
    style: {
      display: 'contents'
    },
    ...props,
    children: children
  });
};

export { LiveRegion };
//# sourceMappingURL=LiveRegion.mjs.map
