import { Button } from "./button.js"; import { CopyToClipboardIcon } from "../icons.js"; import { ComponentProps } from "react"; //#region src/components/copy-button.d.ts export declare const COPIED_RESET_MS = 1500; type CopyButtonProps = Omit, "children" | "onClick"> & { /** Copies and reports whether it worked; failures stay with the caller. */ onCopy: () => Promise; label: string; copiedLabel: string; /** Renders the glyph alone, with the labels as its accessible name. */ iconOnly?: boolean; iconClassName?: string; /** Classes for the visible label, e.g. to hide it on narrow screens. */ labelClassName?: string; }; /** * The in-place confirmation behind `CopyButton`, for a copy control whose * own content is the thing copied (a reference chip, a permalink mark) and * so cannot be a glyph button: `copied` is true for a moment after `copy` * succeeds, and the control shows it where the user clicked. No toast. */ export declare const useCopyConfirmation: (onCopy: () => Promise) => { copied: boolean; copy: () => Promise; }; /** * A copy action that confirms in place: the glyph turns into a check and the * label into `copiedLabel`, then both return. The confirmation lands where * the user is looking, so callers raise no success toast. */ export declare const CopyButton: ({ onCopy, label, copiedLabel, iconOnly, iconClassName, labelClassName, className, ...buttonProps }: CopyButtonProps) => import("react").JSX.Element; /** Shared transient state for copy controls that can succeed outside a click. */ export declare const useCopiedFeedback: () => { copied: boolean; confirm: () => void; reset: () => void; }; type CopyFeedbackProps = { icon?: typeof CopyToClipboardIcon | undefined; labelClassName?: string | undefined; copied: boolean; copiedLabel: string; iconOnly?: boolean | undefined; iconClassName?: string | undefined; label: string; }; /** The standard copy-to-check glyph and label swap, for compound controls. */ export declare const CopyFeedback: ({ icon: Icon, labelClassName, copied, copiedLabel, iconOnly, iconClassName, label }: CopyFeedbackProps) => import("react").JSX.Element; //#endregion