import { jsx } from "react/jsx-runtime";
import "react";
import "clsx";
import { useProps } from "../../core/MantineProvider/use-props/use-props.mjs";
import { factory } from "../../core/factory/factory.mjs";
import { getParsedComboboxData } from "../Combobox/get-parsed-combobox-data/get-parsed-combobox-data.mjs";
import { ComboboxChevron } from "../Combobox/ComboboxChevron/ComboboxChevron.mjs";
import { InputBase } from "../InputBase/InputBase.mjs";
import { NativeSelectOption } from "./NativeSelectOption.mjs";
const defaultProps = {
  rightSectionPointerEvents: "none"
};
const NativeSelect = factory((props, ref) => {
  const { data, children, size, error, rightSection, unstyled, ...others } = useProps(
    "NativeSelect",
    defaultProps,
    props
  );
  const options = getParsedComboboxData(data).map((item, index) => /* @__PURE__ */ jsx(NativeSelectOption, { data: item }, index));
  return /* @__PURE__ */ jsx(
    InputBase,
    {
      component: "select",
      ref,
      ...others,
      __staticSelector: "NativeSelect",
      size,
      pointer: true,
      error,
      unstyled,
      rightSection: rightSection || /* @__PURE__ */ jsx(ComboboxChevron, { size, error, unstyled }),
      children: children || options
    }
  );
});
NativeSelect.classes = InputBase.classes;
NativeSelect.displayName = "@mantine/core/NativeSelect";
export {
  NativeSelect
};
