export interface ContactUser { id?: string email?: string name?: string } export interface ContactMetadata { // Page context url: string timestamp: string viewport: { width: number; height: number } userAgent: string // Navigation context referrer?: string pageTitle?: string timeOnPage?: number // milliseconds since page load // Device details locale?: string timezone?: string screenResolution?: { width: number; height: number } // Session tracking (when provided via props) sessionId?: string correlationId?: string // App context (when provided via props) appVersion?: string environment?: string } export interface ContactData { name?: string email?: string companyName?: string companySize?: string topic?: string message: string additionalInfo?: string user?: ContactUser context?: Record metadata?: ContactMetadata } export interface ContactProps { /** Display variant */ variant?: 'popover' | 'modal' /** Popover position relative to trigger */ side?: 'top' | 'bottom' | 'left' | 'right' /** Trigger button label */ triggerLabel?: string /** Dialog/popover title */ title?: string /** Show name field */ showName?: boolean /** Show email field */ showEmail?: boolean /** Show company name field */ showCompanyName?: boolean /** Show company size field */ showCompanySize?: boolean /** Show topic dropdown */ showTopic?: boolean /** Show message field */ showMessage?: boolean /** Show additional info field */ showAdditionalInfo?: boolean /** Require name field */ requireName?: boolean /** Require email field */ requireEmail?: boolean /** Require company name field */ requireCompanyName?: boolean /** Require company size field */ requireCompanySize?: boolean /** Require topic selection */ requireTopic?: boolean /** Require message field */ requireMessage?: boolean /** Require additional info field */ requireAdditionalInfo?: boolean /** Topic options for dropdown */ topics?: string[] /** Company size options for dropdown */ companySizeOptions?: string[] /** Field layout rows - array of arrays defining field groupings */ rows?: string[][] /** User information for pre-fill and attribution */ user?: ContactUser /** App-specific context */ context?: Record /** Auto-capture URL, timestamp, viewport, userAgent */ captureMetadata?: boolean /** Session ID for correlation across support submissions */ sessionId?: string /** Correlation ID for linking to specific flows/conversations */ correlationId?: string /** App version for debugging */ appVersion?: string /** Environment (production, staging, development) */ environment?: string /** Callback when form submitted (takes precedence over apiEndpoint) */ onSubmit?: (data: ContactData) => Promise | void /** API endpoint to POST form data to */ apiEndpoint?: string /** Submit button label */ submitLabel?: string /** Additional class for trigger button */ className?: string }