feat: MonoText, KeyboardHint, SectionHeader primitives
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
10
src/design-system/primitives/KeyboardHint/KeyboardHint.tsx
Normal file
10
src/design-system/primitives/KeyboardHint/KeyboardHint.tsx
Normal 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>
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
.mono { font-family: var(--font-mono); }
|
||||||
|
.xs { font-size: 10px; }
|
||||||
|
.sm { font-size: 11px; }
|
||||||
|
.md { font-size: 13px; }
|
||||||
12
src/design-system/primitives/MonoText/MonoText.tsx
Normal file
12
src/design-system/primitives/MonoText/MonoText.tsx
Normal 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>
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
17
src/design-system/primitives/SectionHeader/SectionHeader.tsx
Normal file
17
src/design-system/primitives/SectionHeader/SectionHeader.tsx
Normal 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>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user