Skip to content

Commit

Permalink
convert app-footer/index to ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhaulagiri committed May 15, 2024
1 parent 802a56d commit f2fa907
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{! @glint-nocheck: not typesafe yet }}
{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
Expand Down
32 changes: 30 additions & 2 deletions packages/components/src/components/hds/app-footer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,35 @@

import Component from '@glimmer/component';

export default class HdsAppFooterIndexComponent extends Component {
import type { ComponentLike } from '@glint/template';
import type { HdsYieldSignature } from '../yield';
import type HdsAppFooterItemSignature from './legal-links';
import type HdsAppFooterLegalLinksSignature from './legal-links';
import type HdsAppFooterLinkSignature from './link';
import type HdsAppFooterStatusLinkSignature from './status-link';

export interface HdsAppFooterSignature {
Args: {
ariaLabel?: string;
copyrightYear?: string;
theme?: string;
};
Blocks: {
default: [
{
ExtraBefore?: ComponentLike<HdsYieldSignature>;
Item?: ComponentLike<HdsAppFooterItemSignature>;
LegalLinks?: ComponentLike<HdsAppFooterLegalLinksSignature>;
Link?: ComponentLike<HdsAppFooterLinkSignature>;
StatusLink?: ComponentLike<HdsAppFooterStatusLinkSignature>;
ExtraAfter?: ComponentLike<HdsYieldSignature>;
}
];
};
Element: HTMLDivElement;
}

export default class HdsAppFooterIndexComponent extends Component<HdsAppFooterSignature> {
/**
* @param ariaLabel
* @type {string}
Expand All @@ -31,7 +59,7 @@ export default class HdsAppFooterIndexComponent extends Component {
* @return {string} The "class" attribute to apply to the component.
*/
get classNames() {
let classes = ['hds-app-footer'];
const classes = ['hds-app-footer'];

// add a class based on the @theme argument
classes.push(`hds-app-footer--theme-${this.theme}`);
Expand Down
5 changes: 5 additions & 0 deletions packages/components/src/template-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import type HdsAlertIndexComponent from './components/hds/alert';
import type HdsAlertDescriptionComponent from './components/hds/alert/description';
import type HdsAlertTitleComponent from './components/hds/alert/title';
import type HdsAppFooterIndexComponent from './components/hds/app-footer';
import type HdsAppFooterCopyrightComponent from './components/hds/app-footer/copyright';
import type HdsAppFooterItemComponent from './components/hds/app-footer/item';
import type HdsAppFooterLegalLinksComponent from './components/hds/app-footer/legal-links';
Expand Down Expand Up @@ -47,6 +48,10 @@ export default interface HdsComponentsRegistry {

// AppFooter

'Hds::AppFooter': typeof HdsAppFooterIndexComponent;
'hds/app-footer': typeof HdsAppFooterIndexComponent;
HdsAppFooter: typeof HdsAppFooterIndexComponent;

'Hds::AppFooter::Copyright': typeof HdsAppFooterCopyrightComponent;
'hds/app-footer/copyright': typeof HdsAppFooterCopyrightComponent;
HdsAppFooterCopyright: typeof HdsAppFooterCopyrightComponent;
Expand Down

0 comments on commit f2fa907

Please sign in to comment.