<!-- @dsCard group="Components" viewport="700x330" name="Data display" subtitle="Badge, StatusDot, Tag, ChannelLogo, Stat, ProgressBar, Card" -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@300..700&family=Geist+Mono:wght@400..600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../../styles.css">
<script src="https://unpkg.com/react@18.3.1/umd/react.development.js" integrity="sha384-hD6/rw4ppMLGNu3tX5cjIb+uRZ7UkRJ6BPkLpg4hAu/6onKUg4lLsHAs9EBPT82L" crossorigin="anonymous"></script>
<script src="https://unpkg.com/react-dom@18.3.1/umd/react-dom.development.js" integrity="sha384-u6aeetuaXnQ38mYT8rp6sbXaQe3NL9t+IBXmnYxwkUI2Hw4bsp2Wvmx4yRQF1uAm" crossorigin="anonymous"></script>
<script src="https://unpkg.com/@babel/standalone@7.29.0/babel.min.js" integrity="sha384-m08KidiNqLdpJqLq95G/LEi8Qvjl/xUYll3QILypMoQ65QorJ9Lvtp2RXYGBFj1y" crossorigin="anonymous"></script>
<script src="https://unpkg.com/lucide@0.544.0/dist/umd/lucide.min.js"></script>
<script src="../../_ds_bundle.js"></script>
<style>
  body { margin: 0; background: var(--surface-app); color: var(--text-primary); font-family: var(--font-sans); }
  #root { padding: 22px 24px; }
  .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
</style>
</head>
<body>
<div id="root"></div>
<script type="text/babel">
const NS = window.ChicoryTVDesignSystem_eb3b61;
const { Badge, StatusDot, Tag, ChannelLogo, Stat, ProgressBar, Card } = NS;
const Ico = ({ n, s = 15 }) => { const r = React.useRef(null); React.useEffect(() => { if (r.current) { r.current.innerHTML=""; const el = window.lucide.createElement(window.lucide.icons[n]); el.setAttribute("width", s); el.setAttribute("height", s); r.current.appendChild(el);} }); return <span ref={r} style={{ display: "inline-flex" }} />; };

function Demo() {
  return (
    <div>
      <div className="row">
        <Badge tone="accent" dot>Live</Badge>
        <Badge tone="ok">Healthy</Badge>
        <Badge tone="warn">Not normalizing</Badge>
        <Badge tone="error" solid>Error</Badge>
        <Badge tone="neutral">HLS Segmenter</Badge>
        <span style={{ width: 8 }} />
        <StatusDot status="live" label="On air" />
        <StatusDot status="ok" label="Idle" />
        <StatusDot status="error" label="Failed" />
      </div>
      <div className="row">
        <Tag icon={<Ico n="Tag" s={12} />}>genre: comedy</Tag>
        <Tag tone="accent" onRemove={() => {}}>released ≥ 1990</Tag>
        <Tag onRemove={() => {}}>rating: PG</Tag>
        <span style={{ width: 8 }} />
        <ChannelLogo name="Retro Cartoons" size={38} />
        <ChannelLogo name="News 24" size={38} />
        <ChannelLogo name="Late Night" size={38} />
      </div>
      <div style={{ display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: 16, alignItems: "start" }}>
        <Card padded={true} style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 20 }}>
          <Stat label="Active streams" value="7" icon={<Ico n="Radio" />} delta="+2" deltaTone="up" />
          <Stat label="Channels" value="128" icon={<Ico n="Tv" />} />
          <Stat label="Scheduled" value="1,204" icon={<Ico n="CalendarClock" />} />
          <Stat label="Uptime" value="14d 06h" icon={<Ico n="Activity" />} />
        </Card>
        <Card title="Library scan" subtitle="Movies · local">
          <div style={{ display: "flex", flexDirection: "column", gap: 14 }}>
            <ProgressBar value={62} showLabel />
            <ProgressBar value={null} tone="accent" />
            <ProgressBar value={100} tone="ok" showLabel />
          </div>
        </Card>
      </div>
    </div>
  );
}
ReactDOM.createRoot(document.getElementById("root")).render(<Demo />);
</script>
</body>
</html>
