1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 22:33:35 +00:00

[SM-342] Password Toggle directive (#3850)

This commit is contained in:
Oscar Hinton
2022-11-28 14:04:41 +01:00
committed by GitHub
parent cdd9c16778
commit 20eb585d2b
11 changed files with 301 additions and 31 deletions

View File

@@ -1,5 +1,6 @@
<span class="tw-relative">
<span [ngClass]="{ 'tw-invisible': loading }">
<i class="bwi bwi-lg" [ngClass]="iconClass" aria-hidden="true" *ngIf="icon"></i>
<ng-content></ng-content>
</span>
<span

View File

@@ -76,7 +76,16 @@ export class ButtonComponent implements ButtonLikeAbstraction {
}
@Input() buttonType: ButtonTypes = null;
@Input() block?: boolean;
@Input() loading = false;
@Input() disabled = false;
@Input("bitIconButton") icon: string;
get iconClass() {
return [this.icon, "!tw-m-0"];
}
}

View File

@@ -101,3 +101,17 @@ export const Block = BlockTemplate.bind({});
Block.args = {
block: true,
};
const IconTemplate: Story = (args) => ({
props: args,
template: `
<button bitButton [bitIconButton]="icon" buttonType="primary" class="tw-mr-2"></button>
<button bitButton [bitIconButton]="icon"buttonType="secondary" class="tw-mr-2"></button>
<button bitButton [bitIconButton]="icon" buttonType="danger" class="tw-mr-2"></button>
`,
});
export const Icon = IconTemplate.bind({});
Icon.args = {
icon: "bwi-eye",
};