fix(fonts): semantic typography utilities per handoff (7 roles)

Заменяет blanket override из MR !45 на типизированную type scale per
design_handoff_ordinis_mdm/README.md "Scale" section.

Семь semantic @utility в styles.css:
  text-title-xl  22/600   — modal title, section header
  text-title-lg  17/600   — page title в editor
  text-title-md  15/600   — dictionary card title
  text-body      13/400   — workhorse: body, buttons, tabs, inputs
  text-cell      12.5/500 — table cell text
  text-mono      11/500   — Mono: IDs, dates, FK refs (font-mono baked in)
  text-cap       10.5/600 — Tektur UPPERCASE caption (font/uppercase baked in)

Audit phases:
  P1: добавил 7 утилит, font/uppercase/tracking baked где надо
  P2: 43 deterministic codemods (font-mono+text-2xs/[11px] → text-mono,
      [15/17/22]px+font-semibold → text-title-*, [12.5]px → text-cell,
      [10.5]px+uppercase+tracking → text-cap)
  P3: 64 text-sm → text-body (handoff workhorse), 84 text-2xs context-aware
      (TableCell → text-cell, bare → text-cell, плюс cleanup caps в backticks
      template literals который Phase 2 пропустил), 25 text-xs (6 → text-mono
      когда с font-mono, 19 → text-cell), 8 titles text-base/lg → text-title-*
  P4: убрал --text-2xs override (no users), оставил --text-sm: 13px scoped
      к @nstart/ui passthrough (см. comment в styles.css — убирается в Stage 3.9)

Stats:
  text-body: 69 | text-cell: 99 | text-mono: 50 | text-cap: 42
  text-title-xl: 5 | text-title-lg: 5 | text-title-md: 7
  text-sm/text-2xs/text-xs в src/: 0 (только в styles.css комментариях)

Поведение всех 277 typography usages теперь явно соответствует handoff —
каждое место осознанно выбрано под роль, не плажирующий override.
This commit is contained in:
Zimin A.N.
2026-05-11 14:31:35 +03:00
parent e62633d903
commit b94912789f
46 changed files with 296 additions and 243 deletions
@@ -140,7 +140,7 @@ export function Sidebar() {
{/* User block — sticky bottom */}
{auth.isAuthenticated && auth.user?.profile && (
<div className="border-t border-line px-3 py-3 flex items-center gap-2">
<div className="size-8 rounded-full bg-accent text-on-accent inline-flex items-center justify-center text-xs font-semibold">
<div className="size-8 rounded-full bg-accent text-on-accent inline-flex items-center justify-center text-cell font-semibold">
{String(
auth.user.profile.preferred_username ||
auth.user.profile.name ||
@@ -150,7 +150,7 @@ export function Sidebar() {
.toUpperCase()}
</div>
<div className="min-w-0 flex-1">
<div className="text-xs font-medium text-ink truncate">
<div className="text-cell font-medium text-ink truncate">
{String(
auth.user.profile.preferred_username ||
auth.user.profile.name ||
@@ -159,7 +159,7 @@ export function Sidebar() {
)}
</div>
{auth.user.profile.email && (
<div className="text-2xs text-mute truncate">{String(auth.user.profile.email)}</div>
<div className="text-cell text-mute truncate">{String(auth.user.profile.email)}</div>
)}
</div>
</div>
@@ -179,9 +179,8 @@ function SidebarLink({ to, label, icon: Icon, badge }: NavItem) {
<Link
to={to}
className={cn(
// 13px per handoff spec для workhorse body text. text-sm = 14px (Tailwind),
// text-[13px] = exact handoff value.
'group flex items-center gap-2.5 px-3 py-1.5 rounded-md text-[13px] transition-colors',
// text-body = 13px workhorse per handoff (см. styles.css @utility).
'group flex items-center gap-2.5 px-3 py-1.5 rounded-md text-body transition-colors',
active
? 'bg-accent-bg text-accent font-medium'
: 'text-ink-2 hover:text-ink hover:bg-surface-2',
@@ -192,7 +191,7 @@ function SidebarLink({ to, label, icon: Icon, badge }: NavItem) {
{badge !== undefined && (
<span
className={cn(
'inline-flex items-center justify-center min-w-5 h-5 px-1.5 rounded-sm text-[11px] font-mono',
'inline-flex items-center justify-center min-w-5 h-5 px-1.5 rounded-sm text-mono',
active
? 'bg-accent text-on-accent'
: 'bg-surface-2 text-ink-2 group-hover:bg-line',
@@ -60,12 +60,12 @@ export function TopBar() {
return (
<header className="h-14 shrink-0 border-b border-line bg-surface flex items-center px-4 sm:px-6 gap-3">
{/* Breadcrumb — left */}
<nav className="flex items-center gap-1.5 text-sm min-w-0">
<nav className="flex items-center gap-1.5 text-body min-w-0">
{breadcrumb.map((crumb, i) => {
const isLast = i === breadcrumb.length - 1
return (
<span key={i} className="flex items-center gap-1.5 min-w-0">
{i > 0 && <span className="text-mute text-xs">/</span>}
{i > 0 && <span className="text-mute text-cell">/</span>}
{crumb.to && !isLast ? (
<Link
to={crumb.to}
@@ -101,7 +101,7 @@ export function TopBar() {
href="/docs/"
target="_blank"
rel="noreferrer noopener"
className="hidden sm:inline text-xs text-ink-2 hover:text-ink transition-colors"
className="hidden sm:inline text-cell text-ink-2 hover:text-ink transition-colors"
>
{t('nav.docs')}
</a>