Add heading component#123
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Heading component to replace downstream usage of an as prop on existing heading components, allowing semantic heading level (h1–h6) to be independent from the applied visual style.
Changes:
- Introduces
Headingwithlevel/variantprops and ref forwarding, and refactorsH2/H3to use it. - Adds a Storybook story demonstrating semantic level vs visual style override.
- Bumps package version and removes the
.lastsyncfile.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/components/Text.tsx | Adds Heading and refactors H2/H3 to build on it. |
| src/components/Text.stories.tsx | Demonstrates Heading usage, including style override. |
| package.json | Patch version bump for the new exported component. |
| .lastsync | Removes an unreferenced sync marker file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
RoyEJohnson
left a comment
There was a problem hiding this comment.
The Copilot suggestion for a test is good, but the question of handling levels default variants with levels of other than 2 or 3 needs cleared up.
|
i added the spec. i'm not gonna do anything on the variant types because there is really no rationale behind it other than the variants that we happen to have styles for today, the extra classes won't hurt anybody, and it'll work if we decide to add styles for them later. |
some downstream projects (found in assignments and staxpass at least) were using the
asprop on the headings, the new Heading component replaces that pattern.