feat: add tui ui kit

This commit is contained in:
Peter Steinberger
2026-01-03 06:22:20 +01:00
parent aee13507f9
commit 32c91bbb25
8 changed files with 459 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
import {
SelectList,
type SelectItem,
SettingsList,
type SettingItem,
} from "@mariozechner/pi-tui";
import { selectListTheme, settingsListTheme } from "../theme/theme.js";
export function createSelectList(items: SelectItem[], maxVisible = 7) {
return new SelectList(items, maxVisible, selectListTheme);
}
export function createSettingsList(
items: SettingItem[],
onChange: (id: string, value: string) => void,
onCancel: () => void,
maxVisible = 7,
) {
return new SettingsList(
items,
maxVisible,
settingsListTheme,
onChange,
onCancel,
);
}