import { jsx as _jsx } from "react/jsx-runtime";
/**
 * Registry for placeholder input types
 */
class PlaceholderInputTypeRegistry {
    types = new Map();
    /**
     * Register a new placeholder input type
     */
    register(config) {
        this.types.set(config.type.toLowerCase(), config);
    }
    /**
     * Get a registered placeholder input type configuration
     */
    get(type) {
        return this.types.get(type.toLowerCase());
    }
    /**
     * Check if a type is registered
     */
    has(type) {
        return this.types.has(type.toLowerCase());
    }
}
// Create singleton instance
export const placeholderInputTypeRegistry = new PlaceholderInputTypeRegistry();
/**
 * Default text input component for placeholders
 */
const TextInput = ({ placeholder, value, onChange, onKeyDown, inputRef, autoFocus, }) => {
    return (_jsx("input", { ref: inputRef, type: "text", value: value, onChange: (e) => onChange(e.target.value), onKeyDown: onKeyDown, placeholder: placeholder.name, autoFocus: autoFocus, className: "border-feedback-blue placeholder:text-feedback-blue focus:border-feedback-blue focus:ring-feedback-blue/15 inline-block h-6 max-w-[240px] min-w-[64px] rounded-md border bg-white/90 px-2 align-middle text-xs leading-5 transition-colors outline-none focus:bg-white focus:ring-2", style: {
            width: `${Math.max(64, (value?.length || placeholder.name.length) * 7 + 22)}px`,
        } }));
};
// Register default text type
placeholderInputTypeRegistry.register({
    type: "text",
    component: TextInput,
});
// Import and register item selector (dynamic import to avoid circular dependencies)
import("./PlaceholderItemSelector").then((module) => {
    placeholderInputTypeRegistry.register({
        type: "item",
        component: module.PlaceholderItemSelector,
    });
});
//# sourceMappingURL=PlaceholderInputTypes.js.map