feat(dsr): add SectionDivider React parity (DSYS-750) - #1441
Draft
cursor[bot] wants to merge 5 commits into
Draft
Conversation
Implement design-system-react SectionDivider matching the RN Box-based API: top-only border hairline, BorderMuted, marginVertical 5, self-stretch. Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Contributor
📖 Storybook LinksCompare the preview for this pull request with the latest Storybooks from the 🔀 Pull Request Preview
🌳 Main Branch (Latest)
|
Contributor
📖 Storybook LinksCompare the preview for this pull request with the latest Storybooks from the 🔀 Pull Request Preview
🌳 Main Branch (Latest)
|
6 tasks
Comment on lines
+30
to
+37
| <Box | ||
| ref={ref} | ||
| borderColor={borderColor ?? BoxBorderColor.BorderMuted} | ||
| marginVertical={marginVertical ?? 5} | ||
| className={twMerge('self-stretch', borderTopClass, className)} | ||
| style={style} | ||
| {...rest} | ||
| /> |
Contributor
There was a problem hiding this comment.
@cursoragent make sure this is an
element for correct semantic html
Contributor
Author
There was a problem hiding this comment.
- Updated
SectionDividerto render a semantic<hr />viaBox’sasChild, preserving existing API and styling. Addedborder-0to ensure only the top border is visible. - Adjusted ref typing/forwarding and updated the unit test to expect
HTMLHRElement. - Refreshed README to note
<hr />semantics.
Key edits:
packages/design-system-react/src/components/SectionDivider/SectionDivider.tsxpackages/design-system-react/src/components/SectionDivider/SectionDivider.test.tsxpackages/design-system-react/src/components/SectionDivider/README.mdx
Comment on lines
+10
to
+13
| ### Added | ||
|
|
||
| - Added `SectionDivider` React parity with the React Native MMDS horizontal rule API ([#1441](https://github.com/MetaMask/metamask-design-system/pull/1441)) | ||
|
|
Contributor
There was a problem hiding this comment.
Remove the changelog update that is only for the review process @cursoragent
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
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
Adds React (
@metamask/design-system-react) SectionDivider parity for epic DSYS-302 / DSYS-750, matching the existing React Native MMDS horizontal-rule API.Queue note: Content (DSYS-1043, PR #1436), ListItem (DSYS-713, PR #1439), and SectionHeader (DSYS-751, PR #1440) already have open draft PRs, so this run took the next priority-queue item (SectionDivider). Jira MCP could not be authenticated in this cloud environment (interactive OAuth unavailable), so the ticket was not auto-assigned/transitioned — please claim DSYS-750 manually if still To Do.
Implementation mirrors RN:
Boxwith top-onlyborder-t*mapping fromborderWidth, defaultBoxBorderColor.BorderMuted,marginVertical={5}, andself-stretch. No shared types (same as RN — props areBoxProps). No ReactBoxRow/BoxColumn/TextOrChildren.Audit comparison (Phase 1)
SectionDividerincomponent-library. Nearest ad-hoc:ConfirmInfoRowDivider(inline styles), settingsDivider(DSRBox+h-pxbg), snapsdividerfactorySectionDivider=BoxPropswith top-only border defaultsSectionDividername in DSRBoxprops (borderWidth,borderColor,marginVertical, …)BoxBorderWidth/BoxBorderColor/BoxSpacingvia Boxheight: 1px+ background colorborder-thairline on zero-height boxclassName/ inline styletwClassName/styleclassNameon React)Answers
SectionDividerPropsShared(RN also usesBoxPropsonly). Platform:className/style(web) vstwClassName/style(RN).disabled/isDisabledN/A).SectionDividerin DSR. Extension analogues are differently shaped local helpers, not the MMDS API.Known gaps (Phase 2)
ConfirmInfoRowDivider, settingsDivider, and snaps divider still use local one-off implementations; migrate consumers to DSRSectionDividerseparately when product wants shared spacing/border defaults.Related issues
Fixes: DSYS-750 (parent epic DSYS-302)
Manual testing steps
yarn build && yarn workspace @metamask/design-system-react run test --testPathPattern='components/SectionDivider/SectionDivider\.test'yarn storybook→ open React Components / SectionDividerclassNameoverrides (e.g.self-center) via Controls / DocsScreenshots/Recordings
Before
N/A — new React component
After
SectionDivider Default story (light + dark)
SectionDivider BorderWidth story
SectionDivider BorderColor story
SectionDivider MarginVertical story
Pre-merge author checklist
Pre-merge reviewer checklist
To show artifacts inline, enable in settings.