import { type ReactNode } from 'react'; import { type TCurrencyCode, type TMoneyValue, type TValue } from '@commercetools-uikit/money-input'; type TCustomEvent = { target: { id?: string; name?: string; value?: string | string[] | null; }; persist?: () => void; }; export type TLocalizedMoneyInputProps = { /** * Used as HTML id property. */ id?: string; /** * The prefix used to create a HTML `name` property for the amount input field (`${name}.amount`). */ name?: string; /** * value of possible currency *
* the input doesn't accept a "currencies" prop, instead all possible * currencies have to exist (with empty or filled strings) on the value: * { EUR: {amount: '12.00', currencyCode: 'EUR'}, USD: {amount: '', currencyCode: 'USD'}} */ value: Record; /** * Called with the event of the input. */ onChange?: (event: TCustomEvent) => void; /** * the currently selected currency */ selectedCurrency: string; /** * Called when input is blurred */ onBlur?: (event: TCustomEvent) => void; /** * Called when input is focused */ onFocus?: (event: TCustomEvent) => void; /** * Will hide the currency expansion controls when set to `true`. All currencies will be shown when set to `true`. */ hideCurrencyExpansionControls?: boolean; /** * Controls whether one or all currencirs are visible by default */ defaultExpandCurrencies?: boolean; /** * Use this property to reduce the paddings of the component for a ui compact variant */ isCondensed?: boolean; /** * Indicates that the input cannot be modified (e.g not authorized, or changes currently saving). */ isDisabled?: boolean; /** * Indicates that the field is displaying read-only content */ isReadOnly?: boolean; /** * Placeholder text for the input */ placeholder?: Record; /** * Horizontal size limit of the input fields. */ horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto'; /** * Indicates that input has errors */ hasError?: boolean; /** * Control to indicate on the input if there are values that are potentially invalid */ hasWarning?: boolean; /** * A map of errors. Error messages for known errors are rendered automatically. *
* Unknown errors will be forwarded to `renderError` */ errors?: Record; /** * A map of warnings. */ warnings?: Record; /** * Shows high precision badge in case current value uses high precision. */ hasHighPrecisionBadge?: boolean; }; export declare const sortCurrencies: (selectedCurrency: string, allCurrencies: string[]) => string[]; declare const LocalizedMoneyInput: { ({ horizontalConstraint, ...props }: TLocalizedMoneyInputProps): import("@emotion/react/jsx-runtime").JSX.Element; displayName: string; getId: (idPrefix?: string, language?: string) => string | undefined; getName: (namePrefix?: string, language?: string) => string | undefined; convertToMoneyValues(values: TValue[], locale: string): Array; parseMoneyValues(moneyValues: TMoneyValue[] | undefined, locale: string): Record; getHighPrecisionCurrencies(values: Record, locale: string): TCurrencyCode[]; getEmptyCurrencies(values: Record): TCurrencyCode[]; }; export default LocalizedMoneyInput;