@rlabs-inc/create-tui 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rlabs-inc/create-tui",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Create TUI Framework applications - The Terminal UI Framework for TypeScript/Bun",
5
5
  "type": "module",
6
6
  "bin": {
@@ -242,9 +242,6 @@ main().catch(console.error)
242
242
  `
243
243
 
244
244
  const APP_TUI = `<script lang="ts">
245
- /**
246
- * Root Application Component
247
- */
248
245
  import Counter from './components/Counter.tui'
249
246
  </script>
250
247
 
@@ -257,31 +254,19 @@ const APP_TUI = `<script lang="ts">
257
254
  gap={2}
258
255
  >
259
256
  <text variant="accent">Welcome to TUI Framework</text>
260
- <Counter initialCount={0} />
257
+ <Counter />
261
258
  <text variant="muted">Press Q to quit</text>
262
259
  </box>
263
260
  `
264
261
 
265
262
  const COUNTER_TUI = `<script lang="ts">
266
- /**
267
- * Counter Component
268
- *
269
- * A simple reactive counter to demonstrate TUI Framework basics.
270
- */
271
263
  import { keyboard } from '@rlabs-inc/tui'
272
264
 
273
- export let initialCount: number = 0
265
+ const count = signal(0)
274
266
 
275
- const count = signal(initialCount)
276
-
277
- // Handle keyboard input
278
- keyboard.onKey((event) => {
279
- if (event.key === 'ArrowUp' || event.key === '+') {
280
- count.value++
281
- }
282
- if (event.key === 'ArrowDown' || event.key === '-') {
283
- count.value--
284
- }
267
+ keyboard.onKey((e) => {
268
+ if (e.key === '+' || e.key === 'ArrowUp') count.value++
269
+ if (e.key === '-' || e.key === 'ArrowDown') count.value--
285
270
  })
286
271
  </script>
287
272
 
@@ -293,6 +278,6 @@ const COUNTER_TUI = `<script lang="ts">
293
278
  gap={1}
294
279
  >
295
280
  <text>Count: {count}</text>
296
- <text variant="muted">Use +/- or arrow keys</text>
281
+ <text variant="muted">+/- to change</text>
297
282
  </box>
298
283
  `
package/src/index.ts CHANGED
@@ -12,7 +12,7 @@ import { parseArgs } from 'util'
12
12
  import { c, symbols } from './utils/colors'
13
13
  import { create } from './commands/create'
14
14
 
15
- const VERSION = '0.1.0'
15
+ const VERSION = '0.1.2'
16
16
 
17
17
  const HELP = `
18
18
  ${c.bold('@rlabs-inc/create-tui')} ${c.muted(`v${VERSION}`)}