import { default as React } from 'react';
import { ColorTab, HandleToolbarAction } from '../types';
/**
 * Encapsulates all state and interaction logic for the text-color popover.
 *
 * Responsibilities:
 *   - Tab switching (foreground / background).
 *   - Preset swatch selection and hex-code input.
 *   - Native color-picker lifecycle tracking (open / close) so the
 *     Radix popover stays open while the OS panel is visible.
 *   - Firing the correct action string back to the parent via `onAction`.
 *
 * @param onAction          - Callback that routes the action string to TipTap.
 * @param selectedTextColor - Currently active foreground color hex.
 * @param selectedBgColor   - Currently active background color hex.
 * @param colorPalette      - Optional custom palette; falls back to the default 8-swatch set.
 */
export default function useHtmlEditorTextColor(onAction: HandleToolbarAction, selectedTextColor: string | undefined, selectedBgColor: string | undefined, colorPalette: string[] | undefined): {
    activeTab: ColorTab;
    palette: string[];
    activeColor: string | undefined;
    previewHex: string;
    hexInput: string;
    colorInputRef: React.RefObject<HTMLInputElement | null>;
    handleTabChange: (tab: string) => void;
    handleSwatchClick: (color: string) => void;
    handleHexApply: () => void;
    handleReset: () => void;
    handleHexChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
    handleColorPickerInput: (e: React.ChangeEvent<HTMLInputElement>) => void;
};
