Copy button text → icon

- Converts to icon button
- Adds accessibility label field
This commit is contained in:
Henry Wilkinson 2023-04-28 14:53:11 -04:00
parent 1a63c31b71
commit 228e2187e3

View File

@ -40,12 +40,15 @@ export class CopyButton extends LitElement {
render() {
return html`
<sl-button
size="small"
@click=${this.onClick}
?disabled=${!this.value && !this.getValue}
>${this.isCopied ? msg("Copied") : msg("Copy")}</sl-button
>
<sl-tooltip content=${this.isCopied ? msg("Copied to clipboard!") : msg("Copy")}>
<sl-icon-button
size="small"
name=${this.isCopied ? "check-lg" : "files"}
label=${msg("Copy to clipboard")}
@click=${this.onClick}
?disabled=${!this.value && !this.getValue}
></sl-icon-button>
</sl-tooltip>
`;
}