@spunto/brand-kit 0.7.0 → 0.9.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.
- package/package.json +1 -1
- package/src/home/check.ts +14 -0
- package/src/home/editions/cms.json +394 -0
- package/src/home/editions/desktop.json +386 -0
- package/src/home/editions.ts +1 -1
- package/src/home/guide.ts +16 -0
- package/src/home/home.tsx +47 -0
- package/src/home/index.ts +2 -0
- package/src/home/showcase/catalog.ts +94 -0
- package/src/home/showcase/cms/board.tsx +162 -0
- package/src/home/showcase/cms/page.tsx +169 -0
- package/src/home/showcase/cms/parts.tsx +130 -0
- package/src/home/showcase/cms/sample.ts +172 -0
- package/src/home/showcase/cms/table.tsx +207 -0
- package/src/home/showcase/cms/views.tsx +166 -0
- package/src/home/showcase/desktop/desk.tsx +195 -0
- package/src/home/showcase/desktop/drive.tsx +71 -0
- package/src/home/showcase/desktop/handoff.tsx +94 -0
- package/src/home/showcase/desktop/launcher.tsx +161 -0
- package/src/home/showcase/desktop/parts.tsx +388 -0
- package/src/home/showcase/desktop/sample.ts +157 -0
- package/src/home/showcase/desktop/wall.tsx +85 -0
- package/src/home/showcase/stage.tsx +340 -0
- package/src/home/showcase/view.tsx +38 -0
- package/src/home/types.ts +17 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { FONT } from "../../../theme"
|
|
4
|
+
import { AppWindow, CodeCard, Cursor, Float, MUTED, Stage, u, useStage, type StageColors } from "../stage"
|
|
5
|
+
import { Desk } from "./desk"
|
|
6
|
+
import { AppShell, CARDS_TOP, DeskNotice, DesktopCard, HandoffAlert, heldBy, InvoicesPage, leaseOf, ROOM, SiteBrowser, TwoFactorPage, WIN, type Lang } from "./parts"
|
|
7
|
+
import { CAPTION, DESKTOPS, HANDOFF, SITE, UI } from "./sample"
|
|
8
|
+
|
|
9
|
+
/* The hand-off: the agent meets a code sent by SMS and asks for a human. The desktop's card turns red on
|
|
10
|
+
the wall, the member opens the desktop, types the code, gives the hand back — the agent carries on.
|
|
11
|
+
|
|
12
|
+
What is shown is what `POST /api/v1/leases/{id}/handoff` does (server/leases.ts): a notification on
|
|
13
|
+
the desktop's screen, the alert and its two buttons on the wall (web/src/app/Desktops.tsx), the red
|
|
14
|
+
count in the sidebar (Shell.tsx) — and `handoff` back to null once the hand is returned. */
|
|
15
|
+
|
|
16
|
+
const H = 600
|
|
17
|
+
const STILL = 2
|
|
18
|
+
/* 0 the agent is stuck · 1 it hands over · 2 the wall says so · 3 to « Ouvrir le poste » · 4 click · 5–7 the desktop, the code typed ·
|
|
19
|
+
8 signed in · 9 to « C'est fait, rendre la main » · 10 click · 11 the agent carries on · 12 fade · 13 rewind */
|
|
20
|
+
const LENGTHS = [1000, 1500, 1900, 850, 420, 800, 450, 750, 1100, 850, 420, 3400, 450, 120] as const
|
|
21
|
+
|
|
22
|
+
const GAP = 14
|
|
23
|
+
const CARD = (ROOM - GAP) / 2
|
|
24
|
+
const AT = { x: CARD + GAP, y: CARDS_TOP }
|
|
25
|
+
/* Where the alert's two buttons are, on the page. */
|
|
26
|
+
const BUTTONS = { y: AT.y + 37 + CARD * 0.75 + 60, open: AT.x + 62, back: AT.x + 186 }
|
|
27
|
+
|
|
28
|
+
export function HandoffScreen({ lang, colors, night, label }: { lang: Lang; colors: StageColors; night: boolean; label: string }) {
|
|
29
|
+
const { ref, step } = useStage(LENGTHS, STILL)
|
|
30
|
+
const lease = leaseOf("agent", lang, "il y a 3 min", "57 min")
|
|
31
|
+
const waiting = step >= 2 && step <= 10
|
|
32
|
+
const typed = step < 5 ? 0 : step === 5 ? 2 : step === 6 ? 4 : 6
|
|
33
|
+
const through = step >= 8 && step <= 12
|
|
34
|
+
const message = HANDOFF[lang]
|
|
35
|
+
|
|
36
|
+
const desk = (w: number) => (
|
|
37
|
+
<Desk w={w} name="poste-2" held={heldBy(lease, 57)} windows={[{ icon: "browser", title: through ? SITE.tab[lang] : SITE.twoFactor[lang], active: true }]}>
|
|
38
|
+
<SiteBrowser x={40} y={10} w={400} h={234} lang={lang} tab={through ? undefined : SITE.twoFactor[lang]} path={through ? undefined : "/login"}>
|
|
39
|
+
{through ? <InvoicesPage lang={lang} /> : <TwoFactorPage lang={lang} typed={typed} />}
|
|
40
|
+
</SiteBrowser>
|
|
41
|
+
<DeskNotice title={UI.handsOver(lease.holder)} body={message} show={waiting && step < 8} />
|
|
42
|
+
</Desk>
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
const pointer = step <= 2 || step >= 12 ? { x: 250, y: 300 } : step <= 8 ? { x: BUTTONS.open, y: BUTTONS.y } : { x: BUTTONS.back, y: BUTTONS.y }
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Stage stageRef={ref} colors={colors} night={night} height={H} label={label}>
|
|
49
|
+
<AppWindow {...WIN} h={H} address="desktop.spunto.net">
|
|
50
|
+
<AppShell colors={colors} count={DESKTOPS.length} handoffs={waiting ? 1 : 0}>
|
|
51
|
+
<DesktopCard x={0} y={AT.y} w={CARD} name="poste-1" tag="conversation" size="small" status="paused" lease={null} tone={colors.tone} screen={null} />
|
|
52
|
+
<DesktopCard
|
|
53
|
+
{...AT}
|
|
54
|
+
w={CARD}
|
|
55
|
+
name="poste-2"
|
|
56
|
+
tag="auto"
|
|
57
|
+
size="small"
|
|
58
|
+
status="running"
|
|
59
|
+
lease={lease}
|
|
60
|
+
tone={colors.tone}
|
|
61
|
+
screen={desk(CARD)}
|
|
62
|
+
ringed={waiting}
|
|
63
|
+
alert={<HandoffAlert holder={lease.holder} message={message} tone={colors.tone} pressed={step === 4 ? "open" : step === 10 ? "back" : undefined} show={waiting} />}
|
|
64
|
+
/>
|
|
65
|
+
<Cursor {...pointer} down={step === 4 || step === 10} hidden={step <= 2 || (step >= 5 && step <= 8) || step >= 11} ms={800} />
|
|
66
|
+
</AppShell>
|
|
67
|
+
</AppWindow>
|
|
68
|
+
|
|
69
|
+
<Float x={36} y={122} w={470} depth={70} show={step >= 5 && step <= 8} style={{ background: "#eef1ef" }}>
|
|
70
|
+
<div style={{ display: "flex", alignItems: "center", height: u(25), padding: `0 ${u(10)}`, fontSize: u(9.6), fontWeight: 600, color: MUTED }}>
|
|
71
|
+
{CAPTION.opened[lang]}
|
|
72
|
+
<span style={{ marginLeft: "auto", padding: `${u(2)} ${u(10)}`, borderRadius: u(4), background: "#ffffff", fontFamily: FONT.mono, fontWeight: 400, fontSize: u(8.6) }}>desktop.spunto.net/d/…</span>
|
|
73
|
+
</div>
|
|
74
|
+
{desk(470)}
|
|
75
|
+
</Float>
|
|
76
|
+
|
|
77
|
+
<Float x={14} y={452} w={330} depth={130} show={step >= 1 && step <= 11}>
|
|
78
|
+
<CodeCard
|
|
79
|
+
title={CAPTION.agent[lang]}
|
|
80
|
+
meta="…/api/v1/leases/$ID"
|
|
81
|
+
signal={colors.signal}
|
|
82
|
+
lines={[
|
|
83
|
+
{ text: CAPTION.handoff[lang][0], dim: true },
|
|
84
|
+
{ text: "POST …/handoff", hot: step === 1 || step === 2 },
|
|
85
|
+
{ text: ` {"message": "${message}"}` },
|
|
86
|
+
{ text: CAPTION.handoff[lang][1], dim: true, hidden: step < 2 },
|
|
87
|
+
{ text: "GET …", hidden: step < 2 },
|
|
88
|
+
{ text: ' { …, "handoff": null }', hot: true, hidden: step < 11 },
|
|
89
|
+
]}
|
|
90
|
+
/>
|
|
91
|
+
</Float>
|
|
92
|
+
</Stage>
|
|
93
|
+
)
|
|
94
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { FONT, hexAlpha } from "../../../theme"
|
|
4
|
+
import { AppWindow, Float, Icon, Stage, u, useStage, type StageColors } from "../stage"
|
|
5
|
+
import { Desk, DeskWindow, SpuntoMark, type TaskWindow } from "./desk"
|
|
6
|
+
import { DESK_WIN, type Lang } from "./parts"
|
|
7
|
+
import { CAPTION, DESK, LAUNCHER, LEASES, TERMINAL } from "./sample"
|
|
8
|
+
|
|
9
|
+
/* A desktop a member took: a real Linux desktop, and its launcher. Super + Espace opens it, what is typed
|
|
10
|
+
filters its tiles, Enter runs the one that is left — a terminal, on the desktop.
|
|
11
|
+
|
|
12
|
+
The launcher is the image's own page (desktop/branding/launcher/index.html: its tiles, its filter on a
|
|
13
|
+
tile's name and description, the first one left selected); the terminal is the capture's
|
|
14
|
+
(docs/branding/fenetres.png). */
|
|
15
|
+
|
|
16
|
+
const H = 530
|
|
17
|
+
const STILL = 1
|
|
18
|
+
/* 0 the desktop · 1 Super + Espace: the launcher · 2–3 « term » is typed · 4 Enter · 5 a terminal · 6 a command · 7 its answer · 8 fade · 9 rewind */
|
|
19
|
+
const LENGTHS = [1000, 1700, 550, 1100, 500, 800, 900, 3400, 450, 120] as const
|
|
20
|
+
|
|
21
|
+
const NAME = "poste-1"
|
|
22
|
+
const TILES = [...LAUNCHER.apps, ...LAUNCHER.spunto]
|
|
23
|
+
|
|
24
|
+
function Key({ children, lit }: { children: string; lit?: boolean }) {
|
|
25
|
+
return (
|
|
26
|
+
<span style={{ padding: `${u(0.8)} ${u(2.6)}`, borderRadius: u(1.8), border: `1px solid ${lit ? hexAlpha(DESK.signal, 0.6) : DESK.line}`, background: lit ? hexAlpha(DESK.signal, 0.14) : "rgba(255,255,255,0.04)", fontFamily: FONT.mono, fontSize: u(4.6), color: lit ? DESK.signal : DESK.muted }}>
|
|
27
|
+
{children}
|
|
28
|
+
</span>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function Tile({ tile, selected }: { tile: (typeof TILES)[number]; selected: boolean }) {
|
|
33
|
+
const accent = "accent" in tile && tile.accent
|
|
34
|
+
return (
|
|
35
|
+
<span
|
|
36
|
+
style={{
|
|
37
|
+
display: "flex",
|
|
38
|
+
flexDirection: "column",
|
|
39
|
+
gap: u(4),
|
|
40
|
+
padding: u(5.6),
|
|
41
|
+
borderRadius: u(4),
|
|
42
|
+
border: `1px solid ${selected ? "rgba(253,205,92,0.45)" : DESK.line}`,
|
|
43
|
+
background: selected ? "rgba(102,70,183,0.35)" : "rgba(255,255,255,0.04)",
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
<span style={{ display: "flex", alignItems: "center", justifyContent: "center", width: u(14), height: u(14), borderRadius: u(3.3), background: accent ? DESK.signal : "rgba(255,255,255,0.08)", color: accent ? DESK.deep : "inherit", fontSize: u(7.5), lineHeight: 1 }}>{tile.ico}</span>
|
|
47
|
+
<b style={{ fontWeight: 600, fontSize: u(5.6), lineHeight: 1.3 }}>{tile.name}</b>
|
|
48
|
+
<small style={{ fontSize: u(4.7), lineHeight: 1.35, color: DESK.muted }}>{tile.desc}</small>
|
|
49
|
+
</span>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** The launcher's page: the tiles whose name or description holds what was typed, the first of them selected. */
|
|
54
|
+
function LauncherPage({ query, holder }: { query: string; holder: string }) {
|
|
55
|
+
const kept = TILES.filter((t) => `${t.name} ${t.desc}`.toLowerCase().includes(query))
|
|
56
|
+
const section = (label: string) => <span style={{ fontFamily: FONT.mono, fontSize: u(4.4), letterSpacing: "0.08em", textTransform: "uppercase", color: DESK.muted }}>{label}</span>
|
|
57
|
+
const grid = (tiles: typeof TILES, columns: number) => (
|
|
58
|
+
<span style={{ display: "grid", gridTemplateColumns: `repeat(${columns}, 1fr)`, gap: u(4) }}>
|
|
59
|
+
{tiles
|
|
60
|
+
.filter((t) => kept.includes(t))
|
|
61
|
+
.map((t) => (
|
|
62
|
+
<Tile key={t.id} tile={t} selected={t === kept[0]} />
|
|
63
|
+
))}
|
|
64
|
+
</span>
|
|
65
|
+
)
|
|
66
|
+
return (
|
|
67
|
+
<div style={{ display: "flex", flexDirection: "column", gap: u(5.6), height: "100%", padding: `${u(9)} ${u(10)} ${u(6.5)}`, background: `radial-gradient(120% 90% at 85% 0%, ${DESK.glow} 0%, ${DESK.field} 45%, ${DESK.deep} 100%)`, color: DESK.text }}>
|
|
68
|
+
<span style={{ display: "flex", alignItems: "center", gap: u(5) }}>
|
|
69
|
+
<SpuntoMark size={15} tile={DESK.field} style={{ borderRadius: u(2.5) }} />
|
|
70
|
+
<span style={{ fontFamily: FONT.display, fontSize: u(9.2), letterSpacing: "-0.01em" }}>
|
|
71
|
+
Spunto <span style={{ color: DESK.signal }}>Desktop</span>
|
|
72
|
+
</span>
|
|
73
|
+
<span style={{ marginLeft: "auto", display: "flex", alignItems: "center", gap: u(3.3), padding: `${u(2.5)} ${u(5)}`, borderRadius: u(10), border: `1px solid ${DESK.line}`, background: "rgba(255,255,255,0.06)", fontSize: u(5), fontWeight: 500 }}>
|
|
74
|
+
<span style={{ width: u(3.3), height: u(3.3), borderRadius: "50%", background: DESK.signal, boxShadow: `0 0 ${u(4)} ${DESK.signal}` }} />
|
|
75
|
+
{LAUNCHER.reservedBy(NAME, holder)}
|
|
76
|
+
</span>
|
|
77
|
+
</span>
|
|
78
|
+
<span style={{ display: "flex", alignItems: "center", gap: u(4), height: u(20), padding: `0 ${u(6)}`, borderRadius: u(4), border: `1px solid ${DESK.signal}`, boxShadow: `0 0 0 ${u(1.3)} rgba(253,205,92,0.15)`, background: "rgba(0,0,0,0.25)", fontSize: u(6.6) }}>
|
|
79
|
+
<Icon id="search" size={7.5} color={DESK.muted} width={2} />
|
|
80
|
+
{query ? (
|
|
81
|
+
<span>
|
|
82
|
+
{query}
|
|
83
|
+
<span style={{ display: "inline-block", width: 1, height: u(8), marginLeft: u(0.6), verticalAlign: "middle", background: DESK.text }} />
|
|
84
|
+
</span>
|
|
85
|
+
) : (
|
|
86
|
+
<span style={{ color: DESK.muted }}>{LAUNCHER.placeholder}</span>
|
|
87
|
+
)}
|
|
88
|
+
<span style={{ marginLeft: "auto" }} />
|
|
89
|
+
<Key>{LAUNCHER.escape}</Key>
|
|
90
|
+
</span>
|
|
91
|
+
{section(LAUNCHER.sections[0])}
|
|
92
|
+
{grid(LAUNCHER.apps, 5)}
|
|
93
|
+
{section(LAUNCHER.sections[1])}
|
|
94
|
+
{grid(LAUNCHER.spunto, 4)}
|
|
95
|
+
<span style={{ marginTop: "auto", display: "flex", gap: u(6.6), fontSize: u(4.8), color: DESK.muted }}>
|
|
96
|
+
{LAUNCHER.keys.map((k) => (
|
|
97
|
+
<span key={k.label} style={{ display: "flex", alignItems: "center", gap: u(2.5) }}>
|
|
98
|
+
{k.keys.map((key) => (
|
|
99
|
+
<Key key={key}>{key}</Key>
|
|
100
|
+
))}
|
|
101
|
+
{k.label}
|
|
102
|
+
</span>
|
|
103
|
+
))}
|
|
104
|
+
</span>
|
|
105
|
+
</div>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function LauncherScreen({ lang, colors, night, label }: { lang: Lang; colors: StageColors; night: boolean; label: string }) {
|
|
110
|
+
const { ref, step } = useStage(LENGTHS, STILL)
|
|
111
|
+
const holder = LEASES.human.holder[lang]
|
|
112
|
+
const launcher = step >= 1 && step <= 3
|
|
113
|
+
const terminal = step >= 5 && step <= 7
|
|
114
|
+
const query = step === 2 ? LAUNCHER.query.slice(0, 2) : step === 3 || step === 4 ? LAUNCHER.query : ""
|
|
115
|
+
const windows: TaskWindow[] = launcher ? [{ icon: "launcher", title: LAUNCHER.title, active: true }] : terminal ? [{ icon: "terminal", title: TERMINAL.title, active: true }] : []
|
|
116
|
+
const pressed = step === 1 ? LAUNCHER.keys[0].keys : step === 2 ? LAUNCHER.query.slice(0, 2).split("") : step === 3 ? LAUNCHER.query.split("") : ["↵"]
|
|
117
|
+
const prompt = <span style={{ color: DESK.free }}>{TERMINAL.prompt}</span>
|
|
118
|
+
const caret = <span style={{ display: "inline-block", width: u(3.4), height: u(7), marginLeft: u(1.5), verticalAlign: "text-bottom", background: DESK.text }} />
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<Stage stageRef={ref} colors={colors} night={night} height={H} label={label}>
|
|
122
|
+
<AppWindow {...DESK_WIN} h={H} address="desktop.spunto.net/d/…">
|
|
123
|
+
<Desk w={DESK_WIN.w} name={NAME} held={{ kind: "human", holder, minutes: 95 }} windows={windows}>
|
|
124
|
+
<DeskWindow x={70} y={6} w={340} h={244} title={LAUNCHER.title} show={launcher} z={3}>
|
|
125
|
+
<LauncherPage query={query} holder={holder} />
|
|
126
|
+
</DeskWindow>
|
|
127
|
+
<DeskWindow x={112} y={22} w={300} h={170} title={TERMINAL.title} show={terminal}>
|
|
128
|
+
<div style={{ height: "100%", padding: `${u(7)} ${u(8)}`, background: "#120d21", fontFamily: FONT.mono, fontSize: u(6.3), lineHeight: 1.55, color: DESK.text, whiteSpace: "pre" }}>
|
|
129
|
+
<div>
|
|
130
|
+
{prompt} {step >= 6 && TERMINAL.command(NAME)}
|
|
131
|
+
{step < 7 && caret}
|
|
132
|
+
</div>
|
|
133
|
+
{step >= 7 && (
|
|
134
|
+
<>
|
|
135
|
+
{TERMINAL.output(NAME).map((line) => (
|
|
136
|
+
<div key={line}>{line}</div>
|
|
137
|
+
))}
|
|
138
|
+
<div>
|
|
139
|
+
{prompt}
|
|
140
|
+
{caret}
|
|
141
|
+
</div>
|
|
142
|
+
</>
|
|
143
|
+
)}
|
|
144
|
+
</div>
|
|
145
|
+
</DeskWindow>
|
|
146
|
+
</Desk>
|
|
147
|
+
</AppWindow>
|
|
148
|
+
|
|
149
|
+
<Float x={688} y={428} w={216} depth={170} show={step >= 1 && step <= 4} style={{ background: "#150f27" }}>
|
|
150
|
+
<div style={{ padding: `${u(7)} ${u(12)}`, borderBottom: `1px solid ${DESK.line}`, fontSize: u(9.6), fontWeight: 600, color: DESK.muted }}>{CAPTION.keyboard[lang]}</div>
|
|
151
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(5), height: u(40), padding: `0 ${u(12)}` }}>
|
|
152
|
+
{pressed.map((key, i) => (
|
|
153
|
+
<span key={i} style={{ minWidth: u(22), padding: `${u(3.5)} ${u(7)}`, borderRadius: u(4), border: `1px solid ${hexAlpha(DESK.signal, 0.55)}`, background: hexAlpha(DESK.signal, 0.14), fontFamily: FONT.mono, fontSize: u(10.5), textAlign: "center", color: DESK.signal }}>
|
|
154
|
+
{key}
|
|
155
|
+
</span>
|
|
156
|
+
))}
|
|
157
|
+
</div>
|
|
158
|
+
</Float>
|
|
159
|
+
</Stage>
|
|
160
|
+
)
|
|
161
|
+
}
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import type { CSSProperties, ReactNode } from "react"
|
|
4
|
+
import { FONT, hexAlpha } from "../../../theme"
|
|
5
|
+
import { Icon, INK, LINE, MUTED, u, type IconId, type StageColors } from "../stage"
|
|
6
|
+
import { DeskBrowser, SpuntoMark, type Held } from "./desk"
|
|
7
|
+
import { DESK, LEASES, SITE, UI } from "./sample"
|
|
8
|
+
|
|
9
|
+
/* What the Desktop screens share: the app's shell (sidebar, the head of the « Postes » page), the card
|
|
10
|
+
of a desktop on the wall — head, live screen, lease — and the pages its browser is on.
|
|
11
|
+
Positions are the window's design pixels. */
|
|
12
|
+
|
|
13
|
+
export type Lang = "en" | "fr"
|
|
14
|
+
|
|
15
|
+
/** The app's window on the 920-wide board, and the one a whole desktop is opened in. */
|
|
16
|
+
export const WIN = { x: 24, y: 30, w: 872 }
|
|
17
|
+
export const DESK_WIN = { x: 40, y: 32, w: 840 }
|
|
18
|
+
export const SIDEBAR = 124
|
|
19
|
+
export const PAD = 16
|
|
20
|
+
/** Where the cards start under the page's head, and the room they share. */
|
|
21
|
+
export const CARDS_TOP = 96
|
|
22
|
+
export const ROOM = WIN.w - SIDEBAR - PAD * 2
|
|
23
|
+
|
|
24
|
+
const RED = "#d13b3b"
|
|
25
|
+
const GREEN = "#1d8a55"
|
|
26
|
+
const BLUE = "#2f6fd0"
|
|
27
|
+
const NIGHT = "#161226"
|
|
28
|
+
|
|
29
|
+
const NAV_ICON: IconId[] = ["monitor", "layers", "history", "card", "key", "people", "book"]
|
|
30
|
+
|
|
31
|
+
/** The sidebar and the head of the page. `handoffs`: desktops waiting for a human — the count turns into a red badge. */
|
|
32
|
+
export function AppShell({ colors, count, handoffs = 0, children }: { colors: StageColors; count: number; handoffs?: number; children: ReactNode }) {
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
<div style={{ position: "absolute", left: 0, top: 0, bottom: 0, width: u(SIDEBAR), background: "#f6f5f9", borderRight: `1px solid ${LINE}` }}>
|
|
36
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(6), margin: `${u(14)} ${u(10)} 0`, fontFamily: FONT.display, fontSize: u(10.6), whiteSpace: "nowrap" }}>
|
|
37
|
+
<SpuntoMark size={15} tile={colors.signal} ink={colors.field} alt={colors.field} style={{ borderRadius: u(3) }} />
|
|
38
|
+
{UI.brand}
|
|
39
|
+
</div>
|
|
40
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(6), height: u(26), margin: `${u(11)} ${u(9)} 0`, padding: `0 ${u(7)}`, border: `1px solid ${LINE}`, borderRadius: u(5), background: "#ffffff", fontSize: u(10.4), fontWeight: 550 }}>
|
|
41
|
+
<span style={{ display: "flex", alignItems: "center", justifyContent: "center", width: u(14), height: u(14), borderRadius: u(3), background: colors.tone, color: "#ffffff", fontSize: u(8.4), fontWeight: 650 }}>{UI.org[0]}</span>
|
|
42
|
+
{UI.org}
|
|
43
|
+
<Icon id="chevron" size={10} color={MUTED} style={{ marginLeft: "auto" }} />
|
|
44
|
+
</div>
|
|
45
|
+
<div style={{ margin: `${u(13)} ${u(9)} 0`, display: "flex", flexDirection: "column", gap: u(1) }}>
|
|
46
|
+
{UI.nav.map((label, i) => (
|
|
47
|
+
<div key={label} style={{ display: "flex", alignItems: "center", gap: u(7), height: u(23), padding: `0 ${u(7)}`, borderRadius: u(5), background: i === 0 ? hexAlpha(colors.tone, 0.1) : "transparent", fontSize: u(10.4), fontWeight: i === 0 ? 550 : 450, color: i === 0 ? INK : MUTED, whiteSpace: "nowrap" }}>
|
|
48
|
+
<Icon id={NAV_ICON[i]} size={11} color={i === 0 ? colors.tone : MUTED} />
|
|
49
|
+
{label}
|
|
50
|
+
{i === 0 && (
|
|
51
|
+
<span
|
|
52
|
+
style={{
|
|
53
|
+
marginLeft: "auto",
|
|
54
|
+
padding: handoffs ? `0 ${u(4.5)}` : 0,
|
|
55
|
+
borderRadius: u(8),
|
|
56
|
+
background: handoffs ? RED : "transparent",
|
|
57
|
+
color: handoffs ? "#ffffff" : MUTED,
|
|
58
|
+
fontFamily: FONT.mono,
|
|
59
|
+
fontSize: u(8.6),
|
|
60
|
+
fontWeight: 400,
|
|
61
|
+
transition: "background 0.3s ease, color 0.3s ease",
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
{handoffs || count}
|
|
65
|
+
</span>
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
))}
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
<div style={{ position: "absolute", left: u(SIDEBAR + PAD), top: 0, width: u(ROOM), height: "100%" }}>
|
|
72
|
+
<div style={{ position: "absolute", top: u(17), fontFamily: FONT.display, fontSize: u(24), lineHeight: 1.1, letterSpacing: "-0.01em" }}>{UI.title}</div>
|
|
73
|
+
<div style={{ position: "absolute", top: u(50), width: u(470), fontSize: u(9.6), lineHeight: 1.45, color: MUTED }}>{UI.description}</div>
|
|
74
|
+
<div style={{ position: "absolute", right: 0, top: u(52) }}>
|
|
75
|
+
<Btn kind="primary" tone={colors.tone}>
|
|
76
|
+
<Icon id="plus" size={10} />
|
|
77
|
+
{UI.create}
|
|
78
|
+
</Btn>
|
|
79
|
+
</div>
|
|
80
|
+
{children}
|
|
81
|
+
</div>
|
|
82
|
+
</>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function Btn({ kind = "outline", tone, pressed, children }: { kind?: "primary" | "outline" | "ghost"; tone: string; pressed?: boolean; children: ReactNode }) {
|
|
87
|
+
return (
|
|
88
|
+
<span
|
|
89
|
+
style={{
|
|
90
|
+
display: "inline-flex",
|
|
91
|
+
alignItems: "center",
|
|
92
|
+
gap: u(4),
|
|
93
|
+
flexShrink: 0,
|
|
94
|
+
height: u(20),
|
|
95
|
+
padding: `0 ${u(7.5)}`,
|
|
96
|
+
borderRadius: u(4.5),
|
|
97
|
+
border: `1px solid ${kind === "outline" ? LINE : "transparent"}`,
|
|
98
|
+
background: kind === "primary" ? tone : kind === "outline" ? "#ffffff" : "transparent",
|
|
99
|
+
color: kind === "primary" ? "#ffffff" : INK,
|
|
100
|
+
fontSize: u(9.2),
|
|
101
|
+
fontWeight: 550,
|
|
102
|
+
whiteSpace: "nowrap",
|
|
103
|
+
transform: pressed ? "scale(0.95)" : "none",
|
|
104
|
+
filter: pressed ? "brightness(0.9)" : "none",
|
|
105
|
+
transition: "transform 0.15s ease, filter 0.15s ease",
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
{children}
|
|
109
|
+
</span>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type Status = "running" | "paused" | "waking"
|
|
114
|
+
|
|
115
|
+
const PILL: Record<Status, { bg: string; fg: string }> = {
|
|
116
|
+
running: { bg: hexAlpha(GREEN, 0.12), fg: GREEN },
|
|
117
|
+
paused: { bg: "#eeedf2", fg: MUTED },
|
|
118
|
+
waking: { bg: hexAlpha(BLUE, 0.12), fg: BLUE },
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function StatusPill({ status }: { status: Status }) {
|
|
122
|
+
const p = PILL[status]
|
|
123
|
+
return (
|
|
124
|
+
<span style={{ display: "inline-flex", alignItems: "center", gap: u(4), flexShrink: 0, height: u(16), padding: `0 ${u(5.5)}`, borderRadius: u(9), background: p.bg, color: p.fg, fontSize: u(8.2), fontWeight: 550, whiteSpace: "nowrap", transition: "background 0.3s ease, color 0.3s ease" }}>
|
|
125
|
+
{status === "waking" ? <Spinner size={7.5} color={p.fg} /> : <span style={{ width: u(4.5), height: u(4.5), borderRadius: "50%", background: "currentColor" }} />}
|
|
126
|
+
{UI.status[status]}
|
|
127
|
+
</span>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function Spinner({ size, color }: { size: number; color: string }) {
|
|
132
|
+
return (
|
|
133
|
+
<svg viewBox="0 0 16 16" fill="none" stroke={color} strokeWidth="2" strokeLinecap="round" style={{ display: "block", flexShrink: 0, width: u(size), height: u(size) }}>
|
|
134
|
+
<circle cx="8" cy="8" r="6" opacity="0.25" />
|
|
135
|
+
<path d="M8 2a6 6 0 0 1 6 6" />
|
|
136
|
+
</svg>
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export type CardLease = { kind: "agent" | "human"; holder: string; purpose: string | null; taken: string; left: string }
|
|
141
|
+
|
|
142
|
+
/** A lease of the sample, as a card prints it. */
|
|
143
|
+
export const leaseOf = (key: keyof typeof LEASES, lang: Lang, taken: string, left: string): CardLease => {
|
|
144
|
+
const l = LEASES[key]
|
|
145
|
+
return { kind: l.kind, holder: l.holder[lang], purpose: l.purpose ? l.purpose[lang] : null, taken, left }
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** What the desktop's own taskbar says of the same lease. */
|
|
149
|
+
export const heldBy = (lease: CardLease | null, minutes: number): Held => (lease ? { kind: lease.kind, holder: lease.holder, minutes } : null)
|
|
150
|
+
|
|
151
|
+
/** The card of a desktop on the wall: its head, its screen (4:3, the image inside as it comes), an alert when its
|
|
152
|
+
holder hands over, and who holds it — or what one can do with it when nobody does. */
|
|
153
|
+
export function DesktopCard({
|
|
154
|
+
x,
|
|
155
|
+
y,
|
|
156
|
+
w,
|
|
157
|
+
name,
|
|
158
|
+
tag,
|
|
159
|
+
size,
|
|
160
|
+
status,
|
|
161
|
+
lease,
|
|
162
|
+
tone,
|
|
163
|
+
screen,
|
|
164
|
+
alert,
|
|
165
|
+
ringed,
|
|
166
|
+
foot = 62,
|
|
167
|
+
}: {
|
|
168
|
+
x: number
|
|
169
|
+
y: number
|
|
170
|
+
w: number
|
|
171
|
+
name: string
|
|
172
|
+
tag: string
|
|
173
|
+
size: string
|
|
174
|
+
status: Status
|
|
175
|
+
lease: CardLease | null
|
|
176
|
+
tone: string
|
|
177
|
+
/** The desktop's screen while it runs: the wall reloads its image every two seconds. */
|
|
178
|
+
screen: ReactNode
|
|
179
|
+
/** What comes between the screen and the lease: the hand-off's alert. `ringed`: the card says it is waiting for someone. */
|
|
180
|
+
alert?: ReactNode
|
|
181
|
+
ringed?: boolean
|
|
182
|
+
foot?: number
|
|
183
|
+
}) {
|
|
184
|
+
const live = w * 0.75
|
|
185
|
+
return (
|
|
186
|
+
<div
|
|
187
|
+
style={{
|
|
188
|
+
position: "absolute",
|
|
189
|
+
left: u(x),
|
|
190
|
+
top: u(y),
|
|
191
|
+
width: u(w),
|
|
192
|
+
borderRadius: u(8),
|
|
193
|
+
border: `1px solid ${ringed ? RED : LINE}`,
|
|
194
|
+
boxShadow: `0 0 0 ${u(2.5)} ${hexAlpha(RED, ringed ? 0.28 : 0)}`,
|
|
195
|
+
background: "#ffffff",
|
|
196
|
+
overflow: "hidden",
|
|
197
|
+
transition: "border-color 0.3s ease, box-shadow 0.3s ease",
|
|
198
|
+
}}
|
|
199
|
+
>
|
|
200
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(4), height: u(36), padding: `0 ${u(8)}` }}>
|
|
201
|
+
<Icon id="monitor" size={11} color={MUTED} />
|
|
202
|
+
<span style={{ fontSize: u(10.4), fontWeight: 550, whiteSpace: "nowrap" }}>{name}</span>
|
|
203
|
+
<span style={{ padding: `${u(1)} ${u(4)}`, borderRadius: u(3.5), background: "#eeedf2", fontSize: u(7.8), fontWeight: 550, whiteSpace: "nowrap" }}>{tag}</span>
|
|
204
|
+
<span style={{ fontFamily: FONT.mono, fontSize: u(7.4), color: MUTED }}>{size}</span>
|
|
205
|
+
<span style={{ marginLeft: "auto" }} />
|
|
206
|
+
<StatusPill status={status} />
|
|
207
|
+
<Icon id="more" size={10} color={MUTED} width={2.6} style={{ marginLeft: u(-1) }} />
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<div style={{ position: "relative", height: u(live), background: NIGHT, overflow: "hidden" }}>
|
|
211
|
+
<div style={{ position: "absolute", left: 0, top: u((live - w * 0.5625) / 2), opacity: status === "running" ? 1 : 0, transition: "opacity 0.35s ease" }}>{screen}</div>
|
|
212
|
+
<div style={{ position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", gap: u(6), padding: `0 ${u(16)}`, textAlign: "center", fontSize: u(9.6), lineHeight: 1.45, color: "rgba(255,255,255,0.62)", opacity: status === "running" ? 0 : 1, transition: "opacity 0.3s ease" }}>
|
|
213
|
+
{status === "waking" ? (
|
|
214
|
+
<>
|
|
215
|
+
<Spinner size={10} color="rgba(255,255,255,0.7)" />
|
|
216
|
+
{UI.waking}
|
|
217
|
+
</>
|
|
218
|
+
) : (
|
|
219
|
+
<span>
|
|
220
|
+
{UI.paused[0]}
|
|
221
|
+
<br />
|
|
222
|
+
{UI.paused[1]}
|
|
223
|
+
</span>
|
|
224
|
+
)}
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
{alert}
|
|
229
|
+
|
|
230
|
+
<div style={{ display: "flex", flexDirection: "column", justifyContent: "center", gap: u(5), height: u(foot), padding: `0 ${u(10)}`, borderTop: `1px solid ${LINE}`, fontSize: u(9.8) }}>
|
|
231
|
+
{lease ? (
|
|
232
|
+
<>
|
|
233
|
+
<span style={{ display: "flex", alignItems: "center", gap: u(5), whiteSpace: "nowrap" }}>
|
|
234
|
+
<Icon id={lease.kind === "human" ? "person" : "bot"} size={11.5} color={MUTED} />
|
|
235
|
+
<span style={{ fontWeight: 550 }}>{lease.holder}</span>
|
|
236
|
+
{lease.purpose && <span style={{ color: MUTED }}>· {lease.purpose}</span>}
|
|
237
|
+
</span>
|
|
238
|
+
<span style={{ display: "flex", alignItems: "center", gap: u(3.5), fontSize: u(8.4), color: MUTED, whiteSpace: "nowrap" }}>
|
|
239
|
+
<Icon id="clock" size={8.5} />
|
|
240
|
+
{UI.taken(lease.taken, lease.left)}
|
|
241
|
+
<span style={{ marginLeft: "auto" }} />
|
|
242
|
+
<Btn tone={tone}>{UI.release}</Btn>
|
|
243
|
+
</span>
|
|
244
|
+
</>
|
|
245
|
+
) : (
|
|
246
|
+
<>
|
|
247
|
+
<span style={{ display: "flex", alignItems: "center", gap: u(6), whiteSpace: "nowrap" }}>
|
|
248
|
+
<span style={{ color: MUTED }}>{status === "running" ? UI.free : UI.freePaused}</span>
|
|
249
|
+
<span style={{ marginLeft: "auto" }} />
|
|
250
|
+
{status !== "running" && <Btn kind="ghost" tone={tone}>{UI.wake}</Btn>}
|
|
251
|
+
</span>
|
|
252
|
+
<span style={{ display: "flex", justifyContent: "flex-end", gap: u(6) }}>
|
|
253
|
+
<Btn tone={tone}>
|
|
254
|
+
<Icon id="external" size={9.5} />
|
|
255
|
+
{UI.open}
|
|
256
|
+
</Btn>
|
|
257
|
+
<Btn kind="primary" tone={tone}>
|
|
258
|
+
{UI.take}
|
|
259
|
+
</Btn>
|
|
260
|
+
</span>
|
|
261
|
+
</>
|
|
262
|
+
)}
|
|
263
|
+
</div>
|
|
264
|
+
</div>
|
|
265
|
+
)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/** The alert under a desktop's screen when its holder hands over. */
|
|
269
|
+
export function HandoffAlert({ holder, message, tone, pressed, show }: { holder: string; message: string; tone: string; pressed?: "open" | "back"; show: boolean }) {
|
|
270
|
+
return (
|
|
271
|
+
<div style={{ maxHeight: show ? u(90) : 0, overflow: "hidden", transition: "max-height 0.45s cubic-bezier(0.3, 0.7, 0.2, 1)" }}>
|
|
272
|
+
<div style={{ padding: `${u(10)} ${u(12)} ${u(11)}`, borderTop: `1px solid ${hexAlpha(RED, 0.35)}`, background: hexAlpha(RED, 0.06) }}>
|
|
273
|
+
<div style={{ fontSize: u(10.8), fontWeight: 650, color: RED }}>{UI.handsOver(holder)}</div>
|
|
274
|
+
<div style={{ marginTop: u(2), fontSize: u(10), color: INK }}>{message}</div>
|
|
275
|
+
<div style={{ display: "flex", gap: u(6), marginTop: u(7) }}>
|
|
276
|
+
<Btn kind="primary" tone={tone} pressed={pressed === "open"}>
|
|
277
|
+
<Icon id="external" size={9.5} />
|
|
278
|
+
{UI.openDesktop}
|
|
279
|
+
</Btn>
|
|
280
|
+
<Btn tone={tone} pressed={pressed === "back"}>
|
|
281
|
+
{UI.giveBack}
|
|
282
|
+
</Btn>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
)
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const bar = (w: number, style?: CSSProperties) => <span style={{ display: "block", width: u(w), height: u(3.4), borderRadius: u(2), background: "#e3e2ea", ...style }} />
|
|
290
|
+
|
|
291
|
+
/** A page nobody needs to read: whatever site a desktop is on. */
|
|
292
|
+
export function PlainPage({ feed }: { feed?: boolean }) {
|
|
293
|
+
return (
|
|
294
|
+
<div style={{ padding: `${u(12)} ${u(14)}`, display: "flex", flexDirection: "column", gap: u(6) }}>
|
|
295
|
+
{bar(70, { height: u(7), background: "#cfcdda" })}
|
|
296
|
+
{feed ? (
|
|
297
|
+
[0, 1, 2, 3].map((i) => (
|
|
298
|
+
<span key={i} style={{ display: "flex", alignItems: "center", gap: u(7), marginTop: u(3) }}>
|
|
299
|
+
<span style={{ width: u(26), height: u(20), borderRadius: u(2.5), background: "#eceaf3" }} />
|
|
300
|
+
<span style={{ display: "flex", flexDirection: "column", gap: u(4) }}>
|
|
301
|
+
{bar([118, 96, 132, 104][i], { background: "#d6d4e0" })}
|
|
302
|
+
{bar([150, 164, 122, 140][i])}
|
|
303
|
+
</span>
|
|
304
|
+
</span>
|
|
305
|
+
))
|
|
306
|
+
) : (
|
|
307
|
+
<>
|
|
308
|
+
{[150, 132, 160, 96].map((w, i) => (
|
|
309
|
+
<span key={i}>{bar(w)}</span>
|
|
310
|
+
))}
|
|
311
|
+
<span style={{ display: "flex", gap: u(6), marginTop: u(4) }}>
|
|
312
|
+
{[0, 1, 2].map((i) => (
|
|
313
|
+
<span key={i} style={{ width: u(46), height: u(30), borderRadius: u(3), background: "#eceaf3" }} />
|
|
314
|
+
))}
|
|
315
|
+
</span>
|
|
316
|
+
</>
|
|
317
|
+
)}
|
|
318
|
+
</div>
|
|
319
|
+
)
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/** The page the agent works on: a back office where the member signed in — invoices, and an export behind a button. */
|
|
323
|
+
export function InvoicesPage({ lang, aim, pressed, downloaded }: { lang: Lang; aim?: boolean; pressed?: boolean; downloaded?: boolean }) {
|
|
324
|
+
return (
|
|
325
|
+
<>
|
|
326
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(6), padding: `${u(9)} ${u(12)} ${u(7)}` }}>
|
|
327
|
+
<span style={{ fontSize: u(10), fontWeight: 650, letterSpacing: "-0.01em" }}>{SITE.title[lang]}</span>
|
|
328
|
+
<span style={{ display: "flex", alignItems: "center", gap: u(3), padding: `${u(1)} ${u(4.5)}`, borderRadius: u(6), background: "#e4f5ea", color: "#17693f", fontSize: u(4.8), fontWeight: 600 }}>
|
|
329
|
+
<span style={{ width: u(3), height: u(3), borderRadius: "50%", background: "currentColor" }} />
|
|
330
|
+
{SITE.signedIn[lang]}
|
|
331
|
+
</span>
|
|
332
|
+
<span style={{ marginLeft: "auto", display: "flex", alignItems: "center", height: u(11), padding: `0 ${u(6)}`, borderRadius: u(2.5), background: "#1c1b22", color: "#ffffff", fontSize: u(5.2), fontWeight: 600, transform: pressed ? "scale(0.92)" : "none", boxShadow: aim || pressed ? `0 0 0 ${u(1.2)} #ffffff, 0 0 0 ${u(2.6)} ${DESK.primary}, 0 0 0 ${u(pressed ? 8 : 5)} ${hexAlpha(DESK.primary, 0.22)}` : `0 0 0 0 #ffffff, 0 0 0 0 ${DESK.primary}, 0 0 0 0 ${hexAlpha(DESK.primary, 0)}`, transition: "transform 0.15s ease, box-shadow 0.3s ease" }}>{SITE.export[lang]}</span>
|
|
333
|
+
</div>
|
|
334
|
+
<div style={{ margin: `0 ${u(12)}`, border: "1px solid #e3e2ea", borderRadius: u(3) }}>
|
|
335
|
+
{[SITE.columns[lang], ...SITE.rows].map((row, i) => (
|
|
336
|
+
<div key={i} style={{ display: "flex", alignItems: "center", height: u(11.5), padding: `0 ${u(7)}`, borderTop: i ? "1px solid #eceaf1" : "none", background: i ? "transparent" : "#f5f4f8", fontSize: u(5.2), fontWeight: i ? 450 : 600, color: i ? "#1c1b22" : "#6a6878", fontVariantNumeric: "tabular-nums" }}>
|
|
337
|
+
<span style={{ width: u(46) }}>{row[0]}</span>
|
|
338
|
+
<span style={{ flex: 1, fontFamily: i ? FONT.mono : "inherit", fontSize: i ? u(4.9) : "inherit" }}>{row[1]}</span>
|
|
339
|
+
<span>{row[2]}</span>
|
|
340
|
+
</div>
|
|
341
|
+
))}
|
|
342
|
+
</div>
|
|
343
|
+
<div style={{ position: "absolute", left: 0, right: 0, bottom: 0, height: u(15), display: "flex", alignItems: "center", padding: `0 ${u(8)}`, background: "#f1f0f5", borderTop: "1px solid #dddbe6", transform: downloaded ? "none" : "translateY(100%)", transition: "transform 0.35s ease" }}>
|
|
344
|
+
<span style={{ display: "flex", alignItems: "center", gap: u(4), height: u(10), padding: `0 ${u(6)}`, borderRadius: u(2.5), border: "1px solid #d6d4e0", background: "#ffffff", fontSize: u(5.2), fontWeight: 550 }}>
|
|
345
|
+
<Icon id="download" size={6} color="#2f6fe0" width={2.4} />
|
|
346
|
+
{SITE.file[lang]}
|
|
347
|
+
</span>
|
|
348
|
+
</div>
|
|
349
|
+
</>
|
|
350
|
+
)
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/** The page that stops an agent: a code sent to the member's phone. `typed`: how many of its six digits are in. */
|
|
354
|
+
export function TwoFactorPage({ lang, typed }: { lang: Lang; typed: number }) {
|
|
355
|
+
return (
|
|
356
|
+
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", gap: u(6), paddingTop: u(20), textAlign: "center" }}>
|
|
357
|
+
<span style={{ fontSize: u(12), fontWeight: 650, letterSpacing: "-0.01em" }}>{SITE.twoFactor[lang]}</span>
|
|
358
|
+
<span style={{ fontSize: u(6.6), color: "#6a6878" }}>{SITE.twoFactorText[lang]}</span>
|
|
359
|
+
<span style={{ display: "flex", gap: u(5), marginTop: u(7) }}>
|
|
360
|
+
{"481502".split("").map((d, i) => (
|
|
361
|
+
<span key={i} style={{ display: "flex", alignItems: "center", justifyContent: "center", width: u(21), height: u(27), borderRadius: u(3), border: `1px solid ${i === typed ? "#2f6fe0" : "#d6d4e0"}`, boxShadow: i === typed ? `0 0 0 ${u(1.6)} rgba(47,111,224,0.2)` : "none", fontFamily: FONT.mono, fontSize: u(13), fontWeight: 600 }}>
|
|
362
|
+
<span style={{ opacity: i < typed ? 1 : 0, transition: "opacity 0.15s ease" }}>{d}</span>
|
|
363
|
+
</span>
|
|
364
|
+
))}
|
|
365
|
+
</span>
|
|
366
|
+
<span style={{ display: "flex", alignItems: "center", height: u(16), marginTop: u(8), padding: `0 ${u(16)}`, borderRadius: u(3), background: typed >= 6 ? "#1c1b22" : "#b9b7c4", color: "#ffffff", fontSize: u(6.8), fontWeight: 600, transition: "background 0.3s ease" }}>{SITE.confirm[lang]}</span>
|
|
367
|
+
</div>
|
|
368
|
+
)
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/** The desktop's browser on the agent's site: on its invoices unless told otherwise. */
|
|
372
|
+
export function SiteBrowser({ x, y, w, h, lang, tab, path = "/invoices", show, children }: { x: number; y: number; w: number; h: number; lang: Lang; tab?: string; path?: string; show?: boolean; children: ReactNode }) {
|
|
373
|
+
return (
|
|
374
|
+
<DeskBrowser x={x} y={y} w={w} h={h} tab={tab ?? SITE.tab[lang]} address={SITE.host + path} show={show}>
|
|
375
|
+
{children}
|
|
376
|
+
</DeskBrowser>
|
|
377
|
+
)
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/** The notification a hand-off puts on the desktop's own screen (`/ops/notify`: its title and the agent's message). */
|
|
381
|
+
export function DeskNotice({ title, body, show }: { title: string; body: string; show: boolean }) {
|
|
382
|
+
return (
|
|
383
|
+
<div style={{ position: "absolute", right: u(8), top: u(8), width: u(150), zIndex: 5, padding: `${u(7)} ${u(9)}`, borderRadius: u(4), background: DESK.panel, boxShadow: `0 ${u(8)} ${u(20)} ${u(-6)} rgba(0,0,0,0.7), 0 0 0 1px ${hexAlpha(DESK.signal, 0.5)}`, opacity: show ? 1 : 0, transform: show ? "none" : `translateX(${u(12)})`, transition: "opacity 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2)" }}>
|
|
384
|
+
<div style={{ fontSize: u(6.4), fontWeight: 650, color: DESK.text }}>{title}</div>
|
|
385
|
+
<div style={{ marginTop: u(2), fontSize: u(5.8), color: DESK.muted }}>{body}</div>
|
|
386
|
+
</div>
|
|
387
|
+
)
|
|
388
|
+
}
|