UNPKG

@blockstack/ui

Version:

Blockstack UI components built using React and styled-components with styled-system.

39 lines (31 loc) 994 B
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../_virtual/_rollupPluginBabelHelpers.js'; import React__default, { forwardRef } from 'react'; import { Box } from '../box/index.esm.js'; var assumeTextStyle = function assumeTextStyle(as) { switch (as) { case 'h1': return 'display.large'; case 'h2': return 'display.small'; case 'h3': return 'body.large.medium'; default: return undefined; } }; var Text = /*#__PURE__*/forwardRef(function (_ref, ref) { var textStyle = _ref.textStyle, _ref$as = _ref.as, as = _ref$as === void 0 ? 'span' : _ref$as, rest = _objectWithoutPropertiesLoose(_ref, ["textStyle", "as"]); return React__default.createElement(Box, Object.assign({ ref: ref, as: as, whiteSpace: "unset", display: "inline", textStyle: textStyle || assumeTextStyle(as) }, rest)); }); Text.displayName = 'Text'; export { Text }; //# sourceMappingURL=index.esm.js.map