Timace

Team

Team3
  • Ada Kentada@northwind.devDesign
  • Jo Morijo@northwind.devEngineering
  • Sam Reyessam@northwind.devSupport
Meet everyone
components/ui/team-card.tsx
import type { ReactNode } from "react";

// The parts every panel in this kit is made of. The corners of what is inside follow the panel's own.
const air = {
  panel: "flex w-(--tui-team-card-width) max-w-full flex-col gap-(--tui-team-card-gap) rounded-(--tui-team-card-radius) bg-(--tui-team-card-bg) p-(--tui-team-card-padding) font-(family-name:--tui-font) text-(length:--tui-team-card-font-size) leading-none text-(--tui-team-card-fg) shadow-(--tui-team-card-shadow)",
  head: "flex h-9 shrink-0 items-center justify-between gap-3 px-3 text-[0.93em] font-medium text-(--tui-team-card-muted)",
  chip: "inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-md bg-(--tui-team-card-well) px-1.5 text-[0.8em] font-medium text-(--tui-team-card-muted) tabular-nums",
  row: "flex min-h-(--tui-team-card-row-height) items-center gap-3 rounded-[calc(var(--tui-team-card-radius)_-_var(--tui-team-card-padding))] px-3 py-2 transition-colors duration-(--tui-duration)",
  meta: "ml-auto shrink-0 pl-2 text-[0.93em] text-(--tui-team-card-muted) tabular-nums",
  detail: "text-[0.93em] leading-snug text-(--tui-team-card-muted)",
  button: "inline-flex h-(--tui-team-card-row-height) cursor-default items-center justify-center gap-2 rounded-[calc(var(--tui-team-card-radius)_-_var(--tui-team-card-padding))] border-none px-4 font-[inherit] text-[length:inherit] leading-none font-medium whitespace-nowrap no-underline outline-none transition-[background-color,opacity,scale] duration-(--tui-duration) focus-visible:[outline:2px_solid_var(--tui-ring)] focus-visible:[outline-offset:2px] active:scale-[0.98]",
  soft: "bg-(--tui-team-card-well) text-(--tui-team-card-fg) hover:bg-(--tui-team-card-well-hover)",
};

const initials = (name: string) =>
  name
    .split(/\s+/)
    .map((part) => part[0])
    .slice(0, 2)
    .join("")
    .toUpperCase();

export interface TeamProps {
  /** A quiet label over the rows. */
  label?: ReactNode;
  /** A small figure at the end of the label, such as how many people. */
  count?: ReactNode;
  people: { name: string; /** A quieter line under the name. */ detail?: ReactNode; /** What they do, at the end of the row. */ role?: ReactNode; /** A picture of them. Without one, their initials are drawn. */ avatar?: ReactNode }[];
  /** One button across the bottom: see everyone, join the team. */
  action?: { label: string; href: string };
  className?: string;
}

/** The people behind it, as rows in a floating panel: a face, a name, and what they do at the end. */
export function Team({ label, count, people, action, className }: TeamProps) {
  return (
    <div data-slot="team" className={[air.panel, className].filter(Boolean).join(" ")}>
      {(label || count) && (
        <div className={air.head}>
          {label}
          {count && <span className={air.chip}>{count}</span>}
        </div>
      )}
      <ul className="m-0 flex list-none flex-col gap-(--tui-team-card-gap) p-0">
        {people.map((person) => (
          <li key={person.name} data-slot="team-person" className={air.row}>
            <span aria-hidden className="flex size-(--tui-team-card-avatar-size) shrink-0 items-center justify-center overflow-hidden rounded-full bg-(--tui-team-card-well) text-[0.8em] font-semibold [&_img]:size-full [&_img]:object-cover">
              {person.avatar ?? initials(person.name)}
            </span>
            <span className="flex min-w-0 flex-col gap-1.5">
              <span className="truncate font-medium">{person.name}</span>
              {person.detail && <span className={"truncate " + air.detail}>{person.detail}</span>}
            </span>
            {person.role && <span className={air.meta}>{person.role}</span>}
          </li>
        ))}
      </ul>
      {action && (
        <a href={action.href} data-slot="team-action" className={[air.button, air.soft].join(" ")}>
          {action.label}
        </a>
      )}
    </div>
  );
}
styles/timace-ui.css
:root {
  color-scheme: light;
  --tui-bg: #ffffff;
  --tui-fg: #0a0a0a;
  --tui-muted: #f5f5f5;
  --tui-muted-fg: #737373;
  --tui-border: #e5e5e5;
  --tui-primary: #171717;
  --tui-primary-fg: #fafafa;
  --tui-ring: #a3a3a3;
  --tui-success: #16a34a;
  --tui-warning: #d97706;
  --tui-danger: #dc2626;
  --tui-radius: 8px;
  --tui-border-width: 1px;
  --tui-space: 4px;
  --tui-shadow: none;
  --tui-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --tui-text: 14px;
  --tui-duration: 150ms;

  /* Team */
  --tui-team-card-width: 360px;
  --tui-team-card-padding: calc(var(--tui-space) * 2);
  --tui-team-card-gap: calc(var(--tui-space) * 0.5);
  --tui-team-card-radius: calc(var(--tui-radius) * 3.25);
  --tui-team-card-font-size: var(--tui-text);
  --tui-team-card-bg: light-dark(var(--tui-bg), color-mix(in oklab, var(--tui-bg) 90%, var(--tui-fg)));
  --tui-team-card-shadow: 0 0 0 1px color-mix(in srgb, var(--tui-fg) 5%, transparent), 0 2px 6px rgb(0 0 0 / 0.04), 0 16px 40px rgb(0 0 0 / 0.1);
  --tui-team-card-fg: var(--tui-fg);
  --tui-team-card-muted: var(--tui-muted-fg);
  --tui-team-card-well: color-mix(in srgb, light-dark(var(--tui-bg), color-mix(in oklab, var(--tui-bg) 90%, var(--tui-fg))) 94%, var(--tui-fg));
  --tui-team-card-well-hover: color-mix(in srgb, light-dark(var(--tui-bg), color-mix(in oklab, var(--tui-bg) 90%, var(--tui-fg))) 90%, var(--tui-fg));
  --tui-team-card-row-height: calc(var(--tui-space) * 15);
  --tui-team-card-avatar-size: calc(var(--tui-space) * 10);
}

.dark,
[data-theme="dark"] {
  color-scheme: dark;
  --tui-bg: #0a0a0a;
  --tui-fg: #fafafa;
  --tui-muted: #1c1c1c;
  --tui-muted-fg: #a3a3a3;
  --tui-border: #2a2a2a;
  --tui-primary: #fafafa;
  --tui-primary-fg: #171717;
  --tui-ring: #737373;
  --tui-success: #22c55e;
  --tui-warning: #f59e0b;
  --tui-danger: #ef4444;
}

Needs Tailwind CSS v4. Import the stylesheet once, after Tailwind.