dssoca 0.5.0 → 0.9.0

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.
Files changed (56) hide show
  1. package/README.md +39 -13
  2. package/dist/components/Accordion.svelte +297 -0
  3. package/dist/components/Accordion.svelte.d.ts +51 -0
  4. package/dist/components/Badge.svelte +113 -18
  5. package/dist/components/Badge.svelte.d.ts +28 -2
  6. package/dist/components/BottomNav.svelte +254 -0
  7. package/dist/components/BottomNav.svelte.d.ts +32 -0
  8. package/dist/components/Button.svelte +147 -10
  9. package/dist/components/Button.svelte.d.ts +21 -4
  10. package/dist/components/Card.svelte +173 -8
  11. package/dist/components/Card.svelte.d.ts +16 -1
  12. package/dist/components/Container.svelte +55 -0
  13. package/dist/components/Container.svelte.d.ts +16 -0
  14. package/dist/components/EmptyState.svelte +91 -9
  15. package/dist/components/EmptyState.svelte.d.ts +20 -3
  16. package/dist/components/Heading.svelte +83 -0
  17. package/dist/components/Heading.svelte.d.ts +17 -0
  18. package/dist/components/Icon.svelte +199 -24
  19. package/dist/components/Icon.svelte.d.ts +70 -2
  20. package/dist/components/Image.svelte +428 -0
  21. package/dist/components/Image.svelte.d.ts +49 -0
  22. package/dist/components/Input.svelte +173 -39
  23. package/dist/components/Input.svelte.d.ts +22 -0
  24. package/dist/components/Link.svelte +183 -0
  25. package/dist/components/Link.svelte.d.ts +29 -0
  26. package/dist/components/LogStream.svelte +403 -47
  27. package/dist/components/LogStream.svelte.d.ts +35 -7
  28. package/dist/components/Menu.svelte +408 -0
  29. package/dist/components/Menu.svelte.d.ts +66 -0
  30. package/dist/components/MetricTile.svelte +124 -12
  31. package/dist/components/MetricTile.svelte.d.ts +20 -0
  32. package/dist/components/SegmentedControl.svelte +220 -0
  33. package/dist/components/SegmentedControl.svelte.d.ts +37 -0
  34. package/dist/components/ServiceCard.svelte +226 -30
  35. package/dist/components/ServiceCard.svelte.d.ts +13 -1
  36. package/dist/components/Sidebar.svelte +377 -40
  37. package/dist/components/Sidebar.svelte.d.ts +18 -7
  38. package/dist/components/Sparkline.svelte +198 -13
  39. package/dist/components/Sparkline.svelte.d.ts +20 -1
  40. package/dist/components/Spinner.svelte +124 -0
  41. package/dist/components/Spinner.svelte.d.ts +74 -0
  42. package/dist/components/Textarea.svelte +214 -0
  43. package/dist/components/Textarea.svelte.d.ts +38 -0
  44. package/dist/components/Toaster.svelte +209 -12
  45. package/dist/components/Toaster.svelte.d.ts +3 -0
  46. package/dist/components/Topbar.svelte +293 -42
  47. package/dist/components/Topbar.svelte.d.ts +48 -1
  48. package/dist/dssoca.config.d.ts +1 -1
  49. package/dist/dssoca.config.js +10 -0
  50. package/dist/index.d.ts +16 -3
  51. package/dist/index.js +18 -2
  52. package/dist/theme.css +406 -24
  53. package/dist/toast.svelte.d.ts +49 -5
  54. package/dist/toast.svelte.js +165 -9
  55. package/dist/tokens.css +597 -0
  56. package/package.json +25 -4
@@ -1,28 +1,69 @@
1
+ <script module lang="ts">
2
+ /** A single log severity level. */
3
+ export type LogLevel = 'info' | 'warn' | 'err' | 'ok'
4
+
5
+ /** A controlled log line. `id` is optional — when omitted the index is used as the key. */
6
+ export interface LogLine {
7
+ id?: string | number
8
+ /** Timestamp string (e.g. "12:00:01"); rendered verbatim. */
9
+ t?: string
10
+ lvl: LogLevel
11
+ /** Service / source tag (e.g. "[hub]"). */
12
+ svc?: string
13
+ msg: string
14
+ }
15
+
16
+ const LEVELS: LogLevel[] = ['info', 'warn', 'err', 'ok']
17
+ </script>
18
+
1
19
  <script lang="ts">
2
- import { tick, untrack } from 'svelte'
20
+ import { tick, untrack, type Snippet } from 'svelte'
3
21
  import { resolveComponentSize, type Size } from '../config.js'
4
-
5
- interface LogLine { id: number; t: string; lvl: string; svc: string; msg: string }
22
+ import EmptyState from './EmptyState.svelte'
6
23
 
7
24
  interface Props {
8
- live?: boolean
25
+ /** Controlled lines. When provided, the component renders exactly these (capped to `maxLines`). */
26
+ lines?: LogLine[]
27
+ /** Seed lines for the built-in demo stream (only used when `lines` is undefined). */
9
28
  initialLines?: Omit<LogLine, 'id'>[]
29
+ /** Generate a random demo stream. Defaults true ONLY when `lines` is not supplied. */
30
+ demo?: boolean
31
+ /** Back-compat alias for `demo` — drives the built-in ticker. */
32
+ live?: boolean
33
+ /** Max number of lines kept in the buffer (oldest dropped). */
34
+ maxLines?: number
35
+ /** Show the controls toolbar (filters, search, wrap, copy, clear). */
36
+ controls?: boolean
37
+ /** Replace the built-in toolbar entirely. */
38
+ toolbar?: Snippet
39
+ /** Wrap long messages (pre-wrap) vs. horizontal scroll (pre). */
40
+ wrap?: boolean
41
+ /** aria-live politeness for the log region. */
42
+ announce?: 'off' | 'polite' | 'assertive'
43
+ /** Accessible label for the log region. */
44
+ ariaLabel?: string
45
+ /** Show a connecting/loading indicator. */
46
+ loading?: boolean
47
+ /** Custom empty state. */
48
+ empty?: Snippet
10
49
  /** Token size (sm|md|lg); inherits the global size when unset. */
11
50
  size?: Size
12
51
  }
13
52
 
14
- const TEMPLATES = [
53
+ const TEMPLATES: Omit<LogLine, 'id'>[] = [
15
54
  { lvl: 'info', svc: '[movies-api]', msg: 'GET /movies?status=to_watch — 3 rows · 4ms' },
16
- { lvl: 'ok', svc: '[hub]', msg: 'GET /api/auth/session — 8ms' },
17
- { lvl: 'info', svc: '[hub]', msg: 'session refresh — user=rafael' },
18
- { lvl: 'warn', svc: '[caddy]', msg: 'tls internal renewing hub.home' },
19
- { lvl: 'err', svc: '[tasks-api]', msg: 'EADDRINUSE :3004 — retrying in 2s' },
20
- { lvl: 'info', svc: '[notes-api]', msg: 'slow query · 182ms · SELECT * FROM notes' },
21
- { lvl: 'ok', svc: '[meals-api]', msg: 'POST /meals — created id=m_a4f1 · 6ms' },
55
+ { lvl: 'ok', svc: '[hub]', msg: 'GET /api/auth/session — 8ms' },
56
+ { lvl: 'info', svc: '[hub]', msg: 'session refresh — user=admin' },
57
+ { lvl: 'warn', svc: '[caddy]', msg: 'tls internal renewing hub.home' },
58
+ { lvl: 'err', svc: '[tasks-api]', msg: 'EADDRINUSE :3004 — retrying in 2s' },
59
+ { lvl: 'info', svc: '[notes-api]', msg: 'slow query · 182ms · SELECT * FROM notes' },
60
+ { lvl: 'ok', svc: '[meals-api]', msg: 'POST /meals — created id=m_a4f1 · 6ms' },
22
61
  { lvl: 'info', svc: '[movies-api]', msg: 'drizzle migrated 0002 · runtime 12ms' },
23
62
  ]
24
63
 
25
- function pad(n: number) { return String(n).padStart(2, '0') }
64
+ function pad(n: number) {
65
+ return String(n).padStart(2, '0')
66
+ }
26
67
  function nowStr() {
27
68
  const d = new Date()
28
69
  return `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`
@@ -32,71 +73,386 @@
32
73
  return `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`
33
74
  }
34
75
 
35
- let { live = true, initialLines, size }: Props = $props()
76
+ let {
77
+ lines,
78
+ initialLines,
79
+ demo,
80
+ live,
81
+ maxLines = 30,
82
+ controls = true,
83
+ toolbar,
84
+ wrap = true,
85
+ announce = 'polite',
86
+ ariaLabel = 'Log output',
87
+ loading = false,
88
+ empty,
89
+ size,
90
+ }: Props = $props()
36
91
 
92
+ // Controlled mode: `lines` (or empty array) supplied → render those, demo off.
93
+ const controlled = $derived(lines !== undefined)
94
+ // Demo defaults on only when uncontrolled. `live`/`demo` either flips it.
95
+ const demoOn = $derived(!controlled && (demo ?? live ?? true))
96
+
97
+ // Internal demo buffer.
37
98
  const seed = untrack(() => initialLines ?? TEMPLATES)
38
99
  let counter = $state(seed.length)
39
- let lines = $state<LogLine[]>(seed.map((t, i) => ({ ...t, t: timeAgo(i * 4), id: i })))
100
+ let demoLines = $state<LogLine[]>(seed.map((t, i) => ({ ...t, t: t.t || timeAgo(i * 4), id: i })))
101
+
102
+ // The source of truth, capped to maxLines.
103
+ const allLines = $derived((controlled ? (lines as LogLine[]) : demoLines).slice(-maxLines))
104
+
105
+ // --- toolbar state ---
106
+ let activeLevels = $state<Set<LogLevel>>(new Set(LEVELS))
107
+ let query = $state('')
108
+ let wrapOn = $state(untrack(() => wrap))
109
+ $effect(() => {
110
+ wrapOn = wrap
111
+ })
112
+
113
+ const visibleLines = $derived(
114
+ allLines.filter((l) => {
115
+ if (!activeLevels.has(l.lvl)) return false
116
+ if (query.trim()) {
117
+ const q = query.toLowerCase()
118
+ const hay = `${l.t ?? ''} ${l.lvl} ${l.svc ?? ''} ${l.msg}`.toLowerCase()
119
+ if (!hay.includes(q)) return false
120
+ }
121
+ return true
122
+ }),
123
+ )
124
+
125
+ function toggleLevel(lvl: LogLevel) {
126
+ const next = new Set(activeLevels)
127
+ if (next.has(lvl)) next.delete(lvl)
128
+ else next.add(lvl)
129
+ activeLevels = next
130
+ }
131
+
132
+ async function copyVisible() {
133
+ const text = visibleLines
134
+ .map((l) => `${l.t ?? ''} ${l.lvl.toUpperCase()} ${l.svc ?? ''} ${l.msg}`.trim())
135
+ .join('\n')
136
+ try {
137
+ await navigator.clipboard?.writeText(text)
138
+ } catch {
139
+ /* clipboard unavailable (e.g. insecure context) — no-op */
140
+ }
141
+ }
142
+
143
+ function clear() {
144
+ if (controlled) return
145
+ demoLines = []
146
+ }
40
147
 
148
+ // --- follow-tail ---
41
149
  let el: HTMLDivElement | undefined
150
+ let following = $state(true)
151
+ const NEAR = 24 // px from bottom considered "at bottom"
42
152
 
153
+ function atBottom() {
154
+ if (!el) return true
155
+ return el.scrollHeight - el.scrollTop - el.clientHeight <= NEAR
156
+ }
157
+
158
+ function onScroll() {
159
+ following = atBottom()
160
+ }
161
+
162
+ async function jumpToBottom() {
163
+ following = true
164
+ await tick()
165
+ if (el) el.scrollTop = el.scrollHeight
166
+ }
167
+
168
+ // Auto-scroll on new content only when following.
43
169
  $effect(() => {
44
- if (!live) return
45
- const interval = setInterval(async () => {
170
+ // re-run whenever the visible set changes
171
+ void visibleLines.length
172
+ if (!following) return
173
+ tick().then(() => {
174
+ if (el && untrack(() => following)) el.scrollTop = el.scrollHeight
175
+ })
176
+ })
177
+
178
+ // Demo ticker.
179
+ $effect(() => {
180
+ if (!demoOn) return
181
+ const interval = setInterval(() => {
46
182
  const pick = TEMPLATES[Math.floor(Math.random() * TEMPLATES.length)]
47
- lines = [...lines.slice(-30), { ...pick, t: nowStr(), id: counter++ }]
48
- await tick()
49
- if (el) el.scrollTop = el.scrollHeight
183
+ demoLines = [...demoLines.slice(-maxLines), { ...pick, t: nowStr(), id: counter++ }]
50
184
  }, 1800)
51
185
  return () => clearInterval(interval)
52
186
  })
187
+
188
+ function keyFor(line: LogLine, i: number) {
189
+ return line.id ?? i
190
+ }
53
191
  </script>
54
192
 
55
- <div class="ss-logs" bind:this={el} data-size-variant={resolveComponentSize('LogStream', size)}>
56
- {#each lines as line (line.id)}
57
- <div class="ln">
58
- <span class="t">{line.t}</span>
59
- <span class="lvl {line.lvl}">{line.lvl.toUpperCase()}</span>
60
- <span class="svc">{line.svc}</span>
61
- <span>{line.msg}</span>
193
+ <div class="ss-logs" data-size-variant={resolveComponentSize('LogStream', size)}>
194
+ {#if controls}
195
+ {#if toolbar}
196
+ <div class="bar">{@render toolbar()}</div>
197
+ {:else}
198
+ <div class="bar">
199
+ <div class="filters" role="group" aria-label="Filter by level">
200
+ {#each LEVELS as lvl (lvl)}
201
+ <button
202
+ type="button"
203
+ class="chip {lvl}"
204
+ aria-pressed={activeLevels.has(lvl)}
205
+ onclick={() => toggleLevel(lvl)}>{lvl.toUpperCase()}</button
206
+ >
207
+ {/each}
208
+ </div>
209
+ <input
210
+ class="search"
211
+ type="text"
212
+ placeholder="Filter…"
213
+ aria-label="Filter log text"
214
+ bind:value={query}
215
+ />
216
+ <button type="button" class="chip" aria-pressed={wrapOn} onclick={() => (wrapOn = !wrapOn)}
217
+ >WRAP</button
218
+ >
219
+ <button type="button" class="chip" onclick={copyVisible}>COPY</button>
220
+ {#if !controlled}
221
+ <button type="button" class="chip" onclick={clear}>CLEAR</button>
222
+ {/if}
223
+ </div>
224
+ {/if}
225
+ {/if}
226
+
227
+ <div class="viewport">
228
+ <div
229
+ class="scroll"
230
+ class:nowrap={!wrapOn}
231
+ bind:this={el}
232
+ onscroll={onScroll}
233
+ role="log"
234
+ aria-label={ariaLabel}
235
+ aria-live={announce}
236
+ aria-busy={loading}
237
+ >
238
+ {#if loading}
239
+ <div class="status" aria-hidden="true">
240
+ <span class="dot"></span> connecting…
241
+ </div>
242
+ {/if}
243
+
244
+ {#if visibleLines.length === 0}
245
+ {#if empty}
246
+ {@render empty()}
247
+ {:else}
248
+ <EmptyState
249
+ title="No log lines"
250
+ message={allLines.length
251
+ ? 'No lines match the current filters.'
252
+ : 'Waiting for output…'}
253
+ {size}
254
+ />
255
+ {/if}
256
+ {:else}
257
+ {#each visibleLines as line, i (keyFor(line, i))}
258
+ <div class="ln">
259
+ {#if line.t}<span class="t">{line.t}</span>{/if}
260
+ <span class="lvl {line.lvl}">{line.lvl.toUpperCase()}</span>
261
+ {#if line.svc}<span class="svc">{line.svc}</span>{/if}
262
+ <span class="msg">{line.msg}</span>
263
+ </div>
264
+ {/each}
265
+ {/if}
62
266
  </div>
63
- {/each}
267
+
268
+ {#if !following}
269
+ <button type="button" class="jump" onclick={jumpToBottom}> Jump to bottom </button>
270
+ {/if}
271
+ </div>
64
272
  </div>
65
273
 
66
274
  <style>.ss-logs {
275
+ --_min-h: var(--ss-log-min-h, 160px);
276
+ --_max-h: var(--ss-log-max-h, 240px);
277
+ --_t-w: var(--ss-log-t-w, 58px);
278
+ --_lvl-w: var(--ss-log-lvl-w, 38px);
279
+ }
280
+ .ss-logs[data-size-variant=sm] {
281
+ --_min-h: var(--ss-log-min-h, 120px);
282
+ --_max-h: var(--ss-log-max-h, 200px);
283
+ --_t-w: var(--ss-log-t-w, 52px);
284
+ --_lvl-w: var(--ss-log-lvl-w, 34px);
285
+ }
286
+ .ss-logs[data-size-variant=lg] {
287
+ --_min-h: var(--ss-log-min-h, 200px);
288
+ --_max-h: var(--ss-log-max-h, 320px);
289
+ --_t-w: var(--ss-log-t-w, 64px);
290
+ --_lvl-w: var(--ss-log-lvl-w, 42px);
291
+ }
292
+ .ss-logs {
67
293
  font-family: var(--ss-font-mono);
68
- font-size: var(--ss-ui-md);
69
- background: #0a0a0a;
294
+ background: var(--ss-code-bg);
295
+ color: var(--ss-code-fg);
296
+ border: 1px solid var(--ss-line);
297
+ display: flex;
298
+ flex-direction: column;
299
+ }
300
+
301
+ .bar {
302
+ display: flex;
303
+ flex-wrap: wrap;
304
+ align-items: center;
305
+ gap: var(--ss-gap-sm);
306
+ padding: var(--ss-gap-sm) var(--ss-panel-body-px);
307
+ border-bottom: 1px solid var(--ss-line);
308
+ }
309
+
310
+ .filters {
311
+ display: flex;
312
+ gap: var(--ss-gap-sm);
313
+ }
314
+
315
+ .chip {
316
+ font-family: var(--ss-font-mono);
317
+ font-size: var(--ss-ui-sm);
318
+ line-height: 1;
319
+ padding: var(--ss-badge-py) var(--ss-badge-px);
320
+ border: 1px solid var(--ss-line);
321
+ background: transparent;
70
322
  color: var(--ss-code-fg);
323
+ cursor: pointer;
324
+ transition: all var(--ss-dur-fast) var(--ss-ease);
325
+ }
326
+ .chip:hover {
327
+ border-color: var(--ss-line-strong);
328
+ }
329
+ .chip[aria-pressed=true] {
330
+ border-color: var(--ss-line-strong);
331
+ }
332
+ .chip[aria-pressed=false] {
333
+ opacity: 0.45;
334
+ }
335
+ .chip.info[aria-pressed=true] {
336
+ color: var(--ss-log-info);
337
+ }
338
+ .chip.warn[aria-pressed=true] {
339
+ color: var(--ss-log-warn);
340
+ }
341
+ .chip.err[aria-pressed=true] {
342
+ color: var(--ss-log-err);
343
+ }
344
+ .chip.ok[aria-pressed=true] {
345
+ color: var(--ss-log-ok);
346
+ }
347
+
348
+ .search {
349
+ flex: 1 1 8ch;
350
+ min-width: 8ch;
351
+ font-family: var(--ss-font-mono);
352
+ font-size: var(--ss-ui-sm);
353
+ padding: var(--ss-badge-py) var(--ss-gap-sm);
354
+ border: 1px solid var(--ss-line);
355
+ background: transparent;
356
+ color: var(--ss-code-fg);
357
+ }
358
+ .search:focus-visible {
359
+ outline: 2px solid var(--ss-primary);
360
+ outline-offset: 1px;
361
+ }
362
+ .search::placeholder {
363
+ color: var(--ss-fg-faint);
364
+ }
365
+
366
+ .viewport {
367
+ position: relative;
368
+ }
369
+
370
+ .scroll {
371
+ font-size: var(--ss-ui-md);
71
372
  padding: var(--ss-gap) var(--ss-panel-body-px);
72
- min-height: 160px;
73
- max-height: 240px;
373
+ min-height: var(--_min-h);
374
+ max-height: var(--_max-h);
74
375
  overflow: auto;
75
376
  }
76
- .ss-logs .ln {
377
+ .scroll .ln {
77
378
  display: flex;
78
- gap: 10px;
379
+ gap: var(--ss-gap-sm);
79
380
  line-height: 1.45;
381
+ white-space: pre-wrap;
80
382
  }
81
- .ss-logs .t {
383
+ .scroll.nowrap .ln {
384
+ white-space: pre;
385
+ }
386
+ .scroll .msg {
387
+ white-space: inherit;
388
+ }
389
+ .scroll .t {
82
390
  color: var(--ss-fg-faint);
83
- min-width: 58px;
391
+ min-width: var(--_t-w);
392
+ flex: none;
393
+ }
394
+ .scroll .lvl {
395
+ min-width: var(--_lvl-w);
396
+ flex: none;
397
+ }
398
+ .scroll .lvl.info {
399
+ color: var(--ss-log-info);
400
+ }
401
+ .scroll .lvl.warn {
402
+ color: var(--ss-log-warn);
84
403
  }
85
- .ss-logs .lvl {
86
- min-width: 38px;
404
+ .scroll .lvl.err {
405
+ color: var(--ss-log-err);
87
406
  }
88
- .ss-logs .lvl.info {
89
- color: var(--ss-cyan);
407
+ .scroll .lvl.ok {
408
+ color: var(--ss-log-ok);
90
409
  }
91
- .ss-logs .lvl.warn {
92
- color: var(--ss-yellow);
410
+ .scroll .svc {
411
+ color: var(--ss-code-keyword);
412
+ flex: none;
93
413
  }
94
- .ss-logs .lvl.err {
95
- color: var(--ss-red);
414
+
415
+ .status {
416
+ display: flex;
417
+ align-items: center;
418
+ gap: var(--ss-gap-sm);
419
+ color: var(--ss-fg-faint);
420
+ font-size: var(--ss-ui-sm);
421
+ padding-bottom: var(--ss-gap-sm);
422
+ }
423
+ .status .dot {
424
+ width: var(--ss-s-2);
425
+ height: var(--ss-s-2);
426
+ background: var(--ss-primary);
427
+ animation: pulse var(--ss-dur-xslow) var(--ss-ease) infinite;
428
+ }
429
+
430
+ @keyframes pulse {
431
+ 0%, 100% {
432
+ opacity: 0.3;
433
+ }
434
+ 50% {
435
+ opacity: 1;
436
+ }
437
+ }
438
+ .jump {
439
+ position: absolute;
440
+ right: var(--ss-gap);
441
+ bottom: var(--ss-gap);
442
+ font-family: var(--ss-font-mono);
443
+ font-size: var(--ss-ui-sm);
444
+ line-height: 1;
445
+ padding: var(--ss-badge-py) var(--ss-badge-px);
446
+ border: 1px solid var(--ss-line-strong);
447
+ background: var(--ss-bg-elev);
448
+ color: var(--ss-fg);
449
+ cursor: pointer;
450
+ box-shadow: var(--ss-shadow-2);
96
451
  }
97
- .ss-logs .lvl.ok {
98
- color: var(--ss-primary);
452
+ .jump:hover {
453
+ border-color: var(--ss-primary);
99
454
  }
100
- .ss-logs .svc {
101
- color: var(--ss-purple);
455
+ .jump:focus-visible {
456
+ outline: 2px solid var(--ss-primary);
457
+ outline-offset: 1px;
102
458
  }</style>
@@ -1,14 +1,42 @@
1
- import { type Size } from '../config.js';
2
- interface LogLine {
3
- id: number;
4
- t: string;
5
- lvl: string;
6
- svc: string;
1
+ /** A single log severity level. */
2
+ export type LogLevel = 'info' | 'warn' | 'err' | 'ok';
3
+ /** A controlled log line. `id` is optional — when omitted the index is used as the key. */
4
+ export interface LogLine {
5
+ id?: string | number;
6
+ /** Timestamp string (e.g. "12:00:01"); rendered verbatim. */
7
+ t?: string;
8
+ lvl: LogLevel;
9
+ /** Service / source tag (e.g. "[hub]"). */
10
+ svc?: string;
7
11
  msg: string;
8
12
  }
13
+ import { type Snippet } from 'svelte';
14
+ import { type Size } from '../config.js';
9
15
  interface Props {
10
- live?: boolean;
16
+ /** Controlled lines. When provided, the component renders exactly these (capped to `maxLines`). */
17
+ lines?: LogLine[];
18
+ /** Seed lines for the built-in demo stream (only used when `lines` is undefined). */
11
19
  initialLines?: Omit<LogLine, 'id'>[];
20
+ /** Generate a random demo stream. Defaults true ONLY when `lines` is not supplied. */
21
+ demo?: boolean;
22
+ /** Back-compat alias for `demo` — drives the built-in ticker. */
23
+ live?: boolean;
24
+ /** Max number of lines kept in the buffer (oldest dropped). */
25
+ maxLines?: number;
26
+ /** Show the controls toolbar (filters, search, wrap, copy, clear). */
27
+ controls?: boolean;
28
+ /** Replace the built-in toolbar entirely. */
29
+ toolbar?: Snippet;
30
+ /** Wrap long messages (pre-wrap) vs. horizontal scroll (pre). */
31
+ wrap?: boolean;
32
+ /** aria-live politeness for the log region. */
33
+ announce?: 'off' | 'polite' | 'assertive';
34
+ /** Accessible label for the log region. */
35
+ ariaLabel?: string;
36
+ /** Show a connecting/loading indicator. */
37
+ loading?: boolean;
38
+ /** Custom empty state. */
39
+ empty?: Snippet;
12
40
  /** Token size (sm|md|lg); inherits the global size when unset. */
13
41
  size?: Size;
14
42
  }