import { jsx } from "react/jsx-runtime";
import { createContext } from "react";
import { Typography } from "../Accordion/AccordionItem.mjs";
import { fontFamily, headingWeight, heading, tone } from "../../css/typography.css.mjs";
const HeadingContext = createContext(false);
const resolveDefaultComponent = {
  "1": "h1",
  "2": "h2",
  "3": "h3",
  "4": "h4"
};
const Heading = ({
  level,
  weight,
  component,
  ...typographyProps
}) => /* @__PURE__ */ jsx(HeadingContext.Provider, { value: true, children: /* @__PURE__ */ jsx(
  Typography,
  {
    ...typographyProps,
    component: component || resolveDefaultComponent[level],
    className: [
      fontFamily,
      headingWeight[weight || "regular"],
      heading[level],
      tone.neutral
    ]
  }
) });
export {
  Heading,
  HeadingContext
};
