Add Logbuch: project update blog with admin, media and API
Public archive with sidebar navigation, project pages, month archive, search and entry pages with image blocks. Admin area for brands, projects, post types, users, api clients, media and the entry editor with drag and drop images, preview per audience, scheduling and publish checks. Read and write API with bearer tokens, audience scoping, idempotent creation, OpenAPI document and editorial guide. Magic link login with configurable allowed domains, whole app behind the session gate. 456 tests including design rule checks.
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
import type { CSSProperties } from 'react'
|
||||
import { projectCode, type ProjectCodeSource } from '~/domain/project-code'
|
||||
|
||||
export type PlateSize = 'lead' | 'card' | 'row'
|
||||
|
||||
export type PlateProps = {
|
||||
project: ProjectCodeSource
|
||||
color: string
|
||||
number: number
|
||||
size?: PlateSize
|
||||
showNumber?: boolean
|
||||
className?: string
|
||||
}
|
||||
|
||||
export const projectSurface = 'plate-fill'
|
||||
|
||||
export function projectStyle(color: string): CSSProperties {
|
||||
return { '--plate': color } as CSSProperties
|
||||
}
|
||||
|
||||
export function entryNumber(number: number): string {
|
||||
return String(number).padStart(4, '0')
|
||||
}
|
||||
|
||||
export function entryMark(project: ProjectCodeSource, number: number): string {
|
||||
return `${projectCode(project)}-${entryNumber(number)}`
|
||||
}
|
||||
|
||||
const shells: Record<PlateSize, string> = {
|
||||
lead: 'flex min-h-44 flex-col justify-between gap-8 px-5 py-4',
|
||||
card: 'flex flex-col justify-between gap-1 px-2 py-1.5',
|
||||
row: 'inline-flex items-baseline gap-2.5 px-2 py-1',
|
||||
}
|
||||
|
||||
const codeSizes: Record<PlateSize, string> = {
|
||||
lead: 'text-small tracking-plate',
|
||||
card: 'text-micro tracking-mark',
|
||||
row: 'text-micro tracking-label',
|
||||
}
|
||||
|
||||
const numberSizes: Record<PlateSize, string> = {
|
||||
lead: 'text-plate leading-none',
|
||||
card: 'text-small leading-none',
|
||||
row: 'text-micro',
|
||||
}
|
||||
|
||||
export function Plate({ project, color, number, size = 'row', showNumber = true, className }: PlateProps) {
|
||||
return (
|
||||
<span
|
||||
style={projectStyle(color)}
|
||||
className={`${projectSurface} ${shells[size]} font-mono font-semibold text-paper ${className ?? ''}`}
|
||||
>
|
||||
<span className={`block uppercase ${codeSizes[size]}`}>{projectCode(project)}</span>
|
||||
{showNumber ? (
|
||||
<span className={`block tabular-nums ${numberSizes[size]}`}>{entryNumber(number)}</span>
|
||||
) : null}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user