UNPKG

@arche-mc2/arche-controls

Version:

We know that there are a ton of react UI library projects to choose from. Our hope with this one is to provide the next generation of react components that you can use to bootstrap your next project, or as a reference for building a UIKit. Read on to get

29 lines 1.77 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var classnames = require("classnames"); require("./bootstrap-grid.css"); var index_1 = require("../../Display/SvgIcon/index"); var styles_1 = require("./styles"); var UpTile = function (props) { var _a = React.useState(false), isCollapse = _a[0], setCollapse = _a[1]; var handleCollapse = function () { return setCollapse(!isCollapse); }; var title = props.title, children = props.children, maxHeight = props.maxHeight, footer = props.footer; return (React.createElement("div", { className: classnames('UpTile', styles_1.getStyles) }, React.createElement("div", { className: 'box box-home' + (!isCollapse ? '' : ' collapsed-box') }, React.createElement("div", { className: 'box-header with-border' }, React.createElement("h3", { className: 'box-title' }, title), React.createElement("div", { className: 'box-tools pull-right' }, React.createElement("button", { "data-widget": 'collapse', type: 'button', className: 'btn btn-box-tool', onClick: handleCollapse }, React.createElement(index_1.default, { height: 15, width: 15, iconName: isCollapse ? 'plus' : 'minus' })))), React.createElement("div", { className: 'box-body' }, React.createElement("div", { style: maxHeight !== null ? { maxHeight: maxHeight + "px", overflowY: 'auto' } : {} }, children)), footer && React.createElement("div", { className: 'box-footer text-center' }, footer)))); }; UpTile.defaultProps = { title: null, footer: null, maxHeight: null }; exports.default = UpTile; //# sourceMappingURL=UpTile.js.map