- Nx 22.7 monorepo (pnpm 11.1, TypeScript 5.9, Node 24) - apps/api: NestJS 11 (CJS conforme CODING-RULES.md PGD-DB-004) - apps/web: React 19 + Vite 8 (ESM) - libs/shared/api-interface: Zod contract base - Docker Compose dev: Postgres 18, Valkey 8, MinIO, Mailpit - WDS artifacts: - design-artifacts/A-Product-Brief/ (5 docs canônicos + 16 dialogs) - design-artifacts/B-Trigger-Map/ (hub + 4 personas + feature impact) - Stack canon: STACK.md v2.2 + CODING-RULES.md v2.0 + brand.md - AGENTS.md + README.md como entrada para devs/agentes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.8 KiB
2.8 KiB
Design System Naming Conventions
Purpose: Consistent naming across design system components and tokens.
Referenced by: Component-type instructions, design system operations
Component IDs
Format: [type-prefix]-[number]
Prefixes:
- btn = Button
- inp = Input Field
- chk = Checkbox
- rad = Radio
- tgl = Toggle
- drp = Dropdown
- mdl = Modal
- crd = Card
- alt = Alert
- bdg = Badge
- tab = Tab
- acc = Accordion
Examples:
btn-001= First button componentinp-002= Second input field componentmdl-001= First modal component
Rules:
- Always lowercase
- Always hyphenated
- Always zero-padded (001, not 1)
- Sequential within type
Component Names
Format: [Type] [Descriptor] or just [Type]
Examples:
Button(generic)Navigation Button(specific)Primary Button(variant-focused)Icon Button(visual-focused)
Rules:
- Title case
- Descriptive but concise
- Avoid redundancy (not "Button Button")
Variant Names
Format: Lowercase, hyphenated
Purpose-Based:
primary- Main actionsecondary- Secondary actiondestructive- Delete/removesuccess- Positive confirmationwarning- Cautionnavigation- Navigation action
Visual-Based:
outlined- Border, no fillghost- Transparent backgroundsolid- Filled background
Size-Based:
small- Compactmedium- Defaultlarge- Prominent
Rules:
- Lowercase
- Hyphenated for multi-word
- Semantic over visual when possible
State Names
Standard States:
default- Normal statehover- Mouse overactive- Being clicked/pressedfocus- Keyboard focusdisabled- Cannot interactloading- Processingerror- Error statesuccess- Success statewarning- Warning state
Rules:
- Lowercase
- Single word preferred
- Use standard names when possible
Design Token Names
Format: --{category}-{property}-{variant}
Color Tokens:
--color-primary-500
--color-gray-900
--color-success-600
--color-error-500
Typography Tokens:
--text-xs
--text-base
--text-4xl
--font-normal
--font-bold
Spacing Tokens:
--spacing-1
--spacing-4
--spacing-8
Component Tokens:
--button-padding-x
--input-border-color
--card-shadow
Rules:
- Kebab-case
- Hierarchical (general → specific)
- Semantic names preferred
File Names
Component Files:
button.md
navigation-button.md
input-field.md
Rules:
- Lowercase
- Hyphenated
- Match component name (simplified)
Folder Names
components/
design-tokens/
operations/
assessment/
templates/
Rules:
- Lowercase
- Hyphenated
- Plural for collections
Consistency in naming makes the design system easier to navigate and maintain.