import { UiNode, UiText } from '@ory/client'; import { JSX } from 'react'; import { IntlShape } from 'react-intl'; import { ButtonProps } from '../../button'; import { ButtonSocialProps } from '../../button-social'; export interface NodeOverrideProps { buttonOverrideProps?: Partial; buttonSocialOverrideProps?: Partial; } export type NodeProps = { node: UiNode; className?: string; } & NodeOverrideProps; export declare const getNodeLabel: (node: UiNode) => UiText | undefined; /** * Converts a UiText to a FormattedMessage. * The UiText contains the id of the message and the context. * The context is used to inject values into the message from Kratos, e.g. a timestamp. * For example a UI Node from Kratos might look like this: * * \{ * "type":"input", * "group":"default", * "attributes": \{ * "name":"traits.email", * "type":"email", * "required":true, * "autocomplete":"email", * "disabled":false, * "node_type":"input" * \}, * "messages":[], * "meta": \{ * "label": \{ * "id":1070002, * "text":"E-Mail", * "type":"info", * "context":\{ * "title":"E-Mail" * \}, * \} * \} * \} * * The context has the key "title" which matches the formatter template name "\{title\}" * An example translation file would look like this: * \{ * "identities.messages.1070002": "\{title\}" * \} * * The formwatter would then take the meta.label.id and look for the translation with the key matching the id. * It would then replace the template "\{title\}" with the value from the context with the key "title". * * @param uiText - The UiText is part of the UiNode object sent by Kratos when performing a flow. */ export declare const uiTextToFormattedMessage: ({ id, context, text }: Omit, intl: IntlShape) => string; export declare const Node: ({ node, className, buttonOverrideProps, buttonSocialOverrideProps, }: NodeProps) => JSX.Element | null; //# sourceMappingURL=node.d.ts.map