mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 22:33:35 +00:00
[CL-54] Add support for button block without argument + submit button (#3498)
This commit is contained in:
@@ -59,13 +59,12 @@ export class ButtonDirective {
|
||||
"focus-visible:tw-ring-primary-700",
|
||||
"focus-visible:tw-z-10",
|
||||
]
|
||||
.concat(this.block ? ["tw-w-full", "tw-block"] : ["tw-inline-block"])
|
||||
.concat(
|
||||
this.block == null || this.block === false ? ["tw-inline-block"] : ["tw-w-full", "tw-block"]
|
||||
)
|
||||
.concat(buttonStyles[this.buttonType ?? "secondary"]);
|
||||
}
|
||||
|
||||
@Input()
|
||||
buttonType: ButtonTypes = null;
|
||||
|
||||
@Input()
|
||||
block = false;
|
||||
@Input() buttonType: ButtonTypes = null;
|
||||
@Input() block?: boolean;
|
||||
}
|
||||
|
||||
@@ -52,3 +52,21 @@ export const Disabled = DisabledTemplate.bind({});
|
||||
Disabled.args = {
|
||||
size: "small",
|
||||
};
|
||||
|
||||
const BlockTemplate: Story<ButtonDirective> = (args: ButtonDirective) => ({
|
||||
props: args,
|
||||
template: `
|
||||
<span class="tw-flex">
|
||||
<button bitButton [buttonType]="buttonType" [block]="block">[block]="true" Button</button>
|
||||
<a bitButton [buttonType]="buttonType" [block]="block" href="#" class="tw-ml-2">[block]="true" Link</a>
|
||||
|
||||
<button bitButton [buttonType]="buttonType" block class="tw-ml-2">block Button</button>
|
||||
<a bitButton [buttonType]="buttonType" block href="#" class="tw-ml-2">block Link</a>
|
||||
</span>
|
||||
`,
|
||||
});
|
||||
|
||||
export const Block = BlockTemplate.bind({});
|
||||
Block.args = {
|
||||
block: true,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user