devnonla-ui 0.16.1 → 0.17.1
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/README.md +7 -0
- package/package.json +3 -1
- package/src/app/App.tsx +34 -16
- package/src/app/context.ts +1 -1
- package/src/chat/AgentChatbox.tsx +23 -17
- package/src/chat/AgentPanel.tsx +23 -17
- package/src/chat/index.ts +1 -0
- package/src/chat/message-ui/ChatAgentMessage.tsx +5 -2
- package/src/chat/message-ui/ChatMarkdown.tsx +6 -3
- package/src/index.ts +0 -87
- package/src/markdown-editor/MarkdownViewer.tsx +58 -7
- package/src/markdown-editor/ReactCodeRunner.tsx +10 -2
- package/src/markdown-editor/index.ts +13 -0
- package/src/styles.css +58 -66
- package/src/theme.ts +36 -11
- package/src/typography/Typography.tsx +1 -1
- package/src/desktop/DesktopHeader.tsx +0 -87
- package/src/desktop/DesktopIcon.tsx +0 -25
- package/src/desktop/DesktopStage.tsx +0 -6
- package/src/desktop/DesktopWindow.tsx +0 -677
- package/src/desktop/MeadowDesktop.tsx +0 -15
- package/src/desktop/MeadowShell.tsx +0 -12
- package/src/desktop/MeadowWallpaper.tsx +0 -5
- package/src/desktop/assets/desktop-meadow.jpg +0 -0
- package/src/desktop/assets.d.ts +0 -9
- package/src/desktop/surface.ts +0 -1
- /package/src/{markdown-editor → lib}/markdownScale.ts +0 -0
package/src/styles.css
CHANGED
|
@@ -4,20 +4,21 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* NonlaUI theme.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Tokens and chrome live on `.nonla-ui` (the host `App` renders). They do not
|
|
8
|
+
* paint `:root`, `body`, or the rest of the consumer page.
|
|
9
|
+
*
|
|
10
|
+
* Config is the first block in `.nonla-ui`. `.nonla-ui.light` repeats those keys.
|
|
8
11
|
* Derived (`--background`, `--nonla-fill`, `--brand-500`, borders) follows Config.
|
|
9
12
|
* `@theme` only maps tokens to Tailwind utilities (`bg-card`, `text-brand`).
|
|
10
13
|
*
|
|
11
|
-
* Dark is the default
|
|
12
|
-
*
|
|
14
|
+
* Dark is the default on `.nonla-ui`. `App` / `setColorMode` toggle `light` or
|
|
15
|
+
* `dark` on that host. Override Config on `.nonla-ui` in the consuming app's CSS.
|
|
13
16
|
*/
|
|
14
17
|
|
|
15
|
-
:root,
|
|
16
|
-
.dark,
|
|
17
18
|
.nonla-ui {
|
|
18
19
|
color-scheme: dark;
|
|
19
20
|
|
|
20
|
-
/* ── Config. Set these. `.light` repeats the same keys.
|
|
21
|
+
/* ── Config. Set these. `.nonla-ui.light` repeats the same keys. ───── */
|
|
21
22
|
/* Claude dark (claude.com). Warm gray, hue ~60. Page 950, sidebar 900, cards 850, bar 800. */
|
|
22
23
|
--nonla-bg: #141413;
|
|
23
24
|
--nonla-text-main: #faf9f5;
|
|
@@ -57,13 +58,10 @@
|
|
|
57
58
|
--nonla-fill: color-mix(in oklab, var(--nonla-text-main) 6%, var(--nonla-surface));
|
|
58
59
|
--nonla-fill-strong: color-mix(in oklab, var(--nonla-text-main) 10%, var(--nonla-surface));
|
|
59
60
|
--nonla-input-focus: rgb(from var(--nonla-input) r g b / calc(alpha * 2));
|
|
60
|
-
/* Hover and pressed/selected. Sidebar, menus, selects,
|
|
61
|
+
/* Hover and pressed/selected. Sidebar, menus, selects, and buttons share these. */
|
|
61
62
|
--nonla-ink-hover: color-mix(in oklab, var(--nonla-text-main) 6%, transparent);
|
|
62
63
|
--nonla-ink-active: color-mix(in oklab, var(--nonla-text-main) 10%, transparent);
|
|
63
64
|
--nonla-z-base: 0;
|
|
64
|
-
--nonla-z-desktop: 20;
|
|
65
|
-
--nonla-z-window: 30;
|
|
66
|
-
--nonla-z-header: 40;
|
|
67
65
|
--nonla-z-popup-base: 1000;
|
|
68
66
|
|
|
69
67
|
/* ── Aliases. Same rule: do not set. ────────────────────────────────── */
|
|
@@ -126,17 +124,13 @@
|
|
|
126
124
|
color: var(--foreground);
|
|
127
125
|
font-family: var(--nonla-font);
|
|
128
126
|
font-weight: 400;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
/* Size stays off `html`, so `1rem` and Tailwind spacing do not shrink. */
|
|
132
|
-
body {
|
|
127
|
+
/* Size stays on the host, so `1rem` and Tailwind spacing do not shrink globally. */
|
|
133
128
|
font-size: var(--nonla-base-text-size);
|
|
134
129
|
line-height: 1.6;
|
|
135
130
|
}
|
|
136
131
|
|
|
137
132
|
/* Same color keys as Config above. Brand and the label on it stay. */
|
|
138
|
-
.light
|
|
139
|
-
.light .nonla-ui:not(.dark) {
|
|
133
|
+
.nonla-ui.light {
|
|
140
134
|
color-scheme: light;
|
|
141
135
|
|
|
142
136
|
/* Light grays are Tailwind neutral. Page is white. Sidebar and cards are neutral-50. */
|
|
@@ -191,7 +185,6 @@ body {
|
|
|
191
185
|
--color-destructive: var(--destructive);
|
|
192
186
|
--color-border: var(--border);
|
|
193
187
|
--color-border-secondary: var(--border-secondary);
|
|
194
|
-
--default-border-color: var(--border);
|
|
195
188
|
--color-input: var(--input);
|
|
196
189
|
--color-input-focus: var(--input-focus);
|
|
197
190
|
--color-brand: var(--brand);
|
|
@@ -233,10 +226,8 @@ body {
|
|
|
233
226
|
|
|
234
227
|
--font-sans: var(--nonla-font);
|
|
235
228
|
--font-family-sans: var(--font-sans);
|
|
236
|
-
--default-font-family: var(--font-sans);
|
|
237
229
|
--font-mono: Menlo, Monaco, "Courier New", monospace;
|
|
238
230
|
--font-family-mono: var(--font-mono);
|
|
239
|
-
--default-mono-font-family: var(--font-mono);
|
|
240
231
|
|
|
241
232
|
--animate-fadeIn: fadeIn 0.28s ease-out both;
|
|
242
233
|
}
|
|
@@ -252,23 +243,24 @@ body {
|
|
|
252
243
|
}
|
|
253
244
|
}
|
|
254
245
|
|
|
255
|
-
/*
|
|
256
|
-
|
|
246
|
+
/* Scrollbar inside the Nonla host only. */
|
|
247
|
+
.nonla-ui,
|
|
248
|
+
.nonla-ui * {
|
|
257
249
|
scrollbar-width: thin;
|
|
258
250
|
scrollbar-color: var(--nonla-scrollbar-thumb) transparent;
|
|
259
251
|
}
|
|
260
|
-
::-webkit-scrollbar {
|
|
252
|
+
.nonla-ui ::-webkit-scrollbar {
|
|
261
253
|
width: var(--nonla-scrollbar-size);
|
|
262
254
|
height: var(--nonla-scrollbar-size);
|
|
263
255
|
}
|
|
264
|
-
::-webkit-scrollbar-track {
|
|
256
|
+
.nonla-ui ::-webkit-scrollbar-track {
|
|
265
257
|
background: transparent;
|
|
266
258
|
}
|
|
267
|
-
::-webkit-scrollbar-thumb {
|
|
259
|
+
.nonla-ui ::-webkit-scrollbar-thumb {
|
|
268
260
|
background: var(--nonla-scrollbar-thumb);
|
|
269
261
|
border-radius: 99px;
|
|
270
262
|
}
|
|
271
|
-
::-webkit-scrollbar-thumb:hover {
|
|
263
|
+
.nonla-ui ::-webkit-scrollbar-thumb:hover {
|
|
272
264
|
background: var(--nonla-scrollbar-thumb-hover);
|
|
273
265
|
}
|
|
274
266
|
|
|
@@ -567,70 +559,70 @@ body {
|
|
|
567
559
|
font-size: 11px;
|
|
568
560
|
}
|
|
569
561
|
|
|
570
|
-
/* GitHub light syntax. The imported sheet is github-dark-dimmed; these beat it under `.light`. */
|
|
571
|
-
.light .hljs-doctag,
|
|
572
|
-
.light .hljs-keyword,
|
|
573
|
-
.light .hljs-meta .hljs-keyword,
|
|
574
|
-
.light .hljs-template-tag,
|
|
575
|
-
.light .hljs-template-variable,
|
|
576
|
-
.light .hljs-type,
|
|
577
|
-
.light .hljs-variable.language_ {
|
|
562
|
+
/* GitHub light syntax. The imported sheet is github-dark-dimmed; these beat it under `.nonla-ui.light`. */
|
|
563
|
+
.nonla-ui.light .hljs-doctag,
|
|
564
|
+
.nonla-ui.light .hljs-keyword,
|
|
565
|
+
.nonla-ui.light .hljs-meta .hljs-keyword,
|
|
566
|
+
.nonla-ui.light .hljs-template-tag,
|
|
567
|
+
.nonla-ui.light .hljs-template-variable,
|
|
568
|
+
.nonla-ui.light .hljs-type,
|
|
569
|
+
.nonla-ui.light .hljs-variable.language_ {
|
|
578
570
|
color: #d73a49;
|
|
579
571
|
}
|
|
580
|
-
.light .hljs-title,
|
|
581
|
-
.light .hljs-title.class_,
|
|
582
|
-
.light .hljs-title.class_.inherited__,
|
|
583
|
-
.light .hljs-title.function_ {
|
|
572
|
+
.nonla-ui.light .hljs-title,
|
|
573
|
+
.nonla-ui.light .hljs-title.class_,
|
|
574
|
+
.nonla-ui.light .hljs-title.class_.inherited__,
|
|
575
|
+
.nonla-ui.light .hljs-title.function_ {
|
|
584
576
|
color: #6f42c1;
|
|
585
577
|
}
|
|
586
|
-
.light .hljs-attr,
|
|
587
|
-
.light .hljs-attribute,
|
|
588
|
-
.light .hljs-literal,
|
|
589
|
-
.light .hljs-meta,
|
|
590
|
-
.light .hljs-number,
|
|
591
|
-
.light .hljs-operator,
|
|
592
|
-
.light .hljs-variable,
|
|
593
|
-
.light .hljs-selector-attr,
|
|
594
|
-
.light .hljs-selector-class,
|
|
595
|
-
.light .hljs-selector-id {
|
|
578
|
+
.nonla-ui.light .hljs-attr,
|
|
579
|
+
.nonla-ui.light .hljs-attribute,
|
|
580
|
+
.nonla-ui.light .hljs-literal,
|
|
581
|
+
.nonla-ui.light .hljs-meta,
|
|
582
|
+
.nonla-ui.light .hljs-number,
|
|
583
|
+
.nonla-ui.light .hljs-operator,
|
|
584
|
+
.nonla-ui.light .hljs-variable,
|
|
585
|
+
.nonla-ui.light .hljs-selector-attr,
|
|
586
|
+
.nonla-ui.light .hljs-selector-class,
|
|
587
|
+
.nonla-ui.light .hljs-selector-id {
|
|
596
588
|
color: #005cc5;
|
|
597
589
|
}
|
|
598
|
-
.light .hljs-regexp,
|
|
599
|
-
.light .hljs-string,
|
|
600
|
-
.light .hljs-meta .hljs-string {
|
|
590
|
+
.nonla-ui.light .hljs-regexp,
|
|
591
|
+
.nonla-ui.light .hljs-string,
|
|
592
|
+
.nonla-ui.light .hljs-meta .hljs-string {
|
|
601
593
|
color: #032f62;
|
|
602
594
|
}
|
|
603
|
-
.light .hljs-built_in,
|
|
604
|
-
.light .hljs-symbol {
|
|
595
|
+
.nonla-ui.light .hljs-built_in,
|
|
596
|
+
.nonla-ui.light .hljs-symbol {
|
|
605
597
|
color: #e36209;
|
|
606
598
|
}
|
|
607
|
-
.light .hljs-comment,
|
|
608
|
-
.light .hljs-code,
|
|
609
|
-
.light .hljs-formula {
|
|
599
|
+
.nonla-ui.light .hljs-comment,
|
|
600
|
+
.nonla-ui.light .hljs-code,
|
|
601
|
+
.nonla-ui.light .hljs-formula {
|
|
610
602
|
color: #6a737d;
|
|
611
603
|
}
|
|
612
|
-
.light .hljs-name,
|
|
613
|
-
.light .hljs-quote,
|
|
614
|
-
.light .hljs-selector-tag,
|
|
615
|
-
.light .hljs-selector-pseudo {
|
|
604
|
+
.nonla-ui.light .hljs-name,
|
|
605
|
+
.nonla-ui.light .hljs-quote,
|
|
606
|
+
.nonla-ui.light .hljs-selector-tag,
|
|
607
|
+
.nonla-ui.light .hljs-selector-pseudo {
|
|
616
608
|
color: #22863a;
|
|
617
609
|
}
|
|
618
|
-
.light .hljs-subst,
|
|
619
|
-
.light .hljs-emphasis,
|
|
620
|
-
.light .hljs-strong {
|
|
610
|
+
.nonla-ui.light .hljs-subst,
|
|
611
|
+
.nonla-ui.light .hljs-emphasis,
|
|
612
|
+
.nonla-ui.light .hljs-strong {
|
|
621
613
|
color: #24292e;
|
|
622
614
|
}
|
|
623
|
-
.light .hljs-section {
|
|
615
|
+
.nonla-ui.light .hljs-section {
|
|
624
616
|
color: #005cc5;
|
|
625
617
|
}
|
|
626
|
-
.light .hljs-bullet {
|
|
618
|
+
.nonla-ui.light .hljs-bullet {
|
|
627
619
|
color: #735c0f;
|
|
628
620
|
}
|
|
629
|
-
.light .hljs-addition {
|
|
621
|
+
.nonla-ui.light .hljs-addition {
|
|
630
622
|
color: #22863a;
|
|
631
623
|
background-color: #f0fff4;
|
|
632
624
|
}
|
|
633
|
-
.light .hljs-deletion {
|
|
625
|
+
.nonla-ui.light .hljs-deletion {
|
|
634
626
|
color: #b31d28;
|
|
635
627
|
background-color: #ffeef0;
|
|
636
628
|
}
|
package/src/theme.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Paint `light` or `dark` on
|
|
2
|
+
* Paint `light` or `dark` on the Nonla host (`.nonla-ui`). Dark is the default.
|
|
3
3
|
* The stored choice may be `system`, which follows the OS and still paints one of those two.
|
|
4
|
+
*
|
|
5
|
+
* `App` binds the host via `bindColorModeTarget`. Callers can still pass an explicit
|
|
6
|
+
* `target` to `setColorMode` / `initColorMode`. Without a bound host, the fallback is
|
|
7
|
+
* `<html>` for sandboxes that mount their own root.
|
|
4
8
|
*/
|
|
5
9
|
|
|
6
10
|
export type NonlaColorMode = "light" | "dark";
|
|
7
11
|
|
|
8
|
-
/** Stored choice. `system` follows the OS and still applies `light` or `dark` on
|
|
12
|
+
/** Stored choice. `system` follows the OS and still applies `light` or `dark` on the host. */
|
|
9
13
|
export type NonlaColorPreference = NonlaColorMode | "system";
|
|
10
14
|
|
|
11
15
|
/** `localStorage` key written by `setColorMode` / `setColorPreference`. */
|
|
@@ -16,6 +20,7 @@ let mode: NonlaColorMode = "dark";
|
|
|
16
20
|
let preference: NonlaColorPreference = "dark";
|
|
17
21
|
let ready = false;
|
|
18
22
|
let schemeQuery: MediaQueryList | null = null;
|
|
23
|
+
let boundTarget: HTMLElement | null = null;
|
|
19
24
|
|
|
20
25
|
function notify() {
|
|
21
26
|
for (const listener of listeners) listener();
|
|
@@ -39,6 +44,15 @@ export function getColorPreference(): NonlaColorPreference {
|
|
|
39
44
|
return preference;
|
|
40
45
|
}
|
|
41
46
|
|
|
47
|
+
/** Host `App` paints mode on. Cleared on unmount. */
|
|
48
|
+
export function bindColorModeTarget(target: HTMLElement | null) {
|
|
49
|
+
boundTarget = target;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function colorTarget(explicit?: HTMLElement): HTMLElement {
|
|
53
|
+
return explicit ?? boundTarget ?? document.documentElement;
|
|
54
|
+
}
|
|
55
|
+
|
|
42
56
|
function readStored(): NonlaColorPreference | null {
|
|
43
57
|
try {
|
|
44
58
|
// Sandboxed iframes throw on the property access itself, before getItem.
|
|
@@ -74,12 +88,19 @@ function watchSystem() {
|
|
|
74
88
|
});
|
|
75
89
|
}
|
|
76
90
|
|
|
77
|
-
|
|
78
|
-
|
|
91
|
+
function modeFromClass(el: HTMLElement): NonlaColorMode | null {
|
|
92
|
+
if (el.classList.contains("light")) return "light";
|
|
93
|
+
if (el.classList.contains("dark")) return "dark";
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Set `light` or `dark` on `target` (bound host, or `<html>` fallback) so portals inherit the palette. */
|
|
98
|
+
export function applyColorMode(next: NonlaColorMode, target?: HTMLElement) {
|
|
79
99
|
mode = next;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
100
|
+
const el = colorTarget(target);
|
|
101
|
+
el.classList.toggle("light", next === "light");
|
|
102
|
+
el.classList.toggle("dark", next === "dark");
|
|
103
|
+
el.style.colorScheme = next;
|
|
83
104
|
notify();
|
|
84
105
|
}
|
|
85
106
|
|
|
@@ -104,13 +125,17 @@ export function setColorMode(next: NonlaColorMode, target?: HTMLElement) {
|
|
|
104
125
|
|
|
105
126
|
/** Apply the saved mode once. Falls back to dark. A stored `system` choice follows the OS. */
|
|
106
127
|
export function initColorMode(target?: HTMLElement): NonlaColorMode {
|
|
107
|
-
if (typeof document === "undefined"
|
|
128
|
+
if (typeof document === "undefined") return mode;
|
|
129
|
+
const el = colorTarget(target);
|
|
130
|
+
if (ready) {
|
|
131
|
+
applyColorMode(mode, el);
|
|
132
|
+
return mode;
|
|
133
|
+
}
|
|
108
134
|
ready = true;
|
|
109
|
-
const
|
|
110
|
-
const fromClass = root.classList.contains("light") ? "light" : root.classList.contains("dark") ? "dark" : null;
|
|
135
|
+
const fromClass = modeFromClass(el) ?? modeFromClass(document.documentElement);
|
|
111
136
|
const next = readStored() ?? fromClass ?? "dark";
|
|
112
137
|
preference = next;
|
|
113
138
|
if (next === "system") watchSystem();
|
|
114
|
-
applyColorMode(resolved(next),
|
|
139
|
+
applyColorMode(resolved(next), el);
|
|
115
140
|
return mode;
|
|
116
141
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AnchorHTMLAttributes, type CSSProperties, createElement, type HTMLAttributes, type ReactNode } from "react";
|
|
2
2
|
import { cn } from "../lib/cn";
|
|
3
|
-
import { headingClass, markdownBodyClass, markdownParagraphClass, markdownScaleStyle, pageTitleClass } from "../
|
|
3
|
+
import { headingClass, markdownBodyClass, markdownParagraphClass, markdownScaleStyle, pageTitleClass } from "../lib/markdownScale";
|
|
4
4
|
|
|
5
5
|
export type TypographyType = "secondary" | "success" | "warning" | "danger";
|
|
6
6
|
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
|
-
import { cn } from "../lib/cn";
|
|
3
|
-
import { Tooltip } from "../tooltip/Tooltip";
|
|
4
|
-
|
|
5
|
-
export function DesktopBarButton({
|
|
6
|
-
label,
|
|
7
|
-
active,
|
|
8
|
-
onClick,
|
|
9
|
-
children,
|
|
10
|
-
}: {
|
|
11
|
-
label: string;
|
|
12
|
-
active?: boolean;
|
|
13
|
-
onClick?: () => void;
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
}) {
|
|
16
|
-
return (
|
|
17
|
-
<Tooltip title={label} placement="bottom">
|
|
18
|
-
<button
|
|
19
|
-
type="button"
|
|
20
|
-
aria-label={label}
|
|
21
|
-
aria-current={active ? "true" : undefined}
|
|
22
|
-
onClick={onClick}
|
|
23
|
-
className={cn(
|
|
24
|
-
"inline-flex size-8 items-center justify-center rounded-full border-0 bg-transparent cursor-pointer",
|
|
25
|
-
active ? "bg-ink-active text-foreground" : "text-foreground/65 hover:bg-ink-hover hover:text-foreground",
|
|
26
|
-
)}
|
|
27
|
-
>
|
|
28
|
-
{children}
|
|
29
|
-
</button>
|
|
30
|
-
</Tooltip>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function DesktopBarItem({
|
|
35
|
-
label,
|
|
36
|
-
active,
|
|
37
|
-
onClick,
|
|
38
|
-
className,
|
|
39
|
-
children,
|
|
40
|
-
...rest
|
|
41
|
-
}: {
|
|
42
|
-
label?: ReactNode;
|
|
43
|
-
active?: boolean;
|
|
44
|
-
onClick?: () => void;
|
|
45
|
-
className?: string;
|
|
46
|
-
children?: ReactNode;
|
|
47
|
-
} & ButtonHTMLAttributes<HTMLButtonElement>) {
|
|
48
|
-
return (
|
|
49
|
-
<button
|
|
50
|
-
type="button"
|
|
51
|
-
aria-current={active ? "true" : undefined}
|
|
52
|
-
onClick={onClick}
|
|
53
|
-
className={cn(
|
|
54
|
-
"inline-flex h-7 items-center rounded-md border-0 bg-transparent px-2.5 text-sm font-medium leading-5 cursor-pointer",
|
|
55
|
-
active ? "bg-ink-active text-foreground" : "text-foreground/85 hover:bg-ink-hover hover:text-foreground",
|
|
56
|
-
className,
|
|
57
|
-
)}
|
|
58
|
-
{...rest}
|
|
59
|
-
>
|
|
60
|
-
{children ?? label}
|
|
61
|
-
</button>
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function DesktopBarDivider({ className }: { className?: string }) {
|
|
66
|
-
return <span className={cn("mx-2 h-4 w-px bg-border", className)} aria-hidden />;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export type DesktopHeaderProps = {
|
|
70
|
-
left?: ReactNode;
|
|
71
|
-
right?: ReactNode;
|
|
72
|
-
className?: string;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export function DesktopHeader({ left, right, className }: DesktopHeaderProps) {
|
|
76
|
-
return (
|
|
77
|
-
<header
|
|
78
|
-
className={cn(
|
|
79
|
-
"nonla-header-layer fixed inset-x-0 top-0 z-(--nonla-z-header,40) flex h-[42px] items-center justify-between gap-3 border-0 bg-background px-3",
|
|
80
|
-
className,
|
|
81
|
-
)}
|
|
82
|
-
>
|
|
83
|
-
<div className="flex min-w-0 items-center">{left}</div>
|
|
84
|
-
<div className="flex min-w-0 shrink-0 items-center">{right}</div>
|
|
85
|
-
</header>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { forwardRef, type ReactNode } from "react";
|
|
2
|
-
import { Icon } from "../icon/Icon";
|
|
3
|
-
|
|
4
|
-
const iconButtonClass =
|
|
5
|
-
"group w-[96px] flex flex-col items-center gap-0.5 py-2 px-0 rounded-md border-none cursor-pointer select-none outline-none bg-transparent focus-visible:outline-2 focus-visible:outline-brand motion-safe:transition-transform motion-safe:hover:-translate-y-0.5 motion-safe:active:scale-[0.98]";
|
|
6
|
-
|
|
7
|
-
const labelClass = "text-xs leading-[18px] font-semibold text-center line-clamp-2 w-full";
|
|
8
|
-
|
|
9
|
-
export const DesktopIcon = forwardRef<
|
|
10
|
-
HTMLButtonElement,
|
|
11
|
-
{
|
|
12
|
-
label: string;
|
|
13
|
-
media?: ReactNode;
|
|
14
|
-
active?: boolean;
|
|
15
|
-
onCard?: boolean;
|
|
16
|
-
onClick?: () => void;
|
|
17
|
-
}
|
|
18
|
-
>(function DesktopIcon({ label, media, active = false, onCard = false, onClick }, ref) {
|
|
19
|
-
return (
|
|
20
|
-
<button ref={ref} type="button" title={label} aria-label={label} aria-current={active ? "true" : undefined} dir="ltr" onClick={onClick} className={iconButtonClass}>
|
|
21
|
-
{media ?? <Icon name="stars" size={32} />}
|
|
22
|
-
<span className={`${labelClass} ${onCard ? "text-foreground" : "text-white [text-shadow:0_1px_2px_rgba(0,0,0,0.85)]"}`}>{label}</span>
|
|
23
|
-
</button>
|
|
24
|
-
);
|
|
25
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import { cn } from "../lib/cn";
|
|
3
|
-
|
|
4
|
-
export function DesktopStage({ children, className }: { children?: ReactNode; className?: string }) {
|
|
5
|
-
return <div className={cn("relative h-dvh w-screen overflow-hidden bg-background", className)}>{children}</div>;
|
|
6
|
-
}
|