UNPKG

@mskcc/carbon-react

Version:

Carbon react components for the MSKCC DSM

36 lines (28 loc) 1.05 kB
/** * MSKCC 2021, 2024 */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js'); var React = require('react'); var Text = require('./Text.js'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var React__default = /*#__PURE__*/_interopDefaultLegacy(React); /** * Create a text component wrapper for a given text node type. Useful for * returning a `Text` component for a text node like a `<label>`. * @param {string} element * @param {string} displayName */ function createTextComponent(element, displayName) { function TextWrapper(props) { return /*#__PURE__*/React__default["default"].createElement(Text.Text, _rollupPluginBabelHelpers["extends"]({ as: element }, props)); } if (process.env.NODE_ENV !== "production") { TextWrapper.displayName = displayName; } return TextWrapper; } exports.createTextComponent = createTextComponent;