fix(ui): merge type-scale sizes with colours and put the column picker in the header

This commit is contained in:
sam committed 2026-10-24 12:21:48 +11:00
1 parent 6b762a2609
commit 5fdd968fca
12 files changed
+98 -91

No files matched your search

@@ -46,7 +46,11 @@ function toggle(id: string, on: boolean): void {
<template>
<div>
<div v-if="optional.length" class="mb-1 flex justify-end">
<Table>
<TableHeader>
<TableRow>
<TableHead v-for="column in shown" :key="column.id" :class="column.class">{{ column.label }}</TableHead>
<TableHead v-if="optional.length" class="w-0 text-right">
<DropdownMenu>
<DropdownMenuTrigger as-child>
<Button variant="ghost" size="icon-sm" aria-label="Columns" title="Columns"><Columns3 /></Button>
@@ -61,11 +65,7 @@ function toggle(id: string, on: boolean): void {
>{{ column.label }}</DropdownMenuCheckboxItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
<Table>
<TableHeader>
<TableRow>
<TableHead v-for="column in shown" :key="column.id" :class="column.class">{{ column.label }}</TableHead>
</TableHead>
</TableRow>
</TableHeader>
<TableBody>
@@ -73,6 +73,7 @@ function toggle(id: string, on: boolean): void {
<TableCell v-for="column in shown" :key="column.id" :class="column.class">
<slot :name="`cell-${column.id}`" :row="row" />
</TableCell>
<TableCell v-if="optional.length" />
</TableRow>
</TableBody>
</Table>
+7 -1
View File
@@ -1,6 +1,12 @@
import type { ClassValue } from "clsx";
import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";
import { extendTailwindMerge } from "tailwind-merge";
// The type scale's sizes (style.css), registered so a size and a colour on
// one element are not merged as two colours.
const twMerge = extendTailwindMerge({
extend: { theme: { text: ["micro", "caption", "label", "title"] } },
});
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));