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.

50 lines (47 loc) 1.44 kB
import * as React from "react"; import styled, { css } from "styled-components"; import defaultTheme from "../../defaultTheme"; import { ALIGN_OPTIONS } from "./consts"; import { TYPE_AS } from "../consts"; import { textAlign } from "../../utils/rtl"; export const StyledTableCell = styled(({ element: Component, children, className, dataTest, scope }) => /*#__PURE__*/React.createElement(Component, { className: className, "data-test": dataTest, scope: scope }, children)).withConfig({ displayName: "TableCell__StyledTableCell", componentId: "sc-1sjb4ex-0" })(["", ""], ({ theme, whiteSpace, verticalAlign, align }) => css(["box-sizing:border-box;font-family:", ";font-size:", ";color:", ";text-align:", ";white-space:", ";vertical-align:", ";"], theme.orbit.fontFamily, theme.orbit.fontSizeTextNormal, theme.orbit.colorInkNormal, textAlign(align), whiteSpace, verticalAlign)); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 StyledTableCell.defaultProps = { theme: defaultTheme }; const TableCell = ({ align = ALIGN_OPTIONS.LEFT, scope, as = TYPE_AS.TD, verticalAlign, whiteSpace, dataTest, children }) => { return /*#__PURE__*/React.createElement(StyledTableCell, { verticalAlign: verticalAlign, whiteSpace: whiteSpace, align: align, dataTest: dataTest, scope: scope, element: as }, children); }; export default TableCell;