Add Mortgage Refinancing Calculator (v3) to the framework#163
Open
jenbreese wants to merge 1 commit into
Open
Conversation
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.
NOT READY FOR REVIEW
Summary
Incorporates the standalone v0/shadcn Mortgage Refinancing Calculator (v3) into this repo as a normal route so it can be reviewed and iterated on in-framework. This is a lift-and-fit only — the calculator's math and display are unchanged from the original. It's a starting point for deciding what to adapt to our conventions (Stanford tokens, shared UI components, validation rules, etc.), not a finished calculator.
What changed
New route (app/interactives/mortgage-refinancing-calculator-v3/)
page.tsx — the route: loads the original Geist fonts, renders the original header + , wrapped in a .mortgage-refi-v3 scope.
components/refinance-calculator.tsx — the calculator component, brought over as-is (only the broken import path fixed).
lib/mortgage.ts — the present-value / amortization helpers, unchanged.
theme.css — the v3 palette (light, class-dark, and system-preference dark), scoped to .mortgage-refi-v3 so it reproduces the original look without touching the Stanford tokens every other calculator uses.
globals.css — an unscoped reference copy of the original theme, kept for review (not imported by the build).
Shared theme (app/ui/globals.css)
Registered three color tokens in @theme that the calculator needs (--color-panel, --color-panel-foreground, --color-navy-foreground).
Moved brand navy behind a --navy variable (was an inlined literal) so it resolves identically for every existing bg-navy/text-navy while being overridable by scoped themes. All additive and behavior-preserving for other calculators.
Cleanup
Verification