refactor: inline Copy component (#1175)

This commit is contained in:
metonym 2022-03-14 08:17:20 -07:00 committed by GitHub
commit f8aecdbef1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 125 additions and 29 deletions

View file

@ -1,8 +1,20 @@
/// <reference types="svelte" />
import { SvelteComponentTyped } from "svelte";
import { CopyProps } from "../Copy/Copy.svelte";
export interface CopyButtonProps extends CopyProps {
export interface CopyButtonProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> {
/**
* Set the feedback text shown after clicking the button
* @default "Copied!"
*/
feedback?: string;
/**
* Set the timeout duration (ms) to display feedback text
* @default 2000
*/
feedbackTimeout?: number;
/**
* Set the title and ARIA label for the copy button
* @default "Copy to clipboard"