/** @jsxImportSource react */
// Adapted from Charm Lip Gloss's SSH color-profile example (MIT). Sigil's
// stream-scoped session performs the same negotiation for the local terminal.
import React from "react";
import { adaptive, perProfile } from "#/color/index.ts";
import { Box, render, Text, useCapabilities } from "#/index.ts";
const profileAccent = perProfile(
{ ansi16: "magentaBright", ansi256: "ansi256(171)", truecolor: "#D290E4" },
"white",
);
function Swatch({ name, color }: { readonly name: string; readonly color: string }) {
return {name};
}
function App() {
const capabilities = useCapabilities();
const { terminal, color, theme, supports } = capabilities;
return (
Profile:{" "}
{color.depth}-bit / level {color.level}
Terminal: {terminal.name ?? terminal.term ?? "unknown"}
{terminal.version ? ` ${terminal.version}` : ""}
bold
faint
italic
underline
strikethrough
Appearance: {theme.appearance ?? "unknown"}
Hyperlinks: {String(supports.hyperlinks)}
Synchronized output: {String(supports.synchronizedOutput)}
);
}
render();