Skip to content

Conversation

@zeroedin
Copy link
Collaborator

@zeroedin zeroedin commented Jun 13, 2025

What I did

  1. Added <rh-navigation-drawer>

Closes #2465
Related issue: #1329

Testing Instructions

  1. View Deploy Preview

Notes to Reviewers

adamjohnson and others added 14 commits April 17, 2025 16:51
…2325)

* fix(tag): improve color contrast on gray tags in dark schemes

* docs(tag): improve slotted SVG color contrast on dark schemes

* docs(tag): fix `grey` vs `gray` in alt text

* chore(tag): add changeset
* feat(breadcrumb): add ability to truncate middle breadcrumb items

This code was developed with possible assistance by generative AI.

* chore(breadcrumb): add changeset

* fix(breadcrumb): only truncate when `truncate` attr is present

This code was developed with possible assistance by generative AI.

* test(breadcrumb): fix `handleEvent` uncaught TypeError

This code was developed with possible assistance by generative AI.

* docs(breadcrumb): update changeset prose

Co-authored-by: Benny Powers - עם ישראל חי! <[email protected]>

* refactor(breadcrumb): rename truncate lightdom classes

* refactor(breadcrumb): nest `[hidden]` under `rh-breadcrumb` selector

* fix(breadcrumb): implement `render()` method for `truncate` functionality

This code was developed with possible assistance by generative AI.

* refactor: nest lightdom css

* refactor: minor nitpicks

* fix(breadcrumb): add `type` attr to truncate button

* fix(breadcrumb): underline truncation button / ellipsis

* fix(breadcrumb): use logical properties

* lint(breadcrumb): css

* test(breadcrumb): add tests for `truncate`

This code was developed with possible assistance by generative AI.

* test(breadcrumb): unify test examples

* test(breadcrumb): add null guards

---------

Co-authored-by: Benny Powers - עם ישראל חי! <[email protected]>
Co-authored-by: Benny Powers <[email protected]>
* feat(code-block): add attribute/ability to hide line numbers

* chore(code-block): add changeset

* style(code-block): lint typescript and css

* fix(code-block): change attr to `line-numbers` in place of `hide-line-numbers`

* refactor(code-block): rename `lineNumbers` variable

* chore(code-block): update changeset example

* fix(code-block): prevent possible SSR mismatch errors

* docs(code-block): add `line-numbers="hidden"` docs
* fix(card): allow all six color palettes on card

* docs(card): allow all color palettes in nested color context demo

* docs(card): add terminology clarifying color palette usage vs backgrounds

* docs(card): use `darkest` color palette with Promo demo as docs instruct

* chore(card): add changeset

* style(card): lint css

* fix(card): correct `color-palette` / card background behavior ("Option 3")

* docs(card): color context prose

* style(card): lint css

* docs(card): move color palette docs to style page

* fix(card): use `--rh-color-surface` for both `.light` and `.dark`

* refactor(card): surface colors for card background when `color-palette` is set

* refactor(card): move `computedPalette` to `willUpdate()`

* refactor(card): move promo vars to render method
* feat(code-block): reduce line numbers load

* feat(code-block): adding return to computeLineNumbers

* docs: changeset

---------

Co-authored-by: Benny Powers - עם ישראל חי! <[email protected]>
* fix(code-block): fix syntax error breaking build

* chore(code-block): add changeset

* style: revert remove dom

This is kind of a six-of-one scenario. is it better to remove DOM?
or is it better to avoid thrashing the DOM when we add and remove on
changes?
In either case, I think It's more readable this way, even if there's
an empty, aria-hidden dom node

* chore: delete .changeset/shy-coins-fall.md

---------

Co-authored-by: Benny Powers <[email protected]>
Co-authored-by: Benny Powers - עם ישראל חי! <[email protected]>
* fix(tag): remove errant curly brace from demo

* fix(tag): use logical properties

* fix(tag): update interactive (link) tag styles

* style(tag): alphabetize CSS selectors

* fix(tag): make focus and active state include icon

* feat(tag): add functionality for disabled linked tags

* docs(tag): rename label 👉 tag in api docs

* docs(tag): remove docs for `close` nonexistent event

* docs(tag): rename demo to `links.html`

* feat(tag): add ability to make a tag a `<button>`

* feat(tag): FACE + click event for button tags

* docs(tag): rename buttons demo

* docs(tag): add changeset

* docs(tag): update bi-modal `overview.svg`

* docs(tag): update Style page

* docs(tag): update guidelines page

* docs(tag): update a11y page images

* fix(tag): remove button variant

See #2407 (comment) for more info.

* fix(tag): allow clicks to pass through active state

* fix(tag): keep `cursor: pointer;` for the active state on linked tags

* docs(tag): remove button tag info from docs

* fix(tag): remove button callback and event

Co-authored-by: Benny Powers - עם ישראל חי! <[email protected]>

* chore(tag): update changeset

* fix(tag): prevent disabled linked tags from navigating to a URL

---------

Co-authored-by: marionnegp <[email protected]>
Co-authored-by: Benny Powers - עם ישראל חי! <[email protected]>
@zeroedin zeroedin added this to the 2025/Q2 — Diglett release milestone Jun 13, 2025
@zeroedin zeroedin self-assigned this Jun 13, 2025
@zeroedin zeroedin added the feature New feature or request label Jun 13, 2025
@netlify
Copy link

netlify bot commented Jun 13, 2025

Deploy Preview for red-hat-design-system ready!

Name Link
🔨 Latest commit 4201cb8
🔍 Latest deploy log https://app.netlify.com/projects/red-hat-design-system/deploys/68710bbef508a40008376eea
😎 Deploy Preview https://deploy-preview-2443--red-hat-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot
Copy link

changeset-bot bot commented Jun 13, 2025

🦋 Changeset detected

Latest commit: 4201cb8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@rhds/elements Minor

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

@github-actions
Copy link
Contributor

github-actions bot commented Jun 13, 2025

Size Change: +3.43 kB (+1.48%)

Total Size: 235 kB

Filename Size Change
./elements.js 550 B +11 B (+2.04%)
./elements/rh-navigation-drawer/rh-navigation-drawer.js 3.22 kB +3.22 kB (new file) 🆕
./react/rh-navigation-drawer/rh-navigation-drawer.js 202 B +202 B (new file) 🆕
ℹ️ View Unchanged
Filename Size
./elements/rh-accordion/context.js 162 B
./elements/rh-accordion/rh-accordion-header.js 2.67 kB
./elements/rh-accordion/rh-accordion-panel.js 1.26 kB
./elements/rh-accordion/rh-accordion.js 3.32 kB
./elements/rh-alert/rh-alert.js 4.98 kB
./elements/rh-announcement/rh-announcement.js 2.12 kB
./elements/rh-audio-player/rh-audio-player-about.js 1.81 kB
./elements/rh-audio-player/rh-audio-player-rate-stepper.js 1.76 kB
./elements/rh-audio-player/rh-audio-player-scrolling-text-overflow.js 1.52 kB
./elements/rh-audio-player/rh-audio-player-subscribe.js 1.4 kB
./elements/rh-audio-player/rh-audio-player.js 13 kB
./elements/rh-audio-player/rh-cue.js 1.95 kB
./elements/rh-audio-player/rh-transcript.js 2.68 kB
./elements/rh-avatar/random-pattern-controller.js 2.72 kB
./elements/rh-avatar/rh-avatar.js 2.68 kB
./elements/rh-back-to-top/rh-back-to-top.js 1.96 kB
./elements/rh-badge/rh-badge.js 1.6 kB
./elements/rh-blockquote/rh-blockquote.js 1.37 kB
./elements/rh-breadcrumb/rh-breadcrumb.js 1.84 kB
./elements/rh-button/rh-button.js 3.29 kB
./elements/rh-card/rh-card.js 3.27 kB
./elements/rh-chip/context.js 165 B
./elements/rh-chip/rh-chip-group.js 1.58 kB
./elements/rh-chip/rh-chip.js 2.06 kB
./elements/rh-code-block/prism.css.js 667 B
./elements/rh-code-block/prism.js 572 B
./elements/rh-code-block/rh-code-block.js 7.7 kB
./elements/rh-cta/rh-cta.js 3.96 kB
./elements/rh-dialog/rh-dialog.js 4.81 kB
./elements/rh-dialog/yt-api.js 617 B
./elements/rh-disclosure/rh-disclosure.js 2.25 kB
./elements/rh-footer/rh-footer-block.js 714 B
./elements/rh-footer/rh-footer-copyright.js 362 B
./elements/rh-footer/rh-footer-links.js 1.1 kB
./elements/rh-footer/rh-footer-social-link.js 1.04 kB
./elements/rh-footer/rh-footer-universal.js 3.96 kB
./elements/rh-footer/rh-footer.js 4.75 kB
./elements/rh-health-index/rh-health-index.js 2.4 kB
./elements/rh-icon/rh-icon.js 2.49 kB
./elements/rh-icon/ssr.js 181 B
./elements/rh-jump-links/context.js 179 B
./elements/rh-jump-links/rh-jump-link.js 1.55 kB
./elements/rh-jump-links/rh-jump-links-list.js 1.17 kB
./elements/rh-jump-links/rh-jump-links.js 2.35 kB
./elements/rh-menu/rh-menu.js 1.21 kB
./elements/rh-navigation-primary/context.js 176 B
./elements/rh-navigation-primary/rh-navigation-primary-item-menu.js 1.03 kB
./elements/rh-navigation-primary/rh-navigation-primary-item.js 3.41 kB
./elements/rh-navigation-primary/rh-navigation-primary-overlay.js 534 B
./elements/rh-navigation-primary/rh-navigation-primary.js 7.33 kB
./elements/rh-navigation-secondary/rh-navigation-secondary-dropdown.js 2.57 kB
./elements/rh-navigation-secondary/rh-navigation-secondary-menu-section.js 1.32 kB
./elements/rh-navigation-secondary/rh-navigation-secondary-menu.js 1.75 kB
./elements/rh-navigation-secondary/rh-navigation-secondary-overlay.js 562 B
./elements/rh-navigation-secondary/rh-navigation-secondary.js 5.26 kB
./elements/rh-navigation-secondary/test/fixtures.js 769 B
./elements/rh-pagination/rh-pagination.js 5.57 kB
./elements/rh-site-status/rh-site-status.js 2.38 kB
./elements/rh-skip-link/rh-skip-link.js 1.19 kB
./elements/rh-spinner/rh-spinner.js 1.29 kB
./elements/rh-stat/rh-stat.js 2.08 kB
./elements/rh-subnav/rh-subnav.js 2.42 kB
./elements/rh-surface/rh-surface.js 893 B
./elements/rh-surface/test/elements.js 763 B
./elements/rh-switch/rh-switch.js 2.89 kB
./elements/rh-table/rh-sort-button.js 1.4 kB
./elements/rh-table/rh-table.js 2.89 kB
./elements/rh-tabs/context.js 226 B
./elements/rh-tabs/rh-tab-panel.js 973 B
./elements/rh-tabs/rh-tab.js 2.95 kB
./elements/rh-tabs/rh-tabs.js 3.62 kB
./elements/rh-tag/rh-tag.js 3.02 kB
./elements/rh-tile/rh-tile-group.js 1.78 kB
./elements/rh-tile/rh-tile.js 4.89 kB
./elements/rh-timestamp/rh-timestamp.js 983 B
./elements/rh-tooltip/rh-tooltip.js 3.12 kB
./elements/rh-video-embed/rh-video-embed.js 4.6 kB
./lib/color-palettes.js 851 B
./lib/context/headings/consumer.js 593 B
./lib/context/headings/provider.js 1.2 kB
./lib/elements/rh-context-demo/rh-context-demo.js 1.16 kB
./lib/elements/rh-context-picker/rh-context-picker.js 2.18 kB
./lib/environment.js 194 B
./lib/functions.js 175 B
./lib/I18nController.js 1.37 kB
./lib/ScreenSizeController.js 876 B
./lib/ssr-controller.js 201 B
./lib/themable.js 549 B
./react/rh-accordion/rh-accordion-header.js 199 B
./react/rh-accordion/rh-accordion-panel.js 185 B
./react/rh-accordion/rh-accordion.js 215 B
./react/rh-alert/rh-alert.js 184 B
./react/rh-announcement/rh-announcement.js 189 B
./react/rh-audio-player/rh-audio-player-about.js 191 B
./react/rh-audio-player/rh-audio-player-rate-stepper.js 213 B
./react/rh-audio-player/rh-audio-player-scrolling-text-overflow.js 214 B
./react/rh-audio-player/rh-audio-player-subscribe.js 196 B
./react/rh-audio-player/rh-audio-player.js 183 B
./react/rh-audio-player/rh-cue.js 195 B
./react/rh-audio-player/rh-transcript.js 207 B
./react/rh-avatar/rh-avatar.js 173 B
./react/rh-back-to-top/rh-back-to-top.js 183 B
./react/rh-badge/rh-badge.js 174 B
./react/rh-blockquote/rh-blockquote.js 179 B
./react/rh-breadcrumb/rh-breadcrumb.js 179 B
./react/rh-button/rh-button.js 174 B
./react/rh-card/rh-card.js 172 B
./react/rh-chip/rh-chip-group.js 182 B
./react/rh-chip/rh-chip.js 187 B
./react/rh-code-block/rh-code-block.js 181 B
./react/rh-cta/rh-cta.js 170 B
./react/rh-dialog/rh-dialog.js 203 B
./react/rh-disclosure/rh-disclosure.js 192 B
./react/rh-footer/rh-footer-block.js 184 B
./react/rh-footer/rh-footer-copyright.js 187 B
./react/rh-footer/rh-footer-links.js 185 B
./react/rh-footer/rh-footer-social-link.js 193 B
./react/rh-footer/rh-footer-universal.js 188 B
./react/rh-footer/rh-footer.js 174 B
./react/rh-health-index/rh-health-index.js 184 B
./react/rh-icon/rh-icon.js 202 B
./react/rh-jump-links/rh-jump-link.js 196 B
./react/rh-jump-links/rh-jump-links-list.js 189 B
./react/rh-jump-links/rh-jump-links.js 195 B
./react/rh-menu/rh-menu.js 173 B
./react/rh-navigation-primary/rh-navigation-primary-item-menu.js 205 B
./react/rh-navigation-primary/rh-navigation-primary-item.js 210 B
./react/rh-navigation-primary/rh-navigation-primary-overlay.js 199 B
./react/rh-navigation-primary/rh-navigation-primary.js 189 B
./react/rh-navigation-secondary/rh-navigation-secondary-dropdown.js 217 B
./react/rh-navigation-secondary/rh-navigation-secondary-menu-section.js 205 B
./react/rh-navigation-secondary/rh-navigation-secondary-menu.js 199 B
./react/rh-navigation-secondary/rh-navigation-secondary-overlay.js 201 B
./react/rh-navigation-secondary/rh-navigation-secondary.js 213 B
./react/rh-pagination/rh-pagination.js 178 B
./react/rh-site-status/rh-site-status.js 181 B
./react/rh-skip-link/rh-skip-link.js 181 B
./react/rh-spinner/rh-spinner.js 175 B
./react/rh-stat/rh-stat.js 171 B
./react/rh-subnav/rh-subnav.js 175 B
./react/rh-surface/rh-surface.js 175 B
./react/rh-switch/rh-switch.js 185 B
./react/rh-table/rh-sort-button.js 213 B
./react/rh-table/rh-table.js 174 B
./react/rh-tabs/rh-tab-panel.js 181 B
./react/rh-tabs/rh-tab.js 187 B
./react/rh-tabs/rh-tabs.js 174 B
./react/rh-tag/rh-tag.js 171 B
./react/rh-tile/rh-tile-group.js 183 B
./react/rh-tile/rh-tile.js 194 B
./react/rh-timestamp/rh-timestamp.js 176 B
./react/rh-tooltip/rh-tooltip.js 175 B
./react/rh-video-embed/rh-video-embed.js 227 B
./uxdot/ssr-failure-recoverable.js 581 B
./uxdot/uxdot-best-practice.js 812 B
./uxdot/uxdot-color-scheme-picker.js 1.56 kB
./uxdot/uxdot-copy-button.js 1.24 kB
./uxdot/uxdot-copy-permalink.js 1.1 kB
./uxdot/uxdot-demo.js 1.38 kB
./uxdot/uxdot-example.js 1.14 kB
./uxdot/uxdot-feedback.js 837 B
./uxdot/uxdot-header.js 1.02 kB
./uxdot/uxdot-masthead.js 1.36 kB
./uxdot/uxdot-pattern-ssr-controller-client.js 615 B
./uxdot/uxdot-pattern-ssr-controller-server.js 1.72 kB
./uxdot/uxdot-pattern-ssr-controller.js 213 B
./uxdot/uxdot-pattern.js 2.23 kB
./uxdot/uxdot-repo-status-checklist.js 1.16 kB
./uxdot/uxdot-repo-status-list.js 1.07 kB
./uxdot/uxdot-repo-status-table.js 782 B
./uxdot/uxdot-repo.js 1.17 kB
./uxdot/uxdot-search.js 2.39 kB
./uxdot/uxdot-sidenav.js 2.69 kB
./uxdot/uxdot-spacer-tokens-table.js 2.46 kB
./uxdot/uxdot-toc.js 1.8 kB

compressed-size-action

@zeroedin zeroedin changed the title feat: add <rh-navigation-drawer> feat(navigation-drawer): add <rh-navigation-drawer> Jun 13, 2025
@markcaron markcaron moved this to In Progress 🟢 in Red Hat Design System Jun 26, 2025
@bennypowers
Copy link
Member

maybe this should be called <rh-drawer>?

@bennypowers bennypowers linked an issue Jul 7, 2025 that may be closed by this pull request
@zeroedin zeroedin marked this pull request as ready for review July 7, 2025 19:49
@zeroedin
Copy link
Collaborator Author

zeroedin commented Jul 7, 2025

maybe this should be called <rh-drawer>?

I referenced this question in the issue before I saw your comment here. My thought is that <rh-drawer> is different. This is explicitly designed as a navigation drawer; a standard drawer pattern has a toggle/trigger external to itself. The nav drawer collapses at mobile viewport to a disclosure whereas the standard toggled drawer doesn't have a separate mobile experience. This combination of things sets it apart from patterns found in other design system such as Patternfly.

@zeroedin zeroedin moved this from In Progress 🟢 to Review 🔍 in Red Hat Design System Jul 8, 2025
Copy link
Collaborator

@adamjohnson adamjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few nitpicks. Overall, great work as always!

Copy link
Collaborator

@adamjohnson adamjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needs docs. Otherwise, LGTM!

@coreyvickery
Copy link
Collaborator

@adamjohnson @zeroedin Can this be closed without docs? They'll be done next week.

Copy link
Member

@bennypowers bennypowers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't have multiple different drawer elements. see my comments on the issue.

@bennypowers
Copy link
Member

bennypowers commented Jul 21, 2025

Notes from chat:
eventually drawer will have to support many different use cases, e.g

  • has to be able to pull out of any screen edge (think AI chat)
  • has to be able to slot in toggle button if desired (like ux-dot's close button)
  • support push vs overlay
  • etc

Open questions and review note

  • the "it turns into a disclosure" part of this element, can we make that a pattern thing, or maybe move that into the content elements
  • the container attribute is a bit of a code smell, points to larger design issues
  • this should probably be part of a larger layout system

Counterpoint: material 3 has a navigation drawer

all in all, I think it's better that we put this feature back in the oven for more design, and shoot for a duoduo release

cc @markcaron

@coreyvickery
Copy link
Collaborator

@bennypowers Moving to Doduo would give me more time to finish other things for Diglett/understand this element more so I can eventually write the docs. cc @markcaron

@zeroedin
Copy link
Collaborator Author

zeroedin commented Jul 21, 2025

Expanding on what Benny already mentioned.

The container attribute was intended to target an ancestor not explicitly owned by the component. This is necessary for the resize observer to set the "compact" state switching to a disclosure for when the targeted container is not the direct parent of the component, but a higher ancestor in a complex layout.

It is a code smell and not ideal. My thought at the time of writing was trying to navigate the possibility of a nested container-type causing problems in the ancestor tree.

Furthermore, the demo isn't complete enough to fully demonstrate its real need. For the attribute to be truly effective, the .left-column would also have to be of the container-type: inline-size. However, if that were the case, I believe the internal CSS would break anyway due to the expand-at attribute requiring CSS that would then have to explicitly call a container query name, which we can not set dynamically.

We may have to take a more layout-based approach as @bennypowers mentioned vs the self-contained approach taken so far:

<div class="container">
  <rh-navigation-drawer>...</rh-navigation-drawer>
  Your  page content
</div>

vs layout-based where the drawer has a page content slot itself and then becomes the container:

<rh-drawer>
  <div slot="panel">...</div>
  Your page content
</rh-drawer>

Likely, special care will have to be taken to avoid CLS of the whole page in this setup.

Base automatically changed from staging/diglett to main August 6, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

Status: Review 🔍

Development

Successfully merging this pull request may close these issues.

[feat] <rh-navigation-drawer>

7 participants