/* Copyright 2026 Marimo. All rights reserved. */ import React from "react"; import { cn } from "@/utils/cn"; import { Input } from "../ui/input"; export interface RegexInputProps { id?: string; value: string; onChange: (next: string) => void; onKeyDown?: (e: React.KeyboardEvent) => void; placeholder?: string; className?: string; autoFocus?: boolean; "aria-label"?: string; } export const RegexInput = React.forwardRef( ( { id, value, onChange, onKeyDown, placeholder = "pattern", className, autoFocus, "aria-label": ariaLabel, }, ref, ) => (
onChange(e.target.value)} onKeyDown={onKeyDown} placeholder={placeholder} autoFocus={autoFocus} aria-label={ariaLabel} rootClassName="flex-1 min-w-0" className="border-0 mb-0 h-full shadow-none! hover:shadow-none! focus-visible:shadow-none! focus-visible:ring-0 focus-visible:border-0 rounded-none bg-transparent" />
), ); RegexInput.displayName = "RegexInput"; const Slash = () => ( / );