Skip to content
Merged
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
26 changes: 13 additions & 13 deletions packages/solid/examples/components/line-number-demo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createSignal, onMount } from "solid-js"
import { SyntaxStyle } from "@opentui/core"
import { RGBA, SyntaxStyle, TextAttributes } from "@opentui/core"
import { useKeyboard } from "@opentui/solid"
import { createSignal, onMount } from "solid-js"

export default function LineNumberDemo() {
const [showLineNumbers, setShowLineNumbers] = createSignal(true)
Expand All @@ -26,15 +26,15 @@ const evens = results.filter(n => n % 2 === 0)
console.log('Even numbers:', evens)`

const syntaxStyle = SyntaxStyle.fromStyles({
keyword: { fg: "#C792EA" },
function: { fg: "#82AAFF" },
string: { fg: "#C3E88D" },
number: { fg: "#F78C6C" },
comment: { fg: "#546E7A" },
type: { fg: "#FFCB6B" },
operator: { fg: "#89DDFF" },
variable: { fg: "#EEFFFF" },
default: { fg: "#A6ACCD" },
keyword: { fg: RGBA.fromHex("#C792EA") },
function: { fg: RGBA.fromHex("#82AAFF") },
string: { fg: RGBA.fromHex("#C3E88D") },
number: { fg: RGBA.fromHex("#F78C6C") },
comment: { fg: RGBA.fromHex("#546E7A") },
type: { fg: RGBA.fromHex("#FFCB6B") },
operator: { fg: RGBA.fromHex("#89DDFF") },
variable: { fg: RGBA.fromHex("#EEFFFF") },
default: { fg: RGBA.fromHex("#A6ACCD") },
})

let lineNumberRef: any
Expand Down Expand Up @@ -120,8 +120,8 @@ console.log('Even numbers:', evens)`

return (
<box flexDirection="column" width="100%" height="100%" gap={1}>
<box flexDirection="column" backgroundColor="#0D1117" padding={1} border borderColor="#30363D">
<text fg="#4ECDC4" bold>
<box flexDirection="column" backgroundColor="#0D1117" padding={1} border borderColor="#30363D" flexShrink={0}>
<text fg="#4ECDC4" attributes={TextAttributes.BOLD}>
Line Numbers Demo
</text>
<text fg="#888888">Keybindings:</text>
Expand Down
Loading