import { jsx } from "react/jsx-runtime";
import { mapResponsiveValue } from "../../css/atoms/sprinkles.css.mjs";
import { Accordion as Accordion$1, validSpaceValues } from "./Accordion.mjs";
import { wireframe } from "../../themes/wireframe/wireframeTheme.css.mjs";
const spaceScale = ["none", ...Object.keys(wireframe.space.space)];
const filterSpace = (space) => {
  const filteredSpace = mapResponsiveValue(space, (value) => {
    if (spaceScale.includes(value) && !validSpaceValues.includes(value)) {
      throw new Error(
        `To ensure adequate space for touch targets, 'space' prop values must be one of the following: ${validSpaceValues.map((x) => `"${x}"`).join(", ")}`
      );
    }
    return validSpaceValues.includes(value) ? value : "medium";
  });
  return filteredSpace;
};
const Accordion = ({
  space,
  size,
  tone,
  weight,
  ...restProps
}) => /* @__PURE__ */ jsx(
  Accordion$1,
  {
    size: typeof size === "boolean" ? void 0 : size,
    tone: typeof tone === "boolean" ? void 0 : tone,
    weight: typeof weight === "boolean" ? void 0 : weight,
    space: typeof space === "string" || Array.isArray(space) ? filterSpace(space) : void 0,
    ...restProps
  }
);
export {
  Accordion
};
