UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

18 lines (17 loc) 898 B
import { type NumberFormatInternalFormatter, type NumberFormatProps } from './NumberFormatBase'; /** * Create a `NumberFormat.*` variant component. * * Each variant imports only the formatter it cares about * (`formatCurrency`, `formatNumber`, …) and passes it here. * * - `ThisVariantProps` narrows the public prop surface of the variant. * - `formatter` is injected as `__format` so `NumberFormatBase` can pick * the minimal formatter and allow tree shaking. * - `forcedProps` lets a variant force props that define it * (e.g. `{ currency: true }` on `NumberFormat.Currency`). */ export declare function withFormatter<ThisVariantProps extends Partial<NumberFormatProps>>(displayName: string, formatter: NumberFormatInternalFormatter, forcedProps?: Partial<NumberFormatProps>): { (props: ThisVariantProps): import("react/jsx-runtime").JSX.Element; displayName: string; };