UNPKG

@buddhacognitivelab/theme-glassmorphic

Version:

Enhanced glassmorphic theme package with dual-mode support, advanced glass effects, interactive UI components, and gesture-based interactions

144 lines (143 loc) 4.24 kB
/** * @fileoverview Gesture-Enhanced Components - Phase 5 * Advanced components with sophisticated touch and drag interactions */ import React from 'react'; import { SwipeDirection, GestureType } from '../utils/interactions'; export type { SwipeDirection, GestureType }; export type DragAxis = 'x' | 'y' | 'both'; export interface GestureComponentProps { /** Enable gesture interactions */ enableGestures?: boolean; /** Enable haptic feedback */ enableHaptics?: boolean; /** Gesture sensitivity */ sensitivity?: 'low' | 'medium' | 'high'; /** Theme mode override */ themeMode?: 'light' | 'dark' | 'system'; /** Glass effect intensity */ glassIntensity?: 'subtle' | 'moderate' | 'intense'; /** Disabled state */ disabled?: boolean; /** Children */ children?: React.ReactNode; /** Custom styles */ style?: React.CSSProperties; /** CSS class name */ className?: string; } export interface SwipeableCardProps extends GestureComponentProps { /** Card content */ content: React.ReactNode; /** Actions for swipe directions */ actions?: { left?: { icon: React.ReactNode; label: string; action: () => void; color?: string; }; right?: { icon: React.ReactNode; label: string; action: () => void; color?: string; }; up?: { icon: React.ReactNode; label: string; action: () => void; color?: string; }; down?: { icon: React.ReactNode; label: string; action: () => void; color?: string; }; }; /** Swipe threshold */ swipeThreshold?: number; /** Auto-dismiss after swipe */ autoDismiss?: boolean; /** Dismiss callback */ onDismiss?: () => void; } export interface DraggablePanelProps extends GestureComponentProps { /** Panel title */ title?: string; /** Panel content */ content: React.ReactNode; /** Drag axis */ dragAxis?: DragAxis; /** Drag constraints */ dragConstraints?: { top?: number; left?: number; right?: number; bottom?: number; }; /** Snap to grid */ snapToGrid?: boolean; /** Grid size */ gridSize?: number; /** Resize handles */ resizable?: boolean; /** Initial position */ initialPosition?: { x: number; y: number; }; /** Position change callback */ onPositionChange?: (position: { x: number; y: number; }) => void; } export interface PinchZoomContainerProps extends GestureComponentProps { /** Minimum zoom level */ minZoom?: number; /** Maximum zoom level */ maxZoom?: number; /** Initial zoom level */ initialZoom?: number; /** Enable pan */ enablePan?: boolean; /** Enable wheel zoom */ enableWheelZoom?: boolean; /** Zoom step */ zoomStep?: number; /** Zoom callback */ onZoomChange?: (zoom: number) => void; } export interface TouchSliderProps extends GestureComponentProps { /** Current value */ value: number; /** Minimum value */ min?: number; /** Maximum value */ max?: number; /** Step size */ step?: number; /** Orientation */ orientation?: 'horizontal' | 'vertical'; /** Show value label */ showValue?: boolean; /** Custom formatter */ formatter?: (value: number) => string; /** Value change callback */ onChange?: (value: number) => void; /** Change complete callback */ onChangeComplete?: (value: number) => void; } export declare const SwipeableCard: React.FC<SwipeableCardProps>; export declare const DraggablePanel: React.FC<DraggablePanelProps>; export declare const PinchZoomContainer: React.FC<PinchZoomContainerProps>; export declare const TouchSlider: React.FC<TouchSliderProps>; export declare const GestureComponents: { SwipeableCard: React.FC<SwipeableCardProps>; DraggablePanel: React.FC<DraggablePanelProps>; PinchZoomContainer: React.FC<PinchZoomContainerProps>; TouchSlider: React.FC<TouchSliderProps>; }; export default GestureComponents;