diff --git a/docs/src/app/pages/component-viewer/component-overview.html b/docs/src/app/pages/component-viewer/component-overview.html index 715e4e126a72..a3397b3ed5e3 100644 --- a/docs/src/app/pages/component-viewer/component-overview.html +++ b/docs/src/app/pages/component-viewer/component-overview.html @@ -2,7 +2,9 @@

Overview for {{docItem.id}}

- diff --git a/docs/src/app/shared/doc-viewer/angular-aria-banner/angular-aria-banner.css b/docs/src/app/shared/doc-viewer/angular-aria-banner/angular-aria-banner.css index 024ce71a26d8..5bc996314758 100644 --- a/docs/src/app/shared/doc-viewer/angular-aria-banner/angular-aria-banner.css +++ b/docs/src/app/shared/doc-viewer/angular-aria-banner/angular-aria-banner.css @@ -11,33 +11,36 @@ line-height: 1.6; } -.docs-angular-aria-banner-icon { - font-size: 20px; +mat-icon { flex-shrink: 0; - fill: var(--mat-sys-primary); + color: var(--mat-sys-primary); } .docs-angular-aria-banner-content { flex: 1; } -.docs-angular-aria-banner-content strong { +strong { color: var(--mat-sys-primary); } -.docs-angular-aria-banner-content a { +a { color: var(--mat-sys-primary); text-decoration: underline; font-weight: 500; } +p { + margin: 0; +} + @media (max-width: 600px) { .docs-angular-aria-banner { padding: 12px; gap: 8px; } - .docs-angular-aria-banner-icon { + mat-icon { font-size: 18px; } } diff --git a/docs/src/app/shared/doc-viewer/angular-aria-banner/angular-aria-banner.html b/docs/src/app/shared/doc-viewer/angular-aria-banner/angular-aria-banner.html index 888cf5700406..e98063aa474e 100644 --- a/docs/src/app/shared/doc-viewer/angular-aria-banner/angular-aria-banner.html +++ b/docs/src/app/shared/doc-viewer/angular-aria-banner/angular-aria-banner.html @@ -1,16 +1,13 @@
- - - - + info +
Now Available in Angular Aria! -
- The Angular team has introduced a new low-level component library called Angular Aria. - Consider using the - Angular Aria {{ componentName }} - component as an alternative to this CDK component. +

+ The Angular team has introduced a new low-level component library called Angular Aria. + Consider using the + Angular Aria {{ componentName }} + component as an alternative to this CDK component. +

diff --git a/docs/src/app/shared/doc-viewer/angular-aria-banner/angular-aria-banner.ts b/docs/src/app/shared/doc-viewer/angular-aria-banner/angular-aria-banner.ts index cb4741730a83..4a23a0288986 100644 --- a/docs/src/app/shared/doc-viewer/angular-aria-banner/angular-aria-banner.ts +++ b/docs/src/app/shared/doc-viewer/angular-aria-banner/angular-aria-banner.ts @@ -7,6 +7,7 @@ */ import {Component, Input} from '@angular/core'; +import {MatIcon} from '@angular/material/icon'; /** * Mapping of CDK component names to their Angular Aria documentation URLs. @@ -26,6 +27,7 @@ const ANGULAR_ARIA_LINKS: Record = { selector: 'angular-aria-banner', templateUrl: 'angular-aria-banner.html', styleUrl: 'angular-aria-banner.css', + imports: [MatIcon], }) export class AngularAriaBanner { @Input() componentName: string = ''; diff --git a/docs/src/app/shared/doc-viewer/doc-viewer.ts b/docs/src/app/shared/doc-viewer/doc-viewer.ts index aba8ca165325..2fcc06ce5c29 100644 --- a/docs/src/app/shared/doc-viewer/doc-viewer.ts +++ b/docs/src/app/shared/doc-viewer/doc-viewer.ts @@ -81,6 +81,7 @@ export class DocViewer implements OnDestroy { protected portal: Portal | undefined; readonly name = input(); + readonly packageName = input(); /** The document to display, either as a URL to a markdown file or a component to create. */ @Input() @@ -277,9 +278,13 @@ export class DocViewer implements OnDestroy { */ private _injectAngularAriaBanner() { const componentName = this.name(); - const componentsWithAriaBanner = ['listbox', 'tree', 'accordion', 'menu']; + const packageName = this.packageName(); - if (!componentName || !componentsWithAriaBanner.includes(componentName.toLowerCase())) { + if ( + !componentName || + packageName !== 'cdk' || + !['listbox', 'tree', 'accordion', 'menu'].includes(componentName.toLowerCase()) + ) { return; } @@ -289,12 +294,7 @@ export class DocViewer implements OnDestroy { bannerContainer.setAttribute('componentName', componentName); // Insert the banner at the beginning of the document content - const firstChild = this._elementRef.nativeElement.firstChild; - if (firstChild) { - this._elementRef.nativeElement.insertBefore(bannerContainer, firstChild); - } else { - this._elementRef.nativeElement.appendChild(bannerContainer); - } + this._elementRef.nativeElement.prepend(bannerContainer); // Create and attach the banner component const portalHost = new DomPortalOutlet(bannerContainer, this._appRef, this._injector);