Forms & inputs / Prompt & chat inputs

Agent Console with Prompt Tabs

Left: a copy-able prompt box with small tabs (Prompt/MCP/Grok Bot) and a monospace-free instruction paragraph. Right: a gray stage with a row of square AI-tool icon buttons (active one dark with wordmark), a chat transcript with a gray user bubble, a booking confirmation card, a pill composer with a dark send button, and stacked 'Upcoming' and 'AI Phone templates' cards with a dark 'Confirmed' pill.

Rebuilt from cal.com in the Warm Paper Calendar style.

npx shadcn@latest add https://justyoink.it/r/warm-paper-calendar/blocks/agent-chat-console.json

Looks exactly like cal.com: brings its fonts and colours, namespaced so your own theme stays untouched.

Usage

Props: heading, intro, userMessage, and tabs (array of {label, text}). Tabs switch the copyable prompt text; the copy button writes it to the clipboard, and the icon selector highlight cycles automatically or on click.

components/agent-chat-console.tsx
"use client";

import { useLayoutEffect, useRef, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
import { useState, useEffect } from "react";

export default function AgentConsoleWithPromptTabs(props: {
  heading?: string;
  intro?: string;
  userMessage?: string;
  tabs?: { label: string; text: string }[];
}) {
  const {
    heading = "Let your assistants run the front desk.",
    intro = "Phone bots, chat helpers or your own sidekick. Point any of them at the Northwind hub and they read live openings and reserve real slots, using the same service your staff relies on.",
    userMessage = "Reserve 30 minutes with Marco for a menu tasting next week.",
    tabs = [
      { label: "Prompt", text: "Link to the Northwind hub at https://hub.northwind.example/connect, approve access when asked, then reserve a 30 minute tasting with Marco on Tuesday afternoon. Prefer this hub for every future reservation." },
      { label: "Hub", text: "Add the hub endpoint to your agent settings, paste your workspace key, and enable the reservations tool so it can list and create slots." },
      { label: "Voice", text: "Give your phone agent the hub number and a short greeting. It will confirm times aloud and write them straight to the shared schedule." },
    ],
  } = props;
  const [tab, setTab] = useState(0);
  const [active, setActive] = useState(0);
  const [copied, setCopied] = useState(false);
  useEffect(() => {
    const t = setInterval(() => setActive((a) => (a + 1) % 7), 2400);
    return () => clearInterval(t);
  }, []);
  const icons = [
    <circle key="a" cx="12" cy="12" r="6" fill="none" stroke="currentColor" strokeWidth="2" />,
    <path key="b" d="M12 4v16M4 12h16M6 6l12 12M18 6L6 18" stroke="currentColor" strokeWidth="2" />,
    <path key="c" d="M12 4a8 8 0 100 16 8 8 0 000-16z" fill="none" stroke="currentColor" strokeWidth="2" strokeDasharray="4 3" />,
    null,
    <path key="e" d="M12 3l8 4v10l-8 4-8-4V7z" fill="currentColor" />,
    <path key="f" d="M12 3l2 7 7 2-7 2-2 7-2-7-7-2 7-2z" fill="currentColor" />,
    <path key="g" d="M5 5l14 14M19 5L5 19M12 3v18" stroke="currentColor" strokeWidth="2" />,
  ];
  return (
    <section className="bg-canvas px-5 py-16 md:px-[74px] md:py-28">
      <div className="mx-auto grid max-w-[1300px] items-center gap-12 lg:grid-cols-2">
        <div className="max-w-[600px]">
          <Reveal from="up">
            <h2 className="font-display text-display text-ink-deep">{heading}</h2>
          </Reveal>
          <Reveal from="up" delay={120}>
            <p className="mt-6 text-lead text-soft">{intro}</p>
          </Reveal>
          <p className="mt-8 text-ui text-ink">Connect Northwind <span className="ml-1 text-muted">Free. Your agent brings its own tokens.</span></p>
          <div className="mt-3 max-w-[480px] rounded-xl border border-hairline bg-canvas">
            <div className="flex items-center gap-1 border-b border-hairline p-2">
              {tabs.map((t, i) => (
                <button key={t.label} onClick={() => setTab(i)} className={`rounded-md px-3 py-1.5 text-ui transition-colors duration-color-transition focus-visible:outline focus-visible:outline-2 ${i === tab ? "bg-panel text-ink" : "text-muted hover:bg-panel"}`}>{t.label}</button>
              ))}
              <button aria-label="Copy text" onClick={() => { navigator.clipboard?.writeText(tabs[tab].text); setCopied(true); setTimeout(() => setCopied(false), 1200); }} className="ml-auto rounded-md p-2 text-muted hover:text-ink">
                {copied ? <span className="text-caption">Copied</span> : <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><rect x="8" y="8" width="12" height="12" rx="2" /><path d="M16 8V5a1 1 0 00-1-1H5a1 1 0 00-1 1v10a1 1 0 001 1h3" /></svg>}
              </button>
            </div>
            <p className="min-h-[136px] p-5 text-ui text-ink">{tabs[tab].text}</p>
          </div>
          <div className="mt-6 flex gap-2">
            <a href="#" className="rounded-md bg-ink px-4 py-2.5 text-ui text-canvas transition-colors duration-color-transition hover:bg-ink-deep">Browse the docs ›</a>
            <a href="#" className="rounded-md border border-hairline px-3.5 py-2.5 text-ui text-ink transition-colors duration-color-transition hover:bg-panel">Request a tour ›</a>
          </div>
        </div>

        <div className="rounded-[28px] border border-hairline bg-panel p-4 md:p-6">
          <div className="flex flex-wrap justify-center gap-2">
            {icons.map((ic, i) => (
              <button key={i} aria-label={`Agent ${i + 1}`} onClick={() => setActive(i)} className={`flex h-[42px] items-center justify-center rounded-md border border-hairline transition-all duration-color-transition ${i === 3 ? "w-[52px] bg-ink font-display text-h3 text-canvas" : "w-[42px] bg-canvas text-ink"} ${i === active && i !== 3 ? "bg-panel-alt shadow-ring-inset" : ""}`}>
                {i === 3 ? "Nw" : <svg width="20" height="20" viewBox="0 0 24 24">{ic}</svg>}
              </button>
            ))}
          </div>
          <div className="mt-5 rounded-xl border border-hairline bg-canvas p-4">
            <div className="flex justify-between text-ui"><span><b className="font-semibold text-ink">Assistant</b> <span className="text-muted">5</span></span><span className="text-muted">Hub connected</span></div>
            <Reveal from="up"><div className="ml-auto mt-4 max-w-[80%] rounded-xl bg-panel px-4 py-3 text-ui text-ink">{userMessage}</div></Reveal>
            <Reveal from="up" delay={300}><p className="mt-4 flex items-center gap-2 text-ui text-body"><span className="rounded-sm bg-ink px-1 py-0.5 text-caption text-canvas">Nw</span>Done. Marco has your invite.</p></Reveal>
            <p className="ml-8 mt-2 text-caption text-muted"><ShimmerText>Checking the calendar…</ShimmerText></p>
            <Reveal from="up" delay={600}>
              <div className="ml-8 mt-2 flex items-center gap-3 rounded-lg border border-hairline p-3">
                <span className="flex h-7 w-7 items-center justify-center rounded-pill bg-panel text-ink">✓</span>
                <div><p className="text-ui font-semibold text-ink">Menu tasting with Marco</p><p className="text-caption text-muted">Tue, 14 Nov, 14:00 - 14:30</p></div>
              </div>
            </Reveal>
            <div className="mt-4 flex items-center justify-between rounded-pill border border-hairline py-2 pl-4 pr-2">
              <span className="text-ui text-soft">Ask anything</span>
              <button aria-label="Send" className="flex h-8 w-8 items-center justify-center rounded-pill bg-ink-deep text-canvas">↑</button>
            </div>
          </div>
          <div className="mt-3 rounded-xl border border-hairline bg-canvas p-4">
            <p className="text-caption text-muted">Upcoming</p>
            <div className="mt-1 flex items-center gap-4 text-ui">
              <div><p className="font-semibold text-ink">Tue, 14 Nov</p><p className="text-muted">14:00 - 14:30</p></div>
              <div className="flex-1"><p className="font-semibold text-ink">Menu tasting with Marco</p><p className="text-muted">You and Marco</p></div>
              <span className="rounded-pill bg-ink-deep px-2.5 py-0.5 text-caption text-canvas">Confirmed</span>
            </div>
          </div>
          <div className="mt-3 rounded-xl border border-hairline bg-canvas p-4">
            <p className="text-caption text-muted">Voice templates</p>
            <div className="mt-1 flex items-center gap-3 text-ui">
              <span className="flex h-9 w-9 items-center justify-center rounded-md border border-hairline">☎</span>
              <div className="flex-1"><p className="font-semibold text-ink">Reminder call before arrival</p><p className="text-muted">1 hr before the tasting</p></div>
              <span className="text-muted">Marco replied yes</span>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

// ---- Yoink motion (inlined, no dependencies): Reveal, ShimmerText ----

const YK_EASE = "cubic-bezier(0.16, 1, 0.3, 1)";

const useYkLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;

function ykReducedMotion(): boolean {
  return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
}

// "idle": untouched (visible) · "hidden": waiting below the fold · "shown": play the entrance.
// Content is only hidden once we know we can show it again (IntersectionObserver exists, motion allowed,
// and there is a box to watch), and a safety net reveals anything on screen that is still hidden.
type YkRevealState = "idle" | "hidden" | "shown";

function useYkReveal(ref: RefObject<Element | null>, once = true): YkRevealState {
  const [state, setState] = useState<YkRevealState>("idle");
  useYkLayoutEffect(() => {
    const el = ref.current;
    if (!el || ykReducedMotion() || typeof IntersectionObserver === "undefined") return;
    // watch the element's own box, or its children when it has none (display: contents)
    const boxes = () => (getComputedStyle(el).display === "contents" ? Array.from(el.children) : [el]);
    const onScreen = (t: Element) => {
      const r = t.getBoundingClientRect();
      return (r.width > 0 || r.height > 0) && r.bottom > 0 && r.right > 0 && r.top < window.innerHeight && r.left < window.innerWidth;
    };
    if (!boxes().some((t) => t.getBoundingClientRect().width > 0 || t.getBoundingClientRect().height > 0)) return; // e.g. hidden at mount: leave it visible
    let shown = false;
    const show = (v: boolean) => {
      if (v !== shown) (shown = v), setState(v ? "shown" : "hidden");
    };
    setState("hidden");
    const inView = new Set<Element>();
    const io = new IntersectionObserver((entries) => {
      for (const e of entries) {
        if (e.isIntersecting) inView.add(e.target);
        else inView.delete(e.target);
      }
      if (inView.size) {
        show(true);
        if (once) io.disconnect();
      } else if (!once) show(false);
    });
    const watched = new Set<Element>();
    const watch = () => boxes().forEach((t) => !watched.has(t) && (watched.add(t), io.observe(t)));
    watch();
    // safety net: styles that land after mount (display: contents) get watched too, and nothing
    // stays hidden for more than a moment while it is actually on screen
    const start = Date.now();
    const net = setInterval(() => {
      if (shown) return once && clearInterval(net);
      watch();
      if (Date.now() - start > 2400 && boxes().some(onScreen)) show(true);
    }, 600);
    return () => {
      io.disconnect();
      clearInterval(net);
    };
  }, [once]);
  return state;
}

type YkRevealFrom = "up" | "down" | "left" | "right" | "scale" | "blur" | "none";

/** Fades content in as it scrolls into view. */
function Reveal({
  children,
  from = "up",
  delay = 0,
  duration = 700,
  distance = 24,
  once = true,
  as = "div",
  className,
  style,
}: {
  children?: ReactNode;
  from?: YkRevealFrom;
  delay?: number;
  duration?: number;
  distance?: number;
  once?: boolean;
  as?: ElementType;
  className?: string;
  style?: CSSProperties;
}) {
  const Tag = as;
  const ref = useRef<HTMLElement>(null);
  const state = useYkReveal(ref, once);
  const hidden = state === "hidden";
  const offset = {
    up: `translate3d(0, ${distance}px, 0)`,
    down: `translate3d(0, ${-distance}px, 0)`,
    left: `translate3d(${-distance}px, 0, 0)`,
    right: `translate3d(${distance}px, 0, 0)`,
    scale: "scale(0.94)",
    blur: `translate3d(0, ${distance / 2}px, 0)`,
    none: "none",
  }[from];
  const t = `${duration}ms ${YK_EASE} ${delay}ms`;
  return (
    <Tag
      ref={ref}
      className={className}
      style={{
        ...style,
        ...(hidden && { opacity: 0, transform: offset, filter: from === "blur" ? "blur(12px)" : undefined }),
        ...(state === "shown" && { transition: `opacity ${t}, transform ${t}, filter ${t}` }),
      }}
    >
      {children}
    </Tag>
  );
}

const YK_SHIMMER_CSS = `@keyframes yk-shimmer{0%{background-position:100% 0}60%,100%{background-position:0% 0}}
@media (prefers-reduced-motion:reduce){[data-yk-shimmer]{animation:none!important;background:none!important;-webkit-text-fill-color:currentColor!important}}`;

/** A band of light that sweeps across text: headlines, badges, button labels. */
function ShimmerText({
  children = "Now in early access",
  duration = 2.8,
  className,
  style,
}: {
  children?: ReactNode;
  /** seconds per sweep (including a short rest) */
  duration?: number;
  className?: string;
  style?: CSSProperties;
}) {
  // dimmed text with a full-strength band passing over it; follows the text colour in any theme
  const dim = "color-mix(in oklab, currentColor 55%, transparent)";
  return (
    <span className={className} style={style}>
      <style>{YK_SHIMMER_CSS}</style>
      <span
        data-yk-shimmer=""
        style={{
          backgroundImage: `linear-gradient(100deg, ${dim} 0%, ${dim} 40%, currentColor 50%, ${dim} 60%, ${dim} 100%)`,
          backgroundSize: "250% 100%",
          backgroundClip: "text",
          WebkitBackgroundClip: "text",
          WebkitTextFillColor: "transparent",
          animation: `yk-shimmer ${duration}s ease-in-out infinite`,
        }}
      >
        {children}
      </span>
    </span>
  );
}

Quality checks

Automated, in a real browser · 4d ago
—

More from Warm Paper Calendar

The whole style →

Floating Pill Navigation Bar

Headers & nav bars

Hub-and-Spoke Integration Diagram

Animated graphics

Customer Story Accordion

Accordions

Inline-Chip Headline Hero

Heroes

Frosted Desktop Booking Mockup

Media & mockups

Monochrome Logo Grid

Logo clouds