UNPKG

@blend-ui/core

Version:

Blend core cmponents

56 lines (54 loc) 1.54 kB
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from './_virtual/_rollupPluginBabelHelpers.js'; import React, { forwardRef } from 'react'; import styled from 'styled-components'; import { space, typography } from 'styled-system'; import PropTypes from 'prop-types'; var _excluded = ["href"]; var LinkElement = styled.a.attrs(function (props) { return { rel: props.target === "_blank" ? "noopener" : null }; }).withConfig({ displayName: "Link__LinkElement", componentId: "sc-m2w4lu-0" })(["cursor:pointer;text-decoration:none;color:", ";&:hover{color:", ";text-decoration:underline;}", " ", ""], function (props) { return props.theme.colors.textLink; }, function (props) { return props.theme.colors.baseLinkHover; }, space, typography); var Link = /*#__PURE__*/forwardRef(function (_ref, ref) { var href = _ref.href, props = _objectWithoutProperties(_ref, _excluded); return /*#__PURE__*/React.createElement(LinkElement, _extends({ href: href }, props, { ref: ref })); }); Link.displayName = "Link"; Link.propTypes = { href: PropTypes.string.isRequired, target: PropTypes.string.isRequired }; Link.__docgenInfo = { "description": "", "methods": [], "displayName": "Link", "props": { "href": { "description": "", "type": { "name": "string" }, "required": true }, "target": { "description": "", "type": { "name": "string" }, "required": true } } }; export { Link as default };