import { Show } from "solid-js"; import type { JSX } from "solid-js"; import { CardIcon } from "./CardIcon"; import type { StackCardSpec } from "./types"; interface StackCardProps { spec: StackCardSpec; active: boolean; focused?: boolean; concealed?: boolean; celebrating?: boolean; top: number; zIndex: number; height: number; onClick: () => void; children: JSX.Element; } export function StackCard(props: StackCardProps) { return (
{ if (!props.active && !props.concealed) props.onClick(); }} onKeyDown={(e) => { if (props.active) return; if (e.key === "Enter" || e.key === " ") { e.preventDefault(); props.onClick(); } }} style={{ background: `var(${props.spec.bgVar})`, color: `var(${props.spec.fgVar})`, "--stk-card-top": `${props.top}px`, transform: `translateY(var(--stk-card-top))`, "z-index": props.zIndex, height: `${props.height}px`, }} >
{props.spec.num} } >

{props.spec.title}

{props.spec.lede}

{props.children}
); }