예제
실용적인 예제와 라이브 데모.
예제를 선택하면 라이브 미리보기와 소스 코드를 나란히 표시하는 전체 화면이 열립니다.
예제를 선택하면 라이브 미리보기와 소스 코드를 나란히 표시하는 전체 화면이 열립니다.
팀의 작업 보드입니다. 작업을 추가하고, 담당자를 지정하고, 대화 상자에서 편집하고, 담당자나 검색어로 거르고, 열 사이로 드래그하고, 삭제도 되돌릴 수 있습니다. 열과 카드는 같은 객체를 유지하는 평범한 배열이고 모든 이동은 splice() 한 번입니다. 행이 동일성으로 연결되므로 카드를 드래그하든, 정렬하든, 할당하든, 편집하든 기존 요소를 그대로 재사용합니다. 화면의 마운트 횟수가 그 증거입니다.
8 tasks · 2 done
Summarize the changes since the last tag.
The list diff test fails about one run in twenty.
Move it to the new form components.
Drag cards within a column or across columns. 0 cards mounted: reordering, assigning and editing never build a card. Moving it to another column, or filtering it back in, does.
// app.ts: the board. Columns are a list() of columns, cards a list() of each // column's cards. Rows are matched by identity, so reordering inside a column // (a drag, "Sort", "Top"), assigning a user or editing a card moves or patches // the existing elements and mounts nothing. A card dropped into another column // leaves one list and enters another (a filter does the same), so it is built // again there: watch it flash, and the mount count go up. import "nuclo"; import { add, columnOf, columns, cyclePriority, edit, initials, move, PRIORITIES, remove, restore, sortByPriority, users, type Card, type Column, type Draft, type User } from "./board.ts"; import { s } from "./styles.ts"; let dragging: Card | null = null; let over: { column: Column; index: number } | null = null; // where it would land let mounts = 0; // Which cards are shown. A filtered-out card stays in its column, only hidden. const filter = { search: "", user: null as User | "none" | null }; // The open task dialog: a new card for `column`, or `card` being edited. let dialog: { card: Card | null; column: Column; draft: Draft } | null = null; let undo: { card: Card; column: Column; index: number } | null = null; let undoTimer = 0; const PRIORITY = { 1: "low", 2: "normal", 3: "urgent" }; const matches = (c: Card) => { const q = filter.search.trim().toLowerCase(); if (q && !`${c.title} ${c.description} ${c.assignee?.name ?? ""}`.toLowerCase().includes(q)) return false; if (filter.user === "none") return c.assignee === null; return !filter.user || c.assignee === filter.user; }; const visible = (column: Column) => column.cards.filter(matches); const filtering = () => filter.search.trim() !== "" || filter.user !== null; function setOver(column: Column, index: number) { if (over?.column === column && over.index === index) return; over = { column, index }; update(); } function drop() { if (dragging && over) move(dragging, over.column, over.index); dragging = over = null; update(); } function openNew(column: Column) { dialog = { card: null, column, draft: { title: "", description: "", priority: 2, assignee: filter.user && filter.user !== "none" ? filter.user : null } }; update(); } function openEdit(card: Card) { const { title, description, priority, assignee } = card; dialog = { card, column: columnOf(card), draft: { title, description, priority, assignee } }; update(); } const closeDialog = () => { dialog = null; update(); }; function save() { if (!dialog || !dialog.draft.title.trim()) return; const { card, column, draft } = dialog; const next = { ...draft, title: draft.title.trim(), description: draft.description.trim() }; if (!card) add(column, next); else { edit(card, next); if (columnOf(card) !== column) move(card, column, 0); } closeDialog(); } function deleteCard(card: Card) { const column = columnOf(card); undo = { card, column, index: column.cards.indexOf(card) }; remove(card); clearTimeout(undoTimer); undoTimer = window.setTimeout(() => { undo = null; update(); }, 6000); dialog = null; update(); } function undoDelete() { if (!undo) return; restore(undo.card, undo.column, undo.index); clearTimeout(undoTimer); undo = null; update(); } function Avatar(user: () => User | null) { return span( { class: () => cx(s.avatar, user() ? null : s.nobody).className }, { style: () => ({ backgroundColor: user()?.color ?? "" }), title: () => user()?.name ?? "Unassigned" }, () => { const u = user(); return u ? initials(u) : "?"; }, ); } function Field(name: string, ...content: NodeModLike<"label">[]) { return label(s.field, span(name), ...content); } function CardView(card: Card, column: Column) { return div( s.card, { draggable: true, tabIndex: 0 }, { class: () => cx(s.card, card === dragging ? s.lifted : null, over?.column === column && over.index === column.cards.indexOf(card) ? s.before : null).className }, // The mount count is the proof: it only moves when a card is built. on("mount", () => { mounts++; queueMicrotask(update); }), { onClick: (e) => { if (!(e.target as HTMLElement).closest("button, select")) openEdit(card); }, onKeyDown: (e) => { if (e.key === "Enter" && e.target === e.currentTarget) openEdit(card); }, onDragStart: (e) => { e.dataTransfer?.setData("text/plain", card.title); dragging = card; update(); }, onDragEnd: () => { dragging = over = null; update(); }, onDragOver: (e) => { e.preventDefault(); e.stopPropagation(); const below = e.offsetY > e.currentTarget.offsetHeight / 2; setOver(column, column.cards.indexOf(card) + (below ? 1 : 0)); }, }, div(s.cardHead, button(s.priority, { type: "button", title: "Change priority", class: () => cx(s.priority, s[`p${card.priority}`]).className }, () => PRIORITY[card.priority], { onClick: () => { cyclePriority(card); update(); } }), span(s.id, `#${card.id}`), div(s.actions, button(s.icon, { type: "button", title: "Move to top", "aria-label": "Move to top" }, "↑", { onClick: () => { move(card, column, 0); update(); } }), button(s.icon, { type: "button", title: "Delete", "aria-label": "Delete" }, "×", { onClick: () => deleteCard(card) }), ), ), div(s.title, () => card.title), when(() => card.description !== "", p(s.desc, () => card.description)), div(s.cardFoot, Avatar(() => card.assignee), select(s.assign, { "aria-label": "Assignee", value: () => card.assignee?.id ?? "", onChange: (e) => { card.assignee = users.find((u) => u.id === e.currentTarget.value) ?? null; update(); }, }, option({ value: "" }, "Unassigned"), ...users.map((u) => option({ value: u.id }, u.name))), ), ); } function ColumnView(column: Column) { return section( s.column, { class: () => cx(s.column, over?.column === column && over.index === column.cards.length ? s.after : null).className }, { onDragOver: (e) => { e.preventDefault(); setOver(column, column.cards.length); }, onDragLeave: (e) => { if (!e.currentTarget.contains(e.relatedTarget as Node | null)) { over = null; update(); } }, onDrop: (e) => { e.preventDefault(); drop(); }, }, header(s.columnHead, h3(column.title, span(s.count, () => (filtering() ? `${visible(column).length}/${column.cards.length}` : String(column.cards.length)))), button(s.small, { type: "button", title: "Sort by priority", onClick: () => { sortByPriority(column); update(); } }, "Sort"), button(s.small, { type: "button", title: `Add a task to ${column.title}`, "aria-label": `Add a task to ${column.title}`, onClick: () => openNew(column) }, "+"), ), div(s.cards, list(() => visible(column), (card) => CardView(card, column)), when(() => visible(column).length === 0, p(s.empty, () => (column.cards.length ? "No matching tasks" : "Drop a task here"))), ), button(s.addTask, { type: "button", onClick: () => openNew(column) }, "+ Add task"), ); } function Toolbar() { const done = () => columns[columns.length - 1].cards.length; const total = () => columns.reduce((n, c) => n + c.cards.length, 0); const percent = () => (total() ? Math.round((done() / total()) * 100) : 0); const load = (u: User) => columns.slice(0, -1).reduce((n, c) => n + c.cards.filter((card) => card.assignee === u).length, 0); return header( s.bar, div(s.brand, div(s.logo, "▦"), div(h2("Product board"), p(s.sub, () => `${total()} tasks · ${done()} done`))), div(s.progress, { role: "progressbar", "aria-label": "Done", "aria-valuemin": "0", "aria-valuemax": "100", "aria-valuenow": () => String(percent()) }, div(s.fill, { style: () => ({ width: `${percent()}%` }) })), div(s.tools, input(s.search, { type: "search", placeholder: "Search tasks", "aria-label": "Search tasks", value: () => filter.search, onInput: (e) => { filter.search = e.currentTarget.value; update(); } }), div(s.team, { role: "group", "aria-label": "Filter by assignee" }, ...users.map((u) => button( { type: "button", class: () => cx(s.member, filter.user === u ? s.picked : null).className, title: () => `${u.name}: ${load(u)} open`, "aria-pressed": () => String(filter.user === u), onClick: () => { filter.user = filter.user === u ? null : u; update(); } }, Avatar(() => u), )), button({ type: "button", class: () => cx(s.chip, filter.user === "none" ? s.picked : null).className, "aria-pressed": () => String(filter.user === "none"), onClick: () => { filter.user = filter.user === "none" ? null : "none"; update(); } }, "Unassigned"), ), button(s.primary, { type: "button", onClick: () => openNew(columns[0]) }, "+ New task"), ), ); } function Dialog() { const draft = () => dialog?.draft; return div( s.overlay, { onMouseDown: (e) => { if (e.target === e.currentTarget) closeDialog(); }, onKeyDown: (e) => { if (e.key === "Escape") closeDialog(); } }, form( s.dialog, { role: "dialog", "aria-modal": "true", "aria-label": () => (dialog?.card ? "Edit task" : "New task"), onSubmit: (e) => { e.preventDefault(); save(); } }, div(s.dialogHead, h3(() => (dialog?.card ? `Edit task #${dialog.card.id}` : "New task")), button(s.icon, { type: "button", "aria-label": "Close", onClick: closeDialog }, "×")), Field("Title", input(s.input, { required: true, placeholder: "What needs to be done?", value: () => draft()?.title ?? "", onInput: (e) => { dialog!.draft.title = e.currentTarget.value; update(); } }, on("mount", (el) => el.focus()))), Field("Description", textarea(s.input, s.area, { rows: 3, placeholder: "Add some details (optional)", value: () => draft()?.description ?? "", onInput: (e) => { dialog!.draft.description = e.currentTarget.value; } })), div(s.row, Field("Assignee", select(s.input, { value: () => draft()?.assignee?.id ?? "", onChange: (e) => { dialog!.draft.assignee = users.find((u) => u.id === e.currentTarget.value) ?? null; update(); } }, option({ value: "" }, "Unassigned"), ...users.map((u) => option({ value: u.id }, u.name)))), Field("Column", select(s.input, { value: () => dialog?.column.id ?? "", onChange: (e) => { dialog!.column = columns.find((c) => c.id === e.currentTarget.value)!; update(); } }, ...columns.map((c) => option({ value: c.id }, c.title)))), ), div(s.field, span("Priority"), div(s.modes, { role: "radiogroup", "aria-label": "Priority" }, ...PRIORITIES.map((p) => button({ type: "button", role: "radio", class: () => cx(s.mode, draft()?.priority === p.value ? s.on : null).className, "aria-checked": () => String(draft()?.priority === p.value), onClick: () => { dialog!.draft.priority = p.value; update(); } }, p.label)))), div(s.dialogFoot, when(() => dialog?.card != null, button(s.danger, { type: "button", onClick: () => deleteCard(dialog!.card!) }, "Delete")), span(s.grow), button(s.btn, { type: "button", onClick: closeDialog }, "Cancel"), button(s.primary, { type: "submit", disabled: () => !draft()?.title.trim() }, () => (dialog?.card ? "Save" : "Add task")), ), ), ); } export function KanbanBoard() { return div( s.app, Toolbar(), div(s.board, list(() => columns, ColumnView)), p(s.hint, "Drag cards within a column or across columns. ", strong(() => `${mounts} cards mounted`), ": reordering, assigning and editing never build a card. Moving it to another column, or filtering it back in, does."), when(() => undo !== null, div(s.toast, { role: "status" }, span(() => `Deleted “${undo?.card.title ?? ""}”`), button(s.link, { type: "button", onClick: undoDelete }, "Undo"))), when(() => dialog !== null, Dialog()), ); }
// board.ts: the model. Columns hold cards in plain arrays, and every change is // a plain array operation on the same card objects. Nothing is copied or // re-keyed: a card that moves is the same object before and after. export interface User { id: string; name: string; color: string; } export interface Card { id: number; title: string; description: string; priority: 1 | 2 | 3; // 3 is urgent assignee: User | null; // the same object as in `users`, never a copy } export interface Column { id: string; title: string; cards: Card[]; } export const users: User[] = [ { id: "ana", name: "Ana Souza", color: "#e0586f" }, { id: "ben", name: "Ben Carter", color: "#3b82c4" }, { id: "chen", name: "Chen Wei", color: "#2f9e72" }, { id: "dia", name: "Dia Patel", color: "#d98a1f" }, ]; const [ana, ben, chen, dia] = users; let nextId = 1; const card = (title: string, priority: Card["priority"], assignee: User | null, description = ""): Card => ({ id: nextId++, title, description, priority, assignee }); export const columns: Column[] = [ { id: "todo", title: "To do", cards: [ card("Write the release notes", 2, ana, "Summarize the changes since the last tag."), card("Fix the flaky test", 3, ben, "The list diff test fails about one run in twenty."), card("Design the empty state", 1, null), card("Rotate the API keys", 3, dia), ] }, { id: "doing", title: "In progress", cards: [card("Migrate the settings page", 2, chen, "Move it to the new form components."), card("Profile the list diff", 1, ben)] }, { id: "done", title: "Done", cards: [card("Set up CI", 2, dia), card("Pick a logo", 1, ana)] }, ]; export const PRIORITIES = [ { value: 1, label: "Low" }, { value: 2, label: "Normal" }, { value: 3, label: "Urgent" }, ] as const; export const initials = (u: User) => u.name.split(" ").map((w) => w[0]).join(""); export const columnOf = (c: Card) => columns.find((col) => col.cards.includes(c))!; /** Moves a card to `index` in `to`, from wherever it is now. */ export function move(c: Card, to: Column, index = to.cards.length) { const from = columnOf(c); const at = from.cards.indexOf(c); from.cards.splice(at, 1); if (from === to && at < index) index--; to.cards.splice(index, 0, c); } export interface Draft { title: string; description: string; priority: Card["priority"]; assignee: User | null; } /** Puts a new card at the top of `col`. */ export function add(col: Column, draft: Draft): Card { const c = card(draft.title, draft.priority, draft.assignee, draft.description); col.cards.unshift(c); return c; } /** Edits a card in place, so its element is kept. */ export function edit(c: Card, draft: Draft) { Object.assign(c, draft); } /** Puts a deleted card back where it was. */ export function restore(c: Card, col: Column, index: number) { col.cards.splice(Math.min(index, col.cards.length), 0, c); } export function remove(c: Card) { const cards = columnOf(c).cards; cards.splice(cards.indexOf(c), 1); } export function cyclePriority(c: Card) { c.priority = c.priority === 3 ? 1 : ((c.priority + 1) as Card["priority"]); } export function sortByPriority(col: Column) { col.cards.sort((a, b) => b.priority - a.priority); }
import "nuclo"; const mono = "ui-monospace, monospace"; const flash = keyframes({ from: { boxShadow: "0 0 0 2px var(--c-primary)" }, to: { boxShadow: "0 0 0 2px transparent" } }); const pop = keyframes({ from: { opacity: "0", transform: "translateY(8px) scale(0.98)" }, to: { opacity: "1", transform: "none" } }); const fade = keyframes({ from: { opacity: "0" }, to: { opacity: "1" } }); const focus = { outline: "2px solid var(--c-primary)", outlineOffset: "1px" }; const clamp = { WebkitLineClamp: "2", WebkitBoxOrient: "vertical" } as object; // not in the Style type const control = { height: "34px", padding: "0 12px", borderRadius: "8px", fontSize: "0.8125rem", fontWeight: "600" }; export const s = { app: css("kanban-app", { position: "relative", display: "flex", flexDirection: "column", gap: "12px", width: "100%", height: "100%" }), hint: css("kanban-hint", { fontSize: "0.75rem", color: "var(--c-text-muted)", "& strong": { color: "var(--c-primary-ink)", fontVariantNumeric: "tabular-nums" } }), bar: css("kanban-bar", { display: "flex", flexWrap: "wrap", alignItems: "center", gap: "10px 16px", padding: "10px 12px", borderRadius: "12px", border: "1px solid var(--c-border)", backgroundColor: "var(--c-bg-card)" }), brand: css("kanban-brand", { display: "flex", alignItems: "center", gap: "10px", "& h2": { fontSize: "1rem", fontWeight: "700", lineHeight: "1.2" } }), logo: css("kanban-logo", { display: "grid", placeItems: "center", width: "34px", height: "34px", borderRadius: "9px", backgroundColor: "var(--c-primary-dark)", color: "#fff", fontSize: "1.0625rem" }), sub: css("kanban-sub", { fontSize: "0.75rem", color: "var(--c-text-muted)", fontVariantNumeric: "tabular-nums" }), progress: css("kanban-progress", { flex: "1 1 80px", minWidth: "60px", maxWidth: "220px", height: "6px", borderRadius: "999px", backgroundColor: "var(--c-bg-light)", overflow: "hidden" }), fill: css("kanban-fill", { height: "100%", borderRadius: "999px", backgroundColor: "var(--c-primary)", transition: "width 0.3s ease" }), tools: css("kanban-tools", { display: "flex", flexWrap: "wrap", alignItems: "center", gap: "8px", marginLeft: "auto" }), search: css("kanban-search", { ...control, width: "170px", border: "1px solid var(--c-border-light)", backgroundColor: "var(--c-bg)", color: "var(--c-text)", fontWeight: "400", "&:focus-visible": focus }), team: css("kanban-team", { display: "flex", alignItems: "center", gap: "4px" }), member: css("kanban-member", { display: "grid", placeItems: "center", width: "34px", height: "34px", borderRadius: "999px", border: "2px solid transparent", opacity: "0.75", hover: { opacity: "1" }, "&:focus-visible": focus }), chip: css("kanban-chip", { height: "30px", padding: "0 10px", borderRadius: "999px", border: "1px solid var(--c-border-light)", fontSize: "0.75rem", fontWeight: "600", color: "var(--c-text-dim)", hover: { color: "var(--c-text)" }, "&:focus-visible": focus }), picked: css("kanban-picked", { opacity: "1", borderColor: "var(--c-primary)", backgroundColor: "var(--c-primary-alpha-13)", color: "var(--c-primary-ink)" }), primary: css("kanban-primary", { ...control, backgroundColor: "var(--c-primary-dark)", color: "#fff", whiteSpace: "nowrap", hover: { filter: "brightness(1.1)" }, "&:disabled": { opacity: "0.45", cursor: "not-allowed" }, "&:focus-visible": focus }), btn: css("kanban-btn", { ...control, border: "1px solid var(--c-border-light)", backgroundColor: "var(--c-bg)", color: "var(--c-text)", hover: { backgroundColor: "var(--c-bg-secondary)" }, "&:focus-visible": focus }), danger: css("kanban-danger", { ...control, color: "#d64545", hover: { backgroundColor: "rgba(214, 69, 69, 0.12)" }, "&:focus-visible": focus }), link: css("kanban-link", { fontSize: "0.8125rem", fontWeight: "700", color: "var(--c-primary-ink)", textDecoration: "underline" }), board: css("kanban-board", { display: "flex", gap: "12px", flex: "1", minHeight: "0", overflowX: "auto", paddingBottom: "4px", scrollSnapType: "x proximity" }), column: css("kanban-column", { display: "flex", flexDirection: "column", flex: "1 0 260px", minWidth: "0", scrollSnapAlign: "start", borderRadius: "12px", border: "1px solid var(--c-border)", backgroundColor: "var(--c-bg-secondary)", "@media (max-width: 599px)": { flexBasis: "82%" } }), after: css("kanban-after", { boxShadow: "inset 0 -3px 0 var(--c-primary)" }), columnHead: css("kanban-columnHead", { display: "flex", alignItems: "center", gap: "4px", padding: "10px 10px 8px", "& h3": { flex: "1", fontSize: "0.8125rem", fontWeight: "700", textTransform: "uppercase", letterSpacing: "0.04em", color: "var(--c-text-dim)" } }), count: css("kanban-count", { marginLeft: "8px", padding: "1px 7px", borderRadius: "999px", backgroundColor: "var(--c-bg-light)", fontFamily: mono, fontSize: "0.6875rem", fontWeight: "400", letterSpacing: "0", color: "var(--c-text-muted)" }), small: css("kanban-small", { minWidth: "26px", height: "26px", padding: "0 8px", borderRadius: "6px", fontSize: "0.75rem", fontWeight: "600", color: "var(--c-text-dim)", hover: { color: "var(--c-text)", backgroundColor: "var(--c-bg-light)" }, "&:focus-visible": focus }), cards: css("kanban-cards", { display: "flex", flexDirection: "column", gap: "8px", flex: "1", minHeight: "60px", padding: "2px 8px 8px", overflowY: "auto" }), empty: css("kanban-empty", { display: "grid", placeItems: "center", minHeight: "64px", borderRadius: "10px", border: "1px dashed var(--c-border-light)", fontSize: "0.8125rem", color: "var(--c-text-muted)" }), addTask: css("kanban-addTask", { margin: "0 8px 8px", height: "32px", borderRadius: "8px", fontSize: "0.8125rem", fontWeight: "600", color: "var(--c-text-muted)", hover: { color: "var(--c-text)", backgroundColor: "var(--c-bg-light)" }, "&:focus-visible": focus }), card: css("kanban-card", { display: "flex", flexDirection: "column", gap: "6px", padding: "8px 10px 10px", borderRadius: "10px", border: "1px solid var(--c-border)", backgroundColor: "var(--c-bg-card)", cursor: "grab", animation: `${flash} 0.8s ease-out`, hover: { borderColor: "var(--c-border-light)" }, "&:active": { cursor: "grabbing" }, "&:focus-visible": focus }), lifted: css("kanban-lifted", { opacity: "0.4" }), before: css("kanban-before", { boxShadow: "0 -7px 0 -2px var(--c-primary)" }), cardHead: css("kanban-cardHead", { display: "flex", alignItems: "center", gap: "6px" }), priority: css("kanban-priority", { height: "20px", padding: "0 7px", borderRadius: "999px", fontSize: "0.6875rem", fontWeight: "600", textTransform: "uppercase", letterSpacing: "0.02em" }), p1: css("kanban-p1", { backgroundColor: "var(--c-bg-light)", color: "var(--c-text-dim)" }), p2: css("kanban-p2", { backgroundColor: "var(--c-primary-alpha-13)", color: "var(--c-primary-ink)" }), p3: css("kanban-p3", { backgroundColor: "var(--c-primary-dark)", color: "#fff" }), id: css("kanban-id", { flex: "1", fontFamily: mono, fontSize: "0.6875rem", color: "var(--c-text-muted)" }), actions: css("kanban-actions", { display: "flex", gap: "2px" }), icon: css("kanban-icon", { width: "24px", height: "24px", borderRadius: "6px", fontSize: "0.875rem", color: "var(--c-text-muted)", hover: { color: "var(--c-text)", backgroundColor: "var(--c-bg-light)" }, "&:focus-visible": focus }), title: css("kanban-title", { fontSize: "0.875rem", fontWeight: "600", lineHeight: "1.4", overflowWrap: "anywhere" }), desc: css("kanban-desc", { fontSize: "0.8125rem", lineHeight: "1.4", color: "var(--c-text-dim)", display: "-webkit-box", ...clamp, overflow: "hidden" }), cardFoot: css("kanban-cardFoot", { display: "flex", alignItems: "center", gap: "6px", marginTop: "2px" }), avatar: css("kanban-avatar", { display: "grid", placeItems: "center", flex: "none", width: "24px", height: "24px", borderRadius: "999px", color: "#fff", fontSize: "0.625rem", fontWeight: "700", letterSpacing: "0.02em" }), nobody: css("kanban-nobody", { border: "1px dashed var(--c-text-muted)", color: "var(--c-text-muted)", backgroundColor: "transparent" }), assign: css("kanban-assign", { minWidth: "0", maxWidth: "100%", height: "24px", padding: "0 4px", borderRadius: "6px", border: "none", backgroundColor: "transparent", fontSize: "0.75rem", color: "var(--c-text-dim)", cursor: "pointer", hover: { backgroundColor: "var(--c-bg-light)", color: "var(--c-text)" }, "&:focus-visible": focus }), toast: css("kanban-toast", { position: "absolute", left: "50%", bottom: "16px", transform: "translateX(-50%)", display: "flex", alignItems: "center", gap: "14px", padding: "10px 16px", borderRadius: "10px", backgroundColor: "var(--c-bg-card)", border: "1px solid var(--c-border-light)", boxShadow: "0 8px 24px var(--c-shadow)", fontSize: "0.8125rem", animation: `${pop} 0.2s ease-out` }), overlay: css("kanban-overlay", { position: "absolute", inset: "0", zIndex: 10, display: "flex", overflowY: "auto", padding: "16px", backgroundColor: "rgba(0, 0, 0, 0.45)", animation: `${fade} 0.15s ease-out` }), dialog: css("kanban-dialog", { display: "flex", flexDirection: "column", gap: "14px", flex: "none", width: "100%", maxWidth: "440px", margin: "auto", padding: "16px", borderRadius: "14px", border: "1px solid var(--c-border)", backgroundColor: "var(--c-bg-card)", boxShadow: "0 20px 50px var(--c-shadow)", animation: `${pop} 0.2s ease-out` }), dialogHead: css("kanban-dialogHead", { display: "flex", alignItems: "center", justifyContent: "space-between", "& h3": { fontSize: "1rem", fontWeight: "700" } }), dialogFoot: css("kanban-dialogFoot", { display: "flex", alignItems: "center", gap: "8px", marginTop: "2px" }), grow: css("kanban-grow", { flex: "1" }), field: css("kanban-field", { display: "flex", flexDirection: "column", gap: "6px", flex: "1", minWidth: "0", "& > span": { fontSize: "0.75rem", fontWeight: "600", color: "var(--c-text-dim)" } }), row: css("kanban-row", { display: "flex", gap: "12px" }), input: css("kanban-input", { width: "100%", minHeight: "36px", padding: "7px 10px", borderRadius: "8px", border: "1px solid var(--c-border-light)", backgroundColor: "var(--c-bg)", color: "var(--c-text)", fontSize: "0.875rem", fontFamily: "inherit", "&:focus-visible": focus }), area: css("kanban-area", { resize: "vertical", lineHeight: "1.4" }), modes: css("kanban-modes", { display: "flex", padding: "2px", borderRadius: "9px", border: "1px solid var(--c-border-light)", backgroundColor: "var(--c-bg)" }), mode: css("kanban-mode", { flex: "1", height: "30px", borderRadius: "7px", fontSize: "0.8125rem", fontWeight: "600", color: "var(--c-text-dim)", hover: { color: "var(--c-text)" }, "&:focus-visible": focus }), on: css("kanban-on", { backgroundColor: "var(--c-primary-dark)", color: "#fff", hover: { color: "#fff" } }), };