-
Notifications
You must be signed in to change notification settings - Fork 49
Add support for Text in the AppHeader
#2951
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
Merged
+261
−90
Merged
Changes from 32 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
6d81131
Testing different Application Name examples in context
jorytindall c5de994
Added support for a title within the HomeLink
jorytindall 6cc917a
Updated styling to remove the width/height set by the token to use pa…
jorytindall 00e8ac8
Added examples for Terraform Admin Console, Admin UI, and Boundary De…
jorytindall 3864ab5
Updated examples and added examples of the HomeLink states with titles
jorytindall 6db5af1
lint
jorytindall 419464a
Add missing closing tag in showcase
jorytindall b69694e
Testing: concat title with aria label when present
jorytindall a83eff8
Restructured the HomeLink to recieve text and isIconOnly arguments, r…
jorytindall 28a86b2
Lint
jorytindall 61e279a
Changeset
jorytindall 183c5fb
Make text argument required
jorytindall 3a0055c
Remove unused min/max width declarations for the logo
jorytindall bd78286
Updated ariaLabel property in component mock
jorytindall 0cb7bb6
Lint showcase
jorytindall b8e55a8
Removed errant =
jorytindall 0642018
format showcase
jorytindall 893cee4
Removed trailing space
jorytindall 4e9ca60
simplified conditional logic for rendering the icon + text
jorytindall 8da8a7f
Removed disabled state variants of the home link
jorytindall 7df890c
Updated tests
jorytindall 79d5d18
Fix assertion
jorytindall fec2164
lint showcase
jorytindall be2ac96
Fix tests!
jorytindall 0306fb1
Updated examples in the showcase
jorytindall 58891d8
Revise changelog
jorytindall 60dce9d
Removed explicit class on the text element, set isIconOnly to true by…
jorytindall 30d1ba7
linter
jorytindall a122314
linter format
jorytindall 07adb46
Removed all instances where isIconOnly is true because its the default
jorytindall 92bb602
Added more explicit assertion for the icon argument
jorytindall 184601c
lint
jorytindall 9cc3a79
Cleanup of layouts and content in the showcase
jorytindall 142389f
Lint
jorytindall 5797efd
Updated contextual component naming conventions
jorytindall ccb3046
Fixed placement of the badge example
jorytindall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@hashicorp/design-system-components": minor | ||
--- | ||
|
||
`AppHeader` - Refactored the Home Link, removed the `@ariaLabel` argument, added | ||
`@text` (should replace `@ariaLabel`) and `@isIconOnly` arguments. |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{{! | ||
Copyright (c) HashiCorp, Inc. | ||
SPDX-License-Identifier: MPL-2.0 | ||
Copyright (c) HashiCorp, Inc. | ||
SPDX-License-Identifier: MPL-2.0 | ||
}} | ||
|
||
{{page-title "AppHeader Component"}} | ||
|
@@ -43,7 +43,7 @@ | |
<SG.Item @label="With minimum recommended phase 1 content"> | ||
<Hds::AppHeader @hasA11yRefocus={{false}}> | ||
<:logo> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp home menu" @href="#" /> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @text="HashiCorp home menu" @href="#" /> | ||
</:logo> | ||
<:globalActions> | ||
<Hds::Dropdown @enableCollisionDetection={{true}} as |dd|> | ||
|
@@ -80,7 +80,7 @@ | |
<SG.Item @label="With max recommended phase 1 content & Terraform logo"> | ||
<Hds::AppHeader @hasA11yRefocus={{false}}> | ||
<:logo> | ||
<Hds::AppHeader::HomeLink @icon="terraform" @ariaLabel="Terraform home menu" @href="#" /> | ||
<Hds::AppHeader::HomeLink @icon="terraform" @text="Terraform home menu" @href="#" /> | ||
</:logo> | ||
<:globalActions> | ||
<Hds::Dropdown @enableCollisionDetection={{true}} as |dd|> | ||
|
@@ -119,7 +119,7 @@ | |
<SG.Item @label="With max proposed future content"> | ||
<Hds::AppHeader @hasA11yRefocus={{false}}> | ||
<:logo> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp home menu" @href="#" /> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @text="HashiCorp home menu" @href="#" /> | ||
</:logo> | ||
<:globalActions> | ||
<Hds::Dropdown @enableCollisionDetection={{true}} as |dd|> | ||
|
@@ -171,7 +171,7 @@ | |
<SG.Item @label="40 characters long organization name with dashes"> | ||
<Hds::AppHeader @hasA11yRefocus={{false}}> | ||
<:logo> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp home menu" @href="#" /> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @text="HashiCorp home menu" @href="#" /> | ||
</:logo> | ||
<:globalActions> | ||
<Hds::Dropdown @enableCollisionDetection={{true}} as |dd|> | ||
|
@@ -207,7 +207,7 @@ | |
<SG.Item @label="40 characters long organization name with no dashes"> | ||
<Hds::AppHeader @hasA11yRefocus={{false}}> | ||
<:logo> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp home menu" @href="#" /> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @text="HashiCorp home menu" @href="#" /> | ||
</:logo> | ||
<:globalActions> | ||
<Hds::Dropdown @enableCollisionDetection={{true}} as |dd|> | ||
|
@@ -241,6 +241,91 @@ | |
</SG.Item> | ||
</Shw::Grid> | ||
|
||
<Shw::Divider @level="2" /> | ||
|
||
<Shw::Text::H3>With text</Shw::Text::H3> | ||
|
||
<Shw::Grid @columns={{1}} {{style gap="2rem"}} as |SG|> | ||
didoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<SG.Item> | ||
didoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<Hds::AppHeader @hasA11yRefocus={{false}}> | ||
<:logo> | ||
<Hds::AppHeader::HomeLink @icon="terraform" @text="Terraform Admin Console" @isIconOnly={{false}} @href="#" /> | ||
</:logo> | ||
<:utilityActions> | ||
<Hds::Dropdown @enableCollisionDetection={{true}} as |dd|> | ||
<dd.ToggleIcon @icon="user" @text="user menu" /> | ||
<dd.Title @text="Signed In" /> | ||
<dd.Description @text="[email protected]" /> | ||
<dd.Interactive @href="#">Account Settings</dd.Interactive> | ||
</Hds::Dropdown> | ||
</:utilityActions> | ||
</Hds::AppHeader> | ||
</SG.Item> | ||
|
||
<SG.Item> | ||
<Hds::AppHeader @hasA11yRefocus={{false}}> | ||
<:logo> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @text="Admin UI" @isIconOnly={{false}} @href="#" /> | ||
</:logo> | ||
<:globalActions> | ||
<Hds::Dropdown @enableCollisionDetection={{true}} as |dd|> | ||
<dd.ToggleButton @text="Choose an organization" @icon="org" /> | ||
<dd.Checkmark> | ||
organizationName | ||
</dd.Checkmark> | ||
</Hds::Dropdown> | ||
</:globalActions> | ||
<:utilityActions> | ||
<Hds::Dropdown @enableCollisionDetection={{true}} as |dd|> | ||
<dd.ToggleIcon @icon="help" @text="help menu" /> | ||
<dd.Title @text="Help & Support" /> | ||
<dd.Interactive @href="#">Documentation</dd.Interactive> | ||
<dd.Interactive @href="#">Tutorials</dd.Interactive> | ||
<dd.Interactive @href="#">Terraform Provider</dd.Interactive> | ||
<dd.Interactive @href="#">Changelog</dd.Interactive> | ||
<dd.Separator /> | ||
<dd.Interactive @href="#">Create support ticket</dd.Interactive> | ||
<dd.Interactive @href="#">Give feedback</dd.Interactive> | ||
</Hds::Dropdown> | ||
|
||
<Hds::Dropdown @enableCollisionDetection={{true}} as |dd|> | ||
<dd.ToggleIcon @icon="user" @text="user menu" /> | ||
<dd.Title @text="Signed In" /> | ||
<dd.Description @text="[email protected]" /> | ||
<dd.Interactive @href="#">Account Settings</dd.Interactive> | ||
</Hds::Dropdown> | ||
</:utilityActions> | ||
</Hds::AppHeader> | ||
</SG.Item> | ||
|
||
<SG.Item> | ||
<Hds::AppHeader @hasA11yRefocus={{false}}> | ||
<:logo> | ||
<Hds::AppHeader::HomeLink @icon="boundary-color" @text="Boundary Desktop" @isIconOnly={{false}} @href="#" /> | ||
</:logo> | ||
<:utilityActions> | ||
<Hds::Button @color="secondary" @icon="search" @isIconOnly={{true}} @text="Search" /> | ||
</:utilityActions> | ||
</Hds::AppHeader> | ||
</SG.Item> | ||
|
||
<SG.Item> | ||
<Hds::AppHeader @hasA11yRefocus={{false}}> | ||
<:logo> | ||
<Hds::AppHeader::HomeLink | ||
@icon="hashicorp" | ||
@text="HashiCorp Cloud Platform" | ||
@isIconOnly={{false}} | ||
@href="#" | ||
/> | ||
<Hds::Badge @text="Assuming Role: Admin" @color="highlight" @icon="eye" @type="filled" /> | ||
</:logo> | ||
</Hds::AppHeader> | ||
</SG.Item> | ||
|
||
</Shw::Grid> | ||
|
||
<Shw::Divider /> | ||
|
||
<Shw::Text::H2>Options</Shw::Text::H2> | ||
|
@@ -249,7 +334,7 @@ | |
<SG.Item @label="With custom breakpoint (menu button is visible at wide screen width)"> | ||
<Hds::AppHeader @hasA11yRefocus={{false}} @breakpoint="20000px"> | ||
<:logo> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp home menu" @href="#" /> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @text="HashiCorp home menu" @href="#" /> | ||
</:logo> | ||
<:globalActions> | ||
<Hds::Dropdown @enableCollisionDetection={{true}} as |dd|> | ||
|
@@ -285,9 +370,8 @@ | |
</Shw::Grid> | ||
|
||
<Shw::Divider /> | ||
</section> | ||
|
||
<Shw::Divider /> | ||
</section> | ||
|
||
{{! For some reason, Ember tests don't play well with iframes (URL not found) so we can't take snapshots of these examples in Percy }} | ||
<section> | ||
|
@@ -337,51 +421,67 @@ | |
|
||
<Shw::Text::H2>Base elements</Shw::Text::H2> | ||
|
||
<Shw::Text::H3>SideNav::Header::HomeLink</Shw::Text::H3> | ||
<Shw::Text::H3>AppHeader::HomeLink</Shw::Text::H3> | ||
|
||
<Shw::Text::H4>Content</Shw::Text::H4> | ||
|
||
<Shw::Flex as |SF|> | ||
<SF.Item @label="Icon"> | ||
<div class="hds-app-header"> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp" @href="#" /> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @text="HashiCorp" @href="#" /> | ||
</div> | ||
</SF.Item> | ||
|
||
<SF.Item @label="Custom color"> | ||
<div class="hds-app-header"> | ||
<Hds::AppHeader::HomeLink | ||
@icon="boundary" | ||
@ariaLabel="Boundary" | ||
@text="Boundary" | ||
@color="var(--token-color-boundary-brand)" | ||
@href="#" | ||
/> | ||
</div> | ||
</SF.Item> | ||
</Shw::Flex> | ||
|
||
<Shw::Text::H4>Text</Shw::Text::H4> | ||
jorytindall marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<Shw::Flex as |SF|> | ||
<SF.Item> | ||
<div class="hds-app-header"> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @text="HashiCorp" @href="#" @title="Admin UI" /> | ||
didoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</div> | ||
</SF.Item> | ||
|
||
<SF.Item> | ||
<div class="hds-app-header"> | ||
<Hds::AppHeader::HomeLink @icon="terraform" @text="Terraform" @href="#" @title="Terraform Admin Console" /> | ||
jorytindall marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</div> | ||
</SF.Item> | ||
</Shw::Flex> | ||
|
||
<Shw::Text::H4>States</Shw::Text::H4> | ||
|
||
<Shw::Flex as |SF|> | ||
{{#let (array "default" "hover" "active" "focus" "disabled") as |states|}} | ||
{{#let (array "default" "hover" "active" "focus") as |states|}} | ||
{{#each states as |state|}} | ||
<SF.Item @label={{state}}> | ||
<div class="hds-app-header"> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @ariaLabel="HashiCorp" @href="#" mock-state-value={{state}} /> | ||
<Hds::AppHeader::HomeLink @icon="hashicorp" @text="HashiCorp" @href="#" mock-state-value={{state}} /> | ||
</div> | ||
</SF.Item> | ||
{{/each}} | ||
{{/let}} | ||
</Shw::Flex> | ||
|
||
<Shw::Flex as |SF|> | ||
{{#let (array "default" "hover" "active" "focus" "disabled") as |states|}} | ||
{{#let (array "default" "hover" "active" "focus") as |states|}} | ||
{{#each states as |state|}} | ||
<SF.Item> | ||
<div class="hds-app-header"> | ||
<Hds::AppHeader::HomeLink | ||
@icon="boundary" | ||
@ariaLabel="Boundary" | ||
@text="Boundary" | ||
@color="var(--token-color-boundary-brand)" | ||
@href="#" | ||
mock-state-value={{state}} | ||
|
@@ -392,6 +492,24 @@ | |
{{/let}} | ||
</Shw::Flex> | ||
|
||
<Shw::Flex as |SF|> | ||
{{#let (array "default" "hover" "active" "focus") as |states|}} | ||
{{#each states as |state|}} | ||
<SF.Item @label={{state}}> | ||
<div class="hds-app-header"> | ||
<Hds::AppHeader::HomeLink | ||
@icon="terraform" | ||
@text="Terraform Admin Console" | ||
@isIconOnly={{false}} | ||
@href="#" | ||
mock-state-value={{state}} | ||
/> | ||
</div> | ||
</SF.Item> | ||
{{/each}} | ||
{{/let}} | ||
</Shw::Flex> | ||
|
||
<Shw::Divider @level="2" /> | ||
|
||
<Shw::Text::H3>Buttons within AppHeader</Shw::Text::H3> | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't exactly the same as the conditional logic for the
<Hds::Button>
but it seemed to make sense given that the icon is always required. But open to suggestions!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me as well.