import type { Meta, StoryObj } from '@storybook/react'; import { colorSchemes, swatches } from '../lib/tokens'; const meta: Meta = { title: 'Grundlagen/Tokens', parameters: { controls: { disable: true } }, }; export default meta; type Story = StoryObj; const groups: { title: string; tokens: string[] }[] = [ { title: 'Flächen', tokens: ['app', 'frame', 'surface', 'inset', 'raised', 'elevated', 'chip', 'track', 'soft', 'section', 'side', 'side-active'], }, { title: 'Linien', tokens: ['line-frame', 'line', 'line-strong', 'line-heavy', 'line-divider', 'line-subtle', 'line-row', 'line-control'], }, { title: 'Text', tokens: ['fg', 'fg-strong', 'fg-2', 'fg-3', 'fg-4', 'fg-muted', 'fg-subtle', 'fg-faint', 'fg-dim'], }, { title: 'Akzent & Status', tokens: [ 'accent', 'accent-fg', 'accent-focus', 'success', 'success-fg', 'warning', 'warning-fg', 'info', 'info-fg', 'danger', 'danger-fg', 'danger-solid', 'open-bar', ], }, ]; function Swatch({ token }: { token: string }) { return (
{token}
--cl-{token}
); } export const Farben: Story = { render: () => (
{groups.map((g) => (

{g.title}

{g.tokens.map((t) => ( ))}
))}

Gruppen- und Personenfarben

{Object.entries(swatches).map(([name, color]) => (
{name} {color}
))}

Farbschemata (Akzent)

{colorSchemes.map((s) => (
{s.name} {s.color}
))}
), }; const type: { cls: string; label: string; sample: string }[] = [ { cls: 'text-hero font-bold tracking-[-0.03em]', label: 'hero · 48 / 700', sample: '62%' }, { cls: 'text-display font-black tracking-[-0.01em]', label: 'display · 28 / 900', sample: 'Hallo Niklas' }, { cls: 'text-xl font-black', label: 'xl · 20 / 900', sample: 'Login & Registrierung umsetzen' }, { cls: 'text-lg font-bold', label: 'lg · 17 / 700', sample: 'Neue Aufgabe' }, { cls: 'text-md font-bold', label: 'md · 15 / 700', sample: 'Meine Aufgaben' }, { cls: 'text-base', label: 'base · 14 / 400', sample: 'Melde dich an, um mit deinem Team weiterzuarbeiten.' }, { cls: 'text-sm text-fg-subtle', label: 'sm · 13 / 400', sample: 'Wähle, wie Collabry für dich aussieht.' }, { cls: 'text-xs text-fg-muted', label: 'xs · 12 / 400', sample: 'SWE · Collabry · in 3 Tagen' }, { cls: 'text-2xs font-bold text-fg-subtle', label: '2xs · 11 / 700', sample: 'Mit ⌘ + Enter senden' }, ]; export const Typografie: Story = { render: () => (
{type.map((t) => (
{t.label}
{t.sample}
))}
), };