Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions opentui
Submodule opentui added at 44cb16
1 change: 1 addition & 0 deletions packages/demo/demos/prompt-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export function PromptInputApp() {
files={files}
placeholder="Message Claude..."
showDividers
autoFocus
useKeyboard={useKeyboard}
onSubmit={handleSubmit}
/>
Expand Down
9 changes: 2 additions & 7 deletions packages/demo/demos/spinner.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
// @ts-nocheck
import { useKeyboard } from "@gridland/utils"
import { SpinnerPicker, StatusBar } from "@gridland/ui"
import { SpinnerPicker } from "@gridland/ui"

export function SpinnerApp() {
return (
<box flexDirection="column" flexGrow={1}>
<box flexGrow={1}>
<SpinnerPicker useKeyboard={useKeyboard} />
</box>
<box paddingX={1} paddingBottom={1}>
<StatusBar items={[{ key: "←→", label: "change variant" }]} />
</box>
<SpinnerPicker useKeyboard={useKeyboard} />
</box>
)
}
2 changes: 1 addition & 1 deletion packages/docs/components/demos/ai-chat-interface-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function AIChatInterfaceApp() {

export default function AIChatInterfaceDemo() {
return (
<DemoWindow title="AI Chat Interface" tuiStyle={{ width: "100%", height: 480 }}>
<DemoWindow title="AI Chat Interface" tuiStyle={{ width: "100%", height: 480 }} autoFocus>
<AIChatInterfaceApp />
</DemoWindow>
)
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/components/demos/chain-of-thought-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ChainOfThought, ChainOfThoughtHeader, ChainOfThoughtContent, ChainOfTho

export default function ChainOfThoughtDemo() {
return (
<DemoWindow title="Chain of Thought" tuiStyle={{ width: "100%", height: 340 }}>
<DemoWindow title="Chain of Thought" tuiStyle={{ width: "100%", height: 340 }} autoFocus>
<ChainOfThoughtApp />
</DemoWindow>
)
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/components/demos/spinner-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Spinner, SpinnerShowcase } from "@gridland/ui"

export default function SpinnerPickerDemo() {
return (
<DemoWindow title="Spinner" tuiStyle={{ width: "100%", height: 140 }}>
<DemoWindow title="Spinner" tuiStyle={{ width: "100%", height: 140 }} autoFocus>
<SpinnerApp />
</DemoWindow>
)
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/components/demos/tabs-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function ContentTabBarApp() {

export function TabsSimpleDemo() {
return (
<DemoWindow title="TabBar" tuiStyle={{ width: "100%", height: 120 }}>
<DemoWindow title="TabBar" tuiStyle={{ width: "100%", height: 120 }} autoFocus>
<TabBarApp />
</DemoWindow>
)
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/components/demos/text-input-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function TextInputPickerApp() {

export function TextInputPickerDemo() {
return (
<DemoWindow title="TextInput" tuiStyle={{ width: "100%", height: 200 }}>
<DemoWindow title="TextInput" tuiStyle={{ width: "100%", height: 200 }} autoFocus>
<TextInputPickerApp />
</DemoWindow>
)
Expand Down
4 changes: 3 additions & 1 deletion packages/docs/components/ui/demo-window.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface DemoWindowProps {
cols?: number
rows?: number
cursorHighlight?: boolean
autoFocus?: boolean
children: ReactNode
}

Expand All @@ -32,6 +33,7 @@ export function DemoWindow({
cols = 80,
rows = 24,
cursorHighlight = false,
autoFocus = false,
children,
}: DemoWindowProps) {
const { resolvedTheme } = usePageTheme()
Expand Down Expand Up @@ -93,7 +95,7 @@ export function DemoWindow({
<TerminalWindow title={title} className={className} titleBarRight={titleBarRight}>
<div className="overflow-x-auto overscroll-x-none">
<div style={{ display: mode === "browser" ? "block" : "none" }}>
<TUI style={tuiStyle} autoFocus={false} backgroundColor={tuiTheme.background} cursorHighlight={cursorHighlight}>
<TUI style={tuiStyle} autoFocus={autoFocus} backgroundColor={tuiTheme.background} cursorHighlight={cursorHighlight}>
<ThemeProvider theme={tuiTheme}>{children}</ThemeProvider>
</TUI>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/docs/components/ascii.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Renders text as large ASCII art using the `<ascii-font>` OpenTUI intrinsic.
Supports multiple font styles and custom colors.

<div className="my-8">
<DemoWindow title="Ascii" tuiStyle={{ width: "100%", height: 280 }}>
<DemoWindow title="Ascii" tuiStyle={{ width: "100%", height: 280 }} autoFocus>
<AsciiApp />
</DemoWindow>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/docs/components/chat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ call status cards, streaming text, a loading indicator, and a `PromptInput`.
SDK-agnostic — the consumer passes messages and handles submission.

<div className="my-8">
<DemoWindow title="Chat" tuiStyle={{ width: "100%", height: 280 }}>
<DemoWindow title="Chat" tuiStyle={{ width: "100%", height: 280 }} autoFocus>
<ChatApp />
</DemoWindow>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/docs/components/gradient.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Applies a color gradient across text characters. Choose from 13 named presets
or provide custom hex colors.

<div className="my-8">
<DemoWindow title="Gradient" tuiStyle={{ width: "100%", height: 280 }}>
<DemoWindow title="Gradient" tuiStyle={{ width: "100%", height: 280 }} autoFocus>
<GradientApp />
</DemoWindow>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/docs/components/link.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A clickable hyperlink for terminal UIs with configurable underline style and
color.

<div className="my-8">
<DemoWindow title="Link" tuiStyle={{ width: "100%", height: 120 }}>
<DemoWindow title="Link" tuiStyle={{ width: "100%", height: 120 }} autoFocus>
<LinkApp />
</DemoWindow>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/docs/components/modal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A bordered container that overlays content, optionally displays a title, and
listens for the Escape key to trigger a close callback.

<div className="my-8">
<DemoWindow title="Modal" tuiStyle={{ width: "100%", height: 200 }}>
<DemoWindow title="Modal" tuiStyle={{ width: "100%", height: 200 }} autoFocus>
<ModalApp />
</DemoWindow>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/docs/components/multi-select.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A multi-selection list with checkbox indicators, keyboard navigation, group
headers, a submit row, and a submitted state.

<div className="my-8">
<DemoWindow title="MultiSelect" tuiStyle={{ width: "100%", height: 240 }}>
<DemoWindow title="MultiSelect" tuiStyle={{ width: "100%", height: 240 }} autoFocus>
<MultiSelectApp />
</DemoWindow>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/docs/components/primitives.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gridland uses JSX intrinsic elements that map to renderable components in the op
These are used inside `<TUI>`.

<div className="my-8">
<DemoWindow title="Primitives" tuiStyle={{ width: "100%", height: 200 }}>
<DemoWindow title="Primitives" tuiStyle={{ width: "100%", height: 200 }} autoFocus>
<PrimitivesApp />
</DemoWindow>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/docs/components/prompt-input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ command history, and direct Vercel AI SDK integration. Supports both a
self-contained default layout and a fully composable compound mode.

<div className="my-8">
<DemoWindow title="PromptInput" tuiStyle={{ width: "100%", height: 300 }}>
<DemoWindow title="PromptInput" tuiStyle={{ width: "100%", height: 300 }} autoFocus>
<PromptInputApp />
</DemoWindow>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/docs/components/select-input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A single-selection list with radio indicators, keyboard navigation, group
headers, and a submitted state.

<div className="my-8">
<DemoWindow title="SelectInput" tuiStyle={{ width: "100%", height: 240 }}>
<DemoWindow title="SelectInput" tuiStyle={{ width: "100%", height: 240 }} autoFocus>
<SelectInputApp />
</DemoWindow>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/docs/components/status-bar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A horizontal bar that displays keybinding hints with key labels and
descriptions. Commonly placed at the bottom of a view.

<div className="my-8">
<DemoWindow title="StatusBar" tuiStyle={{ width: "100%", height: 80 }}>
<DemoWindow title="StatusBar" tuiStyle={{ width: "100%", height: 80 }} autoFocus>
<StatusBarApp />
</DemoWindow>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/docs/components/terminal-window.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A decorative container that mimics a terminal window with traffic light buttons
and an optional centered title. Defaults to a dark gray background.

<div className="my-8">
<DemoWindow title="Terminal" tuiStyle={{ width: "100%", height: 120 }}>
<DemoWindow title="Terminal" tuiStyle={{ width: "100%", height: 120 }} autoFocus>
<TerminalWindowApp />
</DemoWindow>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/docs/components/tui.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ canvas. It handles client detection, canvas creation, React reconciler setup,
and automatic resizing. Gridland is built on the [opentui](https://opentui.com) engine.

<div className="my-8">
<DemoWindow title="Primitives" tuiStyle={{ width: "100%", height: 200 }}>
<DemoWindow title="Primitives" tuiStyle={{ width: "100%", height: 200 }} autoFocus>
<PrimitivesApp />
</DemoWindow>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/docs/guides/focus-and-navigation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gridland provides a unified focus and input system that works identically in bot
#### Focus with Multi-Select

<div className="my-8">
<DemoWindow title="Focus & Navigation" tuiStyle={{ width: "100%", height: 340 }}>
<DemoWindow title="Focus & Navigation" tuiStyle={{ width: "100%", height: 340 }} autoFocus>
<FocusApp />
</DemoWindow>
</div>
Expand Down

This file was deleted.

Loading
Loading