import _extends from "@babel/runtime/helpers/esm/extends";
import React, { forwardRef, useMemo } from "react";
import { StyledCaretIcon, StyledSelectTrigger } from "./Styles";
import { Typography } from "../Typography/Typography";
export const SelectTrigger = /*#__PURE__*/forwardRef((_ref, ref) => {
  let {
    children,
    type = "button",
    size = "regular",
    invalid = false,
    open = false,
    endAdornment,
    typographyProps,
    mode = "outlined",
    ...rest
  } = _ref;
  const variant = useMemo(() => {
    if (size === "big") {
      return "Body 1";
    }
    if (size === "biggest") {
      return "Header 2";
    }
    return "Body 2";
  }, [size]);
  return /*#__PURE__*/React.createElement(StyledSelectTrigger, _extends({
    ref: ref,
    role: "button",
    type: type,
    $size: size,
    $invalid: invalid,
    "aria-invalid": invalid,
    $mode: mode
  }, rest), /*#__PURE__*/React.createElement(Typography, _extends({
    as: "div",
    overflow: "truncate",
    whitespace: "no-wrap",
    variant: variant,
    weight: size === "biggest" ? "bold" : "regular",
    color: mode === "flat" && invalid ? "alert" : undefined
  }, typographyProps), children), endAdornment ? endAdornment : /*#__PURE__*/React.createElement(StyledCaretIcon, {
    $open: open
  }));
});
SelectTrigger.displayName = "SelectTrigger";
//# sourceMappingURL=SelectTrigger.js.map