/* Upstage Console UI kit — screens composed from design-system primitives.
Consumed by index.html via Babel. Exposes screens on window. */
const DS = window.UpstageDesignSystem_bdeb42;
const { Button, IconButton, Input, Select, Checkbox, Switch, Badge, Banner, Card, Table, Tabs, Tooltip, Sidebar, Nav } = DS;
/* --- Lucide-style inline icons (1.5px stroke) --- */
const Icon = ({ d, extra }) => (
);
const KeyIcon = () => ;
const PlayIcon = () => ;
const ChartIcon = () => ;
const CopyIcon = () => } />;
const TrashIcon = () => ;
const consoleStyles = {
page: { display: "flex", flexDirection: "column", height: "100vh", background: "hsl(var(--subtle))", fontFamily: "var(--font-sans)" },
body: { display: "flex", flex: 1, minHeight: 0 },
content: { flex: 1, overflow: "auto", padding: "32px 36px" },
title: { margin: "0 0 6px", fontSize: 24, fontWeight: 500, letterSpacing: "-0.02em", color: "hsl(var(--foreground))" },
lede: { margin: 0, fontSize: 14, color: "hsl(var(--muted-foreground))", maxWidth: 620 },
headRow: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 18, marginBottom: 24 },
};
function PageHead({ title, lede, action }) {
return (
);
}
/* --- API Keys screen --- */
function ApiKeysScreen() {
const [keys, setKeys] = React.useState([
{ name: "prod-server", key: "up_****3f8a", created: "2026-05-02", status: "Active" },
{ name: "staging", key: "up_****91c2", created: "2026-06-11", status: "Active" },
{ name: "legacy-batch", key: "up_****77d0", created: "2025-11-19", status: "Paused" },
]);
const [name, setName] = React.useState("");
const [showForm, setShowForm] = React.useState(false);
const addKey = () => {
if (!name.trim()) return;
setKeys([{ name: name.trim(), key: "up_****" + Math.random().toString(16).slice(2, 6), created: "2026-07-08", status: "Active" }, ...keys]);
setName("");
setShowForm(false);
};
return (
setShowForm(!showForm)}>Create API key}
/>
Free tier is capped at 60 requests per minute per key.
{showForm && (
setName(e.target.value)} />
)}
({
name: {k.name},
key: {k.key},
created: k.created,
status: {k.status},
actions: (
),
}))}
/>
);
}
/* --- Playground screen --- */
function PlaygroundScreen() {
const [model, setModel] = React.useState("solar-pro3");
const [messages, setMessages] = React.useState([
{ role: "assistant", text: "Hi — I'm Solar. Ask me anything, or paste a document to parse." },
]);
const [draft, setDraft] = React.useState("");
const send = () => {
if (!draft.trim()) return;
setMessages((m) => [...m, { role: "user", text: draft.trim() }, { role: "assistant", text: "(Playground mock) Solar Pro 3 would answer here — streaming, 64k context." }]);
setDraft("");
};
return (
}
/>
{messages.map((m, i) => (
{m.text}
))}
);
}
/* --- Usage screen --- */
function UsageScreen() {
const [tab, setTab] = React.useState("Tokens");
const bars = [42, 55, 38, 61, 74, 52, 68, 81, 63, 90, 77, 96];
return (
Export CSV} />
{bars.map((b, i) => (
))}
);
}
/* --- Shell --- */
function ConsoleApp() {
const [screen, setScreen] = React.useState("keys");
const screens = { keys: , play: , usage: };
return (
);
}
Object.assign(window, { ConsoleApp, ApiKeysScreen, PlaygroundScreen, UsageScreen });