UNPKG

suomifi-ui-components

Version:
40 lines (37 loc) 1.53 kB
import { __rest, __assign, __makeTemplateObject } from 'tslib'; import React, { forwardRef } from 'react'; import classnames from 'classnames'; import { styled } from 'styled-components'; import { Link } from '../Link/Link.js'; import { SkipLinkStyles } from './SkipLink.baseStyles.js'; import { SuomifiThemeConsumer } from '../../theme/SuomifiThemeProvider/SuomifiThemeProvider.js'; import '../../theme/SuomifiTheme/SuomifiTheme.js'; import '../../theme/SpacingProvider/SpacingProvider.js'; var skipClassName = 'fi-link--skip'; var StyledSkipLink = styled(function (props) { props.theme; var passProps = __rest(props, ["theme"]); return /*#__PURE__*/React.createElement(Link, __assign({}, passProps)); }).withConfig({ componentId: "sc-111sl8u-0" })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) { var theme = _a.theme; return SkipLinkStyles(theme); }); var SkipLink = /*#__PURE__*/forwardRef(function (props, ref) { var className = props.className, passProps = __rest(props, ["className"]); return /*#__PURE__*/React.createElement(SuomifiThemeConsumer, null, function (_a) { var suomifiTheme = _a.suomifiTheme; return /*#__PURE__*/React.createElement(StyledSkipLink, __assign({ theme: suomifiTheme, forwardedRef: ref }, passProps, { className: classnames(className, skipClassName) })); }); }); SkipLink.displayName = 'SkipLink'; var templateObject_1; export { SkipLink }; //# sourceMappingURL=SkipLink.js.map