feat(drawer): adds <rh-drawer> - #3060
Conversation
✅ Deploy Preview for red-hat-design-system ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: 5b374be The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
Documentation Health
|
| Category | Score | |
|---|---|---|
| Element description | 13/25 | |
| Attribute documentation | 20/20 | ✅ |
| Slot documentation | 15/15 | ✅ |
| CSS documentation | 15/15 | ✅ |
| Event documentation | 15/15 | ✅ |
| Demos | 0/0 | ❌ |
DrawerCloseEvent — 76/90 ✅
| Category | Score | |
|---|---|---|
| Element description | 11/25 | |
| Attribute documentation | 20/20 | ✅ |
| Slot documentation | 15/15 | ✅ |
| CSS documentation | 15/15 | ✅ |
| Event documentation | 15/15 | ✅ |
| Demos | 0/0 | ❌ |
DrawerThresholdEvent — 76/90 ✅
| Category | Score | |
|---|---|---|
| Element description | 11/25 | |
| Attribute documentation | 20/20 | ✅ |
| Slot documentation | 15/15 | ✅ |
| CSS documentation | 15/15 | ✅ |
| Event documentation | 15/15 | ✅ |
| Demos | 0/0 | ❌ |
rh-drawer (RhDrawer) — 77/100 ⚠️
| Category | Score | |
|---|---|---|
| Element description | 17/25 | |
| Attribute documentation | 20/20 | ✅ |
| Slot documentation | 13/15 | ✅ |
| CSS documentation | 4/15 | ❌ |
| Event documentation | 13/15 | ✅ |
| Demos | 10/10 | ✅ |
Recommendations:
- DrawerThresholdEvent: use RFC 2119 keywords (MUST, SHOULD, AVOID) to clarify requirements (Element description, +5 pts)
- DrawerCloseEvent: use RFC 2119 keywords (MUST, SHOULD, AVOID) to clarify requirements (Element description, +5 pts)
- rh-drawer: add descriptions to all CSS parts (CSS documentation, +5 pts)
- DrawerOpenEvent: use RFC 2119 keywords (MUST, SHOULD, AVOID) to clarify requirements (Element description, +5 pts)
- DrawerOpenEvent: mention accessibility considerations (ARIA, screen reader, WCAG) (Element description, +4 pts)
| this.#resizeObserver = new ResizeObserver(entries => { | ||
| const [entry] = entries; | ||
| if (entry) { | ||
| const narrow = entry.contentBoxSize[0].inlineSize < 992; |
There was a problem hiding this comment.
does this need to be configurable per spec?
There was a problem hiding this comment.
That is definitely a question for @coreyvickery prior iteration allowed it to be via tshirt sizes, curernt figma suggests only 992.
|
Size Change: +7.15 kB (+2.22%) Total Size: 329 kB 📦 View Changed
ℹ️ View Unchanged
|
coreyvickery
left a comment
There was a problem hiding this comment.
@zeroedin Let's remove any box shadows on the actual tray, but not the button. Ready to ship after that.
a2709a3 to
4eb7ec7
Compare
What I did
<rh-drawer>, a side panel component for supplementary content or navigation, aligned with the rh-drawer Figma spec.rh-navigation-primary(for discussion) andrh-navigation-vertical.Supersedes: #2850
The component was simplified significantly from the previous attempt:
Testing Instructions
Notes to Reviewers
The drawer responds to its nearest ancestor with container-type: inline-size. Without one, it always behaves as an overlay. This was one of the refactorings from the previous drawer. I'm still not convinced this implementation gets it right, as it almost always forces full pattern usage, external container + drawer. In my opinion, a drawer is both the panel (the face and knob) and the box for the contents (holding the clothes). Doing so would allow for easier implimenation I think.