causal-inspector 0.1.5 → 0.1.6

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.
@@ -1,15 +1,70 @@
1
1
  /* ── CausalInspector scoped styles ───────────────────────────── */
2
2
 
3
3
  .causal-inspector {
4
+ /* ── Surface ──────────────────── */
5
+ --ci-bg: #0a0a0f;
6
+ --ci-bg-subtle: rgba(15, 15, 20, 0.6);
7
+ --ci-bg-panel: rgba(15, 15, 20, 0.8);
8
+ --ci-bg-hover: rgba(255, 255, 255, 0.04);
9
+ --ci-bg-active: rgba(99, 102, 241, 0.12);
10
+ --ci-bg-selected: rgba(99, 102, 241, 0.15);
11
+
12
+ /* ── Text ─────────────────────── */
13
+ --ci-text: #e0e0f0;
14
+ --ci-text-muted: #70708a;
15
+ --ci-text-dim: rgba(112, 112, 138, 0.6);
16
+ --ci-text-dimmer: rgba(112, 112, 138, 0.4);
17
+ --ci-text-accent: #c7c7ff;
18
+
19
+ /* ── Borders ──────────────────── */
20
+ --ci-border: rgba(255, 255, 255, 0.06);
21
+ --ci-border-hover: rgba(99, 102, 241, 0.3);
22
+
23
+ /* ── Accent (indigo) ──────────── */
24
+ --ci-accent: #6366f1;
25
+ --ci-accent-muted: rgba(99, 102, 241, 0.15);
26
+ --ci-accent-glow: rgba(99, 102, 241, 0.4);
27
+ --ci-accent-text: #818cf8;
28
+
29
+ /* ── Semantic: purple (correlation) */
30
+ --ci-purple: #a78bfa;
31
+ --ci-purple-light: rgba(168, 85, 247, 0.8);
32
+ --ci-purple-dim: rgba(168, 85, 247, 0.7);
33
+ --ci-purple-bg: rgba(168, 85, 247, 0.08);
34
+ --ci-purple-bg-hover: rgba(168, 85, 247, 0.15);
35
+ --ci-purple-border: rgba(168, 85, 247, 0.1);
36
+ --ci-purple-border-alt: rgba(168, 85, 247, 0.2);
37
+
38
+ /* ── Semantic: teal (aggregate) ── */
39
+ --ci-teal: #2dd4bf;
40
+ --ci-teal-bg: rgba(20, 184, 166, 0.1);
41
+ --ci-teal-border: rgba(20, 184, 166, 0.2);
42
+
43
+ /* ── Semantic: red (error) ────── */
44
+ --ci-red: #f87171;
45
+ --ci-red-dim: rgba(248, 113, 113, 0.8);
46
+ --ci-red-bg: rgba(239, 68, 68, 0.1);
47
+ --ci-red-border: rgba(239, 68, 68, 0.2);
48
+
49
+ /* ── Sizing ───────────────────── */
50
+ --ci-radius-sm: 4px;
51
+ --ci-radius-md: 6px;
52
+ --ci-radius-lg: 8px;
53
+ --ci-radius-full: 9999px;
54
+
55
+ /* ── Typography ───────────────── */
56
+ --ci-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
57
+ --ci-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
58
+
4
59
  height: 100%;
5
60
  width: 100%;
6
61
  overflow: hidden;
7
62
  position: relative;
8
63
  display: flex;
9
64
  flex-direction: column;
10
- background: #0a0a0f;
11
- color: #e0e0f0;
12
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
65
+ background: var(--ci-bg);
66
+ color: var(--ci-text);
67
+ font-family: var(--ci-font-sans);
13
68
  -webkit-font-smoothing: antialiased;
14
69
  -moz-osx-font-smoothing: grayscale;
15
70
  }
@@ -36,23 +91,23 @@
36
91
  background-image: none;
37
92
  }
38
93
  .causal-inspector .flexlayout__tabset_tabbar_outer {
39
- background: rgba(15, 15, 20, 0.8) !important;
94
+ background: var(--ci-bg-panel) !important;
40
95
  backdrop-filter: blur(12px) !important;
41
- border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
96
+ border-bottom: 1px solid var(--ci-border) !important;
42
97
  }
43
98
  .causal-inspector .flexlayout__tab_button--selected {
44
- background: rgba(99, 102, 241, 0.12) !important;
45
- color: #c7c7ff !important;
99
+ background: var(--ci-bg-active) !important;
100
+ color: var(--ci-text-accent) !important;
46
101
  }
47
102
  .causal-inspector .flexlayout__tab_button {
48
- color: #70708a !important;
103
+ color: var(--ci-text-muted) !important;
49
104
  font-size: 11px !important;
50
105
  letter-spacing: 0.02em !important;
51
106
  transition: color 150ms, background 150ms !important;
52
107
  }
53
108
  .causal-inspector .flexlayout__tab_button:hover {
54
109
  color: #b0b0c0 !important;
55
- background: rgba(255, 255, 255, 0.04) !important;
110
+ background: var(--ci-bg-hover) !important;
56
111
  }
57
112
  .causal-inspector .flexlayout__splitter {
58
113
  background: rgba(255, 255, 255, 0.03) !important;
@@ -61,7 +116,7 @@
61
116
  background: rgba(99, 102, 241, 0.2) !important;
62
117
  }
63
118
  .causal-inspector .flexlayout__splitter_drag {
64
- background: rgba(99, 102, 241, 0.3) !important;
119
+ background: var(--ci-border-hover) !important;
65
120
  }
66
121
 
67
122
  /* ── Flow diagram ─────────────────────────────────────────── */
@@ -75,24 +130,24 @@
75
130
  .causal-inspector .react-flow__controls {
76
131
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
77
132
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
78
- border-radius: 8px !important;
133
+ border-radius: var(--ci-radius-lg) !important;
79
134
  overflow: hidden !important;
80
135
  }
81
136
  .causal-inspector .react-flow__controls-button {
82
137
  background: rgba(15, 15, 20, 0.9) !important;
83
- border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
84
- fill: #70708a !important;
138
+ border-bottom: 1px solid var(--ci-border) !important;
139
+ fill: var(--ci-text-muted) !important;
85
140
  }
86
141
  .causal-inspector .react-flow__controls-button:hover {
87
- background: rgba(99, 102, 241, 0.15) !important;
88
- fill: #c7c7ff !important;
142
+ background: var(--ci-accent-muted) !important;
143
+ fill: var(--ci-text-accent) !important;
89
144
  }
90
145
 
91
146
  /* ── Selection ring ───────────────────────────────────────── */
92
147
  .causal-inspector *:focus-visible {
93
148
  outline: none;
94
- box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
95
- border-radius: 4px;
149
+ box-shadow: 0 0 0 2px var(--ci-accent-glow);
150
+ border-radius: var(--ci-radius-sm);
96
151
  }
97
152
 
98
153
  /* ── Range input ──────────────────────────────────────────── */
@@ -108,16 +163,16 @@
108
163
  width: 12px;
109
164
  height: 12px;
110
165
  border-radius: 50%;
111
- background: #6366f1;
166
+ background: var(--ci-accent);
112
167
  cursor: pointer;
113
- box-shadow: 0 0 6px rgba(99, 102, 241, 0.4);
168
+ box-shadow: 0 0 6px var(--ci-accent-glow);
114
169
  transition: transform 100ms;
115
170
  }
116
171
  .causal-inspector input[type="range"]::-webkit-slider-thumb:hover {
117
172
  transform: scale(1.2);
118
173
  }
119
174
 
120
- /* ── Pulse animation for running reactors ─────────────────── */
175
+ /* ── Animations ───────────────────────────────────────────── */
121
176
  @keyframes causal-inspector-pulse {
122
177
  0%, 100% { opacity: 1; }
123
178
  50% { opacity: 0.7; }
@@ -126,3 +181,375 @@
126
181
  0%, 100% { box-shadow: 0 0 4px rgba(99, 102, 241, 0.2); }
127
182
  50% { box-shadow: 0 0 12px rgba(99, 102, 241, 0.4); }
128
183
  }
184
+
185
+ .causal-inspector .ci-pulse {
186
+ animation: causal-inspector-pulse 2s ease-in-out infinite;
187
+ }
188
+
189
+ /* ── Layout utilities ─────────────────────────────────────── */
190
+ .causal-inspector .ci-col {
191
+ display: flex;
192
+ flex-direction: column;
193
+ height: 100%;
194
+ }
195
+
196
+ .causal-inspector .ci-row {
197
+ display: flex;
198
+ align-items: center;
199
+ }
200
+
201
+ .causal-inspector .ci-scroll {
202
+ flex: 1;
203
+ overflow-y: auto;
204
+ }
205
+
206
+ .causal-inspector .ci-truncate {
207
+ overflow: hidden;
208
+ text-overflow: ellipsis;
209
+ white-space: nowrap;
210
+ }
211
+
212
+ .causal-inspector .ci-mono {
213
+ font-family: var(--ci-font-mono);
214
+ }
215
+
216
+ .causal-inspector .ci-tabular {
217
+ font-variant-numeric: tabular-nums;
218
+ }
219
+
220
+ /* ── Surface (panel header / toolbar) ─────────────────────── */
221
+ .causal-inspector .ci-surface {
222
+ background: var(--ci-bg-subtle);
223
+ backdrop-filter: blur(8px);
224
+ }
225
+
226
+ /* ── Dividers ─────────────────────────────────────────────── */
227
+ .causal-inspector .ci-divider-h {
228
+ width: 1px;
229
+ height: 16px;
230
+ background: var(--ci-border);
231
+ flex-shrink: 0;
232
+ }
233
+
234
+ /* ── Input ────────────────────────────────────────────────── */
235
+ .causal-inspector .ci-input {
236
+ font-size: 12px;
237
+ border-radius: var(--ci-radius-md);
238
+ background: rgba(255, 255, 255, 0.025);
239
+ border: 1px solid var(--ci-border);
240
+ color: var(--ci-text);
241
+ transition: border-color 150ms, box-shadow 150ms;
242
+ }
243
+
244
+ .causal-inspector .ci-input::placeholder {
245
+ color: var(--ci-text-dimmer);
246
+ }
247
+
248
+ .causal-inspector .ci-input:focus {
249
+ outline: none;
250
+ box-shadow: 0 0 0 1px var(--ci-accent-glow);
251
+ border-color: var(--ci-border-hover);
252
+ }
253
+
254
+ /* ── Button (icon) ────────────────────────────────────────── */
255
+ .causal-inspector .ci-btn {
256
+ padding: 4px;
257
+ border-radius: var(--ci-radius-md);
258
+ color: var(--ci-text-dim);
259
+ background: transparent;
260
+ border: none;
261
+ cursor: pointer;
262
+ transition: color 150ms, background 150ms;
263
+ }
264
+
265
+ .causal-inspector .ci-btn:hover {
266
+ color: var(--ci-text);
267
+ background: rgba(255, 255, 255, 0.05);
268
+ }
269
+
270
+ /* ── Badge (pill) ─────────────────────────────────────────── */
271
+ .causal-inspector .ci-badge {
272
+ display: inline-flex;
273
+ align-items: center;
274
+ gap: 6px;
275
+ padding: 2px 10px;
276
+ border-radius: var(--ci-radius-full);
277
+ font-size: 10px;
278
+ font-family: var(--ci-font-mono);
279
+ border: 1px solid;
280
+ }
281
+
282
+ .causal-inspector .ci-badge--purple {
283
+ background: var(--ci-purple-bg);
284
+ border-color: var(--ci-purple-border);
285
+ color: var(--ci-purple-light);
286
+ }
287
+
288
+ .causal-inspector .ci-badge--teal {
289
+ background: var(--ci-teal-bg);
290
+ border-color: var(--ci-teal-border);
291
+ color: var(--ci-teal);
292
+ }
293
+
294
+ .causal-inspector .ci-badge--red {
295
+ background: var(--ci-red-bg);
296
+ border-color: var(--ci-red-border);
297
+ color: var(--ci-red-dim);
298
+ }
299
+
300
+ /* ── List row (hover highlight) ───────────────────────────── */
301
+ .causal-inspector .ci-list-row {
302
+ transition: background 150ms;
303
+ }
304
+
305
+ .causal-inspector .ci-list-row:hover {
306
+ background: rgba(99, 102, 241, 0.08);
307
+ }
308
+
309
+ /* ── Event row ────────────────────────────────────────────── */
310
+ .causal-inspector .ci-event-row {
311
+ width: 100%;
312
+ text-align: left;
313
+ padding: 8px 12px;
314
+ border-bottom: 1px solid var(--ci-border);
315
+ transition: background 150ms;
316
+ }
317
+
318
+ .causal-inspector .ci-event-row:hover {
319
+ background: rgba(255, 255, 255, 0.02);
320
+ }
321
+
322
+ .causal-inspector .ci-event-row.ci-selected {
323
+ background: var(--ci-bg-selected);
324
+ }
325
+
326
+ .causal-inspector .ci-event-row .ci-copy-btn {
327
+ opacity: 0;
328
+ transition: opacity 150ms;
329
+ }
330
+
331
+ .causal-inspector .ci-event-row:hover .ci-copy-btn {
332
+ opacity: 1;
333
+ }
334
+
335
+ /* ── Tree node ────────────────────────────────────────────── */
336
+ .causal-inspector .ci-tree-node {
337
+ width: 100%;
338
+ text-align: left;
339
+ padding: 6px 8px;
340
+ border-radius: var(--ci-radius-md);
341
+ transition: background 150ms;
342
+ }
343
+
344
+ .causal-inspector .ci-tree-node:hover {
345
+ background: rgba(255, 255, 255, 0.03);
346
+ }
347
+
348
+ .causal-inspector .ci-tree-node.ci-selected {
349
+ background: var(--ci-bg-selected);
350
+ box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
351
+ }
352
+
353
+ .causal-inspector .ci-tree-node .ci-tree-actions {
354
+ opacity: 0;
355
+ transition: opacity 150ms;
356
+ }
357
+
358
+ .causal-inspector .ci-tree-node:hover .ci-tree-actions {
359
+ opacity: 1;
360
+ }
361
+
362
+ /* ── Section header ───────────────────────────────────────── */
363
+ .causal-inspector .ci-header {
364
+ font-size: 10px;
365
+ font-weight: 600;
366
+ color: var(--ci-text-dim);
367
+ text-transform: uppercase;
368
+ letter-spacing: 0.06em;
369
+ }
370
+
371
+ /* ── Skeleton loader ──────────────────────────────────────── */
372
+ .causal-inspector .ci-skeleton {
373
+ background: rgba(255, 255, 255, 0.03);
374
+ border-radius: var(--ci-radius-sm);
375
+ }
376
+
377
+ /* ── Empty state ──────────────────────────────────────────── */
378
+ .causal-inspector .ci-empty {
379
+ display: flex;
380
+ align-items: center;
381
+ justify-content: center;
382
+ height: 100%;
383
+ font-size: 12px;
384
+ color: rgba(112, 112, 138, 0.5);
385
+ letter-spacing: 0.03em;
386
+ }
387
+
388
+ /* ── JSON syntax highlighting ─────────────────────────────── */
389
+ .causal-inspector .ci-json-key { color: #60a5fa; }
390
+ .causal-inspector .ci-json-string { color: #4ade80; }
391
+ .causal-inspector .ci-json-number { color: #fbbf24; }
392
+ .causal-inspector .ci-json-bool { color: #c084fc; }
393
+ .causal-inspector .ci-json-null { color: #71717a; }
394
+ .causal-inspector .ci-json-punct { color: #71717a; }
395
+
396
+ /* ── Log level badges ─────────────────────────────────────── */
397
+ .causal-inspector .ci-log-debug {
398
+ background: rgba(113, 113, 122, 0.2);
399
+ color: #a1a1aa;
400
+ }
401
+
402
+ .causal-inspector .ci-log-info {
403
+ background: rgba(99, 102, 241, 0.15);
404
+ color: #818cf8;
405
+ }
406
+
407
+ .causal-inspector .ci-log-warn {
408
+ background: rgba(245, 158, 11, 0.15);
409
+ color: #fbbf24;
410
+ }
411
+
412
+ .causal-inspector .ci-log-error {
413
+ background: rgba(239, 68, 68, 0.15);
414
+ color: #f87171;
415
+ }
416
+
417
+ /* ── Correlation pill ─────────────────────────────────────── */
418
+ .causal-inspector .ci-corr-pill {
419
+ padding: 2px 6px;
420
+ border-radius: var(--ci-radius-full);
421
+ font-size: 9px;
422
+ font-family: var(--ci-font-mono);
423
+ background: var(--ci-purple-bg);
424
+ color: var(--ci-purple-light);
425
+ border: 1px solid var(--ci-purple-border);
426
+ transition: background 150ms, color 150ms;
427
+ }
428
+
429
+ .causal-inspector .ci-corr-pill:hover {
430
+ background: var(--ci-purple-bg-hover);
431
+ color: var(--ci-purple);
432
+ }
433
+
434
+ /* ── Dropdown (reactor filter, etc.) ──────────────────────── */
435
+ .causal-inspector .ci-dropdown {
436
+ background: rgba(17, 17, 22, 0.95);
437
+ backdrop-filter: blur(12px);
438
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
439
+ border: 1px solid var(--ci-border);
440
+ border-radius: var(--ci-radius-lg);
441
+ }
442
+
443
+ /* ── Toolbar button (text) ────────────────────────────────── */
444
+ .causal-inspector .ci-toolbar-btn {
445
+ font-size: 10px;
446
+ color: var(--ci-text-dim);
447
+ padding: 4px 8px;
448
+ border-radius: var(--ci-radius-md);
449
+ border: 1px solid var(--ci-border);
450
+ background: transparent;
451
+ cursor: pointer;
452
+ transition: color 150ms, background 150ms, border-color 150ms;
453
+ }
454
+
455
+ .causal-inspector .ci-toolbar-btn:hover {
456
+ color: var(--ci-text);
457
+ border-color: var(--ci-border-hover);
458
+ }
459
+
460
+ /* ── Payload container ────────────────────────────────────── */
461
+ .causal-inspector .ci-payload {
462
+ padding: 10px;
463
+ font-size: 10px;
464
+ border-radius: var(--ci-radius-md);
465
+ border: 1px solid var(--ci-border);
466
+ overflow: auto;
467
+ white-space: pre-wrap;
468
+ resize: vertical;
469
+ background: rgba(255, 255, 255, 0.015);
470
+ }
471
+
472
+ /* ── Payload floating buttons ─────────────────────────────── */
473
+ .causal-inspector .ci-payload-btn {
474
+ padding: 4px;
475
+ border-radius: var(--ci-radius-md);
476
+ border: 1px solid var(--ci-border);
477
+ background: rgba(10, 10, 15, 0.8);
478
+ backdrop-filter: blur(4px);
479
+ color: var(--ci-text-dimmer);
480
+ cursor: pointer;
481
+ font-size: 10px;
482
+ transition: color 150ms, background 150ms;
483
+ }
484
+
485
+ .causal-inspector .ci-payload-btn:hover {
486
+ color: var(--ci-text-muted);
487
+ background: rgba(255, 255, 255, 0.05);
488
+ }
489
+
490
+ /* ── Modal overlay ────────────────────────────────────────── */
491
+ .causal-inspector .ci-modal-overlay {
492
+ position: fixed;
493
+ inset: 0;
494
+ z-index: 50;
495
+ display: flex;
496
+ align-items: center;
497
+ justify-content: center;
498
+ background: rgba(0, 0, 0, 0.6);
499
+ backdrop-filter: blur(4px);
500
+ }
501
+
502
+ .causal-inspector .ci-modal-content {
503
+ position: relative;
504
+ width: 90vw;
505
+ max-height: 90vh;
506
+ overflow: auto;
507
+ border-radius: 12px;
508
+ border: 1px solid var(--ci-border);
509
+ padding: 20px;
510
+ background: rgba(15, 15, 20, 0.95);
511
+ box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
512
+ }
513
+
514
+ /* ── Modal buttons ────────────────────────────────────────── */
515
+ .causal-inspector .ci-modal-btn {
516
+ padding: 6px;
517
+ border-radius: var(--ci-radius-md);
518
+ color: rgba(112, 112, 138, 0.5);
519
+ background: transparent;
520
+ border: none;
521
+ cursor: pointer;
522
+ font-size: 12px;
523
+ transition: color 150ms, background 150ms;
524
+ }
525
+
526
+ .causal-inspector .ci-modal-btn:hover {
527
+ color: var(--ci-text);
528
+ background: rgba(255, 255, 255, 0.05);
529
+ }
530
+
531
+ /* ── Flow selection indicator ─────────────────────────────── */
532
+ .causal-inspector .ci-flow-filter {
533
+ padding: 6px 10px;
534
+ border-radius: var(--ci-radius-md);
535
+ background: rgba(99, 102, 241, 0.08);
536
+ border: 1px solid rgba(99, 102, 241, 0.15);
537
+ font-size: 12px;
538
+ color: var(--ci-accent-text);
539
+ }
540
+
541
+ /* ── Muted bg (skeleton) ──────────────────────────────────── */
542
+ .causal-inspector .ci-muted-bg {
543
+ background: rgba(39, 39, 42, 0.5);
544
+ border-radius: var(--ci-radius-sm);
545
+ }
546
+
547
+ /* ── Error dot indicator ──────────────────────────────────── */
548
+ .causal-inspector .ci-error-dot {
549
+ width: 8px;
550
+ height: 8px;
551
+ border-radius: 50%;
552
+ background: rgba(239, 68, 68, 0.8);
553
+ box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
554
+ flex-shrink: 0;
555
+ }
@@ -22,23 +22,23 @@ function PayloadModal({ formatted, onClose, }) {
22
22
  document.addEventListener("keydown", handleKey);
23
23
  return () => document.removeEventListener("keydown", handleKey);
24
24
  }, [onClose]);
25
- return createPortal(_jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center", style: { background: "rgba(0, 0, 0, 0.6)", backdropFilter: "blur(4px)" }, onClick: onClose, children: _jsxs("div", { className: "relative w-[90vw] max-h-[90vh] overflow-auto rounded-xl border border-border p-5", style: { background: "rgba(15, 15, 20, 0.95)", boxShadow: "0 24px 64px rgba(0, 0, 0, 0.5)" }, onClick: (e) => e.stopPropagation(), children: [_jsxs("div", { className: "absolute top-3 right-3 flex gap-1", children: [_jsx("button", { onClick: async () => {
26
- await copyToClipboard(formatted);
27
- setCopied(true);
28
- setTimeout(() => setCopied(false), 1500);
29
- }, className: "p-1.5 rounded-md hover:bg-white/[0.05] transition-colors text-xs text-muted-foreground/50 hover:text-foreground", title: "Copy payload", children: copied ? _jsx(Check, { size: 14 }) : _jsx(Copy, { size: 14 }) }), _jsx("button", { onClick: onClose, className: "p-1.5 rounded-md hover:bg-white/[0.05] transition-colors text-xs text-muted-foreground/50 hover:text-foreground", title: "Close", children: _jsx(X, { size: 14 }) })] }), _jsx("pre", { className: "text-xs whitespace-pre-wrap", children: _jsx(JsonSyntax, { json: formatted }) })] }) }), document.body);
25
+ return createPortal(_jsx("div", { className: "causal-inspector", children: _jsx("div", { className: "ci-modal-overlay", onClick: onClose, children: _jsxs("div", { className: "ci-modal-content", onClick: (e) => e.stopPropagation(), children: [_jsxs("div", { style: { position: "absolute", top: 12, right: 12, display: "flex", gap: 4 }, children: [_jsx("button", { onClick: async () => {
26
+ await copyToClipboard(formatted);
27
+ setCopied(true);
28
+ setTimeout(() => setCopied(false), 1500);
29
+ }, className: "ci-modal-btn", title: "Copy payload", children: copied ? _jsx(Check, { size: 14 }) : _jsx(Copy, { size: 14 }) }), _jsx("button", { onClick: onClose, className: "ci-modal-btn", title: "Close", children: _jsx(X, { size: 14 }) })] }), _jsx("pre", { style: { fontSize: 12, whiteSpace: "pre-wrap" }, children: _jsx(JsonSyntax, { json: formatted }) })] }) }) }), document.body);
30
30
  }
31
31
  export function CopyablePayload({ payload, className = "", }) {
32
32
  const [copied, setCopied] = useState(false);
33
33
  const [modalOpen, setModalOpen] = useState(false);
34
34
  const formatted = formatPayload(payload);
35
- return (_jsxs("div", { className: `relative ${className}`, children: [_jsx("pre", { className: "p-2.5 text-[10px] rounded-md border border-border overflow-auto whitespace-pre-wrap resize-y min-h-24 max-h-[80vh]", style: { background: "rgba(255, 255, 255, 0.015)" }, children: _jsx(JsonSyntax, { json: formatted }) }), _jsxs("div", { className: "absolute top-2 right-2 z-10 flex gap-1", children: [_jsx("button", { onClick: (e) => {
35
+ return (_jsxs("div", { style: { position: "relative" }, className: className, children: [_jsx("pre", { className: "ci-payload", style: { minHeight: 96, maxHeight: "80vh" }, children: _jsx(JsonSyntax, { json: formatted }) }), _jsxs("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 10, display: "flex", gap: 4 }, children: [_jsx("button", { onClick: (e) => {
36
36
  e.stopPropagation();
37
37
  setModalOpen(true);
38
- }, className: "p-1 rounded-md border border-border hover:bg-white/[0.05] transition-all text-[10px] text-muted-foreground/40 hover:text-muted-foreground", style: { background: "rgba(10, 10, 15, 0.8)", backdropFilter: "blur(4px)" }, title: "Expand", children: _jsx(Maximize2, { size: 12 }) }), _jsx("button", { onClick: async (e) => {
38
+ }, className: "ci-payload-btn", title: "Expand", children: _jsx(Maximize2, { size: 12 }) }), _jsx("button", { onClick: async (e) => {
39
39
  e.stopPropagation();
40
40
  await copyToClipboard(formatted);
41
41
  setCopied(true);
42
42
  setTimeout(() => setCopied(false), 1500);
43
- }, className: "p-1 rounded-md border border-border hover:bg-white/[0.05] transition-all text-[10px] text-muted-foreground/40 hover:text-muted-foreground", style: { background: "rgba(10, 10, 15, 0.8)", backdropFilter: "blur(4px)" }, title: "Copy", children: copied ? _jsx(Check, { size: 12 }) : _jsx(Copy, { size: 12 }) })] }), modalOpen && (_jsx(PayloadModal, { formatted: formatted, onClose: () => setModalOpen(false) }))] }));
43
+ }, className: "ci-payload-btn", title: "Copy", children: copied ? _jsx(Check, { size: 12 }) : _jsx(Copy, { size: 12 }) })] }), modalOpen && (_jsx(PayloadModal, { formatted: formatted, onClose: () => setModalOpen(false) }))] }));
44
44
  }
@@ -4,14 +4,17 @@ import { Search, X } from "lucide-react";
4
4
  export function FilterBar() {
5
5
  const filters = useSelector((s) => s.filters);
6
6
  const dispatch = useDispatch();
7
- return (_jsxs("div", { className: "flex flex-wrap items-center gap-2 px-3 py-2 border-b border-border", style: { background: "rgba(15, 15, 20, 0.6)", backdropFilter: "blur(8px)" }, children: [_jsxs("div", { className: "relative flex items-center", children: [_jsx(Search, { size: 12, className: "absolute left-2.5 text-muted-foreground pointer-events-none" }), _jsx("input", { type: "text", placeholder: "search events...", value: filters.search, onChange: (e) => dispatch({
7
+ return (_jsxs("div", { className: "ci-row ci-surface", style: { flexWrap: "wrap", gap: 8, padding: "8px 12px", borderBottom: "1px solid var(--ci-border)" }, children: [_jsxs("div", { className: "ci-row", style: { position: "relative" }, children: [_jsx(Search, { size: 12, style: { position: "absolute", left: 10, color: "var(--ci-text-muted)", pointerEvents: "none" } }), _jsx("input", { type: "text", placeholder: "search events...", value: filters.search, onChange: (e) => dispatch({
8
8
  type: "ui/filter_changed",
9
9
  payload: { search: e.target.value },
10
- }), className: "pl-7 pr-2 py-1.5 text-xs rounded-md bg-background/50 border border-border text-foreground placeholder:text-muted-foreground w-64 focus:outline-none focus:ring-1 focus:ring-indigo-500/40 focus:border-indigo-500/30 transition-all" })] }), filters.correlationId && (_jsxs(_Fragment, { children: [_jsx("span", { className: "w-px h-4 bg-border" }), _jsxs("span", { className: "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-purple-500/10 border border-purple-500/20 text-purple-400 text-[10px] font-mono", children: [filters.correlationId.slice(0, 8), _jsx("button", { onClick: () => dispatch({
10
+ }), className: "ci-input", style: { paddingLeft: 28, paddingRight: 8, paddingTop: 6, paddingBottom: 6, fontSize: 12, width: 256 } })] }), _jsx("span", { className: "ci-divider-h" }), _jsx("label", { style: { fontSize: 10, color: "var(--ci-text-muted)", textTransform: "uppercase", letterSpacing: "0.05em" }, children: "From" }), _jsx("input", { type: "date", value: filters.from ?? "", onChange: (e) => dispatch({
11
+ type: "ui/filter_changed",
12
+ payload: { from: e.target.value || null },
13
+ }), className: "ci-input", style: { padding: "6px 8px", fontSize: 12, width: 128 } }), _jsx("label", { style: { fontSize: 10, color: "var(--ci-text-muted)", textTransform: "uppercase", letterSpacing: "0.05em" }, children: "To" }), _jsx("input", { type: "date", value: filters.to ?? "", onChange: (e) => dispatch({
14
+ type: "ui/filter_changed",
15
+ payload: { to: e.target.value || null },
16
+ }), className: "ci-input", style: { padding: "6px 8px", fontSize: 12, width: 128 } }), filters.correlationId && (_jsxs(_Fragment, { children: [_jsx("span", { className: "ci-divider-h" }), _jsxs("span", { className: "ci-badge ci-badge--purple", children: [filters.correlationId.slice(0, 8), _jsx("button", { onClick: () => dispatch({
11
17
  type: "ui/filter_changed",
12
18
  payload: { correlationId: null },
13
- }), className: "hover:text-foreground transition-colors", children: _jsx(X, { size: 10 }) })] })] })), filters.aggregateKey && (_jsxs(_Fragment, { children: [_jsx("span", { className: "w-px h-4 bg-border" }), _jsxs("span", { className: "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-teal-500/10 border border-teal-500/20 text-teal-400 text-[10px] font-mono", children: [filters.aggregateKey.split(":")[0], ":", filters.aggregateKey.split(":").slice(1).join(":").slice(0, 8), _jsx("button", { onClick: () => dispatch({
14
- type: "ui/filter_changed",
15
- payload: { aggregateKey: null },
16
- }), className: "hover:text-foreground transition-colors", children: _jsx(X, { size: 10 }) })] })] }))] }));
19
+ }), style: { color: "inherit", background: "none", border: "none", cursor: "pointer", padding: 0, transition: "color 150ms" }, children: _jsx(X, { size: 10 }) })] })] }))] }));
17
20
  }
@@ -9,23 +9,23 @@ function tokenizeJson(json) {
9
9
  tokens.push({ text: json.slice(lastIndex, match.index), color: "" });
10
10
  }
11
11
  if (match[1] !== undefined) {
12
- tokens.push({ text: match[1], color: "text-blue-400" });
13
- tokens.push({ text: ":", color: "text-zinc-500" });
12
+ tokens.push({ text: match[1], color: "ci-json-key" });
13
+ tokens.push({ text: ":", color: "ci-json-punct" });
14
14
  }
15
15
  else if (match[2] !== undefined) {
16
- tokens.push({ text: match[2], color: "text-green-400" });
16
+ tokens.push({ text: match[2], color: "ci-json-string" });
17
17
  }
18
18
  else if (match[3] !== undefined) {
19
- tokens.push({ text: match[3], color: "text-amber-400" });
19
+ tokens.push({ text: match[3], color: "ci-json-number" });
20
20
  }
21
21
  else if (match[4] !== undefined) {
22
- tokens.push({ text: match[4], color: "text-purple-400" });
22
+ tokens.push({ text: match[4], color: "ci-json-bool" });
23
23
  }
24
24
  else if (match[5] !== undefined) {
25
- tokens.push({ text: match[5], color: "text-zinc-500" });
25
+ tokens.push({ text: match[5], color: "ci-json-null" });
26
26
  }
27
27
  else if (match[6] !== undefined) {
28
- tokens.push({ text: match[6], color: "text-zinc-500" });
28
+ tokens.push({ text: match[6], color: "ci-json-punct" });
29
29
  }
30
30
  lastIndex = re.lastIndex;
31
31
  }
@@ -36,5 +36,5 @@ function tokenizeJson(json) {
36
36
  }
37
37
  export function JsonSyntax({ json }) {
38
38
  const tokens = tokenizeJson(json);
39
- return (_jsx(_Fragment, { children: tokens.map((t, i) => (_jsx("span", { className: t.color, children: t.text }, i))) }));
39
+ return (_jsx(_Fragment, { children: tokens.map((t, i) => (_jsx("span", { className: t.color || undefined, children: t.text }, i))) }));
40
40
  }