UNPKG

@roots/bud-dashboard

Version:

bud.js core module

8 lines (7 loc) 1.22 kB
import { jsx as _jsx, jsxs as _jsxs } from "@roots/bud-support/jsx-runtime"; import figures from '@roots/bud-support/figures'; import { Box, Text } from '@roots/bud-support/ink'; const View = ({ borderColor = `dim`, children, compact, footer, head, marginTop = 1, paddingY = 0, }) => { return (_jsxs(Box, { flexDirection: "column", marginTop: marginTop, overflowX: "hidden", width: "100%", children: [_jsxs(Box, { flexDirection: "row", gap: 1, overflowX: "hidden", width: "100%", children: [_jsx(Box, { flexDirection: "row", gap: 0, minWidth: 1, children: _jsx(Text, { color: borderColor, children: figures.lineDownRightArc }) }), head] }), !compact && (_jsx(Box, { borderBottom: false, borderColor: borderColor, borderLeft: true, borderRight: false, borderStyle: "single", borderTop: false, flexDirection: "column", gap: 1, overflowX: "hidden", paddingBottom: paddingY, paddingLeft: 1, paddingTop: paddingY, width: "100%", children: children })), _jsxs(Box, { flexDirection: "row", gap: 1, overflowX: "hidden", width: "100%", children: [_jsx(Box, { flexDirection: "row", gap: 0, minWidth: 1, children: _jsx(Text, { color: borderColor, children: figures.lineUpRightArc }) }), footer] })] })); }; export default View;