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.

64 lines (62 loc) 2.02 kB
import * as React from "react"; import styled from "styled-components"; import defaultTheme from "../../defaultTheme"; import { ALIGN_OPTIONS } from "./consts"; import { TYPE_AS } from "../consts"; import { textAlign } from "../../utils/rtl"; export var StyledTableCell = styled(function (_ref) { var Component = _ref.element, children = _ref.children, className = _ref.className, dataTest = _ref.dataTest, scope = _ref.scope; return /*#__PURE__*/React.createElement(Component, { className: className, "data-test": dataTest, scope: scope }, children); }).withConfig({ displayName: "TableCell__StyledTableCell", componentId: "sc-1dr7ow2-0" })(["box-sizing:border-box;font-family:", ";font-size:", ";color:", ";text-align:", ";white-space:", ";vertical-align:", ";"], function (_ref2) { var theme = _ref2.theme; return theme.orbit.fontFamily; }, function (_ref3) { var theme = _ref3.theme; return theme.orbit.fontSizeTextNormal; }, function (_ref4) { var theme = _ref4.theme; return theme.orbit.colorInkNormal; }, function (_ref5) { var align = _ref5.align; return textAlign(align); }, function (_ref6) { var whiteSpace = _ref6.whiteSpace; return whiteSpace; }, function (_ref7) { var verticalAlign = _ref7.verticalAlign; return verticalAlign; }); StyledTableCell.defaultProps = { theme: defaultTheme }; var TableCell = function TableCell(_ref8) { var _ref8$align = _ref8.align, align = _ref8$align === void 0 ? ALIGN_OPTIONS.LEFT : _ref8$align, scope = _ref8.scope, _ref8$as = _ref8.as, as = _ref8$as === void 0 ? TYPE_AS.TD : _ref8$as, verticalAlign = _ref8.verticalAlign, whiteSpace = _ref8.whiteSpace, dataTest = _ref8.dataTest, children = _ref8.children; return /*#__PURE__*/React.createElement(StyledTableCell, { verticalAlign: verticalAlign, whiteSpace: whiteSpace, align: align, dataTest: dataTest, scope: scope, element: as }, children); }; export default TableCell;