UNPKG

terra-props-table

Version:

React component to render a table view for the props metadata of another react component.

88 lines (71 loc) 2.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = _interopRequireDefault(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // These props are used to test react-doc-gen, but they only need to be mocked /* eslint-disable react/no-unused-prop-types */ var propTypes = { /** * An example of type string markup. * `This component contains a very long section of code in it's description column. This component contains a very long section of code in it's description column.` */ string: _propTypes.default.string.isRequired, /** * An example of type number markup. */ number: _propTypes.default.number, /** * An example of type boolean markup. * ```This component contains a very long preformatted section in it's description column. This component contains a very long preformatted section in it's description column.``` */ bool: _propTypes.default.bool, /** * An example of type element markup. */ element: _propTypes.default.element, /** * An example of type node markup. */ node: _propTypes.default.node, /** * An example of type array markup. */ // eslint-disable-next-line react/forbid-prop-types array: _propTypes.default.array, /** * A default example of type arrayOf markup. */ arrayOfDefault: _propTypes.default.arrayOf(_propTypes.default.element), /** * An example of type arrayOf(shapes) markup. */ arrayOfShapes: _propTypes.default.arrayOf(_propTypes.default.shape({ stringProp: _propTypes.default.string })), /** * An example of type oneOfType markup with the option of a string, number or shape type. */ oneOfType: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.shape({ stringProp: _propTypes.default.string })]), /** * An example of type shape markup. */ shape: _propTypes.default.shape({ stringProp: _propTypes.default.string, numberProp: _propTypes.default.number }) }; /* eslint-enable react/no-unused-prop-types */ var MockComponent = function MockComponent(props) { return /*#__PURE__*/_react.default.createElement('span', JSON.stringify({ props: props })); }; MockComponent.propTypes = propTypes; var _default = MockComponent; exports.default = _default;