DataTable: one step larger text

Row text is 15px (new text-table token), header and small cell captions
13px instead of 12px, in the phone card view too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ilya Mukhortov 2026-10-28 12:00:13 +10:00
parent 5d137d4ae6
commit 5a2b156bef
2 changed files with 7 additions and 3 deletions

View File

@ -116,7 +116,7 @@ export function DataTable<T>({
if (renderCard && narrow) {
return (
<div ref={ref}>
<ul className={cn("divide-y divide-border/60 text-sm", className)}>
<ul className={cn("divide-y divide-border/60 text-table [&_.text-xs]:text-ui", className)}>
{skeleton &&
Array.from({ length: 5 }, (_, i) => (
<li key={i} className="space-y-2 px-4 py-3">
@ -149,10 +149,11 @@ export function DataTable<T>({
return (
<div ref={ref}>
<table className={cn("w-full text-sm", className)}>
{/* Текст строк — text-table (15px); мелкие подписи ячеек (text-xs) — на шаг крупнее, text-ui. */}
<table className={cn("w-full text-table [&_td.text-xs]:text-ui [&_td_.text-xs]:text-ui", className)}>
{/* Липкая шапка: фон непрозрачный, линия — тенью ячеек (border у thead при прокрутке остаётся на месте). */}
<thead className="sticky top-0 z-10">
<tr className="text-left text-xs text-muted-foreground">
<tr className="text-left text-ui text-muted-foreground">
{visible.map((col) => {
const active = sort?.id === col.id
const Icon = !active ? ChevronsUpDownIcon : sort.direction === "asc" ? ArrowUpIcon : ArrowDownIcon

View File

@ -124,7 +124,10 @@
* Мелкие размеры между шагами Tailwind — вместо text-[Npx] в разметке:
* text-ui (13px) — мета-строки под заголовком (телефон, карта, врач), второстепенные подписи;
* text-2xs (11px) — счётчики, подписи осей, бейджи; text-3xs (10px) — метки в плотных сетках.
* text-table (15px) — основной текст строк DataTable: таблицы читают подолгу, на шаг крупнее text-sm.
*/
--text-table: 0.9375rem;
--text-table--line-height: 1.375rem;
--text-ui: 0.8125rem;
--text-ui--line-height: 1.125rem;
--text-2xs: 0.6875rem;