diff --git a/e2e/__tests__/__image_snapshots__/input-test-js-components-input-field-common-1-snap.png b/e2e/__tests__/__image_snapshots__/input-test-js-components-input-field-common-1-snap.png index e85d9684..944ebac0 100644 Binary files a/e2e/__tests__/__image_snapshots__/input-test-js-components-input-field-common-1-snap.png and b/e2e/__tests__/__image_snapshots__/input-test-js-components-input-field-common-1-snap.png differ diff --git a/src/components/Form/FormField.js b/src/components/Form/FormField.js index f07d5f77..cf4eefe2 100644 --- a/src/components/Form/FormField.js +++ b/src/components/Form/FormField.js @@ -10,6 +10,7 @@ import type { MetaType } from '../../types'; type FormFieldProps = { children?: React$Node, label?: string, + note?: string, stretch?: boolean, hideErrorLabel?: boolean, direction?: 'row' | 'column', @@ -52,6 +53,21 @@ const [ControlErrorTag, themeError] = createThemeTag(`${name}Error`, ({ COLORS, }, })); +const [FormFieldNoteTag, themeNote] = createThemeTag(`${name}Note`, ({ COLORS, SIZES }: *) => ({ + root: { + position: 'relative', + + fontSize: SIZES.OVERLINE_2, + lineHeight: SIZES.OVERLINE_2_LH, + color: COLORS.GRAY5, + overflow: 'hidden', + textOverflow: 'ellipsis', + whiteSpace: 'nowrap', + display: 'block', + maxWidth: '100%', + marginTop: 4, + }, +})); const [FormFieldDirectionTag, themeDirection] = createThemeTag(`${name}Direction`, { root: props => ({ @@ -80,12 +96,14 @@ const theme = { ...themeLabel, ...themeError, ...themeField, + ...themeNote, }; const FormField = ({ meta = {}, label, + note, children, hideErrorLabel, ...rest @@ -108,6 +126,11 @@ const FormField = ({ { children } + + + { note } + + diff --git a/src/components/InputField/InputField.stories.js b/src/components/InputField/InputField.stories.js index 60a8830f..957f2072 100644 --- a/src/components/InputField/InputField.stories.js +++ b/src/components/InputField/InputField.stories.js @@ -21,9 +21,11 @@ export default (asStory) => { + +