/** * ZUI Button Component * Interactive button with multiple variants */ import { Component } from '../../core/Component'; import type { BaseProps, Rect, EventCallback } from '../../core/types'; export type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'ghost'; export type ButtonSize = 'small' | 'medium' | 'large' | 'capsule' | 'floating'; export interface ButtonProps extends BaseProps { /** Button label text */ label?: string; /** Icon name or path */ icon?: string; /** Button variant */ variant?: ButtonVariant; /** Button size */ size?: ButtonSize; /** Disabled state */ disabled?: boolean; /** Press event handler */ onPress?: EventCallback; /** Long press event handler (1 second) */ onLongPress?: EventCallback; /** Position X */ x?: number; /** Position Y */ y?: number; /** Custom width */ width?: number; /** Custom height */ height?: number; } /** * Button component with multiple variants and states * * @example * ```ts * // Primary button * const primaryBtn = new Button({ * label: 'Submit', * variant: 'primary', * onPress: () => console.log('Pressed!'), * }); * * // Icon button * const iconBtn = new Button({ * icon: 'ic_add', * variant: 'primary', * size: 'floating', * onPress: () => console.log('Add!'), * }); * * // Destructive button * const deleteBtn = new Button({ * label: 'Delete', * icon: 'ic_delete', * variant: 'destructive', * onPress: () => console.log('Delete!'), * }); * ``` */ export declare class Button extends Component { readonly type = "Button"; private backgroundWidget; private textWidget; private iconWidget; private isPressed; private longPressTimer; protected getDefaultProps(): Partial; protected calculateLayout(parentRect?: Rect): void; protected createWidgets(): void; private getContentWidth; protected updateWidgets(): void; protected destroyWidgets(): void; private handleTouchDown; private handleTouchUp; private clearLongPressTimer; /** * Programmatically trigger button press */ press(): void; /** * Set disabled state */ setDisabled(disabled: boolean): void; /** * Set button label */ setLabel(label: string): void; } /** * Create a Button component */ export declare function createButton(props: ButtonProps): Button; /** * Create a primary button */ export declare function PrimaryButton(label: string, onPress: EventCallback, props?: Partial): Button; /** * Create a secondary button */ export declare function SecondaryButton(label: string, onPress: EventCallback, props?: Partial): Button; /** * Create a destructive button */ export declare function DestructiveButton(label: string, onPress: EventCallback, props?: Partial): Button; /** * Create a floating action button */ export declare function FloatingButton(icon: string, onPress: EventCallback, props?: Partial): Button; //# sourceMappingURL=Button.d.ts.map