import { type ComponentPropsWithRef, type ReactNode } from 'react'; import { type ButtonSize, type ButtonVariant } from './buttonClasses.js'; export interface CopyButtonProps extends Omit, 'onClick' | 'children' | 'type'> { variant?: ButtonVariant | undefined; size?: ButtonSize | undefined; /** What it copies, or a function that reads it when pressed, such as from the page. */ text: string | (() => string); /** Names what it copies, such as "email address": the button reads "Copy email * address" and the toast "Copied email address". Without it, both say only "Copy". */ label?: string | undefined; /** No toast, for a copy the reader can see succeed some other way. The button's * check shows either way, and a failure still says so. */ quiet?: boolean | undefined; /** Shows "Copy" (then "Copied") beside the icon, for a copy that is a toolbar's * command rather than a detail beside a value. */ showLabel?: boolean | undefined; /** A glyph in place of the copy icon, such as a branch for a branch name; the check * still shows once it has copied. */ icon?: ReactNode | undefined; /** The whole success toast, in place of "Copied …", as `useCopy` takes it. */ success?: string | undefined; /** The whole failure toast, such as one that says where else to copy it from. */ failure?: string | undefined; } /** The one copy control: a button that copies its text, turns into a check for a * moment, and says so in a toast, which screen readers announce. */ export declare function CopyButton({ text, label, quiet, showLabel, variant, size, icon: glyph, success, failure, ...props }: CopyButtonProps): import("react").JSX.Element; export interface CopyCodeBlockProps { /** What the button copies: the code as the reader would type it. */ text: string; /** Names what it copies, as CopyButton's `label` does, such as "install command". */ label?: string | undefined; /** The code as shown, such as highlighted; `text` by default. A secret's own children * must mask it while it is hidden. */ children?: ReactNode; /** Adds an eye button that shows or hides the value. Without `children` the block masks * the value itself, with dots that don't give away its length. */ secret?: boolean | undefined; /** Whether a secret shows. Leave it out for the block to keep its own state, hidden first. */ revealed?: boolean | undefined; defaultRevealed?: boolean | undefined; onRevealedChange?: ((revealed: boolean) => void) | undefined; /** Breaks a long value across lines instead of scrolling it, such as a token in a block. * Default false: an inline token, key or ID stays on one line and scrolls inside. */ wrap?: boolean | undefined; /** A compact value in the line, such as a token shown once in a Callout: as wide as the * value, up to its container, where a longer one scrolls sideways on its one line. A quiet * surface reads on a panel and a tinted callout alike, and the buttons stay right after the * value, always shown. The copy confirms with its check alone, as the change shows there. */ inline?: boolean | undefined; /** False also says "Copied" in a toast. By default the copy confirms with the button's * check alone, which stays in view until it turns back, as the button is where the reader * pressed; a failure toasts either way. */ quiet?: boolean | undefined; className?: string | undefined; } /** A block of code, such as a command to run, with a button that copies it. The * buttons show while the pointer is over the block or focus is in it, and always * where there is no hover to reveal them. A copy confirms with the button's check, * not a toast; a failure still toasts. With `inline` it is a compact value in the line * instead, such as a token shown once, its buttons always beside it. With `secret` it * masks the value until the eye shows it, and copies it either way. */ export declare function CopyCodeBlock({ text, label, children, secret, revealed: revealedProp, defaultRevealed, onRevealedChange, inline, wrap, quiet, className, }: CopyCodeBlockProps): import("react").JSX.Element;