diff --git a/.changeset/dry-spiders-tell.md b/.changeset/dry-spiders-tell.md
new file mode 100644
index 00000000000..b07bd07ac90
--- /dev/null
+++ b/.changeset/dry-spiders-tell.md
@@ -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.
diff --git a/packages/components/src/components/hds/app-header/home-link.hbs b/packages/components/src/components/hds/app-header/home-link.hbs
index 9235f453019..9521f6f6b45 100644
--- a/packages/components/src/components/hds/app-header/home-link.hbs
+++ b/packages/components/src/components/hds/app-header/home-link.hbs
@@ -14,7 +14,10 @@
@href={{@href}}
@isHrefExternal={{@isHrefExternal}}
...attributes
- aria-label={{this.ariaLabel}}
+ aria-label={{if this.isIconOnly this.text null}}
>
+ {{#unless this.isIconOnly}}
+ {{this.text}}
+ {{/unless}}
\ No newline at end of file
diff --git a/packages/components/src/components/hds/app-header/home-link.ts b/packages/components/src/components/hds/app-header/home-link.ts
index fcf3da1469d..bb53d175014 100644
--- a/packages/components/src/components/hds/app-header/home-link.ts
+++ b/packages/components/src/components/hds/app-header/home-link.ts
@@ -12,21 +12,37 @@ import type { HdsInteractiveSignature } from '../interactive/';
export interface HdsAppHeaderHomeLinkSignature {
Args: HdsInteractiveSignature['Args'] & {
icon: HdsIconSignature['Args']['name'];
+ isIconOnly?: boolean;
color?: string;
- ariaLabel: string;
+ text: string;
};
Element: HdsInteractiveSignature['Element'];
}
export default class HdsAppHeaderHomeLink extends Component {
- get ariaLabel(): string {
- const { ariaLabel } = this.args;
+ get text(): string {
+ const { text } = this.args;
assert(
- '@ariaLabel for "Hds::AppHeader::HomeLink" ("Logo") must have a valid value',
- ariaLabel !== undefined
+ '@text for "Hds::AppHeader::HomeLink" must have a valid value',
+ text !== undefined
);
- return ariaLabel;
+ return text;
+ }
+
+ get icon(): HdsIconSignature['Args']['name'] {
+ const { icon } = this.args;
+
+ assert(
+ '@icon name for "Hds::AppHeader::HomeLink" must be provided',
+ icon !== undefined
+ );
+
+ return icon;
+ }
+
+ get isIconOnly(): boolean {
+ return this.args.isIconOnly ?? true;
}
}
diff --git a/packages/components/src/styles/components/app-header.scss b/packages/components/src/styles/components/app-header.scss
index d0fe7094aee..298ef3c17e2 100644
--- a/packages/components/src/styles/components/app-header.scss
+++ b/packages/components/src/styles/components/app-header.scss
@@ -102,6 +102,7 @@
.hds-app-header__utility-actions {
display: flex;
gap: inherit;
+ align-items: center;
}
// Dropdown & Button color theming overrides
@@ -144,12 +145,11 @@
.hds-app-header__home-link {
@include hds-interactive-dark-theme($add-visible-border: false);
display: flex;
+ gap: 8px;
align-items: center;
justify-content: center;
-
- // Set home link container size:
- width: var(--token-app-header-home-link-size);
- height: var(--token-app-header-home-link-size);
+ padding: 3px;
+ text-decoration: none;
// disabled state:
&:disabled,
diff --git a/showcase/app/components/mock/app/header/app-header.gts b/showcase/app/components/mock/app/header/app-header.gts
index e40f42b1cd2..528f41be5d6 100644
--- a/showcase/app/components/mock/app/header/app-header.gts
+++ b/showcase/app/components/mock/app/header/app-header.gts
@@ -46,7 +46,8 @@ export default class MockAppHeaderAppHeader extends Component
diff --git a/showcase/app/templates/components/app-header/index.hbs b/showcase/app/templates/components/app-header/index.hbs
index 17eaf5839c5..839b7c5d688 100644
--- a/showcase/app/templates/components/app-header/index.hbs
+++ b/showcase/app/templates/components/app-header/index.hbs
@@ -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"}}
@@ -14,8 +14,8 @@
With generic content
-
-
+
+
<:logo>
@@ -32,18 +32,18 @@
-
-
+
+
With typical child component content
-
-
+
+
<:logo>
-
+
<:globalActions>
@@ -75,12 +75,12 @@
-
+
-
+
<:logo>
-
+
<:globalActions>
@@ -114,12 +114,12 @@
-
+
-
+
<:logo>
-
+
<:globalActions>
@@ -160,18 +160,18 @@
-
-
+
+
With long content
-
-
+
+
<:logo>
-
+
<:globalActions>
@@ -202,12 +202,12 @@
-
+
-
+
<:logo>
-
+
<:globalActions>
@@ -238,18 +238,105 @@
-
-
+
+
+
+
+
+ With text
+
+
+
+
+
+ <:logo>
+
+
+ <:utilityActions>
+
+
+
+
+ Account Settings
+
+
+
+
+
+
+
+ <:logo>
+
+
+ <:globalActions>
+
+
+
+ organizationName
+
+
+
+ <:utilityActions>
+
+
+
+ Documentation
+ Tutorials
+ Terraform Provider
+ Changelog
+
+ Create support ticket
+ Give feedback
+
+
+
+
+
+
+ Account Settings
+
+
+
+
+
+
+
+ <:logo>
+
+
+ <:utilityActions>
+
+
+
+
+
+
+
+ <:logo>
+
+
+ <:globalActions>
+
+
+
+
+
+
Options
-
-
+
+
<:logo>
-
+
<:globalActions>
@@ -281,13 +368,12 @@
-
+
-
-
+
{{! 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 }}
@@ -337,14 +423,14 @@
Base elements
- SideNav::Header::HomeLink
+ AppHeader::HomeLink
Content
@@ -352,7 +438,7 @@