UNPKG

@atlaskit/form

Version:

A form allows people to input information.

20 lines (19 loc) • 648 B
import React from 'react'; import { FieldId } from './field-id-context'; import Message from './message'; import messageMotion from './message-motion-capability'; /** * __Helper message__ * * A helper message tells the user what kind of input the field takes. For example, a helper message could be * 'Password should be more than 4 characters' * */ export const HelperMessage = ({ children, testId }) => /*#__PURE__*/React.createElement(FieldId.Consumer, null, fieldId => /*#__PURE__*/React.createElement(Message, { fieldId: fieldId ? `${fieldId}-helper` : undefined, testId: testId }, children)); messageMotion.mark(HelperMessage);