{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"fysk-provider","type":"registry:component","description":"Global provider for Fysk components.","dependencies":["lucide-react","framer-motion"],"registryDependencies":["https://fysk.dev/r/fysk-hooks.json"],"files":[{"path":"fysk/fysk-provider.tsx","type":"registry:component","content":"\"use client\"\r\nimport * as React from \"react\"\r\nimport { Check, AlertCircle, AlertTriangle, Info, ChevronDown, ChevronUp, ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight, MoreHorizontal, Search, Circle, Minus, PanelLeft, X, Loader2 } from \"lucide-react\"\r\nimport { motion, AnimatePresence } from \"framer-motion\"\r\n\r\nexport type FyskIconPosition = \"start\" | \"end\"\r\n\r\nexport interface FyskIcons {\r\n    loading?: React.ReactNode\r\n    success?: React.ReactNode\r\n    error?: React.ReactNode\r\n    warning?: React.ReactNode\r\n    info?: React.ReactNode,\r\n    chevronDown?: React.ReactNode,\r\n    chevronUp?: React.ReactNode,\r\n    chevronLeft?: React.ReactNode,\r\n    chevronRight?: React.ReactNode,\r\n    chevronsLeft?: React.ReactNode,\r\n    chevronsRight?: React.ReactNode,\r\n    moreHorizontal?: React.ReactNode,\r\n    search?: React.ReactNode,\r\n    circle?: React.ReactNode,\r\n    minus?: React.ReactNode,\r\n    panelLeft?: React.ReactNode,\r\n    close?: React.ReactNode,\r\n}\r\n\r\n// --- Animation Configuration ---\r\n\r\n/**\r\n * Easing types based on \"The Easing Blueprint\"\r\n * @see https://animations.dev/learn/animation-theory/the-easing-blueprint\r\n * \r\n * - easeOut: Best for enter animations (responsive feel)\r\n * - easeInOut: Best for layout/morphing (natural acceleration/deceleration)\r\n * - easeIn: Rarely used (feels sluggish)\r\n * - linear: Only for constant animations (marquees, progress)\r\n */\r\nexport type FyskEasing = \"easeOut\" | \"easeInOut\" | \"easeIn\" | \"linear\" | number[]\r\n\r\n/**\r\n * Duration presets in seconds\r\n */\r\nexport interface FyskDurations {\r\n    /** Ultra-fast micro-interactions (50-100ms) */\r\n    instant: number\r\n    /** Quick feedback animations (100-150ms) */\r\n    fast: number\r\n    /** Standard UI transitions (200-250ms) */\r\n    normal: number\r\n    /** Deliberate, noticeable animations (300-400ms) */\r\n    slow: number\r\n    /** Layout/morphing animations (400-500ms) */\r\n    layout: number\r\n}\r\n\r\n/**\r\n * Easing presets for different animation contexts\r\n */\r\nexport interface FyskEasings {\r\n    /** For elements entering the screen (dropdowns, modals, tooltips) */\r\n    enter: FyskEasing\r\n    /** For elements leaving the screen */\r\n    exit: FyskEasing\r\n    /** For elements morphing/changing size while on screen */\r\n    layout: FyskEasing\r\n    /** For hover/focus micro-interactions */\r\n    hover: FyskEasing\r\n    /** For constant animations (spinners, progress) */\r\n    linear: FyskEasing\r\n}\r\n\r\n/**\r\n * Animation effect configurations\r\n */\r\nexport interface FyskEffects {\r\n    /** Enable blur effect on enter/exit transitions */\r\n    blur: boolean\r\n    /** Blur amount in pixels */\r\n    blurAmount: number\r\n    /** Enable scale effect on enter/exit */\r\n    scale: boolean\r\n    /** Scale amount (0.95 = 95%) */\r\n    scaleAmount: number\r\n    /** Enable slide effect */\r\n    slide: boolean\r\n    /** Slide distance in pixels */\r\n    slideDistance: number\r\n}\r\n\r\n/**\r\n * Complete animation configuration\r\n */\r\nexport interface FyskAnimationConfig {\r\n    /** Master switch to enable/disable all animations */\r\n    enabled: boolean\r\n    /** The framer-motion 'motion' object. Type as any to avoid strict peerDependency if not used. */\r\n    motion?: any\r\n    /** The framer-motion 'AnimatePresence' component */\r\n    AnimatePresence?: React.ComponentType<any>\r\n    /** Duration presets (in seconds) */\r\n    durations: FyskDurations\r\n    /** Easing presets */\r\n    easings: FyskEasings\r\n    /** Visual effects */\r\n    effects: FyskEffects\r\n    /** Enable reduced motion for accessibility */\r\n    respectReducedMotion: boolean\r\n}\r\n\r\n/**\r\n * Default animation configuration - professionally tuned values\r\n */\r\nexport const defaultAnimationConfig: FyskAnimationConfig = {\r\n    motion: motion,\r\n    AnimatePresence: AnimatePresence,\r\n    enabled: true,\r\n    durations: {\r\n        instant: 0.1,\r\n        fast: 0.15,\r\n        normal: 0.2,\r\n        slow: 0.3,\r\n        layout: 0.4,\r\n    },\r\n    easings: {\r\n        enter: \"easeOut\",\r\n        exit: \"easeOut\",\r\n        layout: \"easeInOut\",\r\n        hover: \"easeOut\",\r\n        linear: \"linear\",\r\n    },\r\n    effects: {\r\n        blur: true,\r\n        blurAmount: 4,\r\n        scale: true,\r\n        scaleAmount: 0.95,\r\n        slide: true,\r\n        slideDistance: 10,\r\n    },\r\n    respectReducedMotion: true,\r\n}\r\n\r\nexport interface FyskConfig {\r\n    icons?: FyskIcons;\r\n    iconPosition?: FyskIconPosition;\r\n    animations?: Partial<FyskAnimationConfig>;\r\n}\r\n\r\nconst defaultIcons: Required<FyskIcons> = {\r\n    loading: <Loader2 className=\"animate-spin\" />,\r\n    success: <Check />,\r\n    error: <AlertCircle />,\r\n    warning: <AlertTriangle />,\r\n    info: <Info />,\r\n    chevronDown: <ChevronDown className=\"size-4\" />,\r\n    chevronUp: <ChevronUp className=\"size-4\" />,\r\n    chevronLeft: <ChevronLeft className=\"size-4\" />,\r\n    chevronRight: <ChevronRight className=\"size-4\" />,\r\n    chevronsLeft: <ChevronsLeft className=\"size-4\" />,\r\n    chevronsRight: <ChevronsRight className=\"size-4\" />,\r\n    moreHorizontal: <MoreHorizontal className=\"size-4\" />,\r\n    search: <Search className=\"size-4\" />,\r\n    circle: <Circle className=\"size-4\" />,\r\n    minus: <Minus className=\"size-4\" />,\r\n    panelLeft: <PanelLeft className=\"size-4\" />,\r\n    close: <X className=\"size-4\" />\r\n}\r\n\r\nconst FyskContext = React.createContext<FyskConfig>({\r\n    icons: defaultIcons,\r\n    iconPosition: \"start\",\r\n    animations: defaultAnimationConfig\r\n})\r\n\r\nexport function useFyskConfig() {\r\n    return React.useContext(FyskContext)\r\n}\r\n\r\nexport interface FyskProviderProps extends FyskConfig {\r\n    children: React.ReactNode\r\n}\r\n\r\nexport function FyskProvider({\r\n    children,\r\n    icons,\r\n    iconPosition = \"start\",\r\n    animations,\r\n}: FyskProviderProps) {\r\n    const value = React.useMemo(\r\n        () => ({\r\n            icons: { ...defaultIcons, ...icons },\r\n            iconPosition,\r\n            animations,\r\n        }),\r\n        [icons, iconPosition, animations]\r\n    )\r\n\r\n    return <FyskContext.Provider value={value}>{children}</FyskContext.Provider>\r\n}\r\n"}]}