@braineet/ui
Version:
Braineet design system
33 lines (32 loc) • 1.29 kB
JavaScript
var _excluded = ["color", "size", "as", "fontFamily"];
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
import React from 'react';
import { Text as StyledText } from './styles';
/**
* The `Text` component.
*/
import { jsx as _jsx } from "react/jsx-runtime";
var Text = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
var color = _ref.color,
size = _ref.size,
as = _ref.as,
fontFamily = _ref.fontFamily,
restProps = _objectWithoutPropertiesLoose(_ref, _excluded);
return /*#__PURE__*/_jsx(StyledText, _extends({
ref: ref,
forwardedAs: as,
color: color,
$fontFamily: fontFamily,
$size: size
}, restProps, {
style: restProps.isInlineCss ? _extends({}, restProps.style) : restProps.style
}));
});
Text.defaultProps = {
as: 'span',
fontFamily: 'text',
color: 'inherit',
size: 'md'
};
export default Text;