feat: MonoText, KeyboardHint, SectionHeader primitives

This commit is contained in:
hsiegeln
2026-03-18 09:25:25 +01:00
parent 49789d6a15
commit 34537fd1a3
6 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
.kbd {
font-family: var(--font-mono);
font-size: 10px;
background: var(--bg-raised);
border: 1px solid var(--border);
border-radius: 3px;
padding: 0 4px;
color: var(--text-secondary);
line-height: 1.6;
}

View File

@@ -0,0 +1,10 @@
import styles from './KeyboardHint.module.css'
interface KeyboardHintProps {
keys: string
className?: string
}
export function KeyboardHint({ keys, className }: KeyboardHintProps) {
return <kbd className={`${styles.kbd} ${className ?? ''}`}>{keys}</kbd>
}

View File

@@ -0,0 +1,4 @@
.mono { font-family: var(--font-mono); }
.xs { font-size: 10px; }
.sm { font-size: 11px; }
.md { font-size: 13px; }

View File

@@ -0,0 +1,12 @@
import styles from './MonoText.module.css'
import type { ReactNode } from 'react'
interface MonoTextProps {
children: ReactNode
size?: 'xs' | 'sm' | 'md'
className?: string
}
export function MonoText({ children, size = 'md', className }: MonoTextProps) {
return <span className={`${styles.mono} ${styles[size]} ${className ?? ''}`}>{children}</span>
}

View File

@@ -0,0 +1,18 @@
.header {
display: flex;
align-items: center;
justify-content: space-between;
}
.label {
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1.2px;
color: var(--text-muted);
}
.action {
font-size: 12px;
color: var(--text-muted);
}

View File

@@ -0,0 +1,17 @@
import styles from './SectionHeader.module.css'
import type { ReactNode } from 'react'
interface SectionHeaderProps {
children: ReactNode
action?: ReactNode
className?: string
}
export function SectionHeader({ children, action, className }: SectionHeaderProps) {
return (
<div className={`${styles.header} ${className ?? ''}`}>
<span className={styles.label}>{children}</span>
{action && <span className={styles.action}>{action}</span>}
</div>
)
}