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:
@@ -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
|
||||
|
||||
@@ -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"];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user