UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

42 lines (41 loc) 1.77 kB
import type { ReactNode } from 'react'; import type { DataContextProviderProps as DataContextProps } from '../../DataContext/Provider'; import type { FormStatusProps } from '../../../../components/FormStatus'; import type { ContextProps } from '../../../../shared/Context'; import type { FieldProps, Path } from '../../types'; import type { JsonObject } from '../../utils'; export type FieldProviderProps = FieldProps & { children: ReactNode; /** * Locale to use for all nested Eufemia components */ locale?: DataContextProps<JsonObject>['locale']; /** * Provide your own translations. Use the same format as defined in the translation files */ translations?: DataContextProps<JsonObject>['translations']; /** * Async function to load translations for a given locale. * Called on mount and whenever the locale changes. * The returned translations are merged with any existing translations. */ translationsLoader?: DataContextProps<JsonObject>['translationsLoader']; /** * Message formatter for advanced message formatting (e.g. ICU MessageFormat). * Import and pass `icu` from `@dnb/eufemia/shared` to enable * pluralization, select, and other ICU features in translation strings. */ messageFormatter?: DataContextProps<JsonObject>['messageFormatter']; /** For internal use only */ overwriteProps?: { [key: Path]: FieldProps; }; /** For internal use only */ formElement?: ContextProps['formElement']; /** For internal use only */ FormStatus?: { globalStatus: FormStatusProps; }; }; declare function FieldProviderProvider(props: FieldProviderProps): import("react/jsx-runtime").JSX.Element; export default FieldProviderProvider;