Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enterprise Nav: AppHeader component (HDS-3373) #2161

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

KristinLBradley
Copy link
Contributor

@KristinLBradley KristinLBradley commented Jun 13, 2024

STATUS: Created preliminary component(s) & tests. In process of refining components, APIs, & fleshing out Showcase examples. Visual styles, including for Button & Dropdown content, are nearing finalization. Responsive behavior & styling NOT yet completed.

NOT yet ready for in depth review. Sharing for visibility and initial high level feedback on open questions.

📌 Summary

If merged, this PR adds the AppHeader component to HDS.

Showcase:

🛠️ Detailed description

Changes include:

  • New AppHeader component, including:
    • Named block for "Global items": ProductMenu, HomeLink/Logo, OrgPicker
    • Named block for "Utility items": Search, HelpMenu, GeoPicker, UserMenu
  • Basic modifications to SideNav to coordinate with AppHeader

🔗 External links


👀 Component checklist

💬 Please consider using conventional comments when reviewing this PR.

Copy link

vercel bot commented Jun 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
hds-showcase ✅ Ready (Inspect) Visit Preview Jun 25, 2024 5:57pm
hds-website ✅ Ready (Inspect) Visit Preview Jun 25, 2024 5:57pm

aria-label={{this.ariaLabel}}
>
<FlightIcon @name={{@icon}} @color={{@color}} @stretched={{true}} />
</Hds::Interactive>
Copy link
Contributor Author

@KristinLBradley KristinLBradley Jun 13, 2024

Choose a reason for hiding this comment

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

This is pretty much the same as the SideNav::HomeLink component

// constructor() {
// super(...arguments);
// // ADD YOUR ASSERTIONS HERE
// }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will clean all this up later.

</:globalAfter>

<:utility>
<Hds::Button class="hds-side-nav__icon-button" @icon="search" @isIconOnly={{true}} @text="Search" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Icon only buttons icon size vs. Dropdown icon size needs to be more closely examined and perhaps reworked. (Examined & explored this and discussed with @jorytindall.)

I also am now realizing that the "one-off" SideNav::Header::IconButton was likely a mistake that we should also rethink. http://localhost:4201/components/side-nav#sidenav-header-iconbutton

We should look to come up with a better strategy for implementing the dark "theme" for the Button and Dropdown as well. (@jorytindall as a reminder)

This comment was marked as resolved.

Copy link
Contributor Author

@KristinLBradley KristinLBradley Jun 17, 2024

Choose a reason for hiding this comment

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

The Hds::SideNav::Header::IconButton forces a non-standard icon size (in addition to adding dark theme styling). It was created to follow custom styling Terraform had been using for their search button. In my mind, needing a special component to change the button icon size highlights a possible design issue which should be solved in the base Button and Dropdown components. @jorytindall and I can look at this though and decide what to do.

This is the AppHeader using standard icon sizes:
image

@KristinLBradley
Copy link
Contributor Author

KristinLBradley commented Jun 14, 2024

@jorytindall and I discovered a possible design issue with the sizing of icons in the icon only Button vs. in the Dropdown which we may want to explore solutions for:
image

On the right side in the "utility" items area, observe that the search icon in the button is noticeably smaller than the icons in the dropdowns next to it.

For the SideNav, we had ended up creating a Hds::SideNav::Header::IconButton child component which both increased the size of the icon and also applied dark theme styling. This was probably not the best solution however so I think we should also rethink this as part of the enterprise nav work.

2 issues to consider:

  • Visual inconsistency of icon sizing in Button vs. Dropdown
    • We could consider reducing icon size in the Dropdown to match the Button. (Or increasing Button icon size)
  • Cohesive dark theme/design variant solution for Button & Dropdown
    • Currently, we apply an extra classname for SideNav Dropdowns while we created a child component for Buttons. These 2 approaches should either be replaced or consolidated.
    • We could possibly add "dark" variant theme options to Button & Dropdown as a solution.

Copy link
Contributor

@jorytindall jorytindall left a comment

Choose a reason for hiding this comment

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

Left one initial note (I know this is a draft) on the focus/active state of the icon-only buttons being overridden. This is looking really solid so far!

One thing to consider is the width of the various "pickers" (context switcher/geo picker):

  • Since they aren't within the SideNav anymore, what should the width of these elements be?
  • Should they adapt to the content within (and change when something longer/shorter is selected)?
  • Should we set a min/max width? That might result in a long label getting cut off, or requiring truncation 👎

I'll think about this a bit, but just highlighting as another topic of discussion. Great job getting this throw together so quickly!

packages/components/src/styles/components/app-header.scss Outdated Show resolved Hide resolved
Copy link
Contributor

@didoo didoo left a comment

Choose a reason for hiding this comment

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

I've left a couple of comments. Not sure what else provide feedback on, at this stage, in case let me know and I can look in more detail.

</:globalAfter>

<:utility>
<Hds::Button class="hds-side-nav__icon-button" @icon="search" @isIconOnly={{true}} @text="Search" />

This comment was marked as resolved.


// Used to apply dark theme to interactive elements such as Button & Dropdown
@mixin hds-interactive-dark-theme($add-visible-border: true, $is-within-side-nav: false) {
@if $is-within-side-nav {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not that bad, at least it's hidden all in one place

// general dark theme tokens
color: var(--token-color-palette-neutral-0);
background-color: var(--token-color-palette-neutral-700);
border-radius: var(--token-form-control-border-radius);
Copy link
Contributor

Choose a reason for hiding this comment

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

technically it's not the form-control-border-radius but something like button-border-radius; unfortunately we don't have such token, only a variable $hds-button-border-radius in the mixins/_button.scss, maybe you can import the mixin and use that variable instead? (I've never tried, but probably should work)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, will see. (I picked that one because it seemed closest.)

…with AppHeader, Add styling to remove excess spacing from empty header and footer
…wer design mocks, change buttons in Showcase to use Hds::Button icon only variant
…:empty selector to remove excess padding in empty elements
…xin, apply styles to child components via inheritance, add examples of interactive child components to Showcase
…der and SideNav to use for interactive components
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants