mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-04 22:21:21 +09:00
Phase 0 of the ServerKit UI redesign (see docs/REDESIGN_MAP.md): - Remap design tokens to the new infra-console palette behind existing names; add prototype token names (surface ramp, cyan/violet, accent-bright/-bg). Dark/light/system. - Self-host IBM Plex (woff2 vendored via scripts/fetch-fonts.mjs); no Google Fonts CDN. - Runtime-derive the full accent ramp in ThemeContext. - Add shared design-system primitives in components/ds (Pill, EnvTag, SegControl, MetricCard, Gauge, ServiceTile, Sparkline, AreaChart, ScoreGauge, Feed, Drawer). - Restyle the sidebar (gradient rail, mono section headers, left accent bar) and switch the brand to the demo's gradient-tile logo. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
25 lines
756 B
React
25 lines
756 B
React
import { cn } from '@/lib/utils';
|
|
import { svcGrad, initials } from './utils';
|
|
|
|
// Gradient initial avatar. Defaults to a deterministic gradient + first letter
|
|
// derived from `name`; pass `gradient` and/or `label` to override.
|
|
export function ServiceTile({ name = '', size = 38, label, gradient, className, style, ...props }) {
|
|
return (
|
|
<span
|
|
className={cn('sk-tile', className)}
|
|
style={{
|
|
width: size,
|
|
height: size,
|
|
fontSize: Math.round(size * 0.4),
|
|
background: gradient || svcGrad(name),
|
|
...style,
|
|
}}
|
|
{...props}
|
|
>
|
|
{label || initials(name)}
|
|
</span>
|
|
);
|
|
}
|
|
|
|
export default ServiceTile;
|