Skip to content

#434 Improvement: consistent design system and component library extr… - #498

Open
felladaniel36-hash wants to merge 3 commits into
ToluLabs:mainfrom
felladaniel36-hash:#434-Improvement--consistent-design-system-and-component-library-extraction-FIX
Open

#434 Improvement: consistent design system and component library extr…#498
felladaniel36-hash wants to merge 3 commits into
ToluLabs:mainfrom
felladaniel36-hash:#434-Improvement--consistent-design-system-and-component-library-extraction-FIX

Conversation

@felladaniel36-hash

Copy link
Copy Markdown

What does this PR do?

Extracted a consistent design system from the scattered UI primitives in the StellarCred frontend. Created lib/design-tokens.ts as the single source of truth for spacing, color, radius, typography, and shadow tokens. Built a components/primitives/ library with Button, CodeBlock, Input, and Text/Heading components that all consume CSS custom properties for dark/light theme support. Converted inline-styled one-offs in Modal, ThemeToggle, SiteNav, ConfigBanner, and CredCard to use documented CSS classes in globals.css. Added a /components showcase page that documents every primitive with live examples. The result: ~739 inline style occurrences reduced to token-driven layout composition, consistent visual language across the app, and a reusable component library that speeds up future UI work and makes theming (especially for the embed/badge features) straightforward.

Closes #434

Type of change

  • Bug fix
  • New feature / credential type
  • Refactor / cleanup
  • Docs
  • CI / tooling

Merge requirements

  • CI is greencargo test (contracts), pnpm tsc --noEmit (frontend), pnpm build (frontend), circuit tests — all green
  • Greptile confidence ≥ 4/5 — all review comments addressed, no unresolved threads
  • Circuit changes: fixtures/<type>/ artifacts updated
  • No NEXT_PUBLIC_ prefix on server-only env vars
  • No identity fields stored or logged after KYC provider call
  • prehash:false preserved on any issuer signing path touched
  • Issuer private key never referenced from client-bundled code

✅ Merge requirements

  • All CI checks pass (contracts / frontend / circuits as applicable)
  • Every Greptile review comment is addressed — no unresolved review threads
  • Greptile confidence score is 4/5 or higher

Notes for reviewers

Design decisions to highlight:

  1. Token-driven inline styles vs fully CSS-classed: The showcase page (app/components/page.tsx) and CredCard retain a small number of inline style={{}} objects, but these are intentional layout composition (gap, flexWrap, section margins) using token values like var(--spacing-lg). They are not "ad-hoc" one-offs — every value traces back to design-tokens.ts. Fully extracting these to classes would add CSS bloat for section-specific layout that won't be reused elsewhere.

  2. Button hover/focus handling: The Button primitive delegates hover/focus/disabled visual states to the existing .btn-* CSS classes in globals.css rather than managing them via onMouseEnter/Leave. This keeps the component small and lets CSS handle transitions natively. The only inline geometry (padding, fontSize, radius) comes from the token system.

  3. Guard against useToast() in showcase: The ToastDemo component uses a mounted state to avoid SSR/hydration mismatch when calling useToast() in the showcase page. This is the same pattern Toast.tsx and Modal.tsx use for portal rendering.

  4. pnpm build limitation: The CI environment should run pnpm install && pnpm build to validate. The sandbox I worked in couldn't install pnpm dependencies (permission + workspace protocol), so automated build verification wasn't possible locally. All syntax and import validation passed manually.

@drips-wave

drips-wave Bot commented Sep 1, 2026

Copy link
Copy Markdown

@felladaniel36-hash Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improvement: consistent design system and component library extraction

1 participant