UNPKG

@kiwicom/orbit-components

Version:

Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.

66 lines (64 loc) 2.27 kB
import * as React from "react"; import styled from "styled-components"; import transition from "../../../utils/transition"; import { StyledIconRight } from "../TileHeader/index"; import defaultTheme from "../../../defaultTheme"; export var StyledTileWrapper = styled.div.withConfig({ displayName: "TileWrapper__StyledTileWrapper", componentId: "sc-6zjj5s-0" })(["display:block;width:100%;box-sizing:border-box;font-family:", ";color:", ";text-decoration:none;background:", ";border-radius:", ";box-shadow:", ";transition:", ";:hover,:focus{outline:none;box-shadow:", ";", "{color:", ";}}"], function (_ref) { var theme = _ref.theme; return theme.orbit.fontFamily; }, function (_ref2) { var theme = _ref2.theme; return theme.orbit.paletteInkNormal; }, function (_ref3) { var theme = _ref3.theme; return theme.orbit.paletteWhite; }, function (_ref4) { var theme = _ref4.theme; return theme.orbit.borderRadiusNormal; }, function (_ref5) { var theme = _ref5.theme; return theme.orbit.boxShadowAction; }, transition(["box-shadow"], "fast", "ease-in-out"), function (_ref6) { var theme = _ref6.theme; return theme.orbit.boxShadowActionActive; }, StyledIconRight, function (_ref7) { var theme = _ref7.theme; return theme.orbit.paletteInkLightHover; }); StyledTileWrapper.defaultProps = { theme: defaultTheme }; var TileWrapper = function TileWrapper(_ref8) { var href = _ref8.href, external = _ref8.external, dataTest = _ref8.dataTest, onClick = _ref8.onClick, onKeyDown = _ref8.onKeyDown, children = _ref8.children, as = _ref8.as, tabIndex = _ref8.tabIndex, role = _ref8.role, ariaExpanded = _ref8.ariaExpanded, ariaControls = _ref8.ariaControls, id = _ref8.id, htmlTitle = _ref8.htmlTitle; return /*#__PURE__*/React.createElement(StyledTileWrapper, { target: href && external ? "_blank" : undefined, rel: href && external ? "noopener noreferrer" : undefined, href: href || undefined, "data-test": dataTest, onClick: onClick, onKeyDown: onKeyDown, as: as, tabIndex: tabIndex, role: role, ariaExpanded: ariaExpanded, ariaControls: ariaControls, id: id, title: htmlTitle }, children); }; export default TileWrapper;