/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.108.1
 * Released under the MIT license.
 */

import { jsx as _jsx } from "react/jsx-runtime";
import { createContext, useContext } from 'react';
// =============================================================================
// Context
// =============================================================================
const TabsContext = createContext(null);
TabsContext.displayName = 'TabsContext';
export function TabsProvider({ value, children }) {
    return _jsx(TabsContext.Provider, { value: value, children: children });
}
// =============================================================================
// Hook
// =============================================================================
export function useTabsContext() {
    const context = useContext(TabsContext);
    if (!context) {
        throw new Error('useTabsContext must be used within a TabsProvider');
    }
    return context;
}
/**
 * Optional hook to get TabsContext value.
 * Returns null when used outside a TabsProvider (e.g., for TabsAction in standalone usage).
 */
export function useOptionalTabsContext() {
    return useContext(TabsContext);
}

        