import './Link_1oiwct5.css';
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
import React__default, { forwardRef } from 'react';
import { base as base$1 } from './_view/base.js';
import { base as base$2 } from './_disabled/base.js';
import { base as base$3 } from './_focused/base.js';

var _excluded = ["children", "disabled", "target", "href", "rel"];
var base = "b1j91s21";
var linkRoot = function linkRoot(Root) {
  return /*#__PURE__*/forwardRef(function (props, ref) {
    var children = props.children,
      disabled = props.disabled,
      target = props.target,
      href = props.href,
      rel = props.rel,
      rest = _objectWithoutProperties(props, _excluded);
    var forwardProps = {
      disabled: disabled,
      target: target,
      href: disabled ? undefined : href,
      // NOTE: https://developer.chrome.com/docs/lighthouse/best-practices/external-anchors-use-rel-noopener/
      rel: target === '_blank' ? 'noopener noreferrer' : rel
    };
    return /*#__PURE__*/React__default.createElement(Root, _extends({
      ref: ref
    }, forwardProps, rest), children);
  });
};
var linkConfig = {
  name: 'Link',
  tag: 'a',
  layout: linkRoot,
  base: base,
  variations: {
    view: {
      css: base$1
    },
    disabled: {
      css: base$2,
      attrs: true
    },
    focused: {
      css: base$3
    }
  },
  defaults: {
    view: 'primary',
    size: 'm'
  }
};

export { linkConfig, linkRoot };
//# sourceMappingURL=Link.js.map
