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.

39 lines (38 loc) 1.61 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default; exports.__esModule = true; exports.default = void 0; var React = _interopRequireWildcard(require("react")); var _defaultTheme = _interopRequireDefault(require("../../defaultTheme")); var _IllustrationPrimitive = require("../../primitives/IllustrationPrimitive"); const tokens = { [_IllustrationPrimitive.SIZE_OPTIONS.EXTRASMALL]: _defaultTheme.default.orbit.illustrationExtraSmallHeight, [_IllustrationPrimitive.SIZE_OPTIONS.SMALL]: _defaultTheme.default.orbit.illustrationSmallHeight, [_IllustrationPrimitive.SIZE_OPTIONS.MEDIUM]: _defaultTheme.default.orbit.illustrationMediumHeight, [_IllustrationPrimitive.SIZE_OPTIONS.LARGE]: _defaultTheme.default.orbit.illustrationLargeHeight, [_IllustrationPrimitive.SIZE_OPTIONS.DISPLAY]: _defaultTheme.default.orbit.illustrationDisplayHeight }; 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); }; var _default = exports.default = IllustrationWrapper;