docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A React component that provides a currency input field accepting formatted monetary values with proper parsing and validation.
Create a currency input component that accepts formatted currency strings and correctly extracts numeric values.
The component should display values in a formatted currency style with dollar signs and thousand separators.
The component should handle various edge cases gracefully.
Create a React component named CurrencyInput that uses the provided numeric input component to implement the currency parsing and formatting functionality.
The component should:
import React from 'react';
interface CurrencyInputProps {
/** Initial value for uncontrolled mode */
defaultValue?: number;
/** Controlled value */
value?: number | null;
/** Callback fired when value changes */
onChange?: (value: number | null) => void;
/** Minimum allowed value */
min?: number;
/** Maximum allowed value */
max?: number;
/** Whether the input is disabled */
disabled?: boolean;
}
/**
* A currency input component that handles formatted monetary values
* with proper parsing and display formatting.
*/
export declare const CurrencyInput: React.FC<CurrencyInputProps>;Provides numeric input functionality with formatting and parsing support.