Support ink scrolling final pr (#12567)

This commit is contained in:
Jacob Richman
2025-11-11 07:50:11 -08:00
committed by GitHub
parent 7bb13d1c41
commit cbbf565121
43 changed files with 2498 additions and 1568 deletions
@@ -0,0 +1,44 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type React from 'react';
import { Box } from 'ink';
import { theme } from '../semantic-colors.js';
export interface StickyHeaderProps {
children: React.ReactNode;
width: number;
}
export const StickyHeader: React.FC<StickyHeaderProps> = ({
children,
width,
}) => (
<Box
sticky
minHeight={1}
flexShrink={0}
width={width}
stickyChildren={
<Box
borderStyle="single"
width={width}
opaque
borderColor={theme.ui.dark}
borderTop={false}
borderLeft={false}
borderRight={false}
paddingX={1}
>
{children}
</Box>
}
>
<Box paddingX={1} width={width}>
{children}
</Box>
</Box>
);