From 5b7240ed9301f9a677a88bb5a87d18be2b1b2584 Mon Sep 17 00:00:00 2001 From: Gbacc Date: Wed, 29 May 2024 15:02:13 +0200 Subject: [PATCH] fix(TMC-28581): UI Form display fix with hint and required asterisk (#5319) * fix(TMC-28581): UI Form display fix with hint and required asterisk * change required * to css --------- Co-authored-by: Geoffroy Baccarini --- .changeset/weak-boats-destroy.md | 5 +++++ .changeset/wet-sloths-talk.md | 5 +++++ .../src/components/Form/Primitives/Field/Field.tsx | 4 ++-- .../fields/FieldTemplate/FieldTemplate.component.js | 2 +- .../forms/src/UIForm/fields/File/File.component.js | 2 +- .../src/UIForm/fields/Select/Select.component.js | 2 +- .../forms/src/UIForm/fields/Text/Text.component.js | 2 +- .../src/UIForm/fields/TextArea/TextArea.component.js | 2 +- packages/forms/src/UIForm/utils/labels.js | 11 ++++++++--- packages/forms/src/UIForm/utils/labels.module.scss | 4 ++++ packages/forms/stories/json/fields/core-text.json | 9 ++++++--- 11 files changed, 35 insertions(+), 13 deletions(-) create mode 100644 .changeset/weak-boats-destroy.md create mode 100644 .changeset/wet-sloths-talk.md create mode 100644 packages/forms/src/UIForm/utils/labels.module.scss diff --git a/.changeset/weak-boats-destroy.md b/.changeset/weak-boats-destroy.md new file mode 100644 index 0000000000..26e9b4c8bf --- /dev/null +++ b/.changeset/weak-boats-destroy.md @@ -0,0 +1,5 @@ +--- +"@talend/design-system": patch +--- + +Form field label property "required" can now be overriden by passing props diff --git a/.changeset/wet-sloths-talk.md b/.changeset/wet-sloths-talk.md new file mode 100644 index 0000000000..fdaba236cb --- /dev/null +++ b/.changeset/wet-sloths-talk.md @@ -0,0 +1,5 @@ +--- +"@talend/react-forms": patch +--- + +UI Form fields with both hint and required asterisk are now displayed correctly diff --git a/packages/design-system/src/components/Form/Primitives/Field/Field.tsx b/packages/design-system/src/components/Form/Primitives/Field/Field.tsx index 9390862f08..0155e9a6bf 100644 --- a/packages/design-system/src/components/Form/Primitives/Field/Field.tsx +++ b/packages/design-system/src/components/Form/Primitives/Field/Field.tsx @@ -47,10 +47,10 @@ const Field = forwardRef( const LabelComponent = hideLabel ? ( - ) : ( -