Repository URL to install this package:
|
Version:
0.4.48 ▾
|
import React from "react";
import { Box, Text, useStdout } from "ink";
export function Panel({ title, focused = false, height, width, flexGrow, flexShrink, children, badge, }) {
const borderColor = focused ? "cyan" : "gray";
return (React.createElement(Box, { flexDirection: "column", borderStyle: "single", borderColor: borderColor, height: height, width: width, flexGrow: flexGrow, flexShrink: flexShrink, overflow: "hidden" },
title ? (React.createElement(Box, null,
React.createElement(Text, { color: borderColor, bold: focused }, title),
badge ? (React.createElement(React.Fragment, null,
React.createElement(Text, null, " "),
badge)) : null)) : null,
children));
}
export function useTerminalSize() {
const { stdout } = useStdout();
return {
cols: stdout?.columns ?? 80,
rows: stdout?.rows ?? 24,
};
}
//# sourceMappingURL=Panel.js.map