design system token v0.4

This commit is contained in:
Juan
2026-04-13 17:46:30 -05:00
parent f7acb63782
commit c1d4d55333
11 changed files with 33 additions and 12 deletions

View File

@@ -75,6 +75,7 @@
--radius-md: var(--radius); --radius-md: var(--radius);
--radius-lg: calc(var(--radius) + 2px); --radius-lg: calc(var(--radius) + 2px);
--radius-xl: calc(var(--radius) + 4px); --radius-xl: calc(var(--radius) + 4px);
--color-hero-bg: rgb(var(--hero-bg));
--color-sidebar: rgb(var(--sidebar)); --color-sidebar: rgb(var(--sidebar));
--color-sidebar-foreground: rgb(var(--sidebar-foreground)); --color-sidebar-foreground: rgb(var(--sidebar-foreground));
--color-sidebar-primary: rgb(var(--sidebar-primary)); --color-sidebar-primary: rgb(var(--sidebar-primary));

View File

@@ -37,6 +37,7 @@
| `color.semantic.border` | `#c4c4bd` | Default border | | `color.semantic.border` | `#c4c4bd` | Default border |
| `color.semantic.input` | `#c4c4bd` | Input border | | `color.semantic.input` | `#c4c4bd` | Input border |
| `color.semantic.ring` | `#d95e2a` | Focus ring | | `color.semantic.ring` | `#d95e2a` | Focus ring |
| `color.semantic.hero-bg` | `#ddddd7` | Hero banner background |
| `color.semantic.chart.1` | `#d95e2a` | Chart accent | | `color.semantic.chart.1` | `#d95e2a` | Chart accent |
| `color.semantic.chart.2` | `#575753` | Chart secondary | | `color.semantic.chart.2` | `#575753` | Chart secondary |
| `color.semantic.chart.3` | `#7f7f79` | Chart tertiary | | `color.semantic.chart.3` | `#7f7f79` | Chart tertiary |
@@ -69,6 +70,7 @@
| `color.dark.border` | `#575753` | Dark border | | `color.dark.border` | `#575753` | Dark border |
| `color.dark.input` | `#575753` | Dark input border | | `color.dark.input` | `#575753` | Dark input border |
| `color.dark.ring` | `#d95e2a` | Dark focus ring | | `color.dark.ring` | `#d95e2a` | Dark focus ring |
| `color.dark.hero-bg` | `#2f2f2c` | Dark hero banner background |
| `color.dark.chart.1` | `#d95e2a` | Dark chart accent | | `color.dark.chart.1` | `#d95e2a` | Dark chart accent |
| `color.dark.chart.2` | `#c4c4bd` | Dark chart secondary | | `color.dark.chart.2` | `#c4c4bd` | Dark chart secondary |
| `color.dark.chart.3` | `#a6a69f` | Dark chart tertiary | | `color.dark.chart.3` | `#a6a69f` | Dark chart tertiary |

View File

@@ -41,6 +41,8 @@
--input: 87 87 83; --input: 87 87 83;
/* Dark focus ring */ /* Dark focus ring */
--ring: 217 94 42; --ring: 217 94 42;
/* Dark hero banner background */
--hero-bg: 47 47 44;
/* Dark chart accent */ /* Dark chart accent */
--chart-1: 217 94 42; --chart-1: 217 94 42;
/* Dark chart secondary */ /* Dark chart secondary */

View File

@@ -41,6 +41,8 @@
--input: 196 196 189; --input: 196 196 189;
/* Focus ring */ /* Focus ring */
--ring: 217 94 42; --ring: 217 94 42;
/* Hero banner background */
--hero-bg: 221 221 215;
/* Chart accent */ /* Chart accent */
--chart-1: 217 94 42; --chart-1: 217 94 42;
/* Chart secondary */ /* Chart secondary */

View File

@@ -32,6 +32,7 @@ export const ColorTokens = {
'semantic.border': '#c4c4bd', 'semantic.border': '#c4c4bd',
'semantic.input': '#c4c4bd', 'semantic.input': '#c4c4bd',
'semantic.ring': '#d95e2a', 'semantic.ring': '#d95e2a',
'semantic.hero-bg': '#ddddd7',
'semantic.chart.1': '#d95e2a', 'semantic.chart.1': '#d95e2a',
'semantic.chart.2': '#575753', 'semantic.chart.2': '#575753',
'semantic.chart.3': '#7f7f79', 'semantic.chart.3': '#7f7f79',
@@ -64,6 +65,7 @@ export const ColorTokens = {
'dark.border': '#575753', 'dark.border': '#575753',
'dark.input': '#575753', 'dark.input': '#575753',
'dark.ring': '#d95e2a', 'dark.ring': '#d95e2a',
'dark.hero-bg': '#2f2f2c',
'dark.chart.1': '#d95e2a', 'dark.chart.1': '#d95e2a',
'dark.chart.2': '#c4c4bd', 'dark.chart.2': '#c4c4bd',
'dark.chart.3': '#a6a69f', 'dark.chart.3': '#a6a69f',

View File

@@ -11,7 +11,7 @@ const heroVariants = cva('py-24 px-6', {
split: 'text-left', split: 'text-left',
}, },
background: { background: {
default: 'bg-background', default: 'bg-hero-bg',
muted: 'bg-muted', muted: 'bg-muted',
accent: 'bg-primary/5', accent: 'bg-primary/5',
dark: 'bg-foreground text-background', dark: 'bg-foreground text-background',

View File

@@ -6,13 +6,13 @@ import { cn } from '@/lib/utils'
import { Button } from '@/components/ui/button' import { Button } from '@/components/ui/button'
const navbarVariants = cva( const navbarVariants = cva(
'fixed top-0 left-0 right-0 z-50 h-16 font-sans', 'fixed top-0 left-0 right-0 z-50 h-[65px] font-sans',
{ {
variants: { variants: {
variant: { variant: {
solid: 'bg-background border-b border-border', solid: 'bg-card dark:bg-background border-b border-border',
transparent: 'bg-transparent', transparent: 'bg-transparent',
minimal: 'bg-background/80 backdrop-blur-sm border-b border-border/50', minimal: 'bg-card/80 dark:bg-background/80 backdrop-blur-sm border-b border-border/50',
}, },
}, },
defaultVariants: { defaultVariants: {
@@ -47,7 +47,7 @@ function Navbar({
<div className="container mx-auto px-6 h-full flex items-center justify-between"> <div className="container mx-auto px-6 h-full flex items-center justify-between">
{/* Logo slot — left */} {/* Logo slot — left */}
{logo && ( {logo && (
<div data-slot="navbar-logo" className="flex-shrink-0"> <div data-slot="navbar-logo" className="shrink-0">
{logo} {logo}
</div> </div>
)} )}
@@ -55,7 +55,7 @@ function Navbar({
{/* Desktop nav — center */} {/* Desktop nav — center */}
<nav <nav
data-slot="navbar-nav" data-slot="navbar-nav"
className="hidden md:flex items-center gap-1 text-sm font-medium" className="hidden md:flex items-center gap-1 text-sm font-semibold"
> >
{children} {children}
</nav> </nav>
@@ -93,9 +93,9 @@ function Navbar({
{mobileOpen && ( {mobileOpen && (
<div <div
data-slot="navbar-mobile" data-slot="navbar-mobile"
className="md:hidden border-b border-border bg-background" className="md:hidden border-b border-border bg-card dark:bg-background"
> >
<nav className="container mx-auto px-6 py-4 flex flex-col gap-2 text-sm font-medium"> <nav className="container mx-auto px-6 py-4 flex flex-col gap-2 text-sm font-semibold">
{children} {children}
</nav> </nav>
{actions && ( {actions && (
@@ -119,8 +119,8 @@ function NavbarLink({
data-slot="navbar-link" data-slot="navbar-link"
data-active={active || undefined} data-active={active || undefined}
className={cn( className={cn(
'px-3 py-2 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent transition-colors', 'px-3 py-2 text-foreground transition-opacity hover:opacity-70',
'data-[active]:text-foreground data-[active]:font-semibold', 'data-active:opacity-100',
className, className,
)} )}
{...props} {...props}

View File

@@ -26,7 +26,7 @@ function PageLayout({
<div <div
className={cn( className={cn(
'flex flex-1', 'flex flex-1',
navbar && 'pt-16', // offset for fixed navbar navbar && 'pt-16.25', // offset for fixed 65px navbar
)} )}
> >
{sidebar && ( {sidebar && (

View File

@@ -7,7 +7,7 @@ const sectionVariants = cva('py-16', {
variants: { variants: {
variant: { variant: {
default: '', default: '',
highlighted: 'bg-muted', highlighted: 'bg-card dark:bg-muted',
accent: 'bg-primary/5', accent: 'bg-primary/5',
}, },
width: { width: {

View File

@@ -101,6 +101,7 @@ Source of truth: `tokens/*.json` (W3C DTCG format).
| `color.semantic.border` | `{color.primitive.grey.3}` | Default border | | `color.semantic.border` | `{color.primitive.grey.3}` | Default border |
| `color.semantic.input` | `{color.primitive.grey.3}` | Input border | | `color.semantic.input` | `{color.primitive.grey.3}` | Input border |
| `color.semantic.ring` | `{color.primitive.orange}` | Focus ring | | `color.semantic.ring` | `{color.primitive.orange}` | Focus ring |
| `color.semantic.hero-bg` | `{color.primitive.grey.2}` | Hero banner background |
| `color.semantic.chart.1` | `{color.primitive.orange}` | Chart accent | | `color.semantic.chart.1` | `{color.primitive.orange}` | Chart accent |
| `color.semantic.chart.2` | `{color.primitive.grey.7}` | Chart secondary | | `color.semantic.chart.2` | `{color.primitive.grey.7}` | Chart secondary |
| `color.semantic.chart.3` | `{color.primitive.grey.5}` | Chart tertiary | | `color.semantic.chart.3` | `{color.primitive.grey.5}` | Chart tertiary |
@@ -133,6 +134,7 @@ Source of truth: `tokens/*.json` (W3C DTCG format).
| `color.dark.border` | `{color.primitive.grey.7}` | Dark border | | `color.dark.border` | `{color.primitive.grey.7}` | Dark border |
| `color.dark.input` | `{color.primitive.grey.7}` | Dark input border | | `color.dark.input` | `{color.primitive.grey.7}` | Dark input border |
| `color.dark.ring` | `{color.primitive.orange}` | Dark focus ring | | `color.dark.ring` | `{color.primitive.orange}` | Dark focus ring |
| `color.dark.hero-bg` | `{color.primitive.grey.8}` | Dark hero banner background |
| `color.dark.chart.1` | `{color.primitive.orange}` | Dark chart accent | | `color.dark.chart.1` | `{color.primitive.orange}` | Dark chart accent |
| `color.dark.chart.2` | `{color.primitive.grey.3}` | Dark chart secondary | | `color.dark.chart.2` | `{color.primitive.grey.3}` | Dark chart secondary |
| `color.dark.chart.3` | `{color.primitive.grey.4}` | Dark chart tertiary | | `color.dark.chart.3` | `{color.primitive.grey.4}` | Dark chart tertiary |

View File

@@ -158,6 +158,11 @@
"$value": "{color.primitive.orange}", "$value": "{color.primitive.orange}",
"$description": "Focus ring" "$description": "Focus ring"
}, },
"hero-bg": {
"$type": "color",
"$value": "{color.primitive.grey.2}",
"$description": "Hero banner background"
},
"chart": { "chart": {
"1": { "1": {
"$type": "color", "$type": "color",
@@ -325,6 +330,11 @@
"$value": "{color.primitive.orange}", "$value": "{color.primitive.orange}",
"$description": "Dark focus ring" "$description": "Dark focus ring"
}, },
"hero-bg": {
"$type": "color",
"$value": "{color.primitive.grey.8}",
"$description": "Dark hero banner background"
},
"chart": { "chart": {
"1": { "1": {
"$type": "color", "$type": "color",