The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix styling inconsistency for FormSingleRecordFieldChip placeholder (#12795)
Baptiste Devessierd99bff983e5c
diff --git a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormFieldPlaceholder.tsx b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormFieldPlaceholder.tsxnew file mode 100644index 00000000000..6326198c441--- /dev/null+++ b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormFieldPlaceholder.tsx@@ -0,0 +1,8 @@+import { FORM_FIELD_PLACEHOLDER_STYLES } from '@/object-record/record-field/form-types/constants/FormFieldPlaceholderStyles';+import styled from '@emotion/styled';++const StyledPlaceholder = styled.div`+ ${FORM_FIELD_PLACEHOLDER_STYLES}+`;++export { StyledPlaceholder as FormFieldPlaceholder };diff --git a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormMultiSelectFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormMultiSelectFieldInput.tsxindex 947cb63ff88..e1f5b228376 100644--- a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormMultiSelectFieldInput.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormMultiSelectFieldInput.tsx@@ -3,6 +3,7 @@ import styled from '@emotion/styled';import { FormFieldInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputContainer';import { FormFieldInputInnerContainer } from '@/object-record/record-field/form-types/components/FormFieldInputInnerContainer';import { FormFieldInputRowContainer } from '@/object-record/record-field/form-types/components/FormFieldInputRowContainer';+import { FormFieldPlaceholder } from '@/object-record/record-field/form-types/components/FormFieldPlaceholder';import { VariableChipStandalone } from '@/object-record/record-field/form-types/components/VariableChipStandalone';import { FormMultiSelectFieldInputHotKeyScope } from '@/object-record/record-field/form-types/constants/FormMultiSelectFieldInputHotKeyScope';import { VariablePickerComponent } from '@/object-record/record-field/form-types/types/VariablePickerComponent';@@ -59,9 +60,7 @@ const StyledSelectInputContainer = styled.div`top: ${({ theme }) => theme.spacing(9)};`;-const StyledPlaceholder = styled.div`- color: ${({ theme }) => theme.font.color.light};- font-weight: ${({ theme }) => theme.font.weight.medium};+const StyledPlaceholder = styled(FormFieldPlaceholder)`width: 100%;`;diff --git a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormSingleRecordFieldChip.tsx b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormSingleRecordFieldChip.tsxindex cb763dce81d..b3f84bf4297 100644--- a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormSingleRecordFieldChip.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormSingleRecordFieldChip.tsx@@ -1,4 +1,5 @@import { RecordChip } from '@/object-record/components/RecordChip';+import { FormFieldPlaceholder } from '@/object-record/record-field/form-types/components/FormFieldPlaceholder';import {RecordId,Variable,@@ -12,9 +13,7 @@ const StyledRecordChip = styled(RecordChip)`margin: ${({ theme }) => theme.spacing(2)};`;-const StyledPlaceholder = styled.div`- color: ${({ theme }) => theme.font.color.tertiary};- font-size: ${({ theme }) => theme.font.size.md};+const StyledPlaceholder = styled(FormFieldPlaceholder)`margin: ${({ theme }) => theme.spacing(2)};`;diff --git a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/TextVariableEditor.tsx b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/TextVariableEditor.tsxindex 191650c1085..fa27169503d 100644--- a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/TextVariableEditor.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/TextVariableEditor.tsx@@ -1,3 +1,4 @@+import { FORM_FIELD_PLACEHOLDER_STYLES } from '@/object-record/record-field/form-types/constants/FormFieldPlaceholderStyles';import styled from '@emotion/styled';import { Editor, EditorContent } from '@tiptap/react';@@ -30,9 +31,8 @@ const StyledEditor = styled.div<{white-space: ${({ multiline }) => (multiline ? 'pre' : 'nowrap')};p.is-editor-empty:first-of-type::before {+ ${FORM_FIELD_PLACEHOLDER_STYLES}content: attr(data-placeholder);- color: ${({ theme }) => theme.font.color.light};- font-weight: ${({ theme }) => theme.font.weight.medium};float: left;height: 0;pointer-events: none;diff --git a/packages/twenty-front/src/modules/object-record/record-field/form-types/constants/FormFieldPlaceholderStyles.ts b/packages/twenty-front/src/modules/object-record/record-field/form-types/constants/FormFieldPlaceholderStyles.tsnew file mode 100644index 00000000000..dd48c032194--- /dev/null+++ b/packages/twenty-front/src/modules/object-record/record-field/form-types/constants/FormFieldPlaceholderStyles.ts@@ -0,0 +1,10 @@+import { css } from '@emotion/react';+import { ThemeType } from 'twenty-ui/theme';++export const FORM_FIELD_PLACEHOLDER_STYLES = (props: {+ theme: ThemeType;+}) => css`+ color: ${props.theme.font.color.light};+ font-size: ${props.theme.font.size.md};+ font-weight: ${props.theme.font.weight.medium};+`;diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsxindex a1d4e2d72ea..f43b045688a 100644--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx@@ -1,6 +1,7 @@import { FormFieldInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputContainer';import { FormFieldInputInnerContainer } from '@/object-record/record-field/form-types/components/FormFieldInputInnerContainer';import { FormFieldInputRowContainer } from '@/object-record/record-field/form-types/components/FormFieldInputRowContainer';+import { FormFieldPlaceholder } from '@/object-record/record-field/form-types/components/FormFieldPlaceholder';import { InputLabel } from '@/ui/input/components/InputLabel';import { DraggableItem } from '@/ui/layout/draggable-list/components/DraggableItem';import { DraggableList } from '@/ui/layout/draggable-list/components/DraggableList';@@ -111,9 +112,7 @@ const StyledFieldContainer = styled.div<{`}`;-const StyledPlaceholder = styled.div`- color: ${({ theme }) => theme.font.color.light};- font-weight: ${({ theme }) => theme.font.weight.medium};+const StyledPlaceholder = styled(FormFieldPlaceholder)`width: 100%;`;