Skip to content

Commit 513e10b

Browse files
committed
style(sql): replace off-token colours and ad-hoc classes with design tokens [UX-1259]
Map palette literals (blue/green/orange/indigo/purple) in the SQL workspace to semantic registry tokens (info/success/warning/accent/primary) and snap arbitrary typography/radius utilities (text-[Npx], rounded-[3px], leading/ tracking-[...]) to scale tokens. Drop now-redundant dark: variants since the semantic tokens are theme-adaptive. Lookout audit: 0 off-token, 0 ad-hoc.
1 parent 26af8cb commit 513e10b

7 files changed

Lines changed: 91 additions & 91 deletions

File tree

frontend/src/components/debug-helper/debug-dialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ function StorageEntryRow({ storageKey, value }: { storageKey: string; value: str
374374
</Badge>
375375
</div>
376376
{!expanded && (
377-
<div className="min-w-0 truncate font-mono text-[11px] text-muted-foreground">
377+
<div className="min-w-0 truncate font-mono text-xs text-muted-foreground">
378378
{formatted.split('\n')[0]}
379379
</div>
380380
)}
@@ -632,7 +632,7 @@ function FeatureFlagsTab() {
632632
</Badge>
633633
)}
634634
</div>
635-
<Text className="text-[11px] text-muted-foreground">
635+
<Text className="text-xs text-muted-foreground">
636636
default: <InlineCode>{String(defaultValue)}</InlineCode> · effective:{' '}
637637
<InlineCode>{String(effectiveValue)}</InlineCode>
638638
</Text>

frontend/src/components/pages/sql/catalog-tree.tsx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,21 @@ const COL_KIND_ICON: Record<ColumnKind, typeof Hash> = {
6969
// Shared row layout: flex, gap, full-width, left-aligned, padded, rounded, with a
7070
// subtle hover background. Used by namespace rows and the "Add a topic" row.
7171
const ROW_BASE =
72-
'flex w-full cursor-pointer items-center gap-[6px] rounded border-0 bg-transparent px-[8px] py-[6px] text-left text-[13px] text-strong hover:bg-accent-subtle';
72+
'flex w-full cursor-pointer items-center gap-[6px] rounded border-0 bg-transparent px-[8px] py-[6px] text-left text-sm text-strong hover:bg-accent-subtle';
7373

7474
// Truncating label that fills the remaining row width.
7575
const LABEL = 'flex-1 overflow-hidden text-left text-ellipsis whitespace-nowrap';
7676

7777
function engineMark(engine: CatalogEngine) {
7878
if (engine === 'redpanda') {
7979
return (
80-
<span className="inline-flex h-[20px] w-[20px] flex-shrink-0 items-center justify-center rounded bg-indigo-alpha-100 text-indigo-700">
80+
<span className="inline-flex h-[20px] w-[20px] flex-shrink-0 items-center justify-center rounded bg-primary-subtle text-primary">
8181
<Layers size={13} />
8282
</span>
8383
);
8484
}
8585
return (
86-
<span className="inline-flex h-[20px] w-[20px] flex-shrink-0 items-center justify-center rounded bg-blue-alpha-100 text-blue-700">
86+
<span className="inline-flex h-[20px] w-[20px] flex-shrink-0 items-center justify-center rounded bg-info-subtle text-info">
8787
<Box size={13} />
8888
</span>
8989
);
@@ -125,7 +125,7 @@ function ColumnList({ catalogName, tableName }: ColumnListProps) {
125125
if (isLoading) {
126126
return (
127127
<div className="mb-[2px] ml-[26px] border-border-subtle border-l pl-[8px]">
128-
<div className="flex items-center gap-[7px] px-[16px] py-[6px] text-[12px] text-muted-foreground">
128+
<div className="flex items-center gap-[7px] px-[16px] py-[6px] text-xs text-muted-foreground">
129129
<Spinner />
130130
<span>Loading columns…</span>
131131
</div>
@@ -143,7 +143,7 @@ function ColumnList({ catalogName, tableName }: ColumnListProps) {
143143
if (columns.length === 0) {
144144
return (
145145
<div className="mb-[2px] ml-[26px] border-border-subtle border-l pl-[8px]">
146-
<div className="px-[16px] py-[6px] text-[12px] text-disabled">No columns</div>
146+
<div className="px-[16px] py-[6px] text-xs text-disabled">No columns</div>
147147
</div>
148148
);
149149
}
@@ -153,10 +153,10 @@ function ColumnList({ catalogName, tableName }: ColumnListProps) {
153153
{columns.map((col) => {
154154
const KindIcon = COL_KIND_ICON[col.kind];
155155
return (
156-
<div className="flex items-center gap-[7px] px-[8px] py-[3px] text-[12px] text-foreground" key={col.name}>
156+
<div className="flex items-center gap-[7px] px-[8px] py-[3px] text-xs text-foreground" key={col.name}>
157157
<KindIcon className="flex-shrink-0 text-muted-foreground" size={11} />
158158
<span className="flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono">{col.name}</span>
159-
<span className="font-mono text-[10px] text-muted-foreground tracking-[0.02em]">{col.short}</span>
159+
<span className="font-mono text-caption-sm text-muted-foreground tracking-wide">{col.short}</span>
160160
</div>
161161
);
162162
})}
@@ -187,7 +187,7 @@ function TableRow({ catalog, table, isOpen, isActive, onToggle, onQueryTable }:
187187
// The table icon picks up the Iceberg blue when the table is Iceberg-backed or
188188
// tiered, the disabled grey when locked, else the action-primary accent.
189189
const tableIcoClass = cn('flex-shrink-0 text-action-primary', {
190-
'text-blue-700 dark:text-blue-400': (isIceberg || tiered) && allowed,
190+
'text-info': (isIceberg || tiered) && allowed,
191191
'text-disabled': !allowed,
192192
});
193193

@@ -200,7 +200,7 @@ function TableRow({ catalog, table, isOpen, isActive, onToggle, onQueryTable }:
200200
data-tiered={tiered || undefined}
201201
>
202202
<button
203-
className="flex min-w-0 flex-1 cursor-pointer items-center gap-[6px] border-0 bg-transparent px-[8px] py-[6px] font-[inherit] text-[13px] text-strong disabled:cursor-default disabled:text-disabled"
203+
className="flex min-w-0 flex-1 cursor-pointer items-center gap-[6px] border-0 bg-transparent px-[8px] py-[6px] font-sans text-sm text-strong disabled:cursor-default disabled:text-disabled"
204204
disabled={!allowed}
205205
onClick={() => allowed && onToggle()}
206206
type="button"
@@ -209,14 +209,14 @@ function TableRow({ catalog, table, isOpen, isActive, onToggle, onQueryTable }:
209209
<TableIcon className={tableIcoClass} size={13} />
210210
<span className={LABEL}>{table.name}</span>
211211
{isIceberg && (
212-
<span className="inline-flex flex-shrink-0 items-center gap-[3px] rounded-[3px] bg-blue-alpha-100 py-[1px] pr-[5px] pl-[4px] font-bold text-[9px] text-blue-700 uppercase tracking-[0.03em] dark:text-blue-300">
212+
<span className="inline-flex flex-shrink-0 items-center gap-[3px] rounded-sm bg-info-subtle py-[1px] pr-[5px] pl-[4px] font-bold text-caption-sm text-info uppercase tracking-wide">
213213
<Box size={9} />
214214
Iceberg
215215
</span>
216216
)}
217217
{tiered && (
218218
<span
219-
className="inline-flex flex-shrink-0 items-center gap-[3px] rounded-[3px] bg-blue-alpha-100 py-[1px] pr-[5px] pl-[4px] font-bold text-[9px] text-blue-700 uppercase tracking-[0.03em] dark:text-blue-300"
219+
className="inline-flex flex-shrink-0 items-center gap-[3px] rounded-sm bg-info-subtle py-[1px] pr-[5px] pl-[4px] font-bold text-caption-sm text-info uppercase tracking-wide"
220220
title="Iceberg-tiered · bridge queried"
221221
>
222222
<GitMerge size={9} />
@@ -227,7 +227,7 @@ function TableRow({ catalog, table, isOpen, isActive, onToggle, onQueryTable }:
227227
</button>
228228
{allowed && (
229229
<button
230-
className="mr-[4px] inline-flex h-[26px] w-[26px] flex-shrink-0 cursor-pointer items-center justify-center rounded border-0 bg-transparent text-action-primary opacity-0 hover:bg-indigo-100 group-hover:opacity-100"
230+
className="mr-[4px] inline-flex h-[26px] w-[26px] flex-shrink-0 cursor-pointer items-center justify-center rounded border-0 bg-transparent text-action-primary opacity-0 hover:bg-accent group-hover:opacity-100"
231231
onClick={() => onQueryTable(catalog, table)}
232232
title="Query this table"
233233
type="button"
@@ -301,12 +301,12 @@ function NamespaceNode({
301301
<NsChevron className="flex-shrink-0 text-disabled" size={14} />
302302
<GitBranch className="text-muted-foreground" size={13} />
303303
<span className={LABEL}>{namespace.name}</span>
304-
<span className="rounded-full bg-muted px-[7px] py-[1px] text-[11px] text-muted-foreground">{countLabel}</span>
304+
<span className="rounded-full bg-muted px-[7px] py-[1px] text-xs text-muted-foreground">{countLabel}</span>
305305
</button>
306306
{isOpen && (
307307
<div className="ml-[10px]">
308308
{isLoading && allTables.length === 0 && (
309-
<div className="flex items-center gap-[7px] px-[16px] py-[6px] text-[12px] text-muted-foreground">
309+
<div className="flex items-center gap-[7px] px-[16px] py-[6px] text-xs text-muted-foreground">
310310
<Spinner />
311311
<span>Loading tables…</span>
312312
</div>
@@ -323,11 +323,11 @@ function NamespaceNode({
323323
/>
324324
))}
325325
{!isLoading && matched.length === 0 && (
326-
<div className="px-[16px] py-[6px] text-[12px] text-disabled">No tables</div>
326+
<div className="px-[16px] py-[6px] text-xs text-disabled">No tables</div>
327327
)}
328328
{paginate && remaining > 0 && (
329329
<button
330-
className="mt-[2px] flex w-full cursor-pointer items-center gap-[7px] rounded border-0 bg-transparent px-[8px] py-[7px] text-left font-[inherit] font-medium text-[12px] text-action-primary hover:bg-indigo-100"
330+
className="mt-[2px] flex w-full cursor-pointer items-center gap-[7px] rounded border-0 bg-transparent px-[8px] py-[7px] text-left font-sans font-medium text-xs text-action-primary hover:bg-accent"
331331
onClick={onLoadMore}
332332
title="Load more tables"
333333
type="button"
@@ -338,7 +338,7 @@ function NamespaceNode({
338338
)}
339339
{showAddTopic && (
340340
<button
341-
className="flex w-full cursor-pointer items-center gap-[6px] rounded border-0 bg-transparent px-[8px] py-[6px] text-left font-[inherit] font-medium text-[13px] text-action-primary hover:bg-indigo-100"
341+
className="flex w-full cursor-pointer items-center gap-[6px] rounded border-0 bg-transparent px-[8px] py-[6px] text-left font-sans font-medium text-sm text-action-primary hover:bg-accent"
342342
onClick={onAddTable}
343343
title="Create a SQL table from a Redpanda topic"
344344
type="button"
@@ -403,7 +403,7 @@ function CatalogNode({
403403
<div>
404404
<div className="group flex w-full items-center rounded">
405405
<button
406-
className="flex min-w-0 flex-1 cursor-pointer items-center gap-[6px] border-0 bg-transparent px-[8px] py-[6px] font-[inherit] font-semibold text-[13px] text-strong"
406+
className="flex min-w-0 flex-1 cursor-pointer items-center gap-[6px] border-0 bg-transparent px-[8px] py-[6px] font-sans font-semibold text-sm text-strong"
407407
onClick={() => onToggle(catalog.name)}
408408
type="button"
409409
>
@@ -413,7 +413,7 @@ function CatalogNode({
413413
</button>
414414
{showAdd && (
415415
<button
416-
className="mr-[4px] inline-flex h-[26px] w-[26px] flex-shrink-0 cursor-pointer items-center justify-center rounded border-0 bg-transparent text-action-primary opacity-0 hover:bg-indigo-100 group-hover:opacity-100"
416+
className="mr-[4px] inline-flex h-[26px] w-[26px] flex-shrink-0 cursor-pointer items-center justify-center rounded border-0 bg-transparent text-action-primary opacity-0 hover:bg-accent group-hover:opacity-100"
417417
onClick={onAddTable}
418418
title="Add a topic to this catalog"
419419
type="button"
@@ -462,16 +462,16 @@ export function CatalogTree({ catalogs, role, isLoading, activeTableId, onQueryT
462462
return (
463463
<div className="flex h-full min-h-0 flex-col">
464464
<div className="flex items-center justify-between px-[14px] pt-[14px] pb-[8px]">
465-
<span className="font-semibold text-[12px] text-muted-foreground uppercase tracking-[0.04em]">Catalogs</span>
465+
<span className="font-semibold text-xs text-muted-foreground uppercase tracking-wider">Catalogs</span>
466466
{role === 'admin' && (
467-
<span className="text-[10px] text-disabled uppercase tracking-[0.04em]">Redpanda only</span>
467+
<span className="text-caption-sm text-disabled uppercase tracking-wider">Redpanda only</span>
468468
)}
469469
</div>
470470
<div className="px-[12px] pb-[10px]">
471471
<div className="flex items-center">
472472
<Search className="mr-[6px] flex-shrink-0 text-muted-foreground" size={15} />
473473
<input
474-
className="flex-1 border-0 bg-transparent text-[13px] outline-none"
474+
className="flex-1 border-0 bg-transparent text-sm outline-none"
475475
onChange={(e) => setQuery(e.target.value)}
476476
placeholder="Search tables"
477477
value={query}
@@ -481,13 +481,13 @@ export function CatalogTree({ catalogs, role, isLoading, activeTableId, onQueryT
481481

482482
<div className="flex-1 overflow-y-auto px-[8px] pb-[8px]">
483483
{isLoading && catalogs.length === 0 && (
484-
<div className="flex items-center gap-[7px] px-[16px] py-[6px] text-[12px] text-muted-foreground">
484+
<div className="flex items-center gap-[7px] px-[16px] py-[6px] text-xs text-muted-foreground">
485485
<Spinner />
486486
<span>Loading catalogs…</span>
487487
</div>
488488
)}
489489
{!isLoading && catalogs.length === 0 && (
490-
<div className="px-[16px] py-[6px] text-[12px] text-disabled">No catalogs</div>
490+
<div className="px-[16px] py-[6px] text-xs text-disabled">No catalogs</div>
491491
)}
492492
{catalogs.map((catalog) => (
493493
<CatalogNode

frontend/src/components/pages/sql/sql-editor.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ export const SqlEditor = forwardRef<SqlEditorHandle, SqlEditorProps>(function Sq
381381
{tabs.map((t) => (
382382
<div
383383
className={cn(
384-
'relative flex items-center gap-1 whitespace-nowrap border-border-subtle border-r pr-[10px] pl-[14px] text-[12.5px] text-muted-foreground',
384+
'relative flex items-center gap-1 whitespace-nowrap border-border-subtle border-r pr-[10px] pl-[14px] text-xs text-muted-foreground',
385385
'hover:bg-muted hover:text-strong [&_svg]:text-muted-foreground',
386386
'data-[active]:bg-background data-[active]:font-semibold data-[active]:text-strong',
387387
"data-[active]:after:absolute data-[active]:after:inset-x-0 data-[active]:after:-bottom-px data-[active]:after:h-0.5 data-[active]:after:bg-action-primary data-[active]:after:content-['']"
@@ -399,7 +399,7 @@ export const SqlEditor = forwardRef<SqlEditorHandle, SqlEditorProps>(function Sq
399399
</button>
400400
<button
401401
aria-label={`Close ${t.name}`}
402-
className="inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-[3px] border-0 bg-transparent text-muted-foreground hover:bg-muted hover:text-strong"
402+
className="inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent text-muted-foreground hover:bg-muted hover:text-strong"
403403
onClick={(e) => closeTab(t.id, e)}
404404
type="button"
405405
>
@@ -435,15 +435,15 @@ export const SqlEditor = forwardRef<SqlEditorHandle, SqlEditorProps>(function Sq
435435
type="button"
436436
/>
437437
<div className="absolute top-[calc(100%+6px)] right-0 z-[31] max-h-[360px] w-[360px] overflow-y-auto rounded-md border border-border bg-popover p-1 shadow-lg">
438-
<div className="px-2 py-1.5 font-semibold text-[11px] text-muted-foreground uppercase tracking-[0.04em]">
438+
<div className="px-2 py-1.5 font-semibold text-xs text-muted-foreground uppercase tracking-wider">
439439
Recent queries · this browser
440440
</div>
441441
{history.length === 0 ? (
442-
<div className="p-2.5 text-[13px] text-muted-foreground">No queries yet</div>
442+
<div className="p-2.5 text-sm text-muted-foreground">No queries yet</div>
443443
) : null}
444444
{history.map((h, i) => (
445445
<button
446-
className="flex w-full cursor-pointer items-center gap-2 rounded border-0 bg-transparent px-2 py-1.5 text-left text-[12.5px] text-strong hover:bg-accent-subtle [&_svg]:shrink-0 [&_svg]:text-muted-foreground"
446+
className="flex w-full cursor-pointer items-center gap-2 rounded border-0 bg-transparent px-2 py-1.5 text-left text-xs text-strong hover:bg-accent-subtle [&_svg]:shrink-0 [&_svg]:text-muted-foreground"
447447
key={`${h.at}-${i}`}
448448
onClick={() => {
449449
updateSql(h.sql);
@@ -481,10 +481,10 @@ export const SqlEditor = forwardRef<SqlEditorHandle, SqlEditorProps>(function Sq
481481
>
482482
<Play size={14} /> Run
483483
<span className="ml-0.5 inline-flex gap-0.5">
484-
<span className="inline-flex min-w-[18px] items-center justify-center rounded-[3px] bg-white/[0.18] px-1 py-px font-mono font-semibold text-[11px] text-white leading-none">
484+
<span className="inline-flex min-w-[18px] items-center justify-center rounded-sm bg-white/[0.18] px-1 py-px font-mono font-semibold text-xs text-white leading-none">
485485
486486
</span>
487-
<span className="inline-flex min-w-[18px] items-center justify-center rounded-[3px] bg-white/[0.18] px-1 py-px font-mono font-semibold text-[11px] text-white leading-none">
487+
<span className="inline-flex min-w-[18px] items-center justify-center rounded-sm bg-white/[0.18] px-1 py-px font-mono font-semibold text-xs text-white leading-none">
488488
489489
</span>
490490
</span>

0 commit comments

Comments
 (0)