import _extends from "@babel/runtime/helpers/esm/extends";
import React, { forwardRef } from "react";
import classNames from "classnames";
import { StyledLink, StyledLinkElement, StyledLinkElements } from "./Styles";
/**
 * Link component
 */
export const Link = /*#__PURE__*/forwardRef((_ref, ref) => {
  let {
    as,
    children,
    variant = "contained",
    size,
    disabled = false,
    className,
    ...args
  } = _ref;
  const Component = as || "a";
  return /*#__PURE__*/React.createElement(StyledLink, _extends({
    ref: ref,
    as: Component,
    disabled: disabled,
    className: classNames("c-link", className, {
      "c-link--contained": variant === "primary" || variant === "contained",
      "c-link--outlined": variant === "secondary" || variant === "outlined",
      "c-link--text_colored": variant === "tertiary" || variant === "text colored",
      "c-link--text_gray": variant === "option" || variant === "text gray",
      "c-link--dark_transparent": variant === "dark transparent",
      "c-link--circle_raised": variant === "circle raised",
      "c-link--big": size === "big",
      "c-link--small": size === "small",
      "c-link--icon-only": children instanceof Object && !(children instanceof Array),
      "c-link--disabled": disabled
    }),
    variant: variant,
    size: size,
    $iconOnly: children instanceof Object && !(children instanceof Array)
  }, args), children instanceof Array ? /*#__PURE__*/React.createElement(StyledLinkElements, {
    className: "c-link__elements"
  }, children.map((value, index) => value ? /*#__PURE__*/React.createElement(StyledLinkElement, {
    className: "c-link__elements__element",
    key: index
  }, value) : null)) : children);
});
Link.displayName = "Link";
//# sourceMappingURL=Link.js.map