@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
58 lines (57 loc) • 2.15 kB
TypeScript
import React from 'react';
import { NumberFormatProps } from '../number-format/NumberFormat';
import type { TypographySize, TypographyWeight } from '../../elements/typography/Typography';
import type { SpacingProps } from '../../shared/types';
/**
* @deprecated Use `NumberProps` from `Stat.Number` instead.
*/
type AmountOwnProps = Omit<NumberFormatProps, 'children' | 'currency_display' | 'currency_position' | 'element'> & {
children?: string | number;
element?: keyof JSX.IntrinsicElements;
currencyDisplay?: NumberFormatProps['currency_display'];
currencyPosition?: NumberFormatProps['currency_position'];
/**
* 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;
};
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 };
/**
* @deprecated Use `Stat.Number` instead. `Stat.Currency` and `Stat.Percent` are not affected.
*/
declare function Amount(props: AmountProps): import("react/jsx-runtime").JSX.Element;
declare namespace Amount {
var _supportsSpacingProps: boolean;
}
export default Amount;