@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.
53 lines (50 loc) • 1.93 kB
JavaScript
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 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"
})(["", ""], function (_ref2) {
var theme = _ref2.theme,
whiteSpace = _ref2.whiteSpace,
verticalAlign = _ref2.verticalAlign,
align = _ref2.align;
return 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
};
var TableCell = function TableCell(_ref3) {
var _ref3$align = _ref3.align,
align = _ref3$align === void 0 ? ALIGN_OPTIONS.LEFT : _ref3$align,
scope = _ref3.scope,
_ref3$as = _ref3.as,
as = _ref3$as === void 0 ? TYPE_AS.TD : _ref3$as,
verticalAlign = _ref3.verticalAlign,
whiteSpace = _ref3.whiteSpace,
dataTest = _ref3.dataTest,
children = _ref3.children;
return /*#__PURE__*/React.createElement(StyledTableCell, {
verticalAlign: verticalAlign,
whiteSpace: whiteSpace,
align: align,
dataTest: dataTest,
scope: scope,
element: as
}, children);
};
export default TableCell;