/**
* TyCopy Web Component
*
* Read-only field with copy-to-clipboard functionality
* Perfect for API keys, tokens, URLs, code snippets, etc.
*
* Features:
* - Read-only display (not an input)
* - Copy icon on the right
* - Icon animation on copy (copy → check → copy)
* - Same styling as ty-input for consistency
* - Label support
* - Size and flavor variants
*/
import type { Flavor, Size } from '../types/common.js';
import { TyComponent } from '../base/ty-component.js';
import type { PropertyChange } from '../utils/property-manager.js';
/**
* Component internal state
*/
interface CopyState {
value: string;
label: string;
size: Size;
flavor: Flavor;
format: 'text' | 'code';
multiline: boolean;
disabled: boolean;
required: boolean;
}
/**
* TyCopy Element Interface
*/
export interface TyCopyElement extends HTMLElement {
value: string;
label: string;
size: Size;
flavor: Flavor;
format: 'text' | 'code';
disabled: boolean;
required: boolean;
}
/**
* Ty Copy Field Component
*
* @example
* ```html
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* ```
*/
export declare class TyCopy extends TyComponent implements TyCopyElement {
static formAssociated: boolean;
protected static properties: {
value: {
type: "string";
visual: boolean;
formValue: boolean;
default: string;
};
label: {
type: "string";
visual: boolean;
default: string;
};
size: {
type: "string";
visual: boolean;
default: string;
validate: (v: any) => boolean;
coerce: (v: any) => any;
};
flavor: {
type: "string";
visual: boolean;
default: string;
validate: (v: any) => boolean;
coerce: (v: any) => any;
};
format: {
type: "string";
visual: boolean;
default: string;
coerce: (v: any) => "text" | "code";
};
multiline: {
type: "boolean";
visual: boolean;
default: boolean;
};
disabled: {
type: "boolean";
visual: boolean;
default: boolean;
};
required: {
type: "boolean";
visual: boolean;
default: boolean;
};
};
private _copyTimeout;
private _showingSuccess;
constructor();
/**
* Called when component connects to DOM
* TyComponent already handled pre-connection property capture
*/
protected onConnect(): void;
/**
* Called when component disconnects from DOM
*/
protected onDisconnect(): void;
/**
* Handle property changes - called BEFORE render
*/
protected onPropertiesChanged(_changes: PropertyChange[]): void;
/**
* Build CSS class list
*/
private buildClassList;
/**
* Copy value to clipboard
*/
private copyToClipboard;
/**
* Show copy success animation
* Uses state flag so render() can show the correct icon
*/
private showCopySuccess;
/**
* Show copy error animation
* Swaps copy icon → red X icon → copy icon
*/
private showCopyError;
/**
* Setup event listeners
*/
private setupEventListeners;
/**
* Render the component
*/
protected render(): void;
get value(): string;
set value(val: string);
get label(): string;
set label(val: string);
get size(): Size;
set size(value: Size);
get flavor(): Flavor;
set flavor(value: Flavor);
get format(): 'text' | 'code';
set format(value: 'text' | 'code');
get multiline(): boolean;
set multiline(value: boolean);
get disabled(): boolean;
set disabled(value: boolean);
get required(): boolean;
set required(value: boolean);
}
export {};
//# sourceMappingURL=copy.d.ts.map