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.

37 lines 1.31 kB
import * as React from "react"; const TileWrapper = ({ href, external, dataTest, onClick, onKeyDown, children, as, tabIndex, role, ariaExpanded, ariaControls, id, htmlTitle }) => { const WrapperComponent = as ?? "div"; return /*#__PURE__*/React.createElement(WrapperComponent, { className: "orbit-tile-wrapper [&_.orbit-tile-header-icon-right]:hover:text-ink-light-hover font-base text-ink-dark shadow-level1 duration-fast hover:shadow-level2 rounded-300 bg-white-normal box-border block w-full no-underline transition-shadow ease-in-out", "data-test": dataTest, onClick: onClick, onKeyDown: onKeyDown, as: as, tabIndex: tabIndex, role: role, "aria-expanded": ariaExpanded, "aria-controls": ariaControls, id: id }, href ? /*#__PURE__*/React.createElement("a", { className: "text-ink-dark focus:outline-blue-normal focus:[&_.orbit-tile-header-icon-right]:text-ink-light-hover link:text-ink-dark link:font-medium visited:text-ink-dark block size-full no-underline outline-none visited:font-medium focus:outline-2", target: href && external ? "_blank" : undefined, rel: href && external ? "noopener noreferrer" : undefined, href: href || undefined, title: htmlTitle }, children) : children); }; export default TileWrapper;