mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 00:03:56 +00:00
[PM-23816] Revert aria disabled buttons (#15656)
* Revert "[CL-295] Use aria-disabled on buttons (#15009)"
This reverts commit 682f1f83d9.
* fix import
* bring back story fixes
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import { HostBinding, Directive, inject, ElementRef, input, booleanAttribute } from "@angular/core";
|
||||
|
||||
import { ariaDisableElement } from "../utils";
|
||||
import { input, HostBinding, Directive } from "@angular/core";
|
||||
|
||||
export type LinkType = "primary" | "secondary" | "contrast" | "light";
|
||||
|
||||
@@ -60,11 +58,6 @@ const commonStyles = [
|
||||
"before:tw-transition",
|
||||
"focus-visible:before:tw-ring-2",
|
||||
"focus-visible:tw-z-10",
|
||||
"aria-disabled:tw-no-underline",
|
||||
"aria-disabled:tw-pointer-events-none",
|
||||
"aria-disabled:!tw-text-secondary-300",
|
||||
"aria-disabled:hover:!tw-text-secondary-300",
|
||||
"aria-disabled:hover:tw-no-underline",
|
||||
];
|
||||
|
||||
@Directive()
|
||||
@@ -95,19 +88,9 @@ export class AnchorLinkDirective extends LinkDirective {
|
||||
selector: "button[bitLink]",
|
||||
})
|
||||
export class ButtonLinkDirective extends LinkDirective {
|
||||
private el = inject(ElementRef<HTMLButtonElement>);
|
||||
|
||||
disabled = input(false, { transform: booleanAttribute });
|
||||
|
||||
@HostBinding("class") get classList() {
|
||||
return ["before:-tw-inset-y-[0.25rem]"]
|
||||
.concat(commonStyles)
|
||||
.concat(linkStyles[this.linkType()] ?? []);
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
ariaDisableElement(this.el.nativeElement, this.disabled);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user