Repository navigation
Conversation
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Adds Card, CardHeader and CardContent to the next primitives. Card takes
variant ('elevated' | 'outlined' -> data-variant) plus spacing and sizing
style props; CardHeader exposes children as the title slot and a single
endElement slot; CardContent is a padded container. All defaults are
wrapped in :where() so style props win. Each part accepts a closed-union
'as' prop (div|section|article, div|header, div|figure) so the dashboard
Panel keeps its native section/header/figure semantics.
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
- Card now clips edge-to-edge content to rounded boundaries. - Removed all new Card Oxlint warnings. - Updated tests and story example. Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
- Add closed-union prop to Card/CardHeader/CardContent (div|section|article, div|header, div|figure) so the Panel migration keeps native semantics without role= suppressions - Use --perses-border-width-sm token; drop reset-owned box-sizing - Import the style engine via the system barrel - Remove file-wide jsx-a11y suppressions from tests and stories - Move story presentation styles into .ladle/stories.css - Complete the ComponentsContext provider example Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
zhuje
force-pushed
the
zhuje/ou1607-ui-customization-card-component
branch
from
October 21, 2026 19:13
d1ad2cc to
5ee7d19
Compare
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.
Description
Description
Adds the
Cardprimitive (Card,CardHeader,CardContent) to thenextdesign system in@perses-dev/componentsAPI
Card—variant="elevated" | "outlined"(defaultelevated), rendered asdata-variant;as="div" | "section" | "article"(defaultdiv).CardHeader—endElementslot for actions (boolean/null values render no trailing slot);as="div" | "header".CardContent—as="div" | "figure"; supportsp="0"for edge-to-edge content, which the Card clips to its radius (overflow: hidden).applyStyleProps, forwardref(HTMLElement), and are registered as customization slots inPersesComponents/defaultComponentsso hosts can swap them throughComponentsProvider.Design notes
asprop is a closed union, not an openElementType. This is a deliberate exception to the implementation plan's "no polymorphic props" rule: the existing MUI Panel rendersCard component="section"/CardHeader component="header"/CardContent component="figure", and the only alternative (role="region"/role="figure"ondivs) is a semantic regression that tripsjsx-a11y/prefer-tag-over-rolein every consumer. The closed list keeps types simple (refs are alwaysHTMLElement) and prevents misuse (as="button"). Rendering usescreateElementbecause a union JSX tag fails type-checking on thedivref type.CardActions,startElement,subheader, andCardMediahad zero usages and are intentionally omitted.Screenshots
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes
See e2e docs for more details. Common issues include: