@xenosystem/blocks 0.24.0 → 0.26.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.
@@ -0,0 +1,2036 @@
1
+ import {
2
+ PLATFORM_SHELL_BLOCK_MANIFEST,
3
+ PLATFORM_SHELL_PANEL_ID
4
+ } from "../chunk-OB3VAVQI.js";
5
+ import "../chunk-2KG3PWR4.js";
6
+
7
+ // src/shell/PlatformShell.tsx
8
+ import { useState as useState2 } from "react";
9
+ import {
10
+ PLATFORM_MODES as PLATFORM_MODES2,
11
+ buildPlatformThemeCssVars,
12
+ getClosestPlatformTheme as getClosestPlatformTheme2,
13
+ getPlatformMode,
14
+ normalizePlatformBrightness as normalizePlatformBrightness2
15
+ } from "@xenosystem/elements/tokens";
16
+
17
+ // src/shell/ModeSwitcherLayer.tsx
18
+ import { useEffect, useRef } from "react";
19
+ import { PLATFORM_MODES } from "@xenosystem/elements/tokens";
20
+ import { jsx, jsxs } from "react/jsx-runtime";
21
+ function ModeSwitcherLayer({
22
+ open,
23
+ onClose,
24
+ activeModeId,
25
+ onSelectMode,
26
+ modes = PLATFORM_MODES,
27
+ enableShortcuts = true,
28
+ className
29
+ }) {
30
+ const gridRef = useRef(null);
31
+ useEffect(() => {
32
+ if (!enableShortcuts || typeof window === "undefined") return;
33
+ const onKeyDown = (e) => {
34
+ if (e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey) {
35
+ const digit = Number(e.key);
36
+ if (Number.isInteger(digit) && digit >= 0 && digit < modes.length) {
37
+ const target = modes[digit];
38
+ if (target) {
39
+ e.preventDefault();
40
+ onSelectMode(target.id);
41
+ if (open) onClose();
42
+ }
43
+ }
44
+ } else if (e.key === "Escape" && open) {
45
+ e.preventDefault();
46
+ onClose();
47
+ }
48
+ };
49
+ window.addEventListener("keydown", onKeyDown);
50
+ return () => window.removeEventListener("keydown", onKeyDown);
51
+ }, [enableShortcuts, modes, onSelectMode, open, onClose]);
52
+ useEffect(() => {
53
+ if (!open) return;
54
+ const activeBtn = gridRef.current?.querySelector('[aria-pressed="true"]');
55
+ activeBtn?.focus();
56
+ }, [open]);
57
+ if (!open) return null;
58
+ const onCardKeyDown = (e, index) => {
59
+ const buttons = gridRef.current?.querySelectorAll(".xeno-ps-mode-card");
60
+ if (!buttons || buttons.length === 0) return;
61
+ let next = -1;
62
+ if (e.key === "ArrowRight") next = (index + 1) % buttons.length;
63
+ else if (e.key === "ArrowLeft") next = (index - 1 + buttons.length) % buttons.length;
64
+ else if (e.key === "ArrowDown") next = (index + 4) % buttons.length;
65
+ else if (e.key === "ArrowUp") next = (index - 4 + buttons.length) % buttons.length;
66
+ if (next >= 0) {
67
+ e.preventDefault();
68
+ buttons[next]?.focus();
69
+ }
70
+ };
71
+ return /* @__PURE__ */ jsx(
72
+ "div",
73
+ {
74
+ className: className ? `xeno-ps-mode-backdrop ${className}` : "xeno-ps-mode-backdrop",
75
+ "data-xeno-node": "mode-switcher-layer",
76
+ "data-xeno-actions": "select-mode,close",
77
+ onMouseDown: (e) => {
78
+ if (e.target === e.currentTarget) onClose();
79
+ },
80
+ children: /* @__PURE__ */ jsxs(
81
+ "div",
82
+ {
83
+ className: "xeno-ps-mode-dialog",
84
+ role: "dialog",
85
+ "aria-modal": "true",
86
+ "aria-label": "Switch XENO Platform mode",
87
+ children: [
88
+ /* @__PURE__ */ jsxs("div", { className: "xeno-ps-mode-head", children: [
89
+ /* @__PURE__ */ jsxs("div", { children: [
90
+ /* @__PURE__ */ jsx("div", { className: "xeno-ps-mode-title", children: "Workspace Mode" }),
91
+ /* @__PURE__ */ jsx("div", { className: "xeno-ps-mode-sub", children: "Press Alt+0 through Alt+7 anywhere to switch instantly" })
92
+ ] }),
93
+ /* @__PURE__ */ jsx(
94
+ "button",
95
+ {
96
+ type: "button",
97
+ className: "sb-ib",
98
+ "aria-label": "Close mode switcher",
99
+ onClick: onClose,
100
+ children: /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M2.5 2.5l7 7M9.5 2.5l-7 7" }) })
101
+ }
102
+ )
103
+ ] }),
104
+ /* @__PURE__ */ jsx("div", { ref: gridRef, className: "xeno-ps-mode-grid", children: modes.map((mode, idx) => {
105
+ const isActive = mode.id === activeModeId;
106
+ return /* @__PURE__ */ jsxs(
107
+ "button",
108
+ {
109
+ type: "button",
110
+ className: "xeno-ps-mode-card",
111
+ "aria-pressed": isActive,
112
+ "data-active": isActive ? "true" : void 0,
113
+ "data-mode-id": mode.id,
114
+ onKeyDown: (e) => onCardKeyDown(e, idx),
115
+ onClick: () => {
116
+ onSelectMode(mode.id);
117
+ onClose();
118
+ },
119
+ children: [
120
+ /* @__PURE__ */ jsxs("div", { className: "xeno-ps-mode-card-top", children: [
121
+ /* @__PURE__ */ jsx(
122
+ "span",
123
+ {
124
+ className: "xeno-ps-mode-swatch",
125
+ style: { background: mode.color },
126
+ "aria-hidden": "true"
127
+ }
128
+ ),
129
+ /* @__PURE__ */ jsx("span", { className: "xeno-ps-mode-name", children: mode.name }),
130
+ /* @__PURE__ */ jsx("kbd", { className: "xeno-ps-mode-kbd", children: mode.shortcut })
131
+ ] }),
132
+ /* @__PURE__ */ jsx("div", { className: "xeno-ps-mode-summary", children: mode.summary }),
133
+ /* @__PURE__ */ jsxs("div", { className: "xeno-ps-mode-count", children: [
134
+ mode.productCount,
135
+ " products"
136
+ ] })
137
+ ]
138
+ },
139
+ mode.id
140
+ );
141
+ }) })
142
+ ]
143
+ }
144
+ )
145
+ }
146
+ );
147
+ }
148
+
149
+ // src/shell/PlatformUpdatePill.tsx
150
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
151
+ function sanitizeErrorCode(code) {
152
+ const cleaned = code.replace(/[^A-Za-z0-9_.-]/g, "").slice(0, 32);
153
+ return cleaned || "UNKNOWN";
154
+ }
155
+ function formatVersion(version) {
156
+ const trimmed = version.trim();
157
+ if (!trimmed) return "";
158
+ return trimmed.startsWith("v") ? trimmed : `v${trimmed}`;
159
+ }
160
+ function clampPercent(percent) {
161
+ if (typeof percent !== "number" || !Number.isFinite(percent)) return void 0;
162
+ return Math.max(0, Math.min(100, Math.round(percent)));
163
+ }
164
+ function PlatformUpdatePill({
165
+ status,
166
+ onCheckForUpdates,
167
+ onDownloadUpdate,
168
+ onInstallAndRestart,
169
+ onSignIn,
170
+ onManagePlan,
171
+ className
172
+ }) {
173
+ const cls = className ? `xeno-ps-update ${className}` : "xeno-ps-update";
174
+ switch (status.state) {
175
+ case "idle": {
176
+ if (!onCheckForUpdates) return null;
177
+ return /* @__PURE__ */ jsx2(
178
+ "button",
179
+ {
180
+ type: "button",
181
+ className: cls,
182
+ "data-state": "idle",
183
+ "data-no-drag": "true",
184
+ "aria-label": "Check for updates",
185
+ onClick: onCheckForUpdates,
186
+ children: /* @__PURE__ */ jsx2("span", { children: "Check updates" })
187
+ }
188
+ );
189
+ }
190
+ case "checking": {
191
+ return /* @__PURE__ */ jsxs2(
192
+ "button",
193
+ {
194
+ type: "button",
195
+ className: cls,
196
+ "data-state": "checking",
197
+ "data-no-drag": "true",
198
+ disabled: true,
199
+ "aria-live": "polite",
200
+ "aria-label": "Checking for updates",
201
+ children: [
202
+ /* @__PURE__ */ jsx2("span", { className: "xeno-ps-update-pip", "aria-hidden": "true" }),
203
+ /* @__PURE__ */ jsx2("span", { children: "Checking\u2026" })
204
+ ]
205
+ }
206
+ );
207
+ }
208
+ case "up-to-date": {
209
+ const ver = formatVersion(status.version);
210
+ return /* @__PURE__ */ jsxs2(
211
+ "button",
212
+ {
213
+ type: "button",
214
+ className: cls,
215
+ "data-state": "up-to-date",
216
+ "data-no-drag": "true",
217
+ disabled: !onCheckForUpdates,
218
+ "aria-label": `Up to date ${ver}`.trim(),
219
+ title: onCheckForUpdates ? `Up to date (${ver}) \u2014 click to re-check` : `Up to date (${ver})`,
220
+ onClick: onCheckForUpdates,
221
+ children: [
222
+ /* @__PURE__ */ jsx2("span", { className: "xeno-ps-update-pip", "aria-hidden": "true" }),
223
+ /* @__PURE__ */ jsx2("span", { children: ver || "Up to date" })
224
+ ]
225
+ }
226
+ );
227
+ }
228
+ case "available": {
229
+ const ver = formatVersion(status.version);
230
+ return /* @__PURE__ */ jsxs2(
231
+ "button",
232
+ {
233
+ type: "button",
234
+ className: cls,
235
+ "data-state": "available",
236
+ "data-no-drag": "true",
237
+ disabled: !onDownloadUpdate,
238
+ "aria-label": `Download update ${ver}`.trim(),
239
+ onClick: onDownloadUpdate,
240
+ children: [
241
+ /* @__PURE__ */ jsx2("span", { className: "xeno-ps-update-pip", "aria-hidden": "true" }),
242
+ /* @__PURE__ */ jsx2("span", { children: ver ? `Update ${ver}` : "Update available" })
243
+ ]
244
+ }
245
+ );
246
+ }
247
+ case "downloading": {
248
+ const pct = clampPercent(status.percent);
249
+ const ver = formatVersion(status.version);
250
+ return /* @__PURE__ */ jsxs2(
251
+ "button",
252
+ {
253
+ type: "button",
254
+ className: cls,
255
+ "data-state": "downloading",
256
+ "data-no-drag": "true",
257
+ disabled: true,
258
+ "aria-live": "polite",
259
+ "aria-label": pct !== void 0 ? `Downloading update ${ver} (${pct}%)` : `Downloading update ${ver}`,
260
+ children: [
261
+ /* @__PURE__ */ jsx2("span", { children: pct !== void 0 ? `Downloading ${pct}%` : "Downloading\u2026" }),
262
+ pct !== void 0 ? /* @__PURE__ */ jsx2("span", { className: "xeno-ps-update-bar", "aria-hidden": "true", children: /* @__PURE__ */ jsx2("span", { className: "xeno-ps-update-fill", style: { width: `${pct}%` } }) }) : null
263
+ ]
264
+ }
265
+ );
266
+ }
267
+ case "ready": {
268
+ const ver = formatVersion(status.version);
269
+ return /* @__PURE__ */ jsx2(
270
+ "button",
271
+ {
272
+ type: "button",
273
+ className: cls,
274
+ "data-state": "ready",
275
+ "data-no-drag": "true",
276
+ disabled: !onInstallAndRestart,
277
+ "aria-label": ver ? `Restart to install update ${ver}` : "Restart to update",
278
+ onClick: onInstallAndRestart,
279
+ children: /* @__PURE__ */ jsx2("span", { children: "Restart to update" })
280
+ }
281
+ );
282
+ }
283
+ case "signed-out": {
284
+ return /* @__PURE__ */ jsxs2(
285
+ "button",
286
+ {
287
+ type: "button",
288
+ className: cls,
289
+ "data-state": "signed-out",
290
+ "data-no-drag": "true",
291
+ disabled: !onSignIn,
292
+ "aria-label": "Sign in for updates",
293
+ onClick: onSignIn,
294
+ children: [
295
+ /* @__PURE__ */ jsx2("span", { className: "xeno-ps-update-pip", "aria-hidden": "true" }),
296
+ /* @__PURE__ */ jsx2("span", { children: "Sign in for updates" })
297
+ ]
298
+ }
299
+ );
300
+ }
301
+ case "not-entitled": {
302
+ return /* @__PURE__ */ jsxs2(
303
+ "button",
304
+ {
305
+ type: "button",
306
+ className: cls,
307
+ "data-state": "not-entitled",
308
+ "data-no-drag": "true",
309
+ disabled: !onManagePlan,
310
+ "aria-label": "Manage plan for updates",
311
+ onClick: onManagePlan,
312
+ children: [
313
+ /* @__PURE__ */ jsx2("span", { className: "xeno-ps-update-pip", "aria-hidden": "true" }),
314
+ /* @__PURE__ */ jsx2("span", { children: "Manage plan" })
315
+ ]
316
+ }
317
+ );
318
+ }
319
+ case "error": {
320
+ const safeCode = sanitizeErrorCode(status.code);
321
+ return /* @__PURE__ */ jsxs2(
322
+ "button",
323
+ {
324
+ type: "button",
325
+ className: cls,
326
+ "data-state": "error",
327
+ "data-no-drag": "true",
328
+ disabled: !onCheckForUpdates,
329
+ "aria-label": `Update error ${safeCode}`,
330
+ title: onCheckForUpdates ? `Update error (${safeCode}) \u2014 click to retry` : `Update error (${safeCode})`,
331
+ onClick: onCheckForUpdates,
332
+ children: [
333
+ /* @__PURE__ */ jsx2("span", { className: "xeno-ps-update-pip", "aria-hidden": "true" }),
334
+ /* @__PURE__ */ jsx2("span", { children: "Update failed" })
335
+ ]
336
+ }
337
+ );
338
+ }
339
+ }
340
+ }
341
+
342
+ // src/shell/RailPopover.tsx
343
+ import { useEffect as useEffect2, useRef as useRef2 } from "react";
344
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
345
+ function RailPopover({
346
+ open,
347
+ title,
348
+ subtitle,
349
+ items,
350
+ activeItemId,
351
+ onSelectItem,
352
+ onClose
353
+ }) {
354
+ const ref = useRef2(null);
355
+ useEffect2(() => {
356
+ if (!open) return;
357
+ const onPointer = (e) => {
358
+ if (!ref.current?.contains(e.target)) onClose();
359
+ };
360
+ const onKey = (e) => {
361
+ if (e.key === "Escape") onClose();
362
+ };
363
+ document.addEventListener("mousedown", onPointer);
364
+ document.addEventListener("keydown", onKey);
365
+ return () => {
366
+ document.removeEventListener("mousedown", onPointer);
367
+ document.removeEventListener("keydown", onKey);
368
+ };
369
+ }, [open, onClose]);
370
+ if (!open) return null;
371
+ return /* @__PURE__ */ jsxs3(
372
+ "div",
373
+ {
374
+ ref,
375
+ className: "xeno-ps-rail-pop",
376
+ role: "dialog",
377
+ "aria-label": `${title} navigation`,
378
+ "data-xeno-node": "rail-flyout-popover",
379
+ children: [
380
+ /* @__PURE__ */ jsx3("div", { className: "xeno-ps-rail-pop-head", children: /* @__PURE__ */ jsxs3("div", { className: "xeno-ps-rail-pop-ttl", children: [
381
+ title,
382
+ subtitle ? /* @__PURE__ */ jsx3("small", { children: subtitle }) : null
383
+ ] }) }),
384
+ /* @__PURE__ */ jsx3("div", { className: "xeno-ps-rail-pop-body", children: items.map((item) => {
385
+ const isCurrent = item.active !== void 0 ? item.active : item.id === activeItemId;
386
+ return /* @__PURE__ */ jsxs3(
387
+ "button",
388
+ {
389
+ type: "button",
390
+ className: "sb-row",
391
+ disabled: item.disabled,
392
+ "aria-current": isCurrent ? "true" : void 0,
393
+ onClick: () => {
394
+ onSelectItem?.(item.id);
395
+ onClose();
396
+ },
397
+ children: [
398
+ item.icon != null ? /* @__PURE__ */ jsx3("span", { className: "sb-row-icon", "aria-hidden": "true", children: item.icon }) : null,
399
+ /* @__PURE__ */ jsx3("span", { className: "sb-row-label", children: item.label }),
400
+ item.meta != null ? /* @__PURE__ */ jsx3("span", { className: "meta", children: item.meta }) : null
401
+ ]
402
+ },
403
+ item.id
404
+ );
405
+ }) })
406
+ ]
407
+ }
408
+ );
409
+ }
410
+
411
+ // src/shell/styles.ts
412
+ var STYLE_ELEMENT_ID = "xeno-platform-shell-block-styles";
413
+ var PLATFORM_SHELL_CSS = `
414
+ @property --xeno-fr {
415
+ syntax: '<length>';
416
+ inherits: true;
417
+ initial-value: 15px;
418
+ }
419
+
420
+ .xeno-ps-root {
421
+ --xeno-layout-gap: 7px;
422
+ --xeno-layout-gap-y: 7px;
423
+ --xeno-layout-radius: 14px;
424
+ --xeno-layout-rail-w: 56px;
425
+ --xeno-layout-sidebar-w: 236px;
426
+ --xeno-layout-flare: 15px;
427
+ --xeno-ease-open: cubic-bezier(0.22, 0.9, 0.24, 1);
428
+ --xeno-ease-close: cubic-bezier(0.45, 0, 0.2, 1);
429
+ position: relative;
430
+ width: 100%;
431
+ height: 100%;
432
+ min-height: 0;
433
+ box-sizing: border-box;
434
+ font-size: 13px;
435
+ line-height: 1.45;
436
+ -webkit-font-smoothing: antialiased;
437
+ }
438
+
439
+ .xeno-ps-root *,
440
+ .xeno-ps-root *::before,
441
+ .xeno-ps-root *::after {
442
+ box-sizing: border-box;
443
+ }
444
+
445
+ .xeno-ps-root .xeno-app-shell {
446
+ position: relative;
447
+ display: flex;
448
+ width: 100%;
449
+ height: 100%;
450
+ min-height: 0;
451
+ background: var(--xeno-canvas);
452
+ color: var(--xeno-text);
453
+ overflow: hidden;
454
+ }
455
+
456
+ .xeno-ps-root .xeno-app-rail {
457
+ position: relative;
458
+ flex: none;
459
+ width: var(--xeno-layout-rail-w);
460
+ display: flex;
461
+ flex-direction: column;
462
+ align-items: center;
463
+ gap: 4px;
464
+ padding: 10px 0;
465
+ background: var(--xeno-rail-bg);
466
+ z-index: 30;
467
+ }
468
+
469
+ .xeno-ps-root .xeno-app-rail::after {
470
+ content: '';
471
+ position: absolute;
472
+ inset-inline-end: 0;
473
+ inset-block: 0;
474
+ width: 1px;
475
+ background: var(--xeno-rail-stroke);
476
+ transition: inset-block 260ms var(--xeno-ease-open);
477
+ }
478
+
479
+ .xeno-ps-root .xeno-app-shell[data-sidebar='open'] .xeno-app-rail::after {
480
+ inset-block: calc(var(--xeno-layout-flare) + 1px);
481
+ }
482
+
483
+ .xeno-ps-root .xeno-app-rail-logo {
484
+ width: 40px;
485
+ height: 40px;
486
+ border-radius: 10px;
487
+ border: 0;
488
+ background: transparent;
489
+ color: var(--xeno-text);
490
+ display: grid;
491
+ place-items: center;
492
+ margin-bottom: 4px;
493
+ cursor: pointer;
494
+ padding: 0;
495
+ transition: background 150ms ease, transform 180ms var(--xeno-ease-open);
496
+ }
497
+
498
+ .xeno-ps-root .xeno-app-rail-logo:hover {
499
+ background: var(--xeno-hover);
500
+ }
501
+
502
+ .xeno-ps-root .xeno-app-rail-logo:active {
503
+ transform: scale(0.94);
504
+ }
505
+
506
+ .xeno-ps-root .xeno-app-rail-btn {
507
+ position: relative;
508
+ width: 40px;
509
+ height: 40px;
510
+ border-radius: 10px;
511
+ border: 0;
512
+ background: transparent;
513
+ color: var(--xeno-muted-text);
514
+ display: grid;
515
+ place-items: center;
516
+ cursor: pointer;
517
+ padding: 0;
518
+ transition: background 150ms ease, color 150ms ease;
519
+ }
520
+
521
+ .xeno-ps-root .xeno-app-rail-btn:hover:not(:disabled) {
522
+ background: var(--xeno-hover);
523
+ color: var(--xeno-text);
524
+ }
525
+
526
+ .xeno-ps-root .xeno-app-rail-btn[aria-current='page'],
527
+ .xeno-ps-root .xeno-app-rail-btn[aria-current='true'] {
528
+ background: var(--xeno-hover-strong);
529
+ color: var(--xeno-text);
530
+ }
531
+
532
+ .xeno-ps-root .xeno-app-rail-btn:disabled {
533
+ opacity: 0.4;
534
+ cursor: default;
535
+ }
536
+
537
+ .xeno-ps-root .xeno-app-rail-btn:focus-visible,
538
+ .xeno-ps-root .xeno-app-rail-logo:focus-visible,
539
+ .xeno-ps-root .sb-ib:focus-visible,
540
+ .xeno-ps-root .sb-row:focus-visible,
541
+ .xeno-ps-root .xeno-ps-update:focus-visible,
542
+ .xeno-ps-root .xeno-ps-theme-btn:focus-visible,
543
+ .xeno-ps-root .xeno-ps-win-btn:focus-visible {
544
+ outline: 2px solid var(--xeno-accent);
545
+ outline-offset: 1px;
546
+ }
547
+
548
+ .xeno-ps-root .xeno-app-rail-grow {
549
+ flex: 1 1 auto;
550
+ }
551
+
552
+ .xeno-ps-root .xeno-app-rail-footer {
553
+ display: flex;
554
+ flex-direction: column;
555
+ align-items: center;
556
+ gap: 6px;
557
+ }
558
+
559
+ .xeno-ps-root .xeno-app-rail-dot {
560
+ position: absolute;
561
+ top: 7px;
562
+ right: 7px;
563
+ width: 6px;
564
+ height: 6px;
565
+ border-radius: 2px;
566
+ background: var(--xeno-success-text);
567
+ box-shadow: 0 0 0 2px var(--xeno-rail-bg);
568
+ }
569
+
570
+ .xeno-ps-root .xeno-app-rail-dot[data-tone='warn'] {
571
+ background: var(--xeno-warning-text);
572
+ }
573
+
574
+ .xeno-ps-root .xeno-app-rail-dot[data-tone='err'] {
575
+ background: var(--xeno-danger-text);
576
+ }
577
+
578
+ .xeno-ps-root .xeno-app-rail-badge {
579
+ position: absolute;
580
+ bottom: 4px;
581
+ right: 3px;
582
+ min-width: 15px;
583
+ height: 14px;
584
+ padding: 0 3px;
585
+ border-radius: 4px;
586
+ background: var(--xeno-accent);
587
+ color: var(--xeno-accent-text);
588
+ font-size: 9px;
589
+ font-weight: 700;
590
+ line-height: 14px;
591
+ text-align: center;
592
+ font-variant-numeric: tabular-nums;
593
+ }
594
+
595
+ .xeno-ps-root .xeno-app-slot {
596
+ position: relative;
597
+ flex: none;
598
+ width: calc(var(--xeno-layout-sidebar-w) + var(--xeno-layout-gap));
599
+ padding-block: var(--xeno-layout-gap-y);
600
+ padding-inline-start: var(--xeno-layout-gap);
601
+ padding-inline-end: 0;
602
+ display: flex;
603
+ min-height: 0;
604
+ z-index: 20;
605
+ --xeno-fr: var(--xeno-layout-flare);
606
+ transition: width 280ms var(--xeno-ease-open), padding 280ms var(--xeno-ease-open), --xeno-fr 280ms var(--xeno-ease-open);
607
+ }
608
+
609
+ .xeno-ps-root .xeno-app-shell[data-sidebar='closed'] .xeno-app-slot {
610
+ width: 0;
611
+ padding: 0;
612
+ --xeno-fr: 0px;
613
+ pointer-events: none;
614
+ overflow: hidden;
615
+ transition: width 240ms var(--xeno-ease-close), padding 240ms var(--xeno-ease-close), --xeno-fr 220ms var(--xeno-ease-close);
616
+ }
617
+
618
+ .xeno-ps-root .xeno-app-slot::before,
619
+ .xeno-ps-root .xeno-app-slot::after {
620
+ content: '';
621
+ position: absolute;
622
+ inset-inline-start: 0;
623
+ width: calc(var(--xeno-fr) + 1px);
624
+ height: calc(var(--xeno-fr) + 1px);
625
+ pointer-events: none;
626
+ z-index: 25;
627
+ }
628
+
629
+ .xeno-ps-root .xeno-app-slot::before {
630
+ top: 0;
631
+ background: radial-gradient(
632
+ circle at 100% 100%,
633
+ transparent calc(var(--xeno-fr) - 0.4px),
634
+ var(--xeno-rail-stroke) var(--xeno-fr),
635
+ var(--xeno-rail-stroke) calc(var(--xeno-fr) + 0.6px),
636
+ var(--xeno-rail-bg) calc(var(--xeno-fr) + 1px)
637
+ );
638
+ }
639
+
640
+ .xeno-ps-root .xeno-app-slot::after {
641
+ bottom: 0;
642
+ background: radial-gradient(
643
+ circle at 100% 0%,
644
+ transparent calc(var(--xeno-fr) - 0.4px),
645
+ var(--xeno-rail-stroke) var(--xeno-fr),
646
+ var(--xeno-rail-stroke) calc(var(--xeno-fr) + 0.6px),
647
+ var(--xeno-rail-bg) calc(var(--xeno-fr) + 1px)
648
+ );
649
+ }
650
+
651
+ [dir='rtl'] .xeno-ps-root .xeno-app-slot::before,
652
+ .xeno-ps-root[dir='rtl'] .xeno-app-slot::before {
653
+ background: radial-gradient(
654
+ circle at 0% 100%,
655
+ transparent calc(var(--xeno-fr) - 0.4px),
656
+ var(--xeno-rail-stroke) var(--xeno-fr),
657
+ var(--xeno-rail-stroke) calc(var(--xeno-fr) + 0.6px),
658
+ var(--xeno-rail-bg) calc(var(--xeno-fr) + 1px)
659
+ );
660
+ }
661
+
662
+ [dir='rtl'] .xeno-ps-root .xeno-app-slot::after,
663
+ .xeno-ps-root[dir='rtl'] .xeno-app-slot::after {
664
+ background: radial-gradient(
665
+ circle at 0% 0%,
666
+ transparent calc(var(--xeno-fr) - 0.4px),
667
+ var(--xeno-rail-stroke) var(--xeno-fr),
668
+ var(--xeno-rail-stroke) calc(var(--xeno-fr) + 0.6px),
669
+ var(--xeno-rail-bg) calc(var(--xeno-fr) + 1px)
670
+ );
671
+ }
672
+
673
+ .xeno-ps-root .xeno-app-sidebar {
674
+ flex: 1 1 auto;
675
+ display: flex;
676
+ flex-direction: column;
677
+ width: 100%;
678
+ min-width: 0;
679
+ min-height: 0;
680
+ background: var(--xeno-surface);
681
+ border: 1px solid var(--xeno-border);
682
+ border-radius: var(--xeno-layout-radius);
683
+ overflow: hidden;
684
+ }
685
+
686
+ .xeno-ps-root .sb-head {
687
+ display: flex;
688
+ align-items: center;
689
+ gap: 8px;
690
+ height: 46px;
691
+ padding: 0 10px 0 13px;
692
+ flex: none;
693
+ border-bottom: 1px solid var(--xeno-border-subtle);
694
+ }
695
+
696
+ .xeno-ps-root .sb-head-ttl {
697
+ flex: 1;
698
+ min-width: 0;
699
+ font-weight: 600;
700
+ font-size: 13.5px;
701
+ letter-spacing: -0.01em;
702
+ color: var(--xeno-text);
703
+ white-space: nowrap;
704
+ overflow: hidden;
705
+ text-overflow: ellipsis;
706
+ }
707
+
708
+ .xeno-ps-root .sb-head-ttl small {
709
+ display: block;
710
+ font-weight: 400;
711
+ font-size: 10.5px;
712
+ color: var(--xeno-dim-text);
713
+ }
714
+
715
+ .xeno-ps-root .sb-ib {
716
+ width: 28px;
717
+ height: 28px;
718
+ border-radius: 7px;
719
+ border: 0;
720
+ background: transparent;
721
+ color: var(--xeno-muted-text);
722
+ display: grid;
723
+ place-items: center;
724
+ cursor: pointer;
725
+ flex: none;
726
+ padding: 0;
727
+ }
728
+
729
+ .xeno-ps-root .sb-ib:hover {
730
+ background: var(--xeno-hover);
731
+ color: var(--xeno-text);
732
+ }
733
+
734
+ .xeno-ps-root .sb-body {
735
+ flex: 1 1 auto;
736
+ overflow-y: auto;
737
+ padding: 8px;
738
+ display: flex;
739
+ flex-direction: column;
740
+ gap: 2px;
741
+ }
742
+
743
+ .xeno-ps-root .sb-grp {
744
+ padding: 10px 9px 4px;
745
+ font-size: 10px;
746
+ font-weight: 600;
747
+ color: var(--xeno-dim-text);
748
+ text-transform: uppercase;
749
+ letter-spacing: 0.06em;
750
+ }
751
+
752
+ .xeno-ps-root .sb-row {
753
+ display: flex;
754
+ align-items: center;
755
+ gap: 9px;
756
+ width: 100%;
757
+ height: 32px;
758
+ padding: 0 9px;
759
+ border-radius: 8px;
760
+ border: 0;
761
+ background: transparent;
762
+ color: var(--xeno-muted-text);
763
+ font-size: 12.5px;
764
+ font-weight: 500;
765
+ cursor: pointer;
766
+ text-align: left;
767
+ transition: background 120ms, color 120ms;
768
+ }
769
+
770
+ .xeno-ps-root .sb-row:hover:not(:disabled) {
771
+ background: var(--xeno-hover);
772
+ color: var(--xeno-text);
773
+ }
774
+
775
+ .xeno-ps-root .sb-row[aria-current='true'] {
776
+ background: var(--xeno-hover-strong);
777
+ color: var(--xeno-text);
778
+ }
779
+
780
+ .xeno-ps-root .sb-row:disabled {
781
+ opacity: 0.4;
782
+ cursor: default;
783
+ }
784
+
785
+ .xeno-ps-root .sb-row-icon {
786
+ display: inline-flex;
787
+ align-items: center;
788
+ justify-content: center;
789
+ flex: none;
790
+ }
791
+
792
+ .xeno-ps-root .sb-row-label {
793
+ flex: 1 1 auto;
794
+ min-width: 0;
795
+ white-space: nowrap;
796
+ overflow: hidden;
797
+ text-overflow: ellipsis;
798
+ }
799
+
800
+ .xeno-ps-root .sb-row .meta {
801
+ margin-left: auto;
802
+ font-size: 10.5px;
803
+ font-variant-numeric: tabular-nums;
804
+ color: var(--xeno-dim-text);
805
+ flex: none;
806
+ }
807
+
808
+ .xeno-ps-root .sb-row[aria-current='true'] .meta {
809
+ color: var(--xeno-muted-text);
810
+ }
811
+
812
+ .xeno-ps-root .sb-foot {
813
+ flex: none;
814
+ border-top: 1px solid var(--xeno-border-subtle);
815
+ padding: 8px 10px;
816
+ display: flex;
817
+ align-items: center;
818
+ justify-content: space-between;
819
+ gap: 6px;
820
+ }
821
+
822
+ .xeno-ps-root .xeno-app-main {
823
+ flex: 1 1 auto;
824
+ min-width: 0;
825
+ min-height: 0;
826
+ display: flex;
827
+ padding: var(--xeno-layout-gap-y) var(--xeno-layout-gap) var(--xeno-layout-gap-y) var(--xeno-layout-gap);
828
+ }
829
+
830
+ .xeno-ps-root .xeno-app-plate {
831
+ container-type: inline-size;
832
+ flex: 1 1 auto;
833
+ display: flex;
834
+ flex-direction: column;
835
+ min-width: 0;
836
+ min-height: 0;
837
+ background: var(--xeno-viewport);
838
+ border: 1px solid var(--xeno-border);
839
+ border-radius: var(--xeno-layout-radius);
840
+ overflow: hidden;
841
+ }
842
+
843
+ .xeno-ps-root .plate-topbar {
844
+ flex: none;
845
+ display: flex;
846
+ align-items: center;
847
+ justify-content: space-between;
848
+ gap: 10px;
849
+ height: 46px;
850
+ padding: 0 12px 0 14px;
851
+ border-bottom: 1px solid var(--xeno-border-subtle);
852
+ background: var(--xeno-panel-header);
853
+ user-select: none;
854
+ }
855
+
856
+ .xeno-ps-root .plate-topbar[data-drag-region='true'] {
857
+ -webkit-app-region: drag;
858
+ }
859
+
860
+ .xeno-ps-root .plate-topbar[data-drag-region='true'] button,
861
+ .xeno-ps-root .plate-topbar[data-drag-region='true'] a,
862
+ .xeno-ps-root .plate-topbar[data-drag-region='true'] input,
863
+ .xeno-ps-root .plate-topbar[data-drag-region='true'] select,
864
+ .xeno-ps-root .plate-topbar[data-drag-region='true'] [data-no-drag='true'] {
865
+ -webkit-app-region: no-drag;
866
+ }
867
+
868
+ .xeno-ps-root .plate-topbar-left {
869
+ display: flex;
870
+ align-items: center;
871
+ gap: 8px;
872
+ min-width: 0;
873
+ flex: 1 1 0;
874
+ }
875
+
876
+ .xeno-ps-root .plate-topbar-center {
877
+ display: flex;
878
+ align-items: center;
879
+ justify-content: center;
880
+ flex: none;
881
+ }
882
+
883
+ .xeno-ps-root .plate-topbar-right {
884
+ display: flex;
885
+ align-items: center;
886
+ justify-content: flex-end;
887
+ gap: 6px;
888
+ flex: 1 1 0;
889
+ min-width: 0;
890
+ }
891
+
892
+ .xeno-ps-root .plate-crumb {
893
+ display: flex;
894
+ align-items: center;
895
+ gap: 7px;
896
+ font-size: 13px;
897
+ color: var(--xeno-muted-text);
898
+ min-width: 0;
899
+ white-space: nowrap;
900
+ overflow: hidden;
901
+ text-overflow: ellipsis;
902
+ }
903
+
904
+ .xeno-ps-root .plate-crumb-sep {
905
+ color: var(--xeno-dim-text);
906
+ }
907
+
908
+ .xeno-ps-root .plate-crumb-section {
909
+ color: var(--xeno-text);
910
+ font-weight: 600;
911
+ overflow: hidden;
912
+ text-overflow: ellipsis;
913
+ }
914
+
915
+ .xeno-ps-root .plate-body {
916
+ flex: 1 1 auto;
917
+ min-height: 0;
918
+ min-width: 0;
919
+ display: flex;
920
+ flex-direction: column;
921
+ overflow: auto;
922
+ }
923
+
924
+ /* \u2500\u2500 PlatformUpdatePill \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
925
+ .xeno-ps-update {
926
+ appearance: none;
927
+ display: inline-flex;
928
+ align-items: center;
929
+ gap: 6px;
930
+ height: 26px;
931
+ padding: 0 9px;
932
+ border-radius: 6px;
933
+ border: 1px solid var(--xeno-border);
934
+ background: var(--xeno-control);
935
+ color: var(--xeno-muted-text);
936
+ font-size: 11.5px;
937
+ font-weight: 500;
938
+ line-height: 1;
939
+ white-space: nowrap;
940
+ cursor: pointer;
941
+ flex: none;
942
+ font-variant-numeric: tabular-nums;
943
+ transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
944
+ }
945
+
946
+ .xeno-ps-update:hover:not(:disabled) {
947
+ background: var(--xeno-hover-strong);
948
+ color: var(--xeno-text);
949
+ }
950
+
951
+ .xeno-ps-update:disabled {
952
+ cursor: default;
953
+ }
954
+
955
+ .xeno-ps-update[data-state='idle'],
956
+ .xeno-ps-update[data-state='up-to-date'] {
957
+ background: transparent;
958
+ border-color: var(--xeno-border-subtle);
959
+ color: var(--xeno-dim-text);
960
+ }
961
+
962
+ .xeno-ps-update[data-state='checking'] {
963
+ background: var(--xeno-control);
964
+ border-color: var(--xeno-border);
965
+ color: var(--xeno-muted-text);
966
+ }
967
+
968
+ .xeno-ps-update[data-state='available'] {
969
+ background: color-mix(in srgb, var(--xeno-warning-text) 14%, var(--xeno-surface));
970
+ border-color: color-mix(in srgb, var(--xeno-warning-text) 48%, var(--xeno-border));
971
+ color: var(--xeno-warning-text);
972
+ font-weight: 600;
973
+ }
974
+
975
+ .xeno-ps-update[data-state='downloading'] {
976
+ background: var(--xeno-control);
977
+ border-color: var(--xeno-plate-border);
978
+ color: var(--xeno-text);
979
+ }
980
+
981
+ .xeno-ps-update[data-state='ready'] {
982
+ background: var(--xeno-accent);
983
+ border-color: transparent;
984
+ color: var(--xeno-accent-text);
985
+ font-weight: 600;
986
+ }
987
+
988
+ .xeno-ps-update[data-state='ready']:hover:not(:disabled) {
989
+ background: var(--xeno-accent-hover);
990
+ color: var(--xeno-accent-text);
991
+ }
992
+
993
+ .xeno-ps-update[data-state='signed-out'],
994
+ .xeno-ps-update[data-state='not-entitled'] {
995
+ background: var(--xeno-control);
996
+ border-color: var(--xeno-border-strong);
997
+ color: var(--xeno-text);
998
+ }
999
+
1000
+ .xeno-ps-update[data-state='error'] {
1001
+ background: color-mix(in srgb, var(--xeno-danger-text) 12%, var(--xeno-surface));
1002
+ border-color: color-mix(in srgb, var(--xeno-danger-text) 48%, var(--xeno-border));
1003
+ color: var(--xeno-danger-text);
1004
+ }
1005
+
1006
+ .xeno-ps-update-pip {
1007
+ width: 6px;
1008
+ height: 6px;
1009
+ border-radius: 1.5px;
1010
+ background: currentColor;
1011
+ flex: none;
1012
+ }
1013
+
1014
+ .xeno-ps-update[data-state='up-to-date'] .xeno-ps-update-pip {
1015
+ background: var(--xeno-success-text);
1016
+ }
1017
+
1018
+ .xeno-ps-update-bar {
1019
+ width: 34px;
1020
+ height: 4px;
1021
+ border-radius: 2px;
1022
+ background: var(--xeno-border);
1023
+ overflow: hidden;
1024
+ flex: none;
1025
+ }
1026
+
1027
+ .xeno-ps-update-fill {
1028
+ display: block;
1029
+ height: 100%;
1030
+ background: var(--xeno-success-text);
1031
+ transition: width 160ms ease;
1032
+ }
1033
+
1034
+ /* \u2500\u2500 Theme Stop Toggle & WindowControls \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1035
+ .xeno-ps-theme-btn {
1036
+ appearance: none;
1037
+ display: inline-flex;
1038
+ align-items: center;
1039
+ gap: 5px;
1040
+ height: 26px;
1041
+ padding: 0 8px;
1042
+ border-radius: 6px;
1043
+ border: 1px solid var(--xeno-border);
1044
+ background: var(--xeno-control);
1045
+ color: var(--xeno-muted-text);
1046
+ font-size: 11px;
1047
+ font-weight: 500;
1048
+ cursor: pointer;
1049
+ flex: none;
1050
+ white-space: nowrap;
1051
+ transition: background 120ms ease, color 120ms ease;
1052
+ }
1053
+
1054
+ .xeno-ps-theme-btn:hover {
1055
+ background: var(--xeno-hover-strong);
1056
+ color: var(--xeno-text);
1057
+ }
1058
+
1059
+ .xeno-ps-win {
1060
+ display: inline-flex;
1061
+ align-items: center;
1062
+ gap: 2px;
1063
+ margin-inline-start: 4px;
1064
+ padding-inline-start: 6px;
1065
+ border-inline-start: 1px solid var(--xeno-border-subtle);
1066
+ flex: none;
1067
+ }
1068
+
1069
+ /* \u2500\u2500 21-Stop Brightness Popover, Rail Flyout & 8-Mode Switcher Layer \u2500\u2500\u2500\u2500\u2500\u2500 */
1070
+ .xeno-ps-pop-wrap {
1071
+ position: relative;
1072
+ display: inline-flex;
1073
+ align-items: center;
1074
+ }
1075
+
1076
+ .xeno-ps-theme-pop {
1077
+ position: absolute;
1078
+ top: calc(100% + 6px);
1079
+ inset-inline-end: 0;
1080
+ z-index: 80;
1081
+ width: 224px;
1082
+ padding: 10px 12px;
1083
+ border-radius: 10px;
1084
+ background: var(--xeno-elevated, var(--xeno-surface));
1085
+ border: 1px solid var(--xeno-border-strong, var(--xeno-border));
1086
+ box-shadow: var(--xeno-pop, none);
1087
+ display: flex;
1088
+ flex-direction: column;
1089
+ gap: 8px;
1090
+ }
1091
+
1092
+ .xeno-ps-theme-pop-head {
1093
+ display: flex;
1094
+ align-items: center;
1095
+ justify-content: space-between;
1096
+ font-size: 11.5px;
1097
+ font-weight: 600;
1098
+ color: var(--xeno-text);
1099
+ }
1100
+
1101
+ .xeno-ps-theme-pop-val {
1102
+ font-variant-numeric: tabular-nums;
1103
+ color: var(--xeno-muted-text);
1104
+ font-size: 11px;
1105
+ }
1106
+
1107
+ .xeno-ps-theme-presets {
1108
+ display: grid;
1109
+ grid-template-columns: repeat(3, minmax(0, 1fr));
1110
+ gap: 4px;
1111
+ }
1112
+
1113
+ .xeno-ps-theme-preset {
1114
+ appearance: none;
1115
+ height: 24px;
1116
+ border-radius: 6px;
1117
+ border: 1px solid var(--xeno-border);
1118
+ background: var(--xeno-control);
1119
+ color: var(--xeno-muted-text);
1120
+ font-size: 11px;
1121
+ font-weight: 500;
1122
+ cursor: pointer;
1123
+ }
1124
+
1125
+ .xeno-ps-theme-preset:hover {
1126
+ color: var(--xeno-text);
1127
+ background: var(--xeno-hover-strong);
1128
+ }
1129
+
1130
+ .xeno-ps-theme-preset[data-active='true'] {
1131
+ background: var(--xeno-accent);
1132
+ color: var(--xeno-accent-text);
1133
+ border-color: transparent;
1134
+ font-weight: 600;
1135
+ }
1136
+
1137
+ .xeno-ps-theme-slider-row {
1138
+ display: flex;
1139
+ align-items: center;
1140
+ }
1141
+
1142
+ .xeno-ps-theme-range {
1143
+ width: 100%;
1144
+ accent-color: var(--xeno-accent);
1145
+ cursor: pointer;
1146
+ }
1147
+
1148
+ .xeno-ps-mode-trigger {
1149
+ appearance: none;
1150
+ display: inline-flex;
1151
+ align-items: center;
1152
+ gap: 6px;
1153
+ height: 26px;
1154
+ padding-inline: 8px;
1155
+ border-radius: 6px;
1156
+ border: 1px solid var(--xeno-border);
1157
+ background: var(--xeno-control);
1158
+ color: var(--xeno-text);
1159
+ font-size: 11.5px;
1160
+ font-weight: 600;
1161
+ cursor: pointer;
1162
+ flex: none;
1163
+ }
1164
+
1165
+ .xeno-ps-mode-trigger:hover {
1166
+ background: var(--xeno-hover-strong);
1167
+ }
1168
+
1169
+ .xeno-ps-mode-swatch {
1170
+ width: 7px;
1171
+ height: 7px;
1172
+ border-radius: 2px;
1173
+ flex: none;
1174
+ }
1175
+
1176
+ .xeno-ps-mode-backdrop {
1177
+ position: fixed;
1178
+ inset: 0;
1179
+ z-index: 90;
1180
+ display: grid;
1181
+ place-items: center;
1182
+ padding: 20px;
1183
+ background: color-mix(in srgb, var(--xeno-canvas) 74%, transparent);
1184
+ }
1185
+
1186
+ .xeno-ps-mode-dialog {
1187
+ width: min(720px, 100%);
1188
+ border-radius: 14px;
1189
+ background: var(--xeno-surface);
1190
+ border: 1px solid var(--xeno-border-strong, var(--xeno-border));
1191
+ box-shadow: var(--xeno-pop, none);
1192
+ overflow: hidden;
1193
+ display: flex;
1194
+ flex-direction: column;
1195
+ }
1196
+
1197
+ .xeno-ps-mode-head {
1198
+ display: flex;
1199
+ align-items: center;
1200
+ justify-content: space-between;
1201
+ gap: 12px;
1202
+ padding: 12px 14px;
1203
+ border-bottom: 1px solid var(--xeno-border-subtle);
1204
+ }
1205
+
1206
+ .xeno-ps-mode-title {
1207
+ font-size: 13.5px;
1208
+ font-weight: 600;
1209
+ color: var(--xeno-text);
1210
+ }
1211
+
1212
+ .xeno-ps-mode-sub {
1213
+ font-size: 11.5px;
1214
+ color: var(--xeno-muted-text);
1215
+ margin-top: 2px;
1216
+ }
1217
+
1218
+ .xeno-ps-mode-grid {
1219
+ display: grid;
1220
+ grid-template-columns: repeat(4, minmax(0, 1fr));
1221
+ gap: 8px;
1222
+ padding: 12px;
1223
+ }
1224
+
1225
+ .xeno-ps-mode-card {
1226
+ appearance: none;
1227
+ display: flex;
1228
+ flex-direction: column;
1229
+ gap: 6px;
1230
+ padding: 10px;
1231
+ border-radius: 10px;
1232
+ border: 1px solid var(--xeno-border);
1233
+ background: var(--xeno-canvas);
1234
+ color: var(--xeno-text);
1235
+ text-align: start;
1236
+ cursor: pointer;
1237
+ transition: background 120ms ease, border-color 120ms ease;
1238
+ }
1239
+
1240
+ .xeno-ps-mode-card:hover {
1241
+ background: var(--xeno-hover);
1242
+ border-color: var(--xeno-border-strong, var(--xeno-border));
1243
+ }
1244
+
1245
+ .xeno-ps-mode-card[data-active='true'] {
1246
+ background: var(--xeno-control);
1247
+ border-color: var(--xeno-accent);
1248
+ }
1249
+
1250
+ .xeno-ps-mode-card-top {
1251
+ display: flex;
1252
+ align-items: center;
1253
+ gap: 6px;
1254
+ }
1255
+
1256
+ .xeno-ps-mode-name {
1257
+ font-size: 12.5px;
1258
+ font-weight: 600;
1259
+ flex: 1 1 auto;
1260
+ }
1261
+
1262
+ .xeno-ps-mode-kbd {
1263
+ font-size: 10px;
1264
+ padding: 1px 5px;
1265
+ border-radius: 4px;
1266
+ border: 1px solid var(--xeno-border);
1267
+ background: var(--xeno-surface);
1268
+ color: var(--xeno-muted-text);
1269
+ }
1270
+
1271
+ .xeno-ps-mode-summary {
1272
+ font-size: 11px;
1273
+ line-height: 1.35;
1274
+ color: var(--xeno-muted-text);
1275
+ }
1276
+
1277
+ .xeno-ps-mode-count {
1278
+ font-size: 10.5px;
1279
+ color: var(--xeno-dim-text);
1280
+ margin-top: auto;
1281
+ font-variant-numeric: tabular-nums;
1282
+ }
1283
+
1284
+ .xeno-ps-rail-pop {
1285
+ position: absolute;
1286
+ top: 56px;
1287
+ inset-inline-start: calc(var(--xeno-layout-rail-w) + 8px);
1288
+ z-index: 70;
1289
+ width: 224px;
1290
+ border-radius: 12px;
1291
+ background: var(--xeno-surface);
1292
+ border: 1px solid var(--xeno-border-strong, var(--xeno-border));
1293
+ box-shadow: var(--xeno-pop, none);
1294
+ overflow: hidden;
1295
+ }
1296
+
1297
+ .xeno-ps-rail-pop-head {
1298
+ padding: 10px 12px;
1299
+ border-bottom: 1px solid var(--xeno-border-subtle);
1300
+ }
1301
+
1302
+ .xeno-ps-rail-pop-ttl {
1303
+ font-size: 12.5px;
1304
+ font-weight: 600;
1305
+ color: var(--xeno-text);
1306
+ }
1307
+
1308
+ .xeno-ps-rail-pop-ttl small {
1309
+ display: block;
1310
+ font-weight: 400;
1311
+ font-size: 10.5px;
1312
+ color: var(--xeno-dim-text);
1313
+ }
1314
+
1315
+ .xeno-ps-rail-pop-body {
1316
+ padding: 6px;
1317
+ display: flex;
1318
+ flex-direction: column;
1319
+ gap: 2px;
1320
+ }
1321
+
1322
+ @media (max-width: 640px) {
1323
+ .xeno-ps-mode-grid {
1324
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1325
+ }
1326
+ }
1327
+
1328
+ .xeno-ps-win-btn {
1329
+ appearance: none;
1330
+ width: 28px;
1331
+ height: 26px;
1332
+ border-radius: 6px;
1333
+ border: 0;
1334
+ background: transparent;
1335
+ color: var(--xeno-muted-text);
1336
+ display: grid;
1337
+ place-items: center;
1338
+ cursor: pointer;
1339
+ padding: 0;
1340
+ transition: background 120ms ease, color 120ms ease;
1341
+ }
1342
+
1343
+ .xeno-ps-win-btn:hover {
1344
+ background: var(--xeno-hover);
1345
+ color: var(--xeno-text);
1346
+ }
1347
+
1348
+ .xeno-ps-win-btn[data-win-action='close']:hover {
1349
+ background: color-mix(in srgb, var(--xeno-danger) 20%, transparent);
1350
+ color: var(--xeno-danger-text);
1351
+ }
1352
+
1353
+ /* \u2500\u2500 Container-Query Tightening & Narrow Responsive Collapse \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1354
+ @container (max-width: 620px) {
1355
+ .xeno-ps-root .plate-topbar {
1356
+ gap: 6px;
1357
+ padding: 0 8px 0 10px;
1358
+ }
1359
+ .xeno-ps-root .plate-crumb-brand,
1360
+ .xeno-ps-root .plate-crumb-sep {
1361
+ display: none;
1362
+ }
1363
+ .xeno-ps-root .xeno-ps-theme-label {
1364
+ display: none;
1365
+ }
1366
+ .xeno-ps-root .xeno-ps-update {
1367
+ padding: 0 7px;
1368
+ font-size: 11px;
1369
+ }
1370
+ .xeno-ps-root .xeno-ps-update-bar {
1371
+ display: none;
1372
+ }
1373
+ }
1374
+
1375
+ @media (max-width: 780px) {
1376
+ .xeno-ps-root .xeno-app-slot {
1377
+ display: none;
1378
+ }
1379
+ .xeno-ps-root .xeno-app-shell[data-sidebar='open'] .xeno-app-rail::after {
1380
+ top: 0;
1381
+ bottom: 0;
1382
+ }
1383
+ }
1384
+
1385
+ @media (prefers-reduced-motion: reduce) {
1386
+ .xeno-ps-root .xeno-app-rail::after,
1387
+ .xeno-ps-root .xeno-app-rail-logo,
1388
+ .xeno-ps-root .xeno-app-rail-btn,
1389
+ .xeno-ps-root .xeno-app-slot,
1390
+ .xeno-ps-root .sb-row,
1391
+ .xeno-ps-update,
1392
+ .xeno-ps-update-fill,
1393
+ .xeno-ps-theme-btn,
1394
+ .xeno-ps-win-btn {
1395
+ transition: none;
1396
+ }
1397
+ }
1398
+ `;
1399
+ function ensurePlatformShellStyles() {
1400
+ if (typeof document === "undefined" || !document.head) return;
1401
+ if (document.getElementById(STYLE_ELEMENT_ID)) return;
1402
+ const style = document.createElement("style");
1403
+ style.id = STYLE_ELEMENT_ID;
1404
+ style.textContent = PLATFORM_SHELL_CSS;
1405
+ document.head.appendChild(style);
1406
+ }
1407
+
1408
+ // src/shell/ThemeBrightnessPopover.tsx
1409
+ import { useEffect as useEffect3, useRef as useRef3, useState } from "react";
1410
+ import {
1411
+ PLATFORM_BRIGHTNESS_STEP,
1412
+ PLATFORM_THEME_OPTIONS,
1413
+ getClosestPlatformTheme,
1414
+ normalizePlatformBrightness
1415
+ } from "@xenosystem/elements/tokens";
1416
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1417
+ function labelFor(position) {
1418
+ const closest = getClosestPlatformTheme(position);
1419
+ if (closest === "dim") return "Dim";
1420
+ if (closest === "light") return "Light";
1421
+ return "Dark";
1422
+ }
1423
+ function ThemeBrightnessPopover({
1424
+ position,
1425
+ onChange,
1426
+ className
1427
+ }) {
1428
+ const [open, setOpen] = useState(false);
1429
+ const rootRef = useRef3(null);
1430
+ const norm = normalizePlatformBrightness(position);
1431
+ useEffect3(() => {
1432
+ if (!open) return;
1433
+ const onPointer = (e) => {
1434
+ if (!rootRef.current?.contains(e.target)) setOpen(false);
1435
+ };
1436
+ const onKey = (e) => {
1437
+ if (e.key === "Escape") setOpen(false);
1438
+ };
1439
+ document.addEventListener("mousedown", onPointer);
1440
+ document.addEventListener("keydown", onKey);
1441
+ return () => {
1442
+ document.removeEventListener("mousedown", onPointer);
1443
+ document.removeEventListener("keydown", onKey);
1444
+ };
1445
+ }, [open]);
1446
+ return /* @__PURE__ */ jsxs4(
1447
+ "div",
1448
+ {
1449
+ ref: rootRef,
1450
+ className: className ? `xeno-ps-pop-wrap ${className}` : "xeno-ps-pop-wrap",
1451
+ "data-no-drag": "true",
1452
+ "data-xeno-node": "theme-brightness-control",
1453
+ "data-xeno-actions": "toggle-theme-popover,set-brightness",
1454
+ children: [
1455
+ /* @__PURE__ */ jsxs4(
1456
+ "button",
1457
+ {
1458
+ type: "button",
1459
+ className: "xeno-ps-theme-btn",
1460
+ "aria-haspopup": "dialog",
1461
+ "aria-expanded": open,
1462
+ "aria-label": `Theme brightness (${labelFor(norm)} ${norm}%)`,
1463
+ title: `Theme: ${labelFor(norm)} (${norm}%)`,
1464
+ onClick: () => setOpen((v) => !v),
1465
+ children: [
1466
+ /* @__PURE__ */ jsxs4(
1467
+ "svg",
1468
+ {
1469
+ width: "12",
1470
+ height: "12",
1471
+ viewBox: "0 0 16 16",
1472
+ fill: "none",
1473
+ stroke: "currentColor",
1474
+ strokeWidth: "1.5",
1475
+ "aria-hidden": "true",
1476
+ children: [
1477
+ /* @__PURE__ */ jsx4("rect", { x: "2", y: "2", width: "12", height: "12", rx: "2.5" }),
1478
+ /* @__PURE__ */ jsx4("path", { d: "M8 2v12" })
1479
+ ]
1480
+ }
1481
+ ),
1482
+ /* @__PURE__ */ jsx4("span", { className: "xeno-ps-theme-label", children: labelFor(norm) })
1483
+ ]
1484
+ }
1485
+ ),
1486
+ open ? /* @__PURE__ */ jsxs4(
1487
+ "div",
1488
+ {
1489
+ className: "xeno-ps-theme-pop",
1490
+ role: "dialog",
1491
+ "aria-label": "Theme brightness controls",
1492
+ children: [
1493
+ /* @__PURE__ */ jsxs4("div", { className: "xeno-ps-theme-pop-head", children: [
1494
+ /* @__PURE__ */ jsx4("span", { children: "Brightness" }),
1495
+ /* @__PURE__ */ jsxs4("span", { className: "xeno-ps-theme-pop-val", children: [
1496
+ norm,
1497
+ "%"
1498
+ ] })
1499
+ ] }),
1500
+ /* @__PURE__ */ jsx4("div", { className: "xeno-ps-theme-presets", role: "group", "aria-label": "Theme presets", children: PLATFORM_THEME_OPTIONS.map((opt) => /* @__PURE__ */ jsx4(
1501
+ "button",
1502
+ {
1503
+ type: "button",
1504
+ className: "xeno-ps-theme-preset",
1505
+ "data-active": norm === opt.position ? "true" : void 0,
1506
+ "aria-pressed": norm === opt.position,
1507
+ onClick: () => onChange(opt.position),
1508
+ children: opt.label
1509
+ },
1510
+ opt.id
1511
+ )) }),
1512
+ /* @__PURE__ */ jsx4("div", { className: "xeno-ps-theme-slider-row", children: /* @__PURE__ */ jsx4(
1513
+ "input",
1514
+ {
1515
+ type: "range",
1516
+ className: "xeno-ps-theme-range",
1517
+ min: 0,
1518
+ max: 100,
1519
+ step: PLATFORM_BRIGHTNESS_STEP,
1520
+ value: norm,
1521
+ "aria-label": "Continuous theme brightness",
1522
+ "aria-valuetext": `${labelFor(norm)} ${norm}%`,
1523
+ onChange: (e) => onChange(Number(e.target.value))
1524
+ }
1525
+ ) })
1526
+ ]
1527
+ }
1528
+ ) : null
1529
+ ]
1530
+ }
1531
+ );
1532
+ }
1533
+
1534
+ // src/shell/WindowControls.tsx
1535
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
1536
+ function WindowControls({
1537
+ onMinimize,
1538
+ onMaximize,
1539
+ onClose,
1540
+ isMaximized = false,
1541
+ minimizeLabel = "Minimize window",
1542
+ maximizeLabel = "Maximize window",
1543
+ restoreLabel = "Restore window",
1544
+ closeLabel = "Close window",
1545
+ className
1546
+ }) {
1547
+ if (!onMinimize && !onMaximize && !onClose) return null;
1548
+ return /* @__PURE__ */ jsxs5(
1549
+ "div",
1550
+ {
1551
+ className: className ? `xeno-ps-win ${className}` : "xeno-ps-win",
1552
+ role: "group",
1553
+ "aria-label": "Window controls",
1554
+ "data-no-drag": "true",
1555
+ children: [
1556
+ onMinimize ? /* @__PURE__ */ jsx5(
1557
+ "button",
1558
+ {
1559
+ type: "button",
1560
+ className: "xeno-ps-win-btn",
1561
+ "data-win-action": "minimize",
1562
+ "aria-label": minimizeLabel,
1563
+ title: minimizeLabel,
1564
+ onClick: onMinimize,
1565
+ children: /* @__PURE__ */ jsx5(
1566
+ "svg",
1567
+ {
1568
+ width: "10",
1569
+ height: "10",
1570
+ viewBox: "0 0 10 10",
1571
+ fill: "none",
1572
+ stroke: "currentColor",
1573
+ strokeWidth: "1.25",
1574
+ "aria-hidden": "true",
1575
+ children: /* @__PURE__ */ jsx5("path", { d: "M1.5 5.5h7" })
1576
+ }
1577
+ )
1578
+ }
1579
+ ) : null,
1580
+ onMaximize ? /* @__PURE__ */ jsx5(
1581
+ "button",
1582
+ {
1583
+ type: "button",
1584
+ className: "xeno-ps-win-btn",
1585
+ "data-win-action": isMaximized ? "restore" : "maximize",
1586
+ "aria-label": isMaximized ? restoreLabel : maximizeLabel,
1587
+ title: isMaximized ? restoreLabel : maximizeLabel,
1588
+ onClick: onMaximize,
1589
+ children: isMaximized ? /* @__PURE__ */ jsxs5(
1590
+ "svg",
1591
+ {
1592
+ width: "10",
1593
+ height: "10",
1594
+ viewBox: "0 0 10 10",
1595
+ fill: "none",
1596
+ stroke: "currentColor",
1597
+ strokeWidth: "1.15",
1598
+ "aria-hidden": "true",
1599
+ children: [
1600
+ /* @__PURE__ */ jsx5("rect", { x: "1.5", y: "3", width: "5.5", height: "5.5", rx: "1" }),
1601
+ /* @__PURE__ */ jsx5("path", { d: "M3.5 3V2a1 1 0 0 1 1-1H8a1 1 0 0 1 1 1v3.5a1 1 0 0 1-1 1H7" })
1602
+ ]
1603
+ }
1604
+ ) : /* @__PURE__ */ jsx5(
1605
+ "svg",
1606
+ {
1607
+ width: "10",
1608
+ height: "10",
1609
+ viewBox: "0 0 10 10",
1610
+ fill: "none",
1611
+ stroke: "currentColor",
1612
+ strokeWidth: "1.15",
1613
+ "aria-hidden": "true",
1614
+ children: /* @__PURE__ */ jsx5("rect", { x: "1.75", y: "1.75", width: "6.5", height: "6.5", rx: "1" })
1615
+ }
1616
+ )
1617
+ }
1618
+ ) : null,
1619
+ onClose ? /* @__PURE__ */ jsx5(
1620
+ "button",
1621
+ {
1622
+ type: "button",
1623
+ className: "xeno-ps-win-btn",
1624
+ "data-win-action": "close",
1625
+ "aria-label": closeLabel,
1626
+ title: closeLabel,
1627
+ onClick: onClose,
1628
+ children: /* @__PURE__ */ jsx5(
1629
+ "svg",
1630
+ {
1631
+ width: "10",
1632
+ height: "10",
1633
+ viewBox: "0 0 10 10",
1634
+ fill: "none",
1635
+ stroke: "currentColor",
1636
+ strokeWidth: "1.25",
1637
+ "aria-hidden": "true",
1638
+ children: /* @__PURE__ */ jsx5("path", { d: "M2 2l6 6M8 2L2 8" })
1639
+ }
1640
+ )
1641
+ }
1642
+ ) : null
1643
+ ]
1644
+ }
1645
+ );
1646
+ }
1647
+
1648
+ // src/shell/PlatformShell.tsx
1649
+ import { Fragment, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
1650
+ var THEME_STOP_CYCLE = [0, 50, 100];
1651
+ function nextThemeStop(currentPosition) {
1652
+ const norm = normalizePlatformBrightness2(currentPosition);
1653
+ if (norm < 25) return THEME_STOP_CYCLE[1];
1654
+ if (norm < 75) return THEME_STOP_CYCLE[2];
1655
+ return THEME_STOP_CYCLE[0];
1656
+ }
1657
+ function themeLabelFor(position) {
1658
+ const closest = getClosestPlatformTheme2(position);
1659
+ if (closest === "dim") return "Dim";
1660
+ if (closest === "light") return "Light";
1661
+ return "Dark";
1662
+ }
1663
+ function PlatformShell({
1664
+ brandIcon,
1665
+ brandLabel,
1666
+ railItems = [],
1667
+ activeSectionId,
1668
+ onSelectSection,
1669
+ themePosition = 0,
1670
+ onThemePositionChange,
1671
+ railFooter,
1672
+ sidebarTitle,
1673
+ sidebarSubtitle,
1674
+ sidebarOpen: controlledSidebarOpen,
1675
+ defaultSidebarOpen = true,
1676
+ onSidebarOpenChange,
1677
+ sidebarSections = [],
1678
+ activeSidebarItemId,
1679
+ onSelectSidebarItem,
1680
+ sidebarFooter,
1681
+ sidebarContent,
1682
+ sidebarWidth,
1683
+ desktopDragRegion = false,
1684
+ sectionLabel,
1685
+ breadcrumb,
1686
+ modeSlot,
1687
+ headerActions,
1688
+ updateState,
1689
+ onCheckForUpdates,
1690
+ onDownloadUpdate,
1691
+ onInstallAndRestart,
1692
+ onSignIn,
1693
+ onManagePlan,
1694
+ themeToggle = false,
1695
+ themeControlMode = "popover",
1696
+ activeModeId,
1697
+ onSelectMode,
1698
+ modes = PLATFORM_MODES2,
1699
+ modeSwitcherOpen: controlledModeOpen,
1700
+ onModeSwitcherOpenChange,
1701
+ enableModeShortcuts = true,
1702
+ accountSlot,
1703
+ onMinimize,
1704
+ onMaximize,
1705
+ onClose,
1706
+ isMaximized,
1707
+ hideTopbar = false,
1708
+ children,
1709
+ label = "XENO Platform Shell",
1710
+ className
1711
+ }) {
1712
+ useState2(() => {
1713
+ ensurePlatformShellStyles();
1714
+ return null;
1715
+ });
1716
+ const [uncontrolledOpen, setUncontrolledOpen] = useState2(defaultSidebarOpen);
1717
+ const [uncontrolledModeOpen, setUncontrolledModeOpen] = useState2(false);
1718
+ const [railFlyoutId, setRailFlyoutId] = useState2(null);
1719
+ const hasSidebar = sidebarContent != null || sidebarSections.length > 0 || sidebarTitle != null || sidebarFooter != null;
1720
+ const isSidebarOpen = hasSidebar ? controlledSidebarOpen ?? uncontrolledOpen : false;
1721
+ const isModeSwitcherOpen = controlledModeOpen ?? uncontrolledModeOpen;
1722
+ const setModeOpen = (next) => {
1723
+ if (controlledModeOpen === void 0) setUncontrolledModeOpen(next);
1724
+ onModeSwitcherOpenChange?.(next);
1725
+ };
1726
+ const activeMode = activeModeId ? getPlatformMode(activeModeId) : void 0;
1727
+ const activeFlyoutItem = railFlyoutId ? railItems.find((item) => item.id === railFlyoutId && item.flyoutItems && item.flyoutItems.length > 0) : void 0;
1728
+ const toggleSidebar = () => {
1729
+ if (!hasSidebar) return;
1730
+ const next = !isSidebarOpen;
1731
+ if (controlledSidebarOpen === void 0) setUncontrolledOpen(next);
1732
+ onSidebarOpenChange?.(next);
1733
+ };
1734
+ const normalizedPosition = normalizePlatformBrightness2(themePosition);
1735
+ const resolvedTheme = getClosestPlatformTheme2(normalizedPosition);
1736
+ const themeVars = buildPlatformThemeCssVars(normalizedPosition);
1737
+ const rootStyle = {
1738
+ ...themeVars,
1739
+ ...sidebarWidth !== void 0 ? { "--xeno-layout-sidebar-w": `${sidebarWidth}px` } : {},
1740
+ colorScheme: resolvedTheme === "light" ? "light" : "dark"
1741
+ };
1742
+ const rootClass = className ? `xeno xeno-ps-root ${className}` : "xeno xeno-ps-root";
1743
+ return /* @__PURE__ */ jsxs6(
1744
+ "div",
1745
+ {
1746
+ className: rootClass,
1747
+ "data-layout": "platform",
1748
+ "data-theme": resolvedTheme,
1749
+ "data-theme-position": String(normalizedPosition),
1750
+ "data-xeno-node": "platform-shell",
1751
+ "data-xeno-actions": "toggle-sidebar,select-section,set-brightness,switch-mode",
1752
+ style: rootStyle,
1753
+ "aria-label": label,
1754
+ children: [
1755
+ /* @__PURE__ */ jsxs6(
1756
+ "div",
1757
+ {
1758
+ className: "xeno-app-shell",
1759
+ "data-sidebar": isSidebarOpen ? "open" : "closed",
1760
+ children: [
1761
+ /* @__PURE__ */ jsxs6("nav", { className: "xeno-app-rail", "aria-label": "Primary rail", children: [
1762
+ brandIcon != null ? /* @__PURE__ */ jsx6(
1763
+ "button",
1764
+ {
1765
+ type: "button",
1766
+ className: "xeno-app-rail-logo",
1767
+ "aria-label": hasSidebar ? isSidebarOpen ? `Collapse ${brandLabel ?? "navigation"} sidebar` : `Expand ${brandLabel ?? "navigation"} sidebar` : brandLabel ?? "Home",
1768
+ "aria-expanded": hasSidebar ? isSidebarOpen : void 0,
1769
+ title: brandLabel,
1770
+ onClick: toggleSidebar,
1771
+ children: brandIcon
1772
+ }
1773
+ ) : null,
1774
+ railItems.map((item) => {
1775
+ const isActive = item.id === activeSectionId;
1776
+ return /* @__PURE__ */ jsxs6(
1777
+ "button",
1778
+ {
1779
+ type: "button",
1780
+ className: "xeno-app-rail-btn",
1781
+ disabled: item.disabled,
1782
+ "aria-label": item.label,
1783
+ "aria-current": isActive ? "page" : void 0,
1784
+ title: item.label,
1785
+ onClick: () => {
1786
+ onSelectSection?.(item.id);
1787
+ if (!isSidebarOpen && item.flyoutItems && item.flyoutItems.length > 0) {
1788
+ setRailFlyoutId((prev) => prev === item.id ? null : item.id);
1789
+ } else {
1790
+ setRailFlyoutId(null);
1791
+ }
1792
+ },
1793
+ children: [
1794
+ item.icon,
1795
+ item.tone ? /* @__PURE__ */ jsx6(
1796
+ "span",
1797
+ {
1798
+ className: "xeno-app-rail-dot",
1799
+ "data-tone": item.tone,
1800
+ "aria-hidden": "true"
1801
+ }
1802
+ ) : null,
1803
+ item.badge != null ? /* @__PURE__ */ jsx6("span", { className: "xeno-app-rail-badge", "aria-hidden": "true", children: item.badge }) : null
1804
+ ]
1805
+ },
1806
+ item.id
1807
+ );
1808
+ }),
1809
+ /* @__PURE__ */ jsx6("div", { className: "xeno-app-rail-grow" }),
1810
+ railFooter != null ? /* @__PURE__ */ jsx6("div", { className: "xeno-app-rail-footer", children: railFooter }) : null
1811
+ ] }),
1812
+ activeFlyoutItem && activeFlyoutItem.flyoutItems ? /* @__PURE__ */ jsx6(
1813
+ RailPopover,
1814
+ {
1815
+ open: true,
1816
+ title: activeFlyoutItem.label,
1817
+ items: activeFlyoutItem.flyoutItems,
1818
+ activeItemId: activeSidebarItemId,
1819
+ onSelectItem: onSelectSidebarItem,
1820
+ onClose: () => setRailFlyoutId(null)
1821
+ }
1822
+ ) : null,
1823
+ hasSidebar ? /* @__PURE__ */ jsx6("div", { className: "xeno-app-slot", "aria-hidden": !isSidebarOpen, children: /* @__PURE__ */ jsxs6("aside", { className: "xeno-app-sidebar", "aria-label": "Workspace sidebar", children: [
1824
+ sidebarTitle != null || sidebarSubtitle != null ? /* @__PURE__ */ jsxs6("div", { className: "sb-head", children: [
1825
+ /* @__PURE__ */ jsxs6("div", { className: "sb-head-ttl", children: [
1826
+ sidebarTitle,
1827
+ sidebarSubtitle != null ? /* @__PURE__ */ jsx6("small", { children: sidebarSubtitle }) : null
1828
+ ] }),
1829
+ /* @__PURE__ */ jsx6(
1830
+ "button",
1831
+ {
1832
+ type: "button",
1833
+ className: "sb-ib",
1834
+ "aria-label": "Collapse sidebar",
1835
+ title: "Collapse sidebar",
1836
+ onClick: toggleSidebar,
1837
+ children: /* @__PURE__ */ jsx6(
1838
+ "svg",
1839
+ {
1840
+ width: "14",
1841
+ height: "14",
1842
+ viewBox: "0 0 16 16",
1843
+ fill: "none",
1844
+ stroke: "currentColor",
1845
+ strokeWidth: "1.5",
1846
+ strokeLinecap: "round",
1847
+ strokeLinejoin: "round",
1848
+ "aria-hidden": "true",
1849
+ children: /* @__PURE__ */ jsx6("path", { d: "M10 4L6 8l4 4" })
1850
+ }
1851
+ )
1852
+ }
1853
+ )
1854
+ ] }) : null,
1855
+ /* @__PURE__ */ jsx6("div", { className: "sb-body", children: sidebarContent != null ? sidebarContent : sidebarSections.map((section, idx) => /* @__PURE__ */ jsxs6("div", { children: [
1856
+ section.title ? /* @__PURE__ */ jsx6("div", { className: "sb-grp", children: section.title }) : null,
1857
+ section.items.map((row) => {
1858
+ const isCurrent = row.active !== void 0 ? row.active : row.id === activeSidebarItemId;
1859
+ return /* @__PURE__ */ jsxs6(
1860
+ "button",
1861
+ {
1862
+ type: "button",
1863
+ className: "sb-row",
1864
+ disabled: row.disabled,
1865
+ "aria-current": isCurrent ? "true" : void 0,
1866
+ onClick: () => onSelectSidebarItem?.(row.id),
1867
+ children: [
1868
+ row.icon != null ? /* @__PURE__ */ jsx6("span", { className: "sb-row-icon", "aria-hidden": "true", children: row.icon }) : null,
1869
+ /* @__PURE__ */ jsx6("span", { className: "sb-row-label", children: row.label }),
1870
+ row.meta != null ? /* @__PURE__ */ jsx6("span", { className: "meta", children: row.meta }) : null
1871
+ ]
1872
+ },
1873
+ row.id
1874
+ );
1875
+ })
1876
+ ] }, section.id ?? section.title ?? `sec-${idx}`)) }),
1877
+ sidebarFooter != null ? /* @__PURE__ */ jsx6("div", { className: "sb-foot", children: sidebarFooter }) : null
1878
+ ] }) }) : null,
1879
+ /* @__PURE__ */ jsx6("main", { className: "xeno-app-main", children: /* @__PURE__ */ jsxs6("section", { className: "xeno-app-plate", children: [
1880
+ !hideTopbar ? /* @__PURE__ */ jsxs6(
1881
+ "header",
1882
+ {
1883
+ className: "plate-topbar",
1884
+ "data-drag-region": desktopDragRegion ? "true" : void 0,
1885
+ children: [
1886
+ /* @__PURE__ */ jsxs6("div", { className: "plate-topbar-left", children: [
1887
+ hasSidebar && !isSidebarOpen && brandIcon == null ? /* @__PURE__ */ jsx6(
1888
+ "button",
1889
+ {
1890
+ type: "button",
1891
+ className: "sb-ib",
1892
+ "aria-label": "Expand sidebar",
1893
+ title: "Expand sidebar",
1894
+ onClick: toggleSidebar,
1895
+ children: /* @__PURE__ */ jsx6(
1896
+ "svg",
1897
+ {
1898
+ width: "14",
1899
+ height: "14",
1900
+ viewBox: "0 0 16 16",
1901
+ fill: "none",
1902
+ stroke: "currentColor",
1903
+ strokeWidth: "1.5",
1904
+ strokeLinecap: "round",
1905
+ strokeLinejoin: "round",
1906
+ "aria-hidden": "true",
1907
+ children: /* @__PURE__ */ jsx6("path", { d: "M6 4l4 4-4 4" })
1908
+ }
1909
+ )
1910
+ }
1911
+ ) : null,
1912
+ /* @__PURE__ */ jsx6("div", { className: "plate-crumb", children: breadcrumb != null ? breadcrumb : /* @__PURE__ */ jsxs6(Fragment, { children: [
1913
+ brandLabel ? /* @__PURE__ */ jsx6("span", { className: "plate-crumb-brand", children: brandLabel }) : null,
1914
+ brandLabel && sectionLabel ? /* @__PURE__ */ jsx6("span", { className: "plate-crumb-sep", "aria-hidden": "true", children: "/" }) : null,
1915
+ sectionLabel ? /* @__PURE__ */ jsx6("span", { className: "plate-crumb-section", children: sectionLabel }) : null
1916
+ ] }) })
1917
+ ] }),
1918
+ modeSlot != null ? /* @__PURE__ */ jsx6("div", { className: "plate-topbar-center", "data-no-drag": "true", children: modeSlot }) : null,
1919
+ /* @__PURE__ */ jsxs6("div", { className: "plate-topbar-right", children: [
1920
+ headerActions,
1921
+ updateState ? /* @__PURE__ */ jsx6(
1922
+ PlatformUpdatePill,
1923
+ {
1924
+ status: updateState,
1925
+ onCheckForUpdates,
1926
+ onDownloadUpdate,
1927
+ onInstallAndRestart,
1928
+ onSignIn,
1929
+ onManagePlan
1930
+ }
1931
+ ) : null,
1932
+ activeMode && onSelectMode ? /* @__PURE__ */ jsxs6(
1933
+ "button",
1934
+ {
1935
+ type: "button",
1936
+ className: "xeno-ps-mode-trigger",
1937
+ "data-no-drag": "true",
1938
+ "aria-haspopup": "dialog",
1939
+ "aria-expanded": isModeSwitcherOpen,
1940
+ "aria-label": `Workspace mode: ${activeMode.name}`,
1941
+ onClick: () => setModeOpen(!isModeSwitcherOpen),
1942
+ children: [
1943
+ /* @__PURE__ */ jsx6(
1944
+ "span",
1945
+ {
1946
+ className: "xeno-ps-mode-swatch",
1947
+ style: { background: activeMode.color },
1948
+ "aria-hidden": "true"
1949
+ }
1950
+ ),
1951
+ /* @__PURE__ */ jsx6("span", { children: activeMode.name })
1952
+ ]
1953
+ }
1954
+ ) : null,
1955
+ themeToggle && onThemePositionChange ? themeControlMode === "cycle" ? /* @__PURE__ */ jsxs6(
1956
+ "button",
1957
+ {
1958
+ type: "button",
1959
+ className: "xeno-ps-theme-btn",
1960
+ "data-no-drag": "true",
1961
+ "aria-label": `Switch theme (currently ${themeLabelFor(normalizedPosition)})`,
1962
+ title: `Theme: ${themeLabelFor(normalizedPosition)} (${normalizedPosition}%)`,
1963
+ onClick: () => onThemePositionChange(nextThemeStop(normalizedPosition)),
1964
+ children: [
1965
+ /* @__PURE__ */ jsxs6(
1966
+ "svg",
1967
+ {
1968
+ width: "12",
1969
+ height: "12",
1970
+ viewBox: "0 0 16 16",
1971
+ fill: "none",
1972
+ stroke: "currentColor",
1973
+ strokeWidth: "1.5",
1974
+ "aria-hidden": "true",
1975
+ children: [
1976
+ /* @__PURE__ */ jsx6("rect", { x: "2", y: "2", width: "12", height: "12", rx: "2.5" }),
1977
+ /* @__PURE__ */ jsx6("path", { d: "M8 2v12" })
1978
+ ]
1979
+ }
1980
+ ),
1981
+ /* @__PURE__ */ jsx6("span", { className: "xeno-ps-theme-label", children: themeLabelFor(normalizedPosition) })
1982
+ ]
1983
+ }
1984
+ ) : /* @__PURE__ */ jsx6(
1985
+ ThemeBrightnessPopover,
1986
+ {
1987
+ position: normalizedPosition,
1988
+ onChange: onThemePositionChange
1989
+ }
1990
+ ) : null,
1991
+ accountSlot,
1992
+ /* @__PURE__ */ jsx6(
1993
+ WindowControls,
1994
+ {
1995
+ onMinimize,
1996
+ onMaximize,
1997
+ onClose,
1998
+ isMaximized
1999
+ }
2000
+ )
2001
+ ] })
2002
+ ]
2003
+ }
2004
+ ) : null,
2005
+ /* @__PURE__ */ jsx6("div", { className: "plate-body", children })
2006
+ ] }) })
2007
+ ]
2008
+ }
2009
+ ),
2010
+ activeModeId && onSelectMode ? /* @__PURE__ */ jsx6(
2011
+ ModeSwitcherLayer,
2012
+ {
2013
+ open: isModeSwitcherOpen,
2014
+ onClose: () => setModeOpen(false),
2015
+ activeModeId,
2016
+ onSelectMode,
2017
+ modes,
2018
+ enableShortcuts: enableModeShortcuts
2019
+ }
2020
+ ) : null
2021
+ ]
2022
+ }
2023
+ );
2024
+ }
2025
+ export {
2026
+ ModeSwitcherLayer,
2027
+ PLATFORM_SHELL_BLOCK_MANIFEST,
2028
+ PLATFORM_SHELL_CSS,
2029
+ PLATFORM_SHELL_PANEL_ID,
2030
+ PlatformShell,
2031
+ PlatformUpdatePill,
2032
+ RailPopover,
2033
+ ThemeBrightnessPopover,
2034
+ WindowControls,
2035
+ ensurePlatformShellStyles
2036
+ };