@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
50 lines (49 loc) • 1.91 kB
TypeScript
import React from 'react';
import type { NumberFormatProps } from '../number-format/NumberFormatBase';
import type { TypographySize, TypographyWeight } from '../../elements/typography/Typography';
import type { SpacingProps } from '../../shared/types';
type AmountOwnProps = Omit<NumberFormatProps, 'children' | 'currencyDisplay' | 'currencyPosition' | 'element'> & {
children?: string | number;
element?: keyof React.JSX.IntrinsicElements;
currencyDisplay?: NumberFormatProps['currencyDisplay'];
currencyPosition?: NumberFormatProps['currencyPosition'];
/**
* Typography size fallback.
*
* Is used for both main and auxiliary content unless `mainSize` and/or
* `auxiliarySize` are set.
*/
fontSize?: TypographySize;
/**
* Typography size for the main content. Defaults to `large`.
*/
mainSize?: TypographySize;
/**
* Typography weight for the main content. Defaults to `medium`.
*/
mainWeight?: TypographyWeight;
/**
* Typography size for secondary content like affixes. Defaults to `large`.
*/
auxiliarySize?: TypographySize;
/**
* Typography weight for secondary content like currency sign and affixes.
*
* If not set, and `mainSize` equals `auxiliarySize` while `mainWeight` is not set,
* `medium` is used.
*/
auxiliaryWeight?: TypographyWeight;
/**
* Opt-in sign-based text color (`+` => green, `-` => red).
*/
colorizeBySign?: boolean;
/** Formats the value as a percentage. */
percent?: boolean;
};
export type AmountProps = Omit<React.HTMLProps<HTMLElement>, keyof AmountOwnProps | 'ref'> & AmountOwnProps & SpacingProps;
declare function AmountBase(props: AmountProps): import("react/jsx-runtime").JSX.Element;
declare namespace AmountBase {
var _supportsSpacingProps: boolean;
}
export { AmountBase };
export default AmountBase;