@codeworker.br/govbr-tw-react
Version:
Biblioteca de componentes React usando Tailwind CSS que implementa o Padrão Digital de Governo.
27 lines (26 loc) • 932 B
TypeScript
import React, { ReactNode } from "react";
type CopyActionStatus = "idle" | "success" | "error";
interface CopyActionRenderProps {
status: CopyActionStatus;
copied: boolean;
copy: () => Promise<void>;
reset: () => void;
error: Error | null;
target: HTMLElement | null;
}
type CopyActionChild = ReactNode | ((props: CopyActionRenderProps) => ReactNode);
export interface CopyActionProps {
targetRef: React.RefObject<HTMLElement | null>;
children: CopyActionChild;
disabled?: boolean;
feedbackDuration?: number;
onCopy?: (value: string) => void;
onError?: (error: Error) => void;
getText?: (target: HTMLElement) => string;
className?: string;
}
declare const CopyAction: {
({ targetRef, children, disabled, feedbackDuration, onCopy, onError, getText, className, }: CopyActionProps): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
export { CopyAction };