import { jsxs, jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { c as cx } from './index-De1g9FRV.js';
import { S as SrOnly } from './SrOnly-pnf8ajnh.js';
import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-CB_zHDbW.js';

import './Badge.css';const badge = "_badge_n9xub_1";
const empty = "_empty_n9xub_41";
const styles = {
	badge: badge,
	empty: empty
};

const Badge = forwardRef((props, ref) => {
  const { layoutStyles, componentProps } = useLayoutPropsUtil(props);
  const {
    offset,
    children,
    style,
    className,
    "aria-label": ariaLabel,
    ...rest
  } = componentProps;
  const classNames = cx(styles["badge"], className, {
    [styles.empty]: !children
  });
  const offsetX = offset?.x ?? `0px`;
  const offsetY = offset?.y ?? `0px`;
  const iStyle = {
    ...style,
    ...layoutStyles,
    "--a2-inline-badge-offset-y": offsetY,
    "--a2-inline-badge-offset-x": offsetX
  };
  return /* @__PURE__ */ jsxs(
    "sup",
    {
      className: classNames,
      style: iStyle,
      "data-anv": "badge",
      ...rest,
      ref,
      children: [
        /* @__PURE__ */ jsx(SrOnly, { children: ariaLabel }),
        children
      ]
    }
  );
});
Badge.displayName = "Badge";

export { Badge as B };
//# sourceMappingURL=Badge-C_wTvtnB.js.map
