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.

33 lines (29 loc) 1.43 kB
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; var _tokens; import * as React from "react"; import theme from "../../defaultTheme"; import { SIZE_OPTIONS } from "../../primitives/IllustrationPrimitive/consts"; var tokens = (_tokens = {}, _defineProperty(_tokens, SIZE_OPTIONS.EXTRASMALL, theme.orbit.heightIllustrationSmall), _defineProperty(_tokens, SIZE_OPTIONS.SMALL, "120px"), _defineProperty(_tokens, SIZE_OPTIONS.MEDIUM, theme.orbit.heightIllustrationMedium), _defineProperty(_tokens, SIZE_OPTIONS.LARGE, "280px"), _defineProperty(_tokens, SIZE_OPTIONS.DISPLAY, "460px"), _tokens); var IllustrationWrapper = function IllustrationWrapper(_ref) { var _ref$size = _ref.size, size = _ref$size === void 0 ? "medium" : _ref$size, viewBox = _ref.viewBox, title = _ref.title, description = _ref.description, ariaLabelledby = _ref.ariaLabelledby, dataTest = _ref.dataTest, children = _ref.children; var 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;