#434 Improvement: consistent design system and component library extr… - #498
Open
felladaniel36-hash wants to merge 3 commits into
Conversation
…ary extraction FIXED
|
@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! 🚀 |
…system-and-component-library-extraction-FIX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Extracted a consistent design system from the scattered UI primitives in the StellarCred frontend. Created
lib/design-tokens.tsas the single source of truth for spacing, color, radius, typography, and shadow tokens. Built acomponents/primitives/library withButton,CodeBlock,Input, andText/Headingcomponents that all consume CSS custom properties for dark/light theme support. Converted inline-styled one-offs inModal,ThemeToggle,SiteNav,ConfigBanner, andCredCardto use documented CSS classes inglobals.css. Added a/componentsshowcase 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
Merge requirements
cargo test(contracts),pnpm tsc --noEmit(frontend),pnpm build(frontend), circuit tests — all greenfixtures/<type>/artifacts updatedNEXT_PUBLIC_prefix on server-only env varsprehash:falsepreserved on any issuer signing path touched✅ Merge requirements
Notes for reviewers
Design decisions to highlight:
Token-driven inline styles vs fully CSS-classed: The showcase page (
app/components/page.tsx) andCredCardretain a small number of inlinestyle={{}}objects, but these are intentional layout composition (gap, flexWrap, section margins) using token values likevar(--spacing-lg). They are not "ad-hoc" one-offs — every value traces back todesign-tokens.ts. Fully extracting these to classes would add CSS bloat for section-specific layout that won't be reused elsewhere.Button hover/focus handling: The
Buttonprimitive delegates hover/focus/disabled visual states to the existing.btn-*CSS classes inglobals.cssrather 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.Guard against
useToast()in showcase: TheToastDemocomponent uses amountedstate to avoid SSR/hydration mismatch when callinguseToast()in the showcase page. This is the same patternToast.tsxandModal.tsxuse for portal rendering.pnpm build limitation: The CI environment should run
pnpm install && pnpm buildto 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.