chayns-components
Version:
A set of beautiful React components for developing chayns® applications.
50 lines (47 loc) • 1.44 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _react = _interopRequireDefault(require("react"));
var _AbstractList = _interopRequireDefault(require("./AbstractList"));
var _ExpandableList = _interopRequireDefault(require("./ExpandableList/ExpandableList"));
/**
* @component
*/
/**
* The wrapper for the `ListItem`-component to create lists.
*/
const List = _ref => {
let {
className,
children,
notExpandable = false
} = _ref;
if (notExpandable) {
return /*#__PURE__*/_react.default.createElement(_AbstractList.default, {
className: className
}, children);
}
return /*#__PURE__*/_react.default.createElement(_ExpandableList.default, {
className: className
}, children);
};
List.propTypes = {
/**
* A classname string that will be applied to the wrapper container.
*/
className: _propTypes.default.string,
/**
* The children of the list.
*/
children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.arrayOf(_propTypes.default.node)]),
/**
* Wether the components inside of the list should not be expandable.
*/
notExpandable: _propTypes.default.bool
};
List.displayName = 'List';
var _default = List;
exports.default = _default;
//# sourceMappingURL=List.js.map