1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-28 10:33:31 +00:00

resolve merge conflicts from cherry-pick

This commit is contained in:
Bryan Cunningham
2025-12-02 16:15:43 -05:00
parent d1973007a9
commit a38437d719
3 changed files with 20 additions and 17 deletions

View File

@@ -2,7 +2,7 @@
*ngIf="state === SetupExtensionState.Loading"
class="bwi bwi-spinner bwi-spin bwi-3x tw-text-muted"
aria-hidden="true"
[title]="'loading' | i18n"
[appA11yTitle]="'loading' | i18n"
></i>
<section *ngIf="state === SetupExtensionState.NeedsExtension" class="tw-text-center tw-mt-4">

View File

@@ -1,21 +1,23 @@
import { Directive } from "@angular/core";
import { Directive, effect, ElementRef, input } from "@angular/core";
import { TooltipDirective } from "../tooltip/tooltip.directive";
import { setA11yTitleAndAriaLabel } from "./set-a11y-title-and-aria-label";
/**
* @deprecated This function is deprecated in favor of `bitTooltip`.
* Please use `bitTooltip` instead.
*
* Directive that provides accessible tooltips by internally using TooltipDirective.
* This maintains the appA11yTitle API while leveraging the enhanced tooltip functionality.
*/
@Directive({
selector: "[appA11yTitle]",
hostDirectives: [
{
directive: TooltipDirective,
inputs: ["bitTooltip: appA11yTitle", "tooltipPosition"],
},
],
})
export class A11yTitleDirective {}
export class A11yTitleDirective {
readonly title = input.required<string>({ alias: "appA11yTitle" });
constructor(private el: ElementRef) {
const originalTitle = this.el.nativeElement.getAttribute("title");
const originalAriaLabel = this.el.nativeElement.getAttribute("aria-label");
effect(() => {
setA11yTitleAndAriaLabel({
element: this.el.nativeElement,
title: originalTitle ?? this.title(),
label: originalAriaLabel ?? this.title(),
});
});
}
}

View File

@@ -17,6 +17,7 @@ import { TooltipPositionIdentifier, tooltipPositions } from "./tooltip-positions
import { TooltipComponent, TOOLTIP_DATA } from "./tooltip.component";
export const TOOLTIP_DELAY_MS = 800;
/**
* Directive to add a tooltip to any element. The tooltip content is provided via the `bitTooltip` input.
* The position of the tooltip can be set via the `tooltipPosition` input. Default position is "above-center".