@quilltap/theme-storybook 1.0.34 → 1.0.35

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.
@@ -15,9 +15,10 @@ import {
15
15
  Participant,
16
16
  Spacing,
17
17
  Tabs,
18
+ Terminal,
18
19
  ThemeComparison,
19
20
  Typography
20
- } from "../chunk-C4SJNVAC.mjs";
21
+ } from "../chunk-7CI72GBQ.mjs";
21
22
  import "../chunk-WUKYLWAZ.mjs";
22
23
  export {
23
24
  Avatars,
@@ -36,6 +37,7 @@ export {
36
37
  Participant,
37
38
  Spacing,
38
39
  Tabs,
40
+ Terminal,
39
41
  ThemeComparison,
40
42
  Typography
41
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quilltap/theme-storybook",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
4
4
  "description": "Storybook preset and stories for developing Quilltap theme plugins",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -461,6 +461,44 @@
461
461
  --qt-warning-box-bg: color-mix(in srgb, var(--color-warning) 8%, transparent);
462
462
  --qt-warning-box-border: color-mix(in srgb, var(--color-warning) 30%, transparent);
463
463
  --qt-warning-box-fg: var(--color-warning);
464
+
465
+ /* Terminal variables — the terminal carries its own (dark) identity
466
+ regardless of the surrounding theme's light/dark mode. Themes may
467
+ override these to make the terminal pane match a parchment scroll,
468
+ a CRT, etc. */
469
+ --qt-terminal-bg: #1a1a1a;
470
+ --qt-terminal-fg: #e6e6e6;
471
+ --qt-terminal-cursor: #e6e6e6;
472
+ --qt-terminal-selection: rgba(255, 255, 255, 0.2);
473
+ --qt-terminal-ansi-black: #000000;
474
+ --qt-terminal-ansi-red: #cd3131;
475
+ --qt-terminal-ansi-green: #0dbc79;
476
+ --qt-terminal-ansi-yellow: #e5e510;
477
+ --qt-terminal-ansi-blue: #2472c8;
478
+ --qt-terminal-ansi-magenta: #bc3fbc;
479
+ --qt-terminal-ansi-cyan: #11a8cd;
480
+ --qt-terminal-ansi-white: #e5e5e5;
481
+ --qt-terminal-ansi-bright-black: #666666;
482
+ --qt-terminal-ansi-bright-red: #f14c4c;
483
+ --qt-terminal-ansi-bright-green: #23d18b;
484
+ --qt-terminal-ansi-bright-yellow: #f5f543;
485
+ --qt-terminal-ansi-bright-blue: #3b8eea;
486
+ --qt-terminal-ansi-bright-magenta: #d670d6;
487
+ --qt-terminal-ansi-bright-cyan: #29b8db;
488
+ --qt-terminal-ansi-bright-white: #e5e5e5;
489
+
490
+ --qt-terminal-chrome-bg: color-mix(in srgb, var(--qt-terminal-bg) 78%, var(--qt-terminal-fg) 6%);
491
+ --qt-terminal-chrome-border: color-mix(in srgb, var(--qt-terminal-bg) 55%, var(--qt-terminal-fg) 22%);
492
+ --qt-terminal-chrome-fg: var(--qt-terminal-fg);
493
+ --qt-terminal-chrome-muted-fg: color-mix(in srgb, var(--qt-terminal-fg) 55%, transparent);
494
+ --qt-terminal-closed-badge-bg: color-mix(in srgb, var(--qt-terminal-bg) 50%, var(--qt-terminal-fg) 18%);
495
+ --qt-terminal-closed-badge-fg: var(--qt-terminal-fg);
496
+
497
+ /* In-chat terminal embed (nests inside chat bubbles, uses surrounding theme) */
498
+ --qt-terminal-embed-bg: var(--color-card);
499
+ --qt-terminal-embed-border: var(--color-border);
500
+ --qt-terminal-embed-header-bg: var(--color-muted);
501
+ --qt-terminal-embed-header-border: var(--color-border);
464
502
  }
465
503
 
466
504
  /* ==========================================================================
@@ -1406,11 +1444,15 @@
1406
1444
  }
1407
1445
 
1408
1446
  .qt-bg-primary {
1409
- background-color: var(--color-background);
1447
+ background-color: var(--color-primary);
1448
+ }
1449
+
1450
+ .qt-bg-accent {
1451
+ background-color: var(--color-accent);
1410
1452
  }
1411
1453
 
1412
1454
  .qt-bg-secondary {
1413
- background-color: var(--color-muted);
1455
+ background-color: var(--color-secondary);
1414
1456
  }
1415
1457
 
1416
1458
  .qt-bg-card {
@@ -1421,6 +1463,31 @@
1421
1463
  border-color: var(--color-border);
1422
1464
  }
1423
1465
 
1466
+ /* Solid status backgrounds (full opacity) — used for severity bars, status pips */
1467
+ .qt-bg-success {
1468
+ background-color: var(--color-success);
1469
+ }
1470
+
1471
+ .qt-bg-warning {
1472
+ background-color: var(--color-warning);
1473
+ }
1474
+
1475
+ .qt-bg-info {
1476
+ background-color: var(--color-info);
1477
+ }
1478
+
1479
+ .qt-bg-destructive {
1480
+ background-color: var(--color-destructive);
1481
+ }
1482
+
1483
+ .qt-bg-muted-foreground {
1484
+ background-color: var(--color-muted-foreground);
1485
+ }
1486
+
1487
+ .qt-text-on-accent {
1488
+ color: var(--color-accent-foreground);
1489
+ }
1490
+
1424
1491
  /* ==========================================================================
1425
1492
  STATUS COLOR UTILITIES (with opacity variants)
1426
1493
  ========================================================================== */
@@ -1478,6 +1545,32 @@
1478
1545
  background-color: color-mix(in srgb, var(--color-destructive) 20%, transparent);
1479
1546
  }
1480
1547
 
1548
+ .qt-bg-destructive\/60 {
1549
+ background-color: color-mix(in srgb, var(--color-destructive) 60%, transparent);
1550
+ }
1551
+
1552
+ /* Success backgrounds — extra opacity steps */
1553
+ .qt-bg-success\/40 {
1554
+ background-color: color-mix(in srgb, var(--color-success) 40%, transparent);
1555
+ }
1556
+
1557
+ .qt-bg-success\/60 {
1558
+ background-color: color-mix(in srgb, var(--color-success) 60%, transparent);
1559
+ }
1560
+
1561
+ /* Muted-foreground backgrounds with opacity — used for inactive pips */
1562
+ .qt-bg-muted-foreground\/30 {
1563
+ background-color: color-mix(in srgb, var(--color-muted-foreground) 30%, transparent);
1564
+ }
1565
+
1566
+ .qt-bg-muted-foreground\/60 {
1567
+ background-color: color-mix(in srgb, var(--color-muted-foreground) 60%, transparent);
1568
+ }
1569
+
1570
+ .hover\:qt-bg-muted-foreground\/60:hover {
1571
+ background-color: color-mix(in srgb, var(--color-muted-foreground) 60%, transparent);
1572
+ }
1573
+
1481
1574
  /* Text color utilities */
1482
1575
  .qt-text-warning {
1483
1576
  color: var(--color-warning);
@@ -1533,6 +1626,14 @@
1533
1626
  border-color: color-mix(in srgb, var(--color-info) 30%, transparent);
1534
1627
  }
1535
1628
 
1629
+ .qt-border-success\/20 {
1630
+ border-color: color-mix(in srgb, var(--color-success) 20%, transparent);
1631
+ }
1632
+
1633
+ .qt-border-success\/40 {
1634
+ border-color: color-mix(in srgb, var(--color-success) 40%, transparent);
1635
+ }
1636
+
1536
1637
  /* Hover utilities */
1537
1638
  .hover\:qt-bg-destructive\/10:hover {
1538
1639
  background-color: color-mix(in srgb, var(--color-destructive) 10%, transparent);
@@ -2287,3 +2388,83 @@
2287
2388
  background-color: var(--qt-navbar-link-active-bg);
2288
2389
  color: var(--color-primary);
2289
2390
  }
2391
+
2392
+ /* ==========================================================================
2393
+ TERMINAL COMPONENTS
2394
+ In-chat embed, pop-out page, and Terminal Mode pane.
2395
+ Themes can override --qt-terminal-* and --qt-terminal-chrome-* tokens.
2396
+ ========================================================================== */
2397
+
2398
+ .qt-terminal-surface {
2399
+ background-color: var(--qt-terminal-bg);
2400
+ }
2401
+
2402
+ .qt-terminal-embed {
2403
+ background-color: var(--qt-terminal-embed-bg);
2404
+ border: 1px solid var(--qt-terminal-embed-border);
2405
+ border-radius: 0.5rem;
2406
+ overflow: hidden;
2407
+ }
2408
+
2409
+ .qt-terminal-embed-header {
2410
+ display: flex;
2411
+ align-items: center;
2412
+ justify-content: space-between;
2413
+ padding: 0.75rem 1rem;
2414
+ background-color: var(--qt-terminal-embed-header-bg);
2415
+ border-bottom: 1px solid var(--qt-terminal-embed-header-border);
2416
+ }
2417
+
2418
+ .qt-terminal-embed-footer {
2419
+ display: flex;
2420
+ align-items: center;
2421
+ justify-content: space-between;
2422
+ gap: 0.75rem;
2423
+ padding: 0.75rem 1rem;
2424
+ font-size: 0.875rem;
2425
+ background-color: var(--qt-terminal-embed-header-bg);
2426
+ border-top: 1px solid var(--qt-terminal-embed-header-border);
2427
+ }
2428
+
2429
+ .qt-terminal-popout-page {
2430
+ background-color: var(--qt-terminal-bg);
2431
+ color: var(--qt-terminal-chrome-fg);
2432
+ }
2433
+
2434
+ .qt-terminal-popout-header {
2435
+ display: flex;
2436
+ align-items: center;
2437
+ justify-content: space-between;
2438
+ padding: 0.75rem 1rem;
2439
+ background-color: var(--qt-terminal-chrome-bg);
2440
+ border-bottom: 1px solid var(--qt-terminal-chrome-border);
2441
+ color: var(--qt-terminal-chrome-fg);
2442
+ }
2443
+
2444
+ .qt-terminal-popout-link {
2445
+ color: var(--qt-terminal-chrome-fg);
2446
+ }
2447
+
2448
+ .qt-terminal-popout-link:hover {
2449
+ text-decoration: underline;
2450
+ }
2451
+
2452
+ .qt-terminal-popout-title {
2453
+ color: var(--qt-terminal-chrome-fg);
2454
+ font-weight: 500;
2455
+ }
2456
+
2457
+ .qt-terminal-popout-separator {
2458
+ color: var(--qt-terminal-chrome-muted-fg);
2459
+ }
2460
+
2461
+ .qt-terminal-closed-badge {
2462
+ position: absolute;
2463
+ top: 0.5rem;
2464
+ right: 0.5rem;
2465
+ padding: 0.25rem 0.5rem;
2466
+ font-size: 0.75rem;
2467
+ border-radius: 0.25rem;
2468
+ background-color: var(--qt-terminal-closed-badge-bg);
2469
+ color: var(--qt-terminal-closed-badge-fg);
2470
+ }
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Terminal Story Component
3
+ *
4
+ * Previews the in-chat terminal embed, pop-out page, and Terminal Mode pane
5
+ * surfaces. The terminal carries its own (dark) identity by default — themes
6
+ * can override --qt-terminal-* and --qt-terminal-chrome-* tokens to retint
7
+ * the whole stack (e.g. a parchment terminal, a CRT terminal, etc).
8
+ */
9
+
10
+ import React from 'react';
11
+
12
+ const sampleOutput = `$ git status
13
+ On branch main
14
+ Your branch is up to date with 'origin/main'.
15
+
16
+ nothing to commit, working tree clean
17
+ $ npm run dev
18
+ > next dev
19
+ ▲ Next.js 16.0.0
20
+ - Local: http://localhost:3000
21
+ - ready started server on 0.0.0.0:3000`;
22
+
23
+ export const Terminal: React.FC = () => {
24
+ return (
25
+ <div style={{ padding: '1.5rem' }}>
26
+ <h2 style={{ fontSize: '1.5rem', fontWeight: 700, marginBottom: '1.5rem' }}>
27
+ Terminal Components
28
+ </h2>
29
+ <p style={{ marginBottom: '1.5rem', color: 'var(--color-muted-foreground)' }}>
30
+ The terminal carries its own identity. By default it stays dark in both
31
+ light and dark themes — but a theme can override{' '}
32
+ <code>--qt-terminal-bg</code>, <code>--qt-terminal-fg</code>, and the
33
+ <code>--qt-terminal-chrome-*</code> tokens to reskin every surface below.
34
+ </p>
35
+
36
+ {/* In-chat embed */}
37
+ <section style={{ marginBottom: '2rem' }}>
38
+ <h3 style={{ fontSize: '1.125rem', fontWeight: 700, marginBottom: '1rem', borderBottom: '1px solid var(--color-border)', paddingBottom: '0.5rem' }}>
39
+ In-chat embed
40
+ </h3>
41
+ <p style={{ marginBottom: '0.75rem', fontSize: '0.875rem', color: 'var(--color-muted-foreground)' }}>
42
+ <code>.qt-terminal-embed</code> wraps the embed card; the header and
43
+ footer strips inherit the surrounding theme so they nest cleanly with
44
+ chat bubbles.
45
+ </p>
46
+ <div className="qt-terminal-embed" style={{ maxWidth: '36rem' }}>
47
+ <div className="qt-terminal-embed-header">
48
+ <div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
49
+ <h4 style={{ fontSize: '0.875rem', fontWeight: 500, margin: 0 }}>
50
+ Terminal — zsh
51
+ </h4>
52
+ </div>
53
+ <div style={{ display: 'flex', gap: '0.5rem' }}>
54
+ <button className="qt-button-icon" type="button">Pop out</button>
55
+ <button className="qt-button-icon qt-text-destructive" type="button">Kill</button>
56
+ </div>
57
+ </div>
58
+ <div className="qt-terminal-surface" style={{ padding: '0.75rem', fontFamily: 'var(--qt-font-mono, monospace)', color: 'var(--qt-terminal-fg)', fontSize: '0.8125rem', whiteSpace: 'pre-wrap' }}>
59
+ {sampleOutput}
60
+ </div>
61
+ </div>
62
+ </section>
63
+
64
+ {/* Footer state */}
65
+ <section style={{ marginBottom: '2rem' }}>
66
+ <h3 style={{ fontSize: '1.125rem', fontWeight: 700, marginBottom: '1rem', borderBottom: '1px solid var(--color-border)', paddingBottom: '0.5rem' }}>
67
+ Embed footer (handed off to Terminal Mode pane)
68
+ </h3>
69
+ <div className="qt-terminal-embed" style={{ maxWidth: '36rem' }}>
70
+ <div className="qt-terminal-embed-header">
71
+ <h4 style={{ fontSize: '0.875rem', fontWeight: 500, margin: 0 }}>
72
+ Terminal — zsh
73
+ </h4>
74
+ </div>
75
+ <div className="qt-terminal-embed-footer">
76
+ <span className="qt-text-secondary">Showing in Terminal Mode pane.</span>
77
+ <button className="qt-button-secondary" type="button" style={{ fontSize: '0.75rem', padding: '0.25rem 0.5rem' }}>
78
+ Go to pane →
79
+ </button>
80
+ </div>
81
+ </div>
82
+ </section>
83
+
84
+ {/* Pop-out page */}
85
+ <section style={{ marginBottom: '2rem' }}>
86
+ <h3 style={{ fontSize: '1.125rem', fontWeight: 700, marginBottom: '1rem', borderBottom: '1px solid var(--color-border)', paddingBottom: '0.5rem' }}>
87
+ Pop-out page chrome
88
+ </h3>
89
+ <p style={{ marginBottom: '0.75rem', fontSize: '0.875rem', color: 'var(--color-muted-foreground)' }}>
90
+ The full-screen pop-out page uses{' '}
91
+ <code>.qt-terminal-popout-page</code> as the outer canvas and{' '}
92
+ <code>.qt-terminal-popout-header</code> for the breadcrumb bar.
93
+ </p>
94
+ <div className="qt-terminal-popout-page" style={{ borderRadius: '0.5rem', overflow: 'hidden', border: '1px solid var(--color-border)', height: '240px', display: 'flex', flexDirection: 'column' }}>
95
+ <div className="qt-terminal-popout-header">
96
+ <div style={{ display: 'flex', alignItems: 'center', gap: '0.75rem' }}>
97
+ <button className="qt-button-icon" type="button" style={{ color: 'inherit' }}>←</button>
98
+ <a href="#" className="qt-terminal-popout-link" style={{ fontSize: '0.875rem' }}>Chat</a>
99
+ <span className="qt-terminal-popout-separator">/</span>
100
+ <h1 className="qt-terminal-popout-title" style={{ fontSize: '1rem', margin: 0 }}>
101
+ Terminal — zsh
102
+ </h1>
103
+ </div>
104
+ <button className="qt-button-destructive" type="button" style={{ fontSize: '0.875rem' }}>
105
+ Kill Session
106
+ </button>
107
+ </div>
108
+ <div style={{ flex: 1, padding: '0.75rem', fontFamily: 'var(--qt-font-mono, monospace)', color: 'var(--qt-terminal-fg)', fontSize: '0.8125rem', whiteSpace: 'pre-wrap' }}>
109
+ {sampleOutput}
110
+ </div>
111
+ </div>
112
+ </section>
113
+
114
+ {/* Closed badge */}
115
+ <section>
116
+ <h3 style={{ fontSize: '1.125rem', fontWeight: 700, marginBottom: '1rem', borderBottom: '1px solid var(--color-border)', paddingBottom: '0.5rem' }}>
117
+ Session-exited overlay
118
+ </h3>
119
+ <p style={{ marginBottom: '0.75rem', fontSize: '0.875rem', color: 'var(--color-muted-foreground)' }}>
120
+ When the PTY exits but the terminal stays mounted, the{' '}
121
+ <code>.qt-terminal-closed-badge</code> overlay marks it.
122
+ </p>
123
+ <div className="qt-terminal-surface" style={{ position: 'relative', height: '120px', borderRadius: '0.5rem' }}>
124
+ <span className="qt-terminal-closed-badge">Closed</span>
125
+ </div>
126
+ </section>
127
+ </div>
128
+ );
129
+ };
@@ -17,6 +17,7 @@ export * from './components/Avatars';
17
17
  export * from './components/Dialogs';
18
18
  export * from './components/Tabs';
19
19
  export * from './components/Chat';
20
+ export * from './components/Terminal';
20
21
  export * from './components/FilePreview';
21
22
  export * from './components/ThemeComparison';
22
23
  export * from './components/EmptyState';