feat: add tui app

This commit is contained in:
Max Koon
2025-11-14 13:26:15 -05:00
parent 058f2bb94f
commit 5b14b4e7a4
22 changed files with 2395 additions and 128 deletions

View File

@@ -0,0 +1,33 @@
import * as React from "react";
import type { ViewProps, TextProps } from "react-native";
export function View({ children, style }: ViewProps) {
const bg = style &&
'backgroundColor' in style
? typeof style.backgroundColor == 'string'
? style.backgroundColor
: undefined
: undefined;
return <box backgroundColor={bg}>{children}</box>
}
export function Text({ style, children }: TextProps) {
const fg = style &&
'color' in style
? typeof style.color == 'string'
? style.color
: undefined
: undefined;
return <text fg={fg || "black"}>{children}</text>
}
export const Platform = {
OS: "tui",
};
export default {
View,
Text,
}

View File

@@ -0,0 +1,11 @@
{
"name": "react-native-opentui",
"version": "1.0.0",
"main": "index.tsx",
"exports": {
".": "./index.tsx"
},
"peerDependencies": {
"react": "*"
}
}

View File

@@ -0,0 +1,12 @@
{
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"jsxImportSource": "@opentui/react",
"strict": true,
"skipLibCheck": true
}
}