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.

35 lines (33 loc) 995 B
import * as React from "react"; import theme from "../../defaultTheme"; import { SIZE_OPTIONS } from "../../primitives/IllustrationPrimitive/consts"; const tokens = { [SIZE_OPTIONS.EXTRASMALL]: theme.orbit.heightIllustrationSmall, [SIZE_OPTIONS.SMALL]: "120px", [SIZE_OPTIONS.MEDIUM]: theme.orbit.heightIllustrationMedium, [SIZE_OPTIONS.LARGE]: "280px", [SIZE_OPTIONS.DISPLAY]: "460px" }; const IllustrationWrapper = ({ size = "medium", viewBox, title, description, ariaLabelledby, dataTest, children }) => { const height = tokens[size]; return /*#__PURE__*/React.createElement("svg", { height: height, "data-test": dataTest, viewBox: viewBox, fill: "none", role: "img", "aria-labelledby": ariaLabelledby, xmlns: "http://www.w3.org/2000/svg" }, /*#__PURE__*/React.createElement("title", { id: ariaLabelledby }, title), /*#__PURE__*/React.createElement("desc", null, description), children); }; export default IllustrationWrapper;