@activecollab/components
Version:
ActiveCollab Components
59 lines • 2.69 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
const _excluded = ["variant", "as", "color", "italic", "tabularNums", "letterSpacing", "lineHeight", "align", "decoration", "transform", "overflow", "whitespace", "wordBreak", "weight", "className", "children"];
import React, { forwardRef } from "react";
import classNames from "classnames";
import { StyledTypography } from "./Styles";
export const Typography = /*#__PURE__*/forwardRef((_ref, ref) => {
let _ref$variant = _ref.variant,
variant = _ref$variant === void 0 ? "Title 1" : _ref$variant,
as = _ref.as,
_ref$color = _ref.color,
color = _ref$color === void 0 ? "primary" : _ref$color,
_ref$italic = _ref.italic,
italic = _ref$italic === void 0 ? false : _ref$italic,
_ref$tabularNums = _ref.tabularNums,
tabularNums = _ref$tabularNums === void 0 ? false : _ref$tabularNums,
_ref$letterSpacing = _ref.letterSpacing,
letterSpacing = _ref$letterSpacing === void 0 ? "tight" : _ref$letterSpacing,
_ref$lineHeight = _ref.lineHeight,
lineHeight = _ref$lineHeight === void 0 ? "regular" : _ref$lineHeight,
_ref$align = _ref.align,
align = _ref$align === void 0 ? "left" : _ref$align,
_ref$decoration = _ref.decoration,
decoration = _ref$decoration === void 0 ? "none" : _ref$decoration,
_ref$transform = _ref.transform,
transform = _ref$transform === void 0 ? "regular" : _ref$transform,
_ref$overflow = _ref.overflow,
overflow = _ref$overflow === void 0 ? "visible" : _ref$overflow,
_ref$whitespace = _ref.whitespace,
whitespace = _ref$whitespace === void 0 ? "regular" : _ref$whitespace,
_ref$wordBreak = _ref.wordBreak,
wordBreak = _ref$wordBreak === void 0 ? "regular" : _ref$wordBreak,
_ref$weight = _ref.weight,
weight = _ref$weight === void 0 ? "regular" : _ref$weight,
className = _ref.className,
children = _ref.children,
props = _objectWithoutPropertiesLoose(_ref, _excluded);
const Component = as || "div";
return /*#__PURE__*/React.createElement(StyledTypography, _extends({
as: Component,
className: classNames("typography", className),
$italic: italic,
$tabularNums: tabularNums,
$letterSpacing: letterSpacing,
$lineHeight: lineHeight,
$align: align,
$decoration: decoration,
$transform: transform,
$overflow: overflow,
$whitespace: whitespace,
$wordBreak: wordBreak,
$variant: variant,
$color: color,
$weight: weight,
ref: ref
}, props), children);
});
Typography.displayName = "Typography";
//# sourceMappingURL=Typography.js.map