Add corpus card components for DraCor and sibling projects#65
Merged
Conversation
Ports the dracor-frontend CorpusCard to Tailwind CSS + TypeScript.
Reuses the existing Commit component and uses TanStack Router's
Link for navigation via a consumer-supplied `to` prop.
The font-sizes are slightly larger than in dracor-frontend because there
Bootstrap sets `:root { font-size: 0.85rem }` making its effective base 13.6px,
while Tailwind leaves the root at the browser default of 16px. I will leave it like
this for now. When actually migrating dracor-front to use dracor-react
components we could decide to either adjust the base font size or stick with
the new default.
Introduces a composition-based CorpusCard with a CorpusCardRow primitive so eltec-frontend and ecocor-frontend can drop their near-duplicate local implementations. Values passed as numbers are auto-formatted via toLocaleString; an optional popoverContent turns a row's value into a native popover trigger (using useId, no nanoid dep needed). Built-in "Git commit" and "last update" rows render when the corresponding props are set.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65 +/- ##
==========================================
+ Coverage 94.09% 94.58% +0.48%
==========================================
Files 31 33 +2
Lines 288 314 +26
Branches 85 101 +16
==========================================
+ Hits 271 297 +26
Misses 4 4
Partials 13 13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
CorpusCardfor use in the (upcoming) dracor-frontend migration off Bootstrap. Exposed asDracorCorpusCardfrom@dracor/react.CorpusCard(+CorpusCardRowprimitive) intended as the shared base for eltec-frontend and ecocor-frontend, both of which currently ship near-duplicate local implementations. Numeric values auto-format viatoLocaleString; an optionalpopoverContentturns a row's value into a native popover trigger (usinguseId, nonanoiddependency needed). "Git commit" and "last update" rows render automatically when the corresponding props are set.