From c825a481c5b6dc6849a9271811746211d548788a Mon Sep 17 00:00:00 2001 From: George Marshall Date: Wed, 7 Sep 2022 09:21:14 -0700 Subject: [PATCH] Adding custom component props to FormField component (#15679) * adding custom component props to form-field component * replacing ternary operater with binary logical OR * Removing label from wrapping all form-field elements * Adding wrapping label back but providing overriding props as well as updating default props --- ui/components/ui/form-field/README.mdx | 10 ++ ui/components/ui/form-field/form-field.js | 149 +++++++++++------- .../ui/form-field/form-field.stories.js | 31 ++++ .../numeric-input/numeric-input.component.js | 12 ++ ui/components/ui/typography/typography.js | 1 + .../ui/typography/typography.test.js | 3 + 6 files changed, 152 insertions(+), 54 deletions(-) diff --git a/ui/components/ui/form-field/README.mdx b/ui/components/ui/form-field/README.mdx index 5881cef40b30..41511a33edf0 100644 --- a/ui/components/ui/form-field/README.mdx +++ b/ui/components/ui/form-field/README.mdx @@ -29,3 +29,13 @@ Show form fields with error state + +### Custom Components + +Use the custom component props `TitleTextCustomComponent`, `TitleUnitCustomComponent` and `TooltipCustomComponent` to replace the default components. +If these props exists they will replace their respective text props. The FormField is wrapped in a Box component that renders as a `