Exemples
Du concret. Des démos en direct.
Choisissez un exemple pour l'ouvrir en plein écran : l'aperçu en direct et son code source, côte à côte.
Choisissez un exemple pour l'ouvrir en plein écran : l'aperçu en direct et son code source, côte à côte.
Une table de travail sur 10 000 objets de ligne ordinaires. Recherche, filtre, tri et pagination sont de simples fonctions sur le tableau, et le corps de la table est une list() sur la page courante. Les lignes sont appariées par identité : un tri ne déplace que les lignes qui restent sur la page, et une ligne modifiée est partout le même objet. Le compteur de lignes construites le prouve.
0 rows built. Sorting moves the rows that stay on the page and builds only the new ones: search "elif.novak", then sort. Double-click a name, status or amount to edit it.
| 1 | Hana Silva | [email protected] | Contoso | Japan | suspended | $7,608.08 | Aug 16, 2021 | |
| 2 | Lena Haddad | [email protected] | Northwind | Portugal | active | $4,638.47 | Nov 26, 2018 | |
| 3 | Pedro Costa | [email protected] | Initech | Portugal | active | $8,851.01 | Jan 23, 2024 | |
| 4 | Elif Okafor | [email protected] | Contoso | Brazil | invited | $2,920.26 | Feb 15, 2024 | |
| 5 | Pedro Kowalski | [email protected] | Globex | Mexico | active | $3,719.29 | May 19, 2018 | |
| 6 | Lena Okafor | [email protected] | Acme | Japan | suspended | $9,922.26 | Oct 29, 2018 | |
| 7 | Farah Larsen | [email protected] | Hooli | Canada | invited | $8,379.54 | Jul 27, 2025 | |
| 8 | Olga Novak | [email protected] | Globex | Sweden | invited | $3,649.33 | Sep 19, 2025 | |
| 9 | Chen Rossi | [email protected] | Globex | France | suspended | $3,646.55 | Apr 20, 2024 | |
| 10 | Bruno Fischer | [email protected] | Acme | Germany | suspended | $7,161.29 | Nov 27, 2025 | |
| 11 | Farah Haddad | [email protected] | Umbrella | Canada | active | $8,298.25 | Jan 25, 2025 | |
| 12 | Bruno Nguyen | [email protected] | Hooli | Japan | invited | $6,175.75 | Jun 14, 2022 | |
| 13 | Bruno Haddad | [email protected] | Umbrella | India | active | $1,741.76 | May 26, 2024 | |
| 14 | Gabriel Kowalski | [email protected] | Umbrella | Kenya | active | $559.50 | May 2, 2019 | |
| 15 | Julia Nguyen | [email protected] | Hooli | Portugal | invited | $842.35 | Dec 8, 2020 | |
| 16 | Marta Rossi | [email protected] | Northwind | Japan | active | $5,404.77 | Sep 18, 2021 | |
| 17 | Marta Larsen | [email protected] | Globex | Portugal | invited | $5,019.55 | Jul 26, 2018 | |
| 18 | Nikhil Silva | [email protected] | Vandelay | Germany | active | $9,597.70 | Feb 13, 2018 | |
| 19 | Hana Rossi | [email protected] | Hooli | Brazil | active | $4,661.81 | Apr 8, 2019 | |
| 20 | Nikhil Novak | [email protected] | Globex | Japan | invited | $2,761.42 | Nov 8, 2020 | |
| 21 | Pedro Moreau | [email protected] | Globex | France | suspended | $3,358.60 | Oct 8, 2021 | |
| 22 | Igor Silva | [email protected] | Initech | Brazil | active | $8,123.62 | Apr 18, 2025 | |
| 23 | Ana Costa | [email protected] | Northwind | Brazil | active | $3,279.71 | May 14, 2020 | |
| 24 | Nikhil Rossi | [email protected] | Hooli | Japan | active | $4,727.40 | Jul 15, 2019 | |
| 25 | Farah Costa | [email protected] | Vandelay | Japan | suspended | $463.52 | Dec 12, 2020 | |
| 26 | Pedro Novak | [email protected] | Contoso | Portugal | suspended | $7,370.96 | Aug 15, 2024 | |
| 27 | Hana Tanaka | [email protected] | Northwind | Canada | suspended | $2,527.00 | Oct 20, 2020 | |
| 28 | Gabriel Haddad | [email protected] | Vandelay | Brazil | suspended | $4,121.82 | May 6, 2025 | |
| 29 | Pedro Costa | [email protected] | Contoso | Sweden | active | $903.23 | Feb 5, 2023 | |
| 30 | Kofi Kowalski | [email protected] | Globex | Canada | active | $5,807.45 | Mar 11, 2020 | |
| 31 | Ana Silva | [email protected] | Hooli | Kenya | suspended | $9,984.70 | Jul 3, 2022 | |
| 32 | Marta Rossi | [email protected] | Umbrella | Japan | suspended | $351.41 | Jun 21, 2024 | |
| 33 | Hana Nguyen | [email protected] | Globex | Sweden | invited | $8,826.27 | May 23, 2023 | |
| 34 | Marta Haddad | [email protected] | Acme | Portugal | active | $9,888.65 | Dec 21, 2020 | |
| 35 | Ana Fischer | [email protected] | Initech | Portugal | suspended | $5,230.69 | Aug 7, 2020 | |
| 36 | Gabriel Novak | [email protected] | Acme | Portugal | suspended | $2,925.26 | Jan 5, 2019 | |
| 37 | Olga Kowalski | [email protected] | Initech | Kenya | active | $7,178.80 | Jun 10, 2018 | |
| 38 | Pedro Okafor | [email protected] | Contoso | Canada | invited | $3,796.59 | May 26, 2019 | |
| 39 | Ana Costa | [email protected] | Globex | France | suspended | $1,635.60 | Nov 28, 2018 | |
| 40 | Julia Haddad | [email protected] | Umbrella | Kenya | suspended | $9,621.73 | Sep 10, 2023 | |
| 41 | Elif Haddad | [email protected] | Hooli | Portugal | active | $7,260.95 | Sep 17, 2022 | |
| 42 | Ana Novak | [email protected] | Northwind | India | suspended | $2,051.66 | Nov 28, 2021 | |
| 43 | Lena Larsen | [email protected] | Hooli | Mexico | active | $6,855.45 | Sep 30, 2018 | |
| 44 | Igor Costa | [email protected] | Contoso | France | suspended | $7,195.06 | Nov 9, 2021 | |
| 45 | Hana Silva | [email protected] | Acme | Sweden | suspended | $5,367.12 | Sep 17, 2019 | |
| 46 | Lena Nguyen | [email protected] | Northwind | France | active | $4,195.57 | Apr 23, 2021 | |
| 47 | Elif Fischer | [email protected] | Initech | Brazil | suspended | $4,661.02 | Jan 2, 2025 | |
| 48 | Olga Rossi | [email protected] | Hooli | Canada | invited | $6,622.94 | Oct 30, 2022 | |
| 49 | Kofi Moreau | [email protected] | Initech | Brazil | suspended | $3,468.28 | Mar 27, 2024 | |
| 50 | Hana Haddad | [email protected] | Vandelay | Japan | suspended | $9,222.50 | Dec 10, 2020 |
// app.ts: the grid. Everything on screen is derived from the 10,000 rows by // plain functions in data.ts (filter, sort, page), called again on every // update(). The <tbody> is a list() over the current page, and rows are // matched by identity: sorting moves the <tr>s that stay on the page, and an // edited row is the same object in the table, the selection and the totals. // The "rows built" count proves it: it only grows when a row new to the page appears. import "nuclo"; import { columns, count, cycleSort, edit, matches, money, page, pages, query, remove, STATUSES, view, type Column, type Row, type Status } from "./data.ts"; import { s } from "./styles.ts"; type Field = HTMLInputElement | HTMLSelectElement; const CHECK = 40; // px: the checkbox column const ARROW = { none: "↕", ascending: "↑", descending: "↓" }; const selected = new Set<Row>(); let editing: { row: Row; column: Column } | null = null; let built = 0; let counting = false; // Each <tr> counts itself once, when it is built; one update() after the batch shows the total. function counted() { built++; if (counting) return; counting = true; queueMicrotask(() => { counting = false; update(); }); } const pick = (row: Row, yes: boolean) => (yes ? selected.add(row) : selected.delete(row)); // Puts the cell's text back in place of the editor. If the editor had the // focus, the cell takes it, so the keyboard carries on from there. function close(field: Field) { const cell = document.activeElement === field ? field.parentElement : null; editing = null; update(); cell?.focus(); } // Writes the field to its row, unless the browser finds it invalid (an empty // name, an amount that is not a number): then the editor stays open, in red. function save(field: Field) { if (!editing || !field.checkValidity()) return; const { row, column } = editing; if (column.key === "amount") edit(row, "amount", Number(field.value)); else if (column.key === "status") edit(row, "status", field.value as Status); else edit(row, "name", field.value); close(field); } // Enter or leaving the field saves, Escape cancels. const fieldEvents = { onBlur: (e: FocusEvent & { currentTarget: Field }) => save(e.currentTarget), onKeyDown: (e: KeyboardEvent & { currentTarget: Field }) => { if (e.key === "Enter") save(e.currentTarget); if (e.key === "Escape") { e.preventDefault(); // the docs modal closes on Escape: this one is ours close(e.currentTarget); } }, }; function Editor(row: Row, column: Column) { if (column.key === "status") { return select(s.editor, fieldEvents, { value: () => row.status, "aria-label": "Status", onChange: (e) => save(e.currentTarget) }, on("mount", (el) => el.focus()), ...STATUSES.map((status) => option({ value: status }, status))); } const amount = column.key === "amount"; return input(s.editor, fieldEvents, { value: () => String(row[column.key]), required: true, inputMode: amount ? "decimal" : "text", "aria-label": column.label, pattern: amount ? "\\d+(\\.\\d{1,2})?" : undefined, // a plain number, up to two decimals }, on("mount", (el) => { el.focus(); el.select(); })); } const text = (row: Row, column: Column) => column.format?.(row) ?? String(row[column.key]); // A plain cell is static text: its field never changes. An editable one reads // its row on every update(), and swaps in an editor on double-click or Enter. function Cell(row: Row, column: Column) { const style = cx(s.td, column.align === "right" && s.right); if (!column.editable) return td(style, text(row, column)); const startEdit = () => { editing = { row, column }; update(); }; return td( style, s.editable, { tabIndex: 0, onDblClick: startEdit, onKeyDown: (e) => { if (e.key === "Enter" && e.target === e.currentTarget) startEdit(); } }, when(() => editing?.row === row && editing.column === column, Editor(row, column)).else( column.key === "status" ? span({ class: () => cx(s.pill, s[row.status]).className }, () => row.status) : span(() => text(row, column)), ), ); } function RowView(row: Row) { return tr( { class: () => cx(s.tr, selected.has(row) && s.picked).className }, on("mount", counted), td(s.td, s.check, input({ type: "checkbox", "aria-label": `Select row ${row.id}`, checked: () => selected.has(row), onChange: (e) => { pick(row, e.currentTarget.checked); update(); } })), ...columns.map((column) => Cell(row, column)), ); } // Checked when the whole page is selected, a dash when part of it is. function PageCheckbox() { const state = () => { const onPage = query(); const n = onPage.filter((row) => selected.has(row)).length; return n === 0 ? "none" : n === onPage.length ? "all" : "some"; }; return input({ type: "checkbox", "aria-label": "Select every row on this page", checked: () => state() === "all", indeterminate: () => state() === "some", onChange: (e) => { for (const row of query()) pick(row, e.currentTarget.checked); update(); }, }); } function HeaderCell(column: Column) { const sort = () => (view.sort !== column.key ? "none" : view.desc ? "descending" : "ascending"); let from = { x: 0, width: 0 }; // where the resize drag started return th( s.th, { "aria-sort": sort }, button(cx(s.sort, column.align === "right" && s.right), { onClick: () => { cycleSort(column.key); update(); } }, column.label, span(s.arrow, () => ARROW[sort()])), // Drag the edge to resize. The pointer is captured, so the drag goes on outside the header. span(s.resize, { title: `Resize ${column.label}`, onPointerDown: (e) => { e.currentTarget.setPointerCapture(e.pointerId); from = { x: e.clientX, width: column.width }; }, onPointerMove: (e) => { if (!e.currentTarget.hasPointerCapture(e.pointerId)) return; column.width = Math.max(56, from.width + e.clientX - from.x); update(); }, }), ); } function Toolbar() { return div( s.toolbar, input(s.search, { type: "search", placeholder: "Search name, email, company, country", "aria-label": "Search", value: view.search, onInput: (e) => { view.search = e.currentTarget.value; view.page = 0; update(); }, }), select(s.select, { value: view.status, "aria-label": "Status", onChange: (e) => { view.status = e.currentTarget.value as Status | ""; view.page = 0; update(); } }, option({ value: "" }, "All statuses"), ...STATUSES.map((status) => option({ value: status }, status))), when(() => selected.size > 0, div( s.bulk, span(() => `${count.format(selected.size)} selected`), button(s.btn, s.danger, "Delete", { onClick: () => { remove(selected); selected.clear(); update(); } }), button(s.btn, "Clear selection", { onClick: () => { selected.clear(); update(); } }), )), ); } function Table() { return div( s.scroller, table( s.table, { style: () => ({ width: `max(100%, ${columns.reduce((sum, column) => sum + column.width, CHECK)}px)` }) }, colgroup(col({ style: { width: `${CHECK}px` } }), ...columns.map((column) => col({ style: () => ({ width: `${column.width}px` }) }))), thead(tr(th(s.th, s.check, PageCheckbox()), ...columns.map(HeaderCell))), tbody( list(query, RowView), when(() => matches().length === 0, tr(td(s.empty, { colSpan: columns.length + 1 }, "No rows match."))), ), ), ); } function PageButton(icon: string, title: string, target: () => number) { const to = () => Math.max(0, Math.min(target(), pages() - 1)); return button(s.btn, s.icon, { title, "aria-label": title, disabled: () => to() === page(), onClick: () => { view.page = to(); update(); } }, icon); } function Footer() { return footer( s.footer, span(() => { const total = matches().length; const first = page() * view.size; return total === 0 ? "No rows" : `Showing ${count.format(first + 1)}–${count.format(Math.min(first + view.size, total))} of ${count.format(total)}`; }), span(s.totals, () => { const sum = matches().reduce((total, row) => total + row.amount, 0); return `Total ${money.format(sum)} · avg ${money.format(sum / (matches().length || 1))}`; }), label(s.size, "Rows", select(s.select, { value: String(view.size), onChange: (e) => { view.size = Number(e.currentTarget.value); view.page = 0; update(); } }, ...[25, 50, 100].map((n) => option({ value: String(n) }, String(n))))), div( s.pager, PageButton("«", "First page", () => 0), PageButton("‹", "Previous page", () => page() - 1), PageButton("›", "Next page", () => page() + 1), PageButton("»", "Last page", () => pages() - 1), ), ); } export function DataGrid() { return div( s.app, p(s.hint, strong(() => `${count.format(built)} rows built`), ". Sorting moves the rows that stay on the page and builds only the new ones: search \"elif.novak\", then sort. Double-click a name, status or amount to edit it."), Toolbar(), Table(), Footer(), ); }
// data.ts: the model. 10,000 rows of plain objects, each generated from its // index, so the server and the browser build the same table. What the grid // shows is plain functions over that array: filter, sort, then the page slice. // An edit writes to the row object itself. Nothing here knows about the UI. export type Status = "active" | "invited" | "suspended"; export const STATUSES: Status[] = ["active", "invited", "suspended"]; export interface Row { id: number; name: string; email: string; company: string; country: string; status: Status; amount: number; joined: string; // an ISO date, so it sorts as text } export interface Column { key: keyof Row; label: string; width: number; // px: resizing a column writes it here align?: "right"; format?: (row: Row) => string; editable?: boolean; } // One fixed locale, so the server and the browser print the same text. export const count = new Intl.NumberFormat("en-US"); export const money = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }); const day = new Intl.DateTimeFormat("en-US", { dateStyle: "medium", timeZone: "UTC" }); export const columns: Column[] = [ { key: "id", label: "ID", width: 64, align: "right" }, { key: "name", label: "Name", width: 160, editable: true }, { key: "email", label: "Email", width: 210 }, { key: "company", label: "Company", width: 120 }, { key: "country", label: "Country", width: 110 }, { key: "status", label: "Status", width: 110, editable: true }, { key: "amount", label: "Amount", width: 120, align: "right", format: (row) => money.format(row.amount), editable: true }, { key: "joined", label: "Joined", width: 120, format: (row) => day.format(new Date(row.joined)) }, ]; const FIRST = ["Ana", "Bruno", "Chen", "Dana", "Elif", "Farah", "Gabriel", "Hana", "Igor", "Julia", "Kofi", "Lena", "Marta", "Nikhil", "Olga", "Pedro"]; const LAST = ["Silva", "Okafor", "Tanaka", "Novak", "Haddad", "Larsen", "Moreau", "Kowalski", "Costa", "Nguyen", "Fischer", "Rossi"]; const COMPANIES = ["Acme", "Globex", "Initech", "Hooli", "Northwind", "Contoso", "Vandelay", "Umbrella"]; const COUNTRIES = ["Brazil", "Canada", "France", "Germany", "India", "Japan", "Kenya", "Mexico", "Portugal", "Sweden"]; // A small integer hash: every field of a row is a deterministic function of its index. function hash(n: number) { n = Math.imul(n ^ (n >>> 16), 0x45d9f3b); n = Math.imul(n ^ (n >>> 16), 0x45d9f3b); return (n ^ (n >>> 16)) >>> 0; } const pick = <T>(list: readonly T[], i: number, salt: number) => list[hash(i * 8 + salt) % list.length]; const rows: Row[] = Array.from({ length: 10_000 }, (_, i) => { const [first, last, company] = [pick(FIRST, i, 1), pick(LAST, i, 2), pick(COMPANIES, i, 3)]; return { id: i + 1, name: `${first} ${last}`, email: `${first}.${last}@${company}.com`.toLowerCase(), company, country: pick(COUNTRIES, i, 4), status: pick(STATUSES, i, 5), amount: (hash(i * 8 + 6) % 1_000_000) / 100, joined: new Date(Date.UTC(2018, 0, 1 + (hash(i * 8 + 7) % 2900))).toISOString().slice(0, 10), }; }); // What the grid asks for; query() turns it into the rows on screen. A status of "" is every status. export const view = { search: "", status: "" as Status | "", sort: null as keyof Row | null, desc: false, page: 0, size: 50 }; const SEARCHED = ["name", "email", "company", "country"] as const; // A one-entry memo. Filtering and sorting 10,000 rows takes a few milliseconds: // fine once per keystroke, wasteful on every update() (a column resize runs one // per pointer move, and several parts of the grid read the result each time). let memo: { key: string; rows: Row[] } | null = null; /** Every row that passes the search and the status filter, in sort order. */ export function matches() { const key = JSON.stringify([view.search, view.status, view.sort, view.desc]); if (memo?.key === key) return memo.rows; const q = view.search.trim().toLowerCase(); const found = rows.filter((row) => (!view.status || row.status === view.status) && (!q || SEARCHED.some((field) => row[field].toLowerCase().includes(q)))); const by = view.sort; if (by) { const dir = view.desc ? -1 : 1; // sort() is stable: rows with equal values stay in id order. found.sort((a, b) => (a[by] < b[by] ? -dir : a[by] > b[by] ? dir : 0)); } memo = { key, rows: found }; return found; } export const pages = () => Math.max(1, Math.ceil(matches().length / view.size)); /** The page on screen, kept in range when the rows behind it shrink. */ export const page = () => Math.min(view.page, pages() - 1); /** The rows of the current page. */ export const query = () => matches().slice(page() * view.size, (page() + 1) * view.size); /** A header click: ascending, then descending, then back to id order. */ export function cycleSort(key: keyof Row) { if (view.sort !== key) [view.sort, view.desc] = [key, false]; else if (!view.desc) view.desc = true; else view.sort = null; } /** Writes one field. The row stays the same object, wherever it is used. */ export function edit<K extends keyof Row>(row: Row, key: K, value: Row[K]) { row[key] = value; memo = null; // it may filter or sort differently now } /** Deletes rows in place: every other row keeps its object. */ export function remove(gone: Set<Row>) { let kept = 0; for (const row of rows) if (!gone.has(row)) rows[kept++] = row; rows.length = kept; memo = null; }
import "nuclo"; const mono = "ui-monospace, monospace"; const control = { height: "32px", padding: "0 10px", borderRadius: "8px", border: "1px solid var(--c-border-light)", backgroundColor: "var(--c-bg)", color: "var(--c-text)", fontFamily: "inherit", fontSize: "0.8125rem" }; const cell = { height: "36px", padding: "0 10px", borderBottom: "1px solid var(--c-border)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }; export const s = { app: css("grid-app", { display: "flex", flexDirection: "column", gap: "10px", width: "100%", height: "100%" }), hint: css("grid-hint", { fontSize: "0.8125rem", color: "var(--c-text-dim)", "& strong": { color: "var(--c-primary-ink)", fontVariantNumeric: "tabular-nums" } }), toolbar: css("grid-toolbar", { display: "flex", flexWrap: "wrap", alignItems: "center", gap: "8px" }), search: css("grid-search", { ...control, flex: "1 1 180px", minWidth: "0", maxWidth: "320px" }), select: css("grid-select", control), bulk: css("grid-bulk", { display: "flex", alignItems: "center", gap: "8px", marginLeft: "auto", fontSize: "0.8125rem", fontWeight: "600", fontVariantNumeric: "tabular-nums" }), btn: css("grid-btn", { ...control, fontWeight: "600", whiteSpace: "nowrap", hover: { backgroundColor: "var(--c-bg-secondary)" }, "&:disabled": { opacity: "0.4", cursor: "default" } }), danger: css("grid-danger", { borderColor: "transparent", backgroundColor: "var(--c-primary-dark)", color: "#fff", hover: { backgroundColor: "var(--c-primary-dark)", filter: "brightness(0.92)" } }), icon: css("grid-icon", { width: "32px", padding: "0" }), // The table scrolls inside this box, both ways: on a phone the page itself never does. scroller: css("grid-scroller", { flex: "1", minHeight: "200px", overflow: "auto", borderRadius: "10px", border: "1px solid var(--c-border)", backgroundColor: "var(--c-bg)" }), // Fixed layout: the <col> widths are the column widths, whatever the cells hold. table: css("grid-table", { tableLayout: "fixed", borderCollapse: "separate", borderSpacing: "0", fontSize: "0.8125rem" }), th: css("grid-th", { ...cell, position: "sticky", top: "0", zIndex: 1, padding: "0", textAlign: "left", backgroundColor: "var(--c-bg-secondary)" }), sort: css("grid-sort", { display: "flex", alignItems: "center", gap: "4px", width: "100%", height: "36px", padding: "0 10px", fontSize: "inherit", fontWeight: "600", color: "var(--c-text-dim)", hover: { color: "var(--c-text)" } }), arrow: css("grid-arrow", { color: "var(--c-text-muted)" }), resize: css("grid-resize", { position: "absolute", top: "0", right: "0", width: "8px", height: "100%", borderRight: "1px solid var(--c-border)", cursor: "col-resize", touchAction: "none", hover: { backgroundColor: "var(--c-primary-alpha-19)" } }), tr: css("grid-tr", { hover: { backgroundColor: "var(--c-bg-secondary)" } }), picked: css("grid-picked", { backgroundColor: "var(--c-primary-alpha-08)", hover: { backgroundColor: "var(--c-primary-alpha-13)" } }), td: css("grid-td", cell), check: css("grid-check", { textAlign: "center", "& input": { accentColor: "var(--c-primary)", cursor: "pointer" } }), right: css("grid-right", { textAlign: "right", justifyContent: "flex-end", fontVariantNumeric: "tabular-nums" }), editable: css("grid-editable", { cursor: "text", focusVisible: { outline: "2px solid var(--c-primary)", outlineOffset: "-2px" } }), editor: css("grid-editor", { width: "100%", height: "28px", padding: "0 6px", borderRadius: "6px", border: "1px solid var(--c-primary)", outline: "none", backgroundColor: "var(--c-bg)", color: "var(--c-text)", fontFamily: "inherit", fontSize: "inherit", textAlign: "inherit", invalid: { borderColor: "#ef4444", backgroundColor: "rgba(239,68,68,0.1)" } }), pill: css("grid-pill", { display: "inline-block", padding: "2px 8px", borderRadius: "999px", fontSize: "0.6875rem", fontWeight: "600", textTransform: "uppercase", letterSpacing: "0.02em" }), active: css("grid-active", { backgroundColor: "var(--c-primary-alpha-13)", color: "var(--c-primary-ink)" }), invited: css("grid-invited", { backgroundColor: "var(--c-bg-light)", color: "var(--c-accent-cool)" }), suspended: css("grid-suspended", { backgroundColor: "var(--c-bg-light)", color: "var(--c-text-muted)", textDecoration: "line-through" }), empty: css("grid-empty", { padding: "32px", textAlign: "center", color: "var(--c-text-muted)" }), footer: css("grid-footer", { display: "flex", flexWrap: "wrap", alignItems: "center", gap: "8px 14px", fontSize: "0.8125rem", color: "var(--c-text-dim)", fontVariantNumeric: "tabular-nums" }), totals: css("grid-totals", { flex: "1", fontFamily: mono, fontSize: "0.75rem", color: "var(--c-text-muted)" }), size: css("grid-size", { display: "flex", alignItems: "center", gap: "6px" }), pager: css("grid-pager", { display: "flex", gap: "4px" }), };