@crossworks/share-ui 0.500.31 → 0.500.36

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": "@crossworks/share-ui",
3
- "version": "0.500.31",
3
+ "version": "0.500.36",
4
4
  "description": "The server-rendered share surface — the /s/<token> presenters, view-payload contract, mini-app sandbox, and the few primitives they need. Lives in MANTLE (the server renders these), published for jackdaw to consume; may depend only on @mantle/{client-types,content-core} (the jackdaw-repo-split boundary).",
5
5
  "type": "module",
6
6
  "exports": {
@@ -42,8 +42,8 @@
42
42
  "dependencies": {
43
43
  "@dicebear/core": "^10.7.0",
44
44
  "@dicebear/styles": "^10.6.0",
45
- "@mantle/client-types": "npm:@crossworks/client-types@0.500.31",
46
- "@mantle/content-core": "npm:@crossworks/content-core@0.500.31",
45
+ "@mantle/client-types": "npm:@crossworks/client-types@0.500.36",
46
+ "@mantle/content-core": "npm:@crossworks/content-core@0.500.36",
47
47
  "@radix-ui/react-label": "^2.1.17",
48
48
  "@radix-ui/react-slot": "^1.5.0",
49
49
  "class-variance-authority": "^0.7.1",
@@ -0,0 +1,39 @@
1
+ /**
2
+ * What the host's bridge sends the db broker for each request of an app. A kind
3
+ * it does not know is never a write: an older host once sent anything that was
4
+ * not a query as an exec.
5
+ */
6
+ import { describe, expect, it } from 'vitest';
7
+ import { dbBrokerBody, type BridgeReq } from './app-bridge-protocol';
8
+
9
+ const req = (r: Record<string, unknown>) => ({ v: 1, id: 'r1', ...r }) as unknown as BridgeReq;
10
+
11
+ describe('dbBrokerBody', () => {
12
+ it('sends a query and an exec as it always did', () => {
13
+ expect(dbBrokerBody(req({ kind: 'db.query', sql: 'SELECT 1' }))).toEqual({
14
+ op: 'query',
15
+ sql: 'SELECT 1',
16
+ params: [],
17
+ });
18
+ expect(dbBrokerBody(req({ kind: 'db.exec', sql: 'DELETE FROM t', params: [1] }))).toEqual({
19
+ op: 'exec',
20
+ sql: 'DELETE FROM t',
21
+ params: [1],
22
+ });
23
+ });
24
+
25
+ it('sends a batch with its statements and guard', () => {
26
+ const statements = [{ sql: 'INSERT INTO t VALUES (1)' }];
27
+ const guard = { sql: 'SELECT 1', params: [] };
28
+ expect(dbBrokerBody(req({ kind: 'db.batch', statements, guard }))).toEqual({
29
+ op: 'batch',
30
+ statements,
31
+ guard,
32
+ });
33
+ });
34
+
35
+ it('sends nothing for a kind it does not know', () => {
36
+ expect(dbBrokerBody(req({ kind: 'db.merge', sql: 'DELETE FROM t' }))).toBeNull();
37
+ expect(dbBrokerBody(req({ kind: 'hub.get' }))).toBeNull();
38
+ });
39
+ });
@@ -26,11 +26,34 @@ export type BridgeReq =
26
26
  | { v: 1; id: string; kind: 'tool.call'; slug: string; input: unknown }
27
27
  | { v: 1; id: string; kind: 'db.query'; sql: string; params?: unknown[] }
28
28
  | { v: 1; id: string; kind: 'db.exec'; sql: string; params?: unknown[] }
29
+ // All or nothing: the guard is read first under the write lock.
30
+ | {
31
+ v: 1;
32
+ id: string;
33
+ kind: 'db.batch';
34
+ statements: { sql: string; params?: unknown[] }[];
35
+ guard?: { sql: string; params?: unknown[] };
36
+ }
29
37
  // Team-hub surface only: the shell answers from the /api/team/hub payload it
30
38
  // already holds (data-down). Rejected with ok:false anywhere else (owner
31
39
  // editor, ordinary shares) so hub apps degrade to a local preview.
32
40
  | { v: 1; id: string; kind: 'hub.get' };
33
41
 
42
+ /** The db broker's body for a database request of the app, or null for a kind
43
+ * this host does not know (a newer kit): that is never a write. */
44
+ export function dbBrokerBody(req: BridgeReq): Record<string, unknown> | null {
45
+ switch (req.kind) {
46
+ case 'db.query':
47
+ return { op: 'query', sql: req.sql, params: req.params ?? [] };
48
+ case 'db.exec':
49
+ return { op: 'exec', sql: req.sql, params: req.params ?? [] };
50
+ case 'db.batch':
51
+ return { op: 'batch', statements: req.statements, guard: req.guard };
52
+ default:
53
+ return null;
54
+ }
55
+ }
56
+
34
57
  /** Where a hub app can ask the /team shell to navigate (intent-up: the SHELL
35
58
  * owns chat and the briefing reader; the app can open them, never embed them). */
36
59
  export type HubNavTarget = 'chat' | { briefing: string } | { app: string };
@@ -46,11 +69,22 @@ export type BridgeEvt =
46
69
  | { v: 1; kind: 'resize'; height: number }
47
70
  | { v: 1; kind: 'error'; message: string; stack?: string }
48
71
  // Team-hub surface only; ignored anywhere else.
49
- | { v: 1; kind: 'hub.nav'; target: HubNavTarget };
72
+ | { v: 1; kind: 'hub.nav'; target: HubNavTarget }
73
+ // The frame's answer to a `look` (ui_look): its own picture, or why not.
74
+ // Sent by the frame document's listener (app-frame-html.ts), not the kit.
75
+ | LookRes;
76
+
77
+ /** A frame's answer to `look`: a PNG data URL of its visible viewport. */
78
+ export type LookRes =
79
+ | { v: 1; kind: 'look.res'; id: string; ok: true; dataUrl: string }
80
+ | { v: 1; kind: 'look.res'; id: string; ok: false; error: string };
50
81
 
51
82
  /** Responses the host sends DOWN, correlated to a BridgeReq by `id`. */
52
83
  export type BridgeRes =
53
- { v: 1; id: string; ok: true; output: unknown } | { v: 1; id: string; ok: false; error: string };
84
+ | { v: 1; id: string; ok: true; output: unknown }
85
+ // `reason`: the broker's word for why ('read-only', 'busy', 'guard'), which
86
+ // the kit hands to the app as err.reason.
87
+ | { v: 1; id: string; ok: false; error: string; reason?: string };
54
88
 
55
89
  /** Control messages the host pushes DOWN unprompted: agent region annotations
56
90
  * and the live theme. */
@@ -59,7 +93,11 @@ export type BridgeCtl =
59
93
  // Live theme: the host's <html> class + data-color-theme, mirrored onto the
60
94
  // iframe's <html> so a dark/light or colour-theme switch restyles a RUNNING
61
95
  // app (every theme's tokens are already in the linked stylesheet).
62
- | { v: 1; kind: 'theme'; cls: string; colorTheme: string | null };
96
+ | { v: 1; kind: 'theme'; cls: string; colorTheme: string | null }
97
+ // ui_look (docs/agent-ui.md, "Look"): the host cannot read inside the
98
+ // frame, so it asks the frame to draw itself at `scale`; one `look.res`
99
+ // answers it.
100
+ | { v: 1; kind: 'look'; id: string; scale: number };
63
101
 
64
102
  export type FromApp = BridgeReq | BridgeEvt;
65
103
  export type FromHost = BridgeRes | BridgeCtl;
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { describe, expect, it } from 'vitest';
9
9
  import {
10
+ LOOK_LISTENER,
10
11
  appLibraryScripts,
11
12
  buildAppFrameCsp,
12
13
  buildAppFrameHtml,
@@ -209,3 +210,69 @@ describe('buildAppFrameCsp: the library files an app may load', () => {
209
210
  expect(csp).toContain("connect-src 'none'");
210
211
  });
211
212
  });
213
+
214
+ describe('buildAppFrameHtml: the frame draws itself for ui_look', () => {
215
+ /** The listener run against a stand-in window, its dynamic import stood in. */
216
+ function listener(draw: (scale: number) => Promise<string>) {
217
+ const parent = {
218
+ sent: [] as unknown[],
219
+ postMessage(m: unknown) {
220
+ this.sent.push(m);
221
+ },
222
+ };
223
+ let onMessage: ((e: { source: unknown; data: unknown }) => void) | null = null;
224
+ const win = {
225
+ parent,
226
+ addEventListener: (_t: string, fn: typeof onMessage) => (onMessage = fn),
227
+ };
228
+ const loaded: string[] = [];
229
+ const code = LOOK_LISTENER.replace("import('/share-runtime/frame-look.js')", '__imp()');
230
+ expect(code).not.toBe(LOOK_LISTENER);
231
+ new Function('window', '__imp', code)(win, () => {
232
+ loaded.push('/share-runtime/frame-look.js');
233
+ return Promise.resolve({ drawFrame: draw });
234
+ });
235
+ const send = async (source: unknown, data: unknown) => {
236
+ onMessage!({ source, data });
237
+ await new Promise((r) => setTimeout(r, 0));
238
+ };
239
+ return { parent, loaded, send };
240
+ }
241
+
242
+ it('is in every frame document, and the CSP lets it load its drawer', () => {
243
+ expect(frame('x')).toContain(LOOK_LISTENER);
244
+ expect(buildAppFrameCsp('https://b.example')).toContain('https://b.example/share-runtime/');
245
+ });
246
+
247
+ it('answers its parent once, with the picture at the asked scale', async () => {
248
+ const scales: number[] = [];
249
+ const l = listener(async (s) => {
250
+ scales.push(s);
251
+ return 'data:image/png;base64,AAAA';
252
+ });
253
+ await l.send(l.parent, { v: 1, kind: 'look', id: 'q1', scale: 1.5 });
254
+ expect(scales).toEqual([1.5]);
255
+ expect(l.parent.sent).toEqual([
256
+ { ok: true, dataUrl: 'data:image/png;base64,AAAA', v: 1, kind: 'look.res', id: 'q1' },
257
+ ]);
258
+ });
259
+
260
+ it('a failed draw says why', async () => {
261
+ const l = listener(async () => {
262
+ throw new Error('no canvas');
263
+ });
264
+ await l.send(l.parent, { v: 1, kind: 'look', id: 'q2', scale: 1 });
265
+ expect(l.parent.sent).toEqual([
266
+ { ok: false, error: 'no canvas', v: 1, kind: 'look.res', id: 'q2' },
267
+ ]);
268
+ });
269
+
270
+ it('ignores anyone but its parent, and any other message: nothing is loaded', async () => {
271
+ const l = listener(async () => 'data:,');
272
+ await l.send({}, { v: 1, kind: 'look', id: 'q3', scale: 1 });
273
+ await l.send(l.parent, { v: 1, kind: 'theme', cls: 'dark' });
274
+ await l.send(l.parent, { v: 1, kind: 'look', scale: 1 });
275
+ expect(l.loaded).toEqual([]);
276
+ expect(l.parent.sent).toEqual([]);
277
+ });
278
+ });
@@ -89,6 +89,24 @@ const THEME_SYNC = `
89
89
  })();
90
90
  `;
91
91
 
92
+ // Host-injected too, for ui_look (docs/agent-ui.md, "Look"): on `look` from
93
+ // the parent, the frame loads its drawer (/share-runtime/frame-look.js, never
94
+ // part of an app bundle, so every app answers with no rebuild) and posts one
95
+ // `look.res` back: its visible viewport as a PNG data URL, or why not.
96
+ export const LOOK_LISTENER = `
97
+ (function(){
98
+ window.addEventListener('message', function(e){
99
+ if(e.source!==window.parent) return;
100
+ var m=e.data; if(!m||m.v!==1||m.kind!=='look'||typeof m.id!=='string') return;
101
+ function reply(r){ r.v=1; r.kind='look.res'; r.id=m.id; try{ window.parent.postMessage(r,'*'); }catch(_){} }
102
+ import('/share-runtime/frame-look.js')
103
+ .then(function(x){ return x.drawFrame(typeof m.scale==='number'?m.scale:1); })
104
+ .then(function(url){ reply({ok:true,dataUrl:url}); },
105
+ function(err){ reply({ok:false,error:String((err&&err.message)||err)}); });
106
+ });
107
+ })();
108
+ `;
109
+
92
110
  /** HTML-attribute escape for the theme values baked into the <html> tag —
93
111
  * they arrive as query params, so they are untrusted for MARKUP purposes
94
112
  * even though a wrong theme is harmless. */
@@ -268,6 +286,7 @@ ${
268
286
  <script>${ERROR_REPORTER}</script>
269
287
  ${viewerScript(opts.viewer)}<script type="module">${opts.bundleCode}</script>
270
288
  <script>${THEME_SYNC}</script>
289
+ <script>${LOOK_LISTENER}</script>
271
290
  ${opts.neatSpec ? `<script type="module" src="/share-runtime/share-page.js"></script>\n` : ''}</body>
272
291
  </html>`;
273
292
  }
@@ -23,6 +23,7 @@
23
23
  import { useCallback, useEffect, useRef, useState, type ReactNode } from 'react';
24
24
  import { RevealGate } from './app-reveal';
25
25
  import {
26
+ dbBrokerBody,
26
27
  isFromApp,
27
28
  isHubNavTarget,
28
29
  type BridgeReq,
@@ -215,7 +216,7 @@ export function AppSandbox({
215
216
  // Broker a request from the app and post the correlated response back.
216
217
  const handleRequest = useCallback(
217
218
  async (req: BridgeReq) => {
218
- const reply = (res: { ok: boolean; output?: unknown; error?: string }) => {
219
+ const reply = (res: { ok: boolean; output?: unknown; error?: string; reason?: string }) => {
219
220
  iframeRef.current?.contentWindow?.postMessage({ v: 1, id: req.id, ...res }, '*');
220
221
  };
221
222
  try {
@@ -297,13 +298,16 @@ export function AppSandbox({
297
298
  reply(data);
298
299
  return;
299
300
  }
300
- // db.query | db.exec
301
- const op = req.kind === 'db.query' ? 'query' : 'exec';
302
301
  gateRef.current?.requestStart();
302
+ const body = dbBrokerBody(req);
303
+ if (!body) {
304
+ reply({ ok: false, error: 'this host does not know that request' });
305
+ return;
306
+ }
303
307
  const r = await doFetch(`${apiBase}/db-broker`, {
304
308
  method: 'POST',
305
309
  headers: { 'content-type': 'application/json' },
306
- body: JSON.stringify({ op, sql: req.sql, params: req.params ?? [] }),
310
+ body: JSON.stringify(body),
307
311
  });
308
312
  reply(await r.json());
309
313
  } catch (err) {
@@ -359,6 +363,9 @@ export function AppSandbox({
359
363
  }
360
364
  return;
361
365
  }
366
+ // A frame's picture for ui_look: the agent UI's own listener takes
367
+ // it; it is no request.
368
+ if (m.kind === 'look.res') return;
362
369
  if (m.kind === 'hub.nav') {
363
370
  // Validate before navigating — never act on a malformed message from a
364
371
  // (possibly buggy) app bundle. Ignored off the /team surface.
@@ -21,6 +21,8 @@ import { parseThemeBlocks } from './theme-css-blocks';
21
21
  * (primary/destructive/success/warning/info and the code-* syntax
22
22
  * palette) on every neutral surface, because inks land wherever their
23
23
  * ~330 call sites happen to sit.
24
+ * `foreground`, `card-foreground` and `muted-foreground` on the
25
+ * `selected` surface (a picked card or option).
24
26
  * 3.0:1 non-text — focus rings against what they ring, and generated chart
25
27
  * colours against the chart surfaces. Seeded brand ramps (pinnacle)
26
28
  * are authored artwork and exempt from the chart bar.
@@ -218,6 +220,21 @@ describe('every registered theme', () => {
218
220
  }
219
221
  });
220
222
 
223
+ // A picked card or option (ListCard, the theme and avatar cards) wears
224
+ // --selected and keeps its ordinary text: the title, the muted
225
+ // preview, the time stamp. Starry Night dark once tinted it half
226
+ // accent, light on light, and the preview read at 1.3:1.
227
+ it(`${theme.id} ${mode}: text on the selected surface reaches AA`, () => {
228
+ for (const text of ['foreground', 'card-foreground', 'muted-foreground']) {
229
+ const ratio = contrast(t[text]!, t.selected!);
230
+ expect(
231
+ ratio,
232
+ `${theme.id} (${mode}): ${text} ${t[text]} on selected ${t.selected} is ` +
233
+ `${ratio.toFixed(2)}:1 — the generator must solve the selected surface.`,
234
+ ).toBeGreaterThanOrEqual(4.5);
235
+ }
236
+ });
237
+
221
238
  it(`${theme.id} ${mode}: focus rings reach non-text contrast`, () => {
222
239
  for (const [ring, surface] of UI_PAIRS) {
223
240
  expect(
package/styles/themes.css CHANGED
@@ -23,6 +23,7 @@
23
23
  --muted-foreground: #69707e;
24
24
  --accent: #e0e7ff;
25
25
  --accent-foreground: #374151;
26
+ --selected: #f1f4ff;
26
27
  --destructive: #df3236;
27
28
  --destructive-foreground: #ffffff;
28
29
  --destructive-ink: #d7282f;
@@ -95,6 +96,7 @@
95
96
  --muted-foreground: #9ca3af;
96
97
  --accent: #374151;
97
98
  --accent-foreground: #d1d5db;
99
+ --selected: #2b3546;
98
100
  --destructive: #ef4444;
99
101
  --destructive-foreground: #0f172a;
100
102
  --destructive-ink: #fd524f;
@@ -167,6 +169,7 @@
167
169
  --muted-foreground: #6b7280;
168
170
  --accent: #fffbeb;
169
171
  --accent-foreground: #92400e;
172
+ --selected: #fffdf5;
170
173
  --destructive: #df3236;
171
174
  --destructive-foreground: #ffffff;
172
175
  --destructive-ink: #db2e33;
@@ -239,6 +242,7 @@
239
242
  --muted-foreground: #a3a3a3;
240
243
  --accent: #92400e;
241
244
  --accent-foreground: #fde68a;
245
+ --selected: #53311c;
242
246
  --destructive: #df3236;
243
247
  --destructive-foreground: #ffffff;
244
248
  --destructive-ink: #fa4e4c;
@@ -311,6 +315,7 @@
311
315
  --muted-foreground: #605d75;
312
316
  --accent: #e6a5b8;
313
317
  --accent-foreground: #4b2e36;
318
+ --selected: #f3d2dc;
314
319
  --destructive: #c4494b;
315
320
  --destructive-foreground: #f9f8fb;
316
321
  --destructive-ink: #ae3439;
@@ -383,6 +388,7 @@
383
388
  --muted-foreground: #a09aad;
384
389
  --accent: #372e3f;
385
390
  --accent-foreground: #f2b8c6;
391
+ --selected: #2d2738;
386
392
  --destructive: #e57373;
387
393
  --destructive-foreground: #1a1823;
388
394
  --destructive-ink: #e57373;
@@ -455,6 +461,7 @@
455
461
  --muted-foreground: #7c3aed;
456
462
  --accent: #dbeafe;
457
463
  --accent-foreground: #1e40af;
464
+ --selected: #edf4ff;
458
465
  --destructive: #df3236;
459
466
  --destructive-foreground: #ffffff;
460
467
  --destructive-ink: #d7282f;
@@ -527,6 +534,7 @@
527
534
  --muted-foreground: #c4b5fd;
528
535
  --accent: #4338ca;
529
536
  --accent-foreground: #e0e7ff;
537
+ --selected: #312a8b;
530
538
  --destructive: #df3236;
531
539
  --destructive-foreground: #ffffff;
532
540
  --destructive-ink: #f54948;
@@ -599,6 +607,7 @@
599
607
  --muted-foreground: #5f5f5f;
600
608
  --accent: #fbe2a7;
601
609
  --accent-foreground: #333333;
610
+ --selected: #fce8b8;
602
611
  --destructive: #ce484d;
603
612
  --destructive-foreground: #ffffff;
604
613
  --destructive-ink: #b12c36;
@@ -671,6 +680,7 @@
671
680
  --muted-foreground: #e4a2b1;
672
681
  --accent: #98526d;
673
682
  --accent-foreground: #f3e3ea;
683
+ --selected: #583f51;
674
684
  --destructive: #e35ea4;
675
685
  --destructive-foreground: #12242e;
676
686
  --destructive-ink: #e863a9;
@@ -743,6 +753,7 @@
743
753
  --muted-foreground: #646464;
744
754
  --accent: #e8e8e8;
745
755
  --accent-foreground: #202020;
756
+ --selected: #f2f2f2;
746
757
  --destructive: #d73f1f;
747
758
  --destructive-foreground: #ffffff;
748
759
  --destructive-ink: #cb3310;
@@ -815,6 +826,7 @@
815
826
  --muted-foreground: #b4b4b4;
816
827
  --accent: #2a2a2a;
817
828
  --accent-foreground: #eeeeee;
829
+ --selected: #222222;
818
830
  --destructive: #d73f1f;
819
831
  --destructive-foreground: #ffffff;
820
832
  --destructive-ink: #ed5536;
@@ -887,6 +899,7 @@
887
899
  --muted-foreground: #5e5e5e;
888
900
  --accent: #ffff00;
889
901
  --accent-foreground: #000000;
902
+ --selected: #ffff80;
890
903
  --destructive: #df3236;
891
904
  --destructive-foreground: #ffffff;
892
905
  --destructive-ink: #c1001b;
@@ -959,6 +972,7 @@
959
972
  --muted-foreground: #b1b1b1;
960
973
  --accent: #87ceeb;
961
974
  --accent-foreground: #000000;
975
+ --selected: #3a464c;
962
976
  --destructive: #df3236;
963
977
  --destructive-foreground: #ffffff;
964
978
  --destructive-ink: #ff9289;
@@ -1031,6 +1045,7 @@
1031
1045
  --muted-foreground: #56586d;
1032
1046
  --accent: #007dbb;
1033
1047
  --accent-foreground: #ffffff;
1048
+ --selected: #b3d8eb;
1034
1049
  --destructive: #d20f39;
1035
1050
  --destructive-foreground: #ffffff;
1036
1051
  --destructive-ink: #b60023;
@@ -1103,6 +1118,7 @@
1103
1118
  --muted-foreground: #afb6d1;
1104
1119
  --accent: #89dceb;
1105
1120
  --accent-foreground: #1e1e2e;
1121
+ --selected: #364858;
1106
1122
  --destructive: #f38ba8;
1107
1123
  --destructive-foreground: #1e1e2e;
1108
1124
  --destructive-ink: #ff98b5;
@@ -1175,6 +1191,7 @@
1175
1191
  --muted-foreground: #6a6964;
1176
1192
  --accent: #e9e6dc;
1177
1193
  --accent-foreground: #28261b;
1194
+ --selected: #f2f0e9;
1178
1195
  --destructive: #141413;
1179
1196
  --destructive-foreground: #ffffff;
1180
1197
  --destructive-ink: #141413;
@@ -1247,6 +1264,7 @@
1247
1264
  --muted-foreground: #b7b5a9;
1248
1265
  --accent: #1a1915;
1249
1266
  --accent-foreground: #f5f4ee;
1267
+ --selected: #20201c;
1250
1268
  --destructive: #df3236;
1251
1269
  --destructive-foreground: #ffffff;
1252
1270
  --destructive-ink: #ff625d;
@@ -1319,6 +1337,7 @@
1319
1337
  --muted-foreground: #555c69;
1320
1338
  --accent: #f3e5f5;
1321
1339
  --accent-foreground: #374151;
1340
+ --selected: #f4edf5;
1322
1341
  --destructive: #df3236;
1323
1342
  --destructive-foreground: #ffffff;
1324
1343
  --destructive-ink: #bb0015;
@@ -1391,6 +1410,7 @@
1391
1410
  --muted-foreground: #9ca3af;
1392
1411
  --accent: #484441;
1393
1412
  --accent-foreground: #d1d5db;
1413
+ --selected: #3a3633;
1394
1414
  --destructive: #ef4444;
1395
1415
  --destructive-foreground: #1e1b18;
1396
1416
  --destructive-ink: #ff736c;
@@ -1463,6 +1483,7 @@
1463
1483
  --muted-foreground: #6b6b89;
1464
1484
  --accent: #d8e6ff;
1465
1485
  --accent-foreground: #2a2a4a;
1486
+ --selected: #ecf3ff;
1466
1487
  --destructive: #dc3055;
1467
1488
  --destructive-foreground: #ffffff;
1468
1489
  --destructive-ink: #d2234d;
@@ -1535,6 +1556,7 @@
1535
1556
  --muted-foreground: #a0a0c0;
1536
1557
  --accent: #303060;
1537
1558
  --accent-foreground: #e2e2f5;
1559
+ --selected: #252547;
1538
1560
  --destructive: #dc3055;
1539
1561
  --destructive-foreground: #ffffff;
1540
1562
  --destructive-ink: #f74d6b;
@@ -1607,6 +1629,7 @@
1607
1629
  --muted-foreground: #0c0c1d;
1608
1630
  --accent: #00ffcc;
1609
1631
  --accent-foreground: #0c0c1d;
1632
+ --selected: #80ffe6;
1610
1633
  --destructive: #e91f00;
1611
1634
  --destructive-foreground: #ffffff;
1612
1635
  --destructive-ink: #de0300;
@@ -1679,6 +1702,7 @@
1679
1702
  --muted-foreground: #8186a8;
1680
1703
  --accent: #00ffcc;
1681
1704
  --accent-foreground: #0c0c1d;
1705
+ --selected: #002623;
1682
1706
  --destructive: #e91f00;
1683
1707
  --destructive-foreground: #ffffff;
1684
1708
  --destructive-ink: #ff3d24;
@@ -1751,6 +1775,7 @@
1751
1775
  --muted-foreground: #69707e;
1752
1776
  --accent: #eeeeee;
1753
1777
  --accent-foreground: #111827;
1778
+ --selected: #f7f7f7;
1754
1779
  --destructive: #dd3035;
1755
1780
  --destructive-foreground: #fcfcfc;
1756
1781
  --destructive-ink: #d72830;
@@ -1823,6 +1848,7 @@
1823
1848
  --muted-foreground: #898989;
1824
1849
  --accent: #333333;
1825
1850
  --accent-foreground: #c1c1c1;
1851
+ --selected: #222222;
1826
1852
  --destructive: #5f8787;
1827
1853
  --destructive-foreground: #121113;
1828
1854
  --destructive-ink: #689090;
@@ -1895,6 +1921,7 @@
1895
1921
  --muted-foreground: #434343;
1896
1922
  --accent: #3f7bad;
1897
1923
  --accent-foreground: #ffffff;
1924
+ --selected: #99b8d2;
1898
1925
  --destructive: #ff6f00;
1899
1926
  --destructive-foreground: #000000;
1900
1927
  --destructive-ink: #8e0000;
@@ -1967,6 +1994,7 @@
1967
1994
  --muted-foreground: #a0a0a0;
1968
1995
  --accent: #64b5f6;
1969
1996
  --accent-foreground: #000000;
1997
+ --selected: #30383e;
1970
1998
  --destructive: #ffa000;
1971
1999
  --destructive-foreground: #000000;
1972
2000
  --destructive-ink: #ffa000;
@@ -2039,6 +2067,7 @@
2039
2067
  --muted-foreground: #57534e;
2040
2068
  --accent: #fef3c7;
2041
2069
  --accent-foreground: #7f1d1d;
2070
+ --selected: #fcf5de;
2042
2071
  --destructive: #991b1b;
2043
2072
  --destructive-foreground: #ffffff;
2044
2073
  --destructive-ink: #991b1b;
@@ -2111,6 +2140,7 @@
2111
2140
  --muted-foreground: #d6d3d1;
2112
2141
  --accent: #b45309;
2113
2142
  --accent-foreground: #fef3c7;
2143
+ --selected: #6f3c16;
2114
2144
  --destructive: #df3236;
2115
2145
  --destructive-foreground: #ffffff;
2116
2146
  --destructive-ink: #fa4e4c;
@@ -2183,6 +2213,7 @@
2183
2213
  --muted-foreground: #5f5f5f;
2184
2214
  --accent: #c0c0c0;
2185
2215
  --accent-foreground: #333333;
2216
+ --selected: #dbdbdb;
2186
2217
  --destructive: #cc3333;
2187
2218
  --destructive-foreground: #ffffff;
2188
2219
  --destructive-ink: #ba1e24;
@@ -2255,6 +2286,7 @@
2255
2286
  --muted-foreground: #919191;
2256
2287
  --accent: #404040;
2257
2288
  --accent-foreground: #d9d9d9;
2289
+ --selected: #2a2a2a;
2258
2290
  --destructive: #c64f50;
2259
2291
  --destructive-foreground: #ffffff;
2260
2292
  --destructive-ink: #e56b6a;
@@ -2327,6 +2359,7 @@
2327
2359
  --muted-foreground: #64564b;
2328
2360
  --accent: #dbc894;
2329
2361
  --accent-foreground: #5c4b3e;
2362
+ --selected: #e1d2aa;
2330
2363
  --destructive: #ac6257;
2331
2364
  --destructive-foreground: #fffff9;
2332
2365
  --destructive-ink: #8a443a;
@@ -2399,6 +2432,7 @@
2399
2432
  --muted-foreground: #b8b0a6;
2400
2433
  --accent: #a18f5c;
2401
2434
  --accent-foreground: #2a2521;
2435
+ --selected: #43391c;
2402
2436
  --destructive: #9e6156;
2403
2437
  --destructive-foreground: #fcf5e7;
2404
2438
  --destructive-ink: #e4a195;
@@ -2471,6 +2505,7 @@
2471
2505
  --muted-foreground: #515151;
2472
2506
  --accent: #727a4f;
2473
2507
  --accent-foreground: #ffffff;
2508
+ --selected: #c4c7b5;
2474
2509
  --destructive: #df3236;
2475
2510
  --destructive-foreground: #ffffff;
2476
2511
  --destructive-ink: #a80000;
@@ -2543,6 +2578,7 @@
2543
2578
  --muted-foreground: #b1b1b1;
2544
2579
  --accent: #3664b7;
2545
2580
  --accent-foreground: #e5e5e5;
2581
+ --selected: #324564;
2546
2582
  --destructive: #df3236;
2547
2583
  --destructive-foreground: #ffffff;
2548
2584
  --destructive-ink: #ff9289;
@@ -2615,6 +2651,7 @@
2615
2651
  --muted-foreground: #724f44;
2616
2652
  --accent: #e4c7b8;
2617
2653
  --accent-foreground: #56453f;
2654
+ --selected: #ebdccf;
2618
2655
  --destructive: #1f1a17;
2619
2656
  --destructive-foreground: #ffffff;
2620
2657
  --destructive-ink: #1f1a17;
@@ -2687,6 +2724,7 @@
2687
2724
  --muted-foreground: #cdb2a3;
2688
2725
  --accent: #baab92;
2689
2726
  --accent-foreground: #2d2521;
2727
+ --selected: #50463e;
2690
2728
  --destructive: #e57373;
2691
2729
  --destructive-foreground: #2d2521;
2692
2730
  --destructive-ink: #ff9c9a;
@@ -2759,6 +2797,7 @@
2759
2797
  --muted-foreground: #6b7280;
2760
2798
  --accent: #e0f2fe;
2761
2799
  --accent-foreground: #1e3a8a;
2800
+ --selected: #f0f9ff;
2762
2801
  --destructive: #df3236;
2763
2802
  --destructive-foreground: #ffffff;
2764
2803
  --destructive-ink: #db2e33;
@@ -2831,6 +2870,7 @@
2831
2870
  --muted-foreground: #a3a3a3;
2832
2871
  --accent: #1e3a8a;
2833
2872
  --accent-foreground: #bfdbfe;
2873
+ --selected: #223058;
2834
2874
  --destructive: #df3236;
2835
2875
  --destructive-foreground: #ffffff;
2836
2876
  --destructive-ink: #fa4e4c;
@@ -2903,6 +2943,7 @@
2903
2943
  --muted-foreground: #707070;
2904
2944
  --accent: #f5f5f5;
2905
2945
  --accent-foreground: #171717;
2946
+ --selected: #fafafa;
2906
2947
  --destructive: #e7000b;
2907
2948
  --destructive-foreground: #f9f9f9;
2908
2949
  --destructive-ink: #e30003;
@@ -2975,6 +3016,7 @@
2975
3016
  --muted-foreground: #a1a1a1;
2976
3017
  --accent: #404040;
2977
3018
  --accent-foreground: #fafafa;
3019
+ --selected: #2d2d2d;
2978
3020
  --destructive: #ff6467;
2979
3021
  --destructive-foreground: #262626;
2980
3022
  --destructive-ink: #ff6467;
@@ -3047,6 +3089,7 @@
3047
3089
  --muted-foreground: #6d4c41;
3048
3090
  --accent: #c8e6c9;
3049
3091
  --accent-foreground: #1b5e20;
3092
+ --selected: #e0eedd;
3050
3093
  --destructive: #c62828;
3051
3094
  --destructive-foreground: #ffffff;
3052
3095
  --destructive-ink: #c62828;
@@ -3119,6 +3162,7 @@
3119
3162
  --muted-foreground: #d7cfc4;
3120
3163
  --accent: #227b29;
3121
3164
  --accent-foreground: #f0ebe5;
3165
+ --selected: #285b2c;
3122
3166
  --destructive: #c62828;
3123
3167
  --destructive-foreground: #f0ebe5;
3124
3168
  --destructive-ink: #ff7368;
@@ -3191,6 +3235,7 @@
3191
3235
  --muted-foreground: #333333;
3192
3236
  --accent: #0066ff;
3193
3237
  --accent-foreground: #ffffff;
3238
+ --selected: #80b3ff;
3194
3239
  --destructive: #000000;
3195
3240
  --destructive-foreground: #ffffff;
3196
3241
  --destructive-ink: #000000;
@@ -3263,6 +3308,7 @@
3263
3308
  --muted-foreground: #cccccc;
3264
3309
  --accent: #3399ff;
3265
3310
  --accent-foreground: #000000;
3311
+ --selected: #33587c;
3266
3312
  --destructive: #ffffff;
3267
3313
  --destructive-foreground: #000000;
3268
3314
  --destructive-ink: #ffffff;
@@ -3335,6 +3381,7 @@
3335
3381
  --muted-foreground: #505050;
3336
3382
  --accent: #f3eac8;
3337
3383
  --accent-foreground: #5d4037;
3384
+ --selected: #f9f4e3;
3338
3385
  --destructive: #ac6161;
3339
3386
  --destructive-foreground: #ffffff;
3340
3387
  --destructive-ink: #995051;
@@ -3407,6 +3454,7 @@
3407
3454
  --muted-foreground: #b2b2b2;
3408
3455
  --accent: #e0e0e0;
3409
3456
  --accent-foreground: #333333;
3457
+ --selected: #444444;
3410
3458
  --destructive: #d9afaf;
3411
3459
  --destructive-foreground: #2b2b2b;
3412
3460
  --destructive-ink: #d9afaf;
@@ -3479,6 +3527,7 @@
3479
3527
  --muted-foreground: #666d7b;
3480
3528
  --accent: #d1fae5;
3481
3529
  --accent-foreground: #374151;
3530
+ --selected: #e8fdf2;
3482
3531
  --destructive: #df3236;
3483
3532
  --destructive-foreground: #ffffff;
3484
3533
  --destructive-ink: #d3232c;
@@ -3551,6 +3600,7 @@
3551
3600
  --muted-foreground: #888f9d;
3552
3601
  --accent: #2f3949;
3553
3602
  --accent-foreground: #a1a1aa;
3603
+ --selected: #161f2f;
3554
3604
  --destructive: #ef4444;
3555
3605
  --destructive-foreground: #0f172a;
3556
3606
  --destructive-ink: #fd524f;
@@ -3623,6 +3673,7 @@
3623
3673
  --muted-foreground: #5c6371;
3624
3674
  --accent: #f3e5f5;
3625
3675
  --accent-foreground: #374151;
3676
+ --selected: #f9f2fa;
3626
3677
  --destructive: #ae5f60;
3627
3678
  --destructive-foreground: #ffffff;
3628
3679
  --destructive-ink: #984b4d;
@@ -3695,6 +3746,7 @@
3695
3746
  --muted-foreground: #9ca3af;
3696
3747
  --accent: #4a3d5a;
3697
3748
  --accent-foreground: #d1d5db;
3749
+ --selected: #3c3148;
3698
3750
  --destructive: #fca5a5;
3699
3751
  --destructive-foreground: #1c1917;
3700
3752
  --destructive-ink: #fca5a5;
@@ -3767,6 +3819,7 @@
3767
3819
  --muted-foreground: #397175;
3768
3820
  --accent: #c9e5e7;
3769
3821
  --accent-foreground: #0a4a55;
3822
+ --selected: #deeeef;
3770
3823
  --destructive: #d13838;
3771
3824
  --destructive-foreground: #ffffff;
3772
3825
  --destructive-ink: #c52b2e;
@@ -3839,6 +3892,7 @@
3839
3892
  --muted-foreground: #36a5a5;
3840
3893
  --accent: #164955;
3841
3894
  --accent-foreground: #4de8e8;
3895
+ --selected: #11333b;
3842
3896
  --destructive: #db2d31;
3843
3897
  --destructive-foreground: #f9f9f9;
3844
3898
  --destructive-ink: #ff5853;
@@ -3911,6 +3965,7 @@
3911
3965
  --muted-foreground: #4f6357;
3912
3966
  --accent: #e9f1d6;
3913
3967
  --accent-foreground: #38440a;
3968
+ --selected: #f4f8eb;
3914
3969
  --destructive: #d5182f;
3915
3970
  --destructive-foreground: #ffffff;
3916
3971
  --destructive-ink: #d5182f;
@@ -3983,6 +4038,7 @@
3983
4038
  --muted-foreground: #9db3a5;
3984
4039
  --accent: #1f3a33;
3985
4040
  --accent-foreground: #8fdcc4;
4041
+ --selected: #1a2e28;
3986
4042
  --destructive: #ee5d66;
3987
4043
  --destructive-foreground: #1a0508;
3988
4044
  --destructive-ink: #ee5d66;
@@ -4055,6 +4111,7 @@
4055
4111
  --muted-foreground: #b7397b;
4056
4112
  --accent: #ffc1e3;
4057
4113
  --accent-foreground: #91185c;
4114
+ --selected: #ffe4f3;
4058
4115
  --destructive: #d13869;
4059
4116
  --destructive-foreground: #ffffff;
4060
4117
  --destructive-ink: #c52b60;
@@ -4127,6 +4184,7 @@
4127
4184
  --muted-foreground: #d67ad6;
4128
4185
  --accent: #5a1f5d;
4129
4186
  --accent-foreground: #ffb3ff;
4187
+ --selected: #421a49;
4130
4188
  --destructive: #e90065;
4131
4189
  --destructive-foreground: #ffffff;
4132
4190
  --destructive-ink: #ff387c;
@@ -4199,6 +4257,7 @@
4199
4257
  --muted-foreground: #606775;
4200
4258
  --accent: #bfc9bb;
4201
4259
  --accent-foreground: #1a1f2e;
4260
+ --selected: #e2e6e0;
4202
4261
  --destructive: #c73e3a;
4203
4262
  --destructive-foreground: #ffffff;
4204
4263
  --destructive-ink: #bd3432;
@@ -4271,6 +4330,7 @@
4271
4330
  --muted-foreground: #a0a0a0;
4272
4331
  --accent: #36443a;
4273
4332
  --accent-foreground: #f5f5f5;
4333
+ --selected: #242b26;
4274
4334
  --destructive: #df3236;
4275
4335
  --destructive-foreground: #ffffff;
4276
4336
  --destructive-ink: #ed4141;
@@ -4343,6 +4403,7 @@
4343
4403
  --muted-foreground: #333333;
4344
4404
  --accent: #f59e0b;
4345
4405
  --accent-foreground: #000000;
4406
+ --selected: #facf85;
4346
4407
  --destructive: #df3236;
4347
4408
  --destructive-foreground: #ffffff;
4348
4409
  --destructive-ink: #d4242d;
@@ -4415,6 +4476,7 @@
4415
4476
  --muted-foreground: #cccccc;
4416
4477
  --accent: #fcd34d;
4417
4478
  --accent-foreground: #000000;
4479
+ --selected: #5e5635;
4418
4480
  --destructive: #f87171;
4419
4481
  --destructive-foreground: #000000;
4420
4482
  --destructive-ink: #f87171;
@@ -4487,6 +4549,7 @@
4487
4549
  --muted-foreground: #6f6863;
4488
4550
  --accent: #f2daba;
4489
4551
  --accent-foreground: #57534e;
4552
+ --selected: #f5e7d4;
4490
4553
  --destructive: #991b1b;
4491
4554
  --destructive-foreground: #ffffff;
4492
4555
  --destructive-ink: #991b1b;
@@ -4559,6 +4622,7 @@
4559
4622
  --muted-foreground: #a8a29e;
4560
4623
  --accent: #1e4252;
4561
4624
  --accent-foreground: #e7e5e4;
4625
+ --selected: #24343b;
4562
4626
  --destructive: #dc2626;
4563
4627
  --destructive-foreground: #ffffff;
4564
4628
  --destructive-ink: #fd4c43;
@@ -4631,6 +4695,7 @@
4631
4695
  --muted-foreground: #3a5ba0;
4632
4696
  --accent: #467a96;
4633
4697
  --accent-foreground: #fffbe6;
4698
+ --selected: #cad8e3;
4634
4699
  --destructive: #2d1e2f;
4635
4700
  --destructive-foreground: #fffbe6;
4636
4701
  --destructive-ink: #2d1e2f;
@@ -4703,6 +4768,7 @@
4703
4768
  --muted-foreground: #7e8da6;
4704
4769
  --accent: #bccdf0;
4705
4770
  --accent-foreground: #181a24;
4771
+ --selected: #181e34;
4706
4772
  --destructive: #9e496b;
4707
4773
  --destructive-foreground: #ffe268;
4708
4774
  --destructive-ink: #ca7092;
@@ -4775,6 +4841,7 @@
4775
4841
  --muted-foreground: #756e69;
4776
4842
  --accent: #feb47b;
4777
4843
  --accent-foreground: #3d3436;
4844
+ --selected: #fff2e7;
4778
4845
  --destructive: #df3140;
4779
4846
  --destructive-foreground: #ffffff;
4780
4847
  --destructive-ink: #d62639;
@@ -4847,6 +4914,7 @@
4847
4914
  --muted-foreground: #d7c6bc;
4848
4915
  --accent: #feb47b;
4849
4916
  --accent-foreground: #2a2024;
4917
+ --selected: #684f46;
4850
4918
  --destructive: #df3140;
4851
4919
  --destructive-foreground: #ffffff;
4852
4920
  --destructive-ink: #ff666a;
@@ -4919,6 +4987,7 @@
4919
4987
  --muted-foreground: #202020;
4920
4988
  --accent: #ededed;
4921
4989
  --accent-foreground: #202020;
4990
+ --selected: #f5f5f5;
4922
4991
  --destructive: #ca3214;
4923
4992
  --destructive-foreground: #fffcfc;
4924
4993
  --destructive-ink: #ca3214;
@@ -4991,6 +5060,7 @@
4991
5060
  --muted-foreground: #a2a2a2;
4992
5061
  --accent: #313131;
4993
5062
  --accent-foreground: #fafafa;
5063
+ --selected: #242424;
4994
5064
  --destructive: #541c15;
4995
5065
  --destructive-foreground: #ede9e8;
4996
5066
  --destructive-ink: #bc7a6f;
@@ -5063,6 +5133,7 @@
5063
5133
  --muted-foreground: #834588;
5064
5134
  --accent: #f1c4e6;
5065
5135
  --accent-foreground: #77347c;
5136
+ --selected: #f5ddf0;
5066
5137
  --destructive: #ab4347;
5067
5138
  --destructive-foreground: #ffffff;
5068
5139
  --destructive-ink: #ab4347;
@@ -5135,6 +5206,7 @@
5135
5206
  --muted-foreground: #c2b6cf;
5136
5207
  --accent: #463753;
5137
5208
  --accent-foreground: #f8f1f5;
5209
+ --selected: #392f43;
5138
5210
  --destructive: #301015;
5139
5211
  --destructive-foreground: #ffffff;
5140
5212
  --destructive-ink: #af8488;
@@ -5207,6 +5279,7 @@
5207
5279
  --muted-foreground: #5c6371;
5208
5280
  --accent: #d6e4f0;
5209
5281
  --accent-foreground: #1e3a8a;
5282
+ --selected: #ebf2f8;
5210
5283
  --destructive: #df3236;
5211
5284
  --destructive-foreground: #ffffff;
5212
5285
  --destructive-ink: #c60920;
@@ -5279,6 +5352,7 @@
5279
5352
  --muted-foreground: #a3a3a3;
5280
5353
  --accent: #2a3656;
5281
5354
  --accent-foreground: #bfdbfe;
5355
+ --selected: #2a334b;
5282
5356
  --destructive: #df3236;
5283
5357
  --destructive-foreground: #ffffff;
5284
5358
  --destructive-ink: #ff635e;
@@ -5351,6 +5425,7 @@
5351
5425
  --muted-foreground: #0f1419;
5352
5426
  --accent: #e3ecf6;
5353
5427
  --accent-foreground: #006cbd;
5428
+ --selected: #edf2f7;
5354
5429
  --destructive: #eb0c25;
5355
5430
  --destructive-foreground: #ffffff;
5356
5431
  --destructive-ink: #d00002;
@@ -5423,6 +5498,7 @@
5423
5498
  --muted-foreground: #7d8185;
5424
5499
  --accent: #061622;
5425
5500
  --accent-foreground: #1c9cf0;
5501
+ --selected: #0f171f;
5426
5502
  --destructive: #eb0c25;
5427
5503
  --destructive-foreground: #ffffff;
5428
5504
  --destructive-ink: #f92832;
@@ -5495,6 +5571,7 @@
5495
5571
  --muted-foreground: #525252;
5496
5572
  --accent: #ebebeb;
5497
5573
  --accent-foreground: #000000;
5574
+ --selected: #f5f5f5;
5498
5575
  --destructive: #d73d43;
5499
5576
  --destructive-foreground: #ffffff;
5500
5577
  --destructive-ink: #d0363d;
@@ -5567,6 +5644,7 @@
5567
5644
  --muted-foreground: #a4a4a4;
5568
5645
  --accent: #333333;
5569
5646
  --accent-foreground: #ffffff;
5647
+ --selected: #1e1e1e;
5570
5648
  --destructive: #ff5b5b;
5571
5649
  --destructive-foreground: #000000;
5572
5650
  --destructive-ink: #ff5b5b;
@@ -5639,6 +5717,7 @@
5639
5717
  --muted-foreground: #76644f;
5640
5718
  --accent: #d4c8aa;
5641
5719
  --accent-foreground: #4a3f35;
5720
+ --selected: #ece5d4;
5642
5721
  --destructive: #b54a35;
5643
5722
  --destructive-foreground: #ffffff;
5644
5723
  --destructive-ink: #af4530;
@@ -5711,6 +5790,7 @@
5711
5790
  --muted-foreground: #c5bcac;
5712
5791
  --accent: #59493e;
5713
5792
  --accent-foreground: #ece5d8;
5793
+ --selected: #4a3d35;
5714
5794
  --destructive: #b54a35;
5715
5795
  --destructive-foreground: #ffffff;
5716
5796
  --destructive-ink: #eb7b63;
@@ -5783,6 +5863,7 @@
5783
5863
  --muted-foreground: #525252;
5784
5864
  --accent: #e2ebff;
5785
5865
  --accent-foreground: #1965d8;
5866
+ --selected: #f0f4fe;
5786
5867
  --destructive: #d73d43;
5787
5868
  --destructive-foreground: #ffffff;
5788
5869
  --destructive-ink: #d0363d;
@@ -5855,6 +5936,7 @@
5855
5936
  --muted-foreground: #a0a0a0;
5856
5937
  --accent: #1e293b;
5857
5938
  --accent-foreground: #79c0ff;
5939
+ --selected: #202631;
5858
5940
  --destructive: #cc494d;
5859
5941
  --destructive-foreground: #ffffff;
5860
5942
  --destructive-ink: #ee6869;
@@ -5927,6 +6009,7 @@
5927
6009
  --muted-foreground: #6a4f30;
5928
6010
  --accent: #f0c88c;
5929
6011
  --accent-foreground: #341a00;
6012
+ --selected: #f8deb5;
5930
6013
  --destructive: #a52a1e;
5931
6014
  --destructive-foreground: #fff4dd;
5932
6015
  --destructive-ink: #a52a1e;
@@ -5978,6 +6061,7 @@
5978
6061
  --muted-foreground: #bda882;
5979
6062
  --accent: #2d241d;
5980
6063
  --accent-foreground: #fde7bc;
6064
+ --selected: #261e18;
5981
6065
  --destructive: #e0553f;
5982
6066
  --destructive-foreground: #120f0e;
5983
6067
  --destructive-ink: #e0553f;
@@ -6033,6 +6117,9 @@
6033
6117
  --color-muted-foreground: var(--muted-foreground);
6034
6118
  --color-accent: var(--accent);
6035
6119
  --color-accent-foreground: var(--accent-foreground);
6120
+ /* The selected surface (a picked list row or option card): the most accent
6121
+ over card at which its ordinary text still reads at 4.5:1. */
6122
+ --color-selected: var(--selected);
6036
6123
  --color-destructive: var(--destructive);
6037
6124
  --color-destructive-foreground: var(--destructive-foreground);
6038
6125
  --color-destructive-ink: var(--destructive-ink);
@@ -22,6 +22,8 @@
22
22
  * ink (primary/destructive/success/warning/info/code-*) on every
23
23
  * neutral surface, because ~330 call sites use inks without declaring
24
24
  * a background.
25
+ * `foreground`, `card-foreground` and `muted-foreground` on the
26
+ * derived `selected` surface (step 9).
25
27
  * 3.0:1 non-text — ring against background+card, sidebar-ring against
26
28
  * sidebar, generated chart colours against background+card.
27
29
  * (A seeded `charts` override is authored brand artwork and is
@@ -43,10 +45,12 @@ import { fileURLToPath } from 'node:url';
43
45
  import { join } from 'node:path';
44
46
  import { THEME_SEEDS } from './seeds.mjs';
45
47
  import {
48
+ contrast,
46
49
  cssToHex,
47
50
  deltaE,
48
51
  hueDistance,
49
52
  oklchToSrgb,
53
+ parseColor,
50
54
  parseOklch,
51
55
  solvePair,
52
56
  solveText,
@@ -296,9 +300,58 @@ function generateModeUncached(modeSeed, { mode }) {
296
300
  });
297
301
  }
298
302
 
303
+ // 9. The selected surface — a picked card or option (a list row, a theme
304
+ // card), tinted toward the accent over the card it sits on. Its text
305
+ // stays the card's own foreground and muted-foreground (a row does not
306
+ // switch to accent-foreground), so all three must still read at 4.5:1
307
+ // on it. The tint is the most accent, up to the half the kit used, that
308
+ // allows. A theme whose accent sits close to its text (a light accent in
309
+ // dark mode) has little room that way, so its selected surface takes
310
+ // the accent's hue on the far side of the card instead: deeper in dark
311
+ // mode, paler in light. See selectedSurface.
312
+ out.selected = selectedSurface(out, dark);
313
+
299
314
  return out;
300
315
  }
301
316
 
317
+ /** A selected surface reads as picked when it is at least this far (OKLab ΔE)
318
+ * from the card around it. */
319
+ const SELECTED_MIN_DELTA = 0.03;
320
+
321
+ /** The selected surface: the kit's half accent over card where the card's
322
+ * text reads on it; else as much accent as it allows; and when that leaves
323
+ * it barely tinted, the accent's hue on the far side of the card's
324
+ * lightness from the text. Zero accent is the card itself, which
325
+ * the text already clears, so this always lands. */
326
+ function selectedSurface(out, dark) {
327
+ const accent = parseColor(out.accent);
328
+ const card = parseColor(out.card);
329
+ const texts = [out.foreground, out['card-foreground'], out['muted-foreground']];
330
+ const reads = (hex) => texts.every((t) => contrast(t, hex) >= 4.5);
331
+ let tint = cssToHex(out.card);
332
+ for (let share = 0.5; share > 0; share -= 0.02) {
333
+ const hex = toHex(accent.map((c, i) => c * share + card[i] * (1 - share)));
334
+ if (reads(hex)) {
335
+ tint = hex;
336
+ break;
337
+ }
338
+ }
339
+ // The kit's half tint, where it reads, ships as it always looked, however
340
+ // faint the theme's authored accent makes it.
341
+ if (tint === toHex(accent.map((c, i) => (c + card[i]) / 2))) return tint;
342
+ if (deltaE(tint, out.card) >= SELECTED_MIN_DELTA) return tint;
343
+ const [cardL] = parseOklch(out.card);
344
+ const [, aC, aH] = parseOklch(toHex(accent.map((c, i) => (c + card[i]) / 2)));
345
+ const C = Math.min(aC, 0.06);
346
+ for (let step = 1; step <= 20; step++) {
347
+ const L = cardL + (dark ? -1 : 1) * step * 0.01;
348
+ if (L < 0.08 || L > 0.99) break;
349
+ const hex = toHex(oklchToSrgb([L, C, aH]));
350
+ if (reads(hex) && deltaE(hex, out.card) >= SELECTED_MIN_DELTA) return hex;
351
+ }
352
+ return tint;
353
+ }
354
+
302
355
  // ── emission ─────────────────────────────────────────────────────────────────
303
356
 
304
357
  /** Canonical token order for a theme block (stable, review-friendly diffs). */
@@ -318,6 +371,7 @@ const EMIT_ORDER = [
318
371
  'muted-foreground',
319
372
  'accent',
320
373
  'accent-foreground',
374
+ 'selected',
321
375
  'destructive',
322
376
  'destructive-foreground',
323
377
  'destructive-ink',
@@ -381,6 +435,9 @@ const THEME_INLINE = `@theme inline {
381
435
  --color-muted-foreground: var(--muted-foreground);
382
436
  --color-accent: var(--accent);
383
437
  --color-accent-foreground: var(--accent-foreground);
438
+ /* The selected surface (a picked list row or option card): the most accent
439
+ over card at which its ordinary text still reads at 4.5:1. */
440
+ --color-selected: var(--selected);
384
441
  --color-destructive: var(--destructive);
385
442
  --color-destructive-foreground: var(--destructive-foreground);
386
443
  --color-destructive-ink: var(--destructive-ink);