import { TooltipProps } from '../Tooltip/Tooltip.types'; import { ValuesOf } from '../utils/typeUtils'; import { COPY_BUTTON_SIZE, SIZE, VARIANT } from './CodeSnippet.constants'; export type CodeSnippetVariant = ValuesOf; export type CodeSnippetSize = ValuesOf; /** Internal: size of the copy icon button inside singleline / multiline blocks. */ export type CopyButtonSize = ValuesOf; export type CodeSnippetProps = { /** Code to render inside the snippet. */ code: string; /** Visual variant of the snippet. * @default 'singleline' */ variant?: CodeSnippetVariant; /** Controls the typography size. Defaults to `'small'` for `singleline` and `multiline`; for `inline`, inherits from the surrounding text when omitted. */ size?: CodeSnippetSize; /** Text written to the clipboard when the copy action is triggered. Defaults to `code`. */ copyText?: string; /** Disables copy functionality across all variants. For `inline` the code renders as static, non-interactive text; for `singleline` / `multiline` the copy button is hidden. * @default false */ disableCopy?: boolean; /** Tooltip label shown while idle (before the user copies). Defaults to `'Copy to clipboard'`. */ copyTooltipText?: string; /** Tooltip label shown right after a successful copy. Auto-reverts to `copyTooltipText` after 3 seconds. Defaults to `'Copied to clipboard'`. */ copiedTooltipText?: string; /** * Accepts props to forward to the `` that wraps the copy trigger, for example `placement` or delays. The snippet sets `content` itself, so use `copyTooltipText` and `copiedTooltipText` to customize the labels. * @linkTypeTo Tooltip * @setTypeName TooltipProps */ tooltipProps?: Omit, 'content'>; /** Fires after a successful clipboard write. Receives the value that was copied. */ onCopy?: (copiedValue: string) => void; /** Adds an `aria-label` to the root element. */ ariaLabel?: string; /** Wraps lines instead of using a horizontal scrollbar. Applicable only to the `multiline` variant. */ wrapText?: boolean; /** Applies a `data-hook` HTML attribute that can be used in tests. */ dataHook?: string; /** Specifies a CSS class name to be appended to the component's root element. * @internal */ className?: string; }; //# sourceMappingURL=CodeSnippet.types.d.ts.map