goobs-frontend
Version:
A comprehensive React-based libary for building modern web applications
32 lines • 1.24 kB
TypeScript
import { default as React } from 'react';
export type MoneyTextTone = 'total' | 'due';
export interface MoneyTextProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
/** The amount to render. Accepts a number or a numeric string. */
value: number | string;
/** ISO 4217 currency code. Default `'USD'`. */
currency?: string;
/**
* Render in a tabular-monospace face so columns of figures align on the
* decimal point. Emitted as `data-money-mono`.
*/
mono?: boolean;
/**
* Semantic tint. `'total'` reads bolder (the summed line), `'due'` reads in
* the warning palette (an outstanding balance). Emitted as
* `data-money-tone`. Omit for the neutral default.
*/
tone?: MoneyTextTone;
/**
* Text shown when `value` can't be parsed into a number (empty string, null-
* ish, garbage). Default `'—'`.
*/
emptyText?: string;
}
/**
* Read-only formatter. Reuses `formatMoney` from the shared currency util so
* the display string and the editable `<USDField>` agree on parsing. Negatives
* render as `-$X.XX`.
*/
declare const MoneyText: React.FC<MoneyTextProps>;
export default MoneyText;
//# sourceMappingURL=MoneyText.d.ts.map