12 KiB
Frontend System Current State
1. UI primitive source of truth
The current primitive source of truth is the local
components/ui
layer.
Current core primitive files:
components/ui/button.tsxcomponents/ui/card.tsxcomponents/ui/app-card.tsxcomponents/ui/input.tsxcomponents/ui/textarea.tsxcomponents/ui/select.tsxcomponents/ui/dialog.tsxcomponents/ui/sheet.tsxcomponents/ui/tabs.tsxcomponents/ui/dropdown-menu.tsxcomponents/ui/accordion.tsxcomponents/ui/badge.tsxcomponents/ui/checkbox.tsxcomponents/ui/table.tsxcomponents/ui/label.tsxcomponents/ui/separator.tsx
Feature code currently imports these local primitives rather than importing Radix primitives directly.
2. Libraries currently used for UI, motion, icons, and class composition
UI primitives and wrappers currently used:
@radix-ui/react-accordion@radix-ui/react-checkbox@radix-ui/react-dialog@radix-ui/react-dropdown-menu@radix-ui/react-select@radix-ui/react-slot
Motion currently used:
framer-motiontailwindcss-animate
Icons currently used:
lucide-react
Class composition currently used:
class-variance-authorityclsxtailwind-merge
Shared helper:
lib/utils.ts
Current helper function:
cn()
3. Current token system in use
The active token system is defined in:
app/globals.csstailwind.config.ts
Current semantic color tokens exposed in Tailwind:
backgroundforegroundcardcard-foregroundpopoverpopover-foregroundprimaryprimary-foregroundsecondarysecondary-foregroundmutedmuted-foregroundaccentaccent-foregrounddestructivedestructive-foregroundborderborder-stronginputringsurface.1surface.2surface.3surface.inversebrand.primarybrand.secondarystatus.successstatus.success-softstatus.warningstatus.warning-softsidebar.*
Current shared utility usage is centered on:
bg-cardbg-backgroundbg-surface-2text-card-foregroundtext-foregroundtext-muted-foregroundborder-border/80border-border/70border-input
There are also decorative hero tokens still present in current code:
--hero-base--hero-ink--hero-left--hero-right--hero-bottom
4. Current radius system in use
Current radius tokens in:
app/globals.css
are:
--radius-surface: 24px--radius-nested: 16px--radius-pill: 9999px
Current Tailwind mappings in:
tailwind.config.ts
are:
rounded-surfacerounded-nestedrounded-pill
Current usage pattern:
rounded-surface- outer surfaces and primitive containers
components/ui/card.tsxcomponents/ui/app-card.tsxcomponents/ui/dialog.tsxcomponents/ui/select.tsxcomponents/ui/tabs.tsx
rounded-nested- controls and inner blocks
components/ui/button.tsxcomponents/ui/input.tsxcomponents/ui/textarea.tsxcomponents/ui/select.tsxcomponents/ui/dialog.tsxcomponents/ui/sheet.tsx
rounded-pill- top-level chrome controls
components/layout/site-header.tsxcomponents/layout/floating-preferences.tsx
5. Current surface/card/panel rules in use
Base Card
Source:
components/ui/card.tsx
Current base surface rule:
rounded-surface border border-border/80 bg-card text-card-foreground shadow-card
AppCard
Source:
components/ui/app-card.tsx
Current visual levels:
level={1}border border-border/80 bg-card text-card-foreground shadow-card
level={2}border border-input bg-background text-foreground shadow-xs
level={3}border border-border/80 bg-surface-2 text-foreground shadow-panel
level="inverse"border-transparent bg-foreground text-background shadow-card
Current padding variants:
nonesmp-4
mdp-6
lgp-8
Current interactive rule:
hover:bg-accent/30 hover:text-accent-foreground
Current feature code now reuses these levels in shared admin surfaces.
Examples:
components/root/media-field-picker.tsxcomponents/root/portfolio-projects-overview.tsxcomponents/root/portfolio-project-form.tsxcomponents/root/portfolio-categories-manager.tsxcomponents/root/site-settings-form.tsx
6. Current input/button/select/dialog/sheet rules in use
Button
Source:
components/ui/button.tsx
Current base rule:
inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-nested text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50
Current variants:
defaultbg-primary text-primary-foreground shadow-sm hover:bg-primary/92
secondarybg-secondary text-secondary-foreground hover:bg-secondary/90
outlineborder border-input bg-background hover:border-border-strong hover:bg-accent hover:text-accent-foreground
ghosttext-muted-foreground hover:bg-muted hover:text-foreground
linkrounded-none text-primary underline-offset-4 hover:underline
destructivebg-destructive text-destructive-foreground hover:bg-destructive/90
Input
Source:
components/ui/input.tsx
Current rule:
flex h-10 w-full rounded-nested border border-input bg-background px-3 py-2 text-base text-foreground shadow-xs ... focus-visible:border-ring ... focus-visible:ring-ring/30
Select
Source:
components/ui/select.tsx
Current trigger rule:
flex h-10 w-full items-center justify-between rounded-nested border border-input bg-background px-3 py-2 text-sm shadow-xs
Current content rule:
rounded-surface border border-input bg-background text-foreground shadow-panel
Current item rule:
rounded-nested ... focus:bg-accent focus:text-accent-foreground
Dialog
Source:
components/ui/dialog.tsx
Current overlay rule:
fixed inset-0 z-50 bg-foreground/30 backdrop-blur-sm
Current content rule:
rounded-surface border border-border/80 bg-card p-6 text-card-foreground shadow-panel
Current close button rule:
inline-flex h-8 w-8 items-center justify-center rounded-nested text-muted-foreground hover:bg-accent hover:text-foreground
Sheet
Source:
components/ui/sheet.tsx
Current overlay rule matches Dialog:
fixed inset-0 z-50 bg-foreground/30 backdrop-blur-sm
Current content rule:
border-border/80 bg-card p-6 text-card-foreground shadow-panel
Current side radius rules:
sm:rounded-l-surfacesm:rounded-r-surfacerounded-b-surfacerounded-t-surface
Tabs
Source:
components/ui/tabs.tsx
Current list rule:
inline-flex ... gap-2 rounded-surface border border-border/80 bg-muted/40 p-1.5
Current trigger rule:
rounded-nested px-3 py-2 text-sm font-medium text-muted-foreground
Current active trigger rule:
border border-border/80 bg-background text-foreground shadow-xs
7. Current layout/container rules in use
Container
Source:
components/layout/container.tsx
Current base rule:
mx-auto w-full px-4 sm:px-6 lg:px-8
Current size variants:
defaultmax-w-layout
narrowmax-w-narrow
widemax-w-wide
adminmax-w-admin
Mapped widths from:
app/globals.css
are:
--container-narrow: 48rem--container-default: 72rem--container-wide: 80rem--container-admin: 88rem
Shared public top chrome
Current shared top controls use:
rounded-pillborder-border/70bg-background/80shadow-panelbackdrop-blur-chrome
Files:
components/layout/site-header.tsxcomponents/layout/floating-preferences.tsx
Admin shell
Current admin layout still uses:
min-h-screen bg-muted/30grid min-h-screen lg:grid-cols-[280px_minmax(0,1fr)]- sticky sidebar and header
p-4 lg:p-6
Source:
components/dashboard/dashboard-layout.tsx
8. Current spacing rhythm in use
Current repeated spacing values:
p-4p-6p-8px-3 py-2px-4 py-2px-4 py-3px-4 py-4gap-2gap-3gap-4gap-6space-y-2space-y-3space-y-4space-y-6
Current primitive spacing sources:
CardHeadergap-1.5 p-6
CardContentp-6 pt-0
AppCard padding="sm"p-4
AppCard padding="md"p-6
AppCard padding="lg"p-8
Containerpx-4 sm:px-6 lg:px-8
Current layout spacing is also built around:
gap-sectiongap-content
from:
tailwind.config.ts
9. Current motion rules in use
Primary motion library:
framer-motion
State animation utility layer:
tailwindcss-animate
Current motion patterns:
- reveal-on-scroll wrapper
components/motion-fade.tsxinitial={{ opacity: 0, y: 20 }}whileInView={{ opacity: 1, y: 0 }}transition={{ duration: 0.45, delay, ease: "easeOut" }}
- shared overlay and disclosure state classes
components/ui/dialog.tsxcomponents/ui/sheet.tsxcomponents/ui/select.tsxcomponents/ui/dropdown-menu.tsxcomponents/ui/accordion.tsx
- animated navigation chrome
components/layout/site-header.tsx
10. Current icon rules in use
Current icon library:
lucide-react
Current rule:
icons are imported directly from
lucide-react
and used through local primitives or feature components.
Examples:
components/ui/dialog.tsxcomponents/ui/select.tsxcomponents/layout/site-header.tsxcomponents/theme-toggle.tsxcomponents/root/portfolio-project-form.tsx
No second React icon library is present in:
package.json
11. Current forbidden drift or remaining transitional areas, if any
The shared primitive layer is currently tokenized.
Remaining transitional or non-shared drift still present in the codebase:
- public atmospheric and hero visuals still use route-specific raw gradients and
rgba(...)components/layout/home-hero.tsxcomponents/layout/site-ambient-backdrop.tsxcomponents/layout/hero-atmosphere.tsxcomponents/layout/site-logo.tsx
coming-soonstill uses older translucent raw chrome rulesapp/[locale]/coming-soon/page.tsx
- some public route-level content blocks still use route-local classes instead of shared primitives
app/[locale]/(site)/portfolio/page.tsxapp/[locale]/(site)/portfolio/[slug]/page.tsx
- one custom dark preview surface remains in current admin code
components/root/site-settings-form.tsxbg-slate-950text-white/55text-white/60
- some admin and public cards still use
Cardwith local class overrides instead ofAppCardapp/root/page.tsxcomponents/dashboard/dashboard-card.tsx
These are current areas in the repository, but they are not the shared-system rules.
12. Codex rules derived from the current system
- Use
components/uias the primitive source of truth. - Use
cn()fromlib/utils.tsfor class composition. - Use semantic tokens already defined in
app/globals.cssand mapped intailwind.config.ts. - Use
Cardas the base surface primitive. - Use
AppCardwhen feature code needs explicit shared surface levels. - Use
AppCard level={1}for primary card surfaces. - Use
AppCard level={2}for nested panels and inner blocks. - Use
AppCard level={3}for elevated grouped panels. - Use
rounded-surface,rounded-nested, androunded-pillas the shared radius system. - Use
Input,Textarea,Select,Dialog,Sheet, andTabsfromcomponents/uiinstead of rebuilding those patterns in feature code. - Use
Containerfor width and horizontal padding rules. - Use
lucide-reactfor icons. - Use
framer-motionfor custom motion andtailwindcss-animatefor primitive state transitions. - Do not treat route-specific hero visuals or transitional raw blocks as shared-system primitives.