feat(ui): increase spacing in form builder view mode

This commit is contained in:
psychedelicious
2025-02-28 14:33:38 +10:00
parent 94771ea626
commit ded8a84284
2 changed files with 13 additions and 3 deletions

View File

@@ -50,7 +50,7 @@ const ContainerElement = memo(({ id }: { id: string }) => {
ContainerElement.displayName = 'ContainerElementComponent';
const containerViewModeSx: SystemStyleObject = {
gap: 4,
gap: 2,
'&[data-self-layout="column"]': {
flexDir: 'column',
alignItems: 'stretch',
@@ -197,7 +197,7 @@ const rootViewModeSx: SystemStyleObject = {
borderRadius: 'base',
w: 'full',
h: 'full',
gap: 4,
gap: 2,
display: 'flex',
flex: 1,
maxW: '768px',
@@ -232,6 +232,7 @@ RootContainerElementViewMode.displayName = 'RootContainerElementViewMode';
const rootEditModeSx: SystemStyleObject = {
...rootViewModeSx,
gap: 4,
'&[data-is-dragging-over="true"]': {
opacity: 1,
bg: 'base.850',

View File

@@ -20,6 +20,9 @@ const sx: SystemStyleObject = {
flex: '1 1 0',
minW: 32,
},
'&[data-with-description="false"]': {
pb: 2,
},
};
export const NodeFieldElementViewMode = memo(({ el }: { el: NodeFieldElement }) => {
@@ -35,7 +38,13 @@ export const NodeFieldElementViewMode = memo(({ el }: { el: NodeFieldElement })
);
return (
<Flex id={id} className={NODE_FIELD_CLASS_NAME} sx={sx} data-parent-layout={containerCtx.layout}>
<Flex
id={id}
className={NODE_FIELD_CLASS_NAME}
sx={sx}
data-parent-layout={containerCtx.layout}
data-with-description={showDescription && !!_description}
>
<FormControl flex="1 1 0" orientation="vertical">
<NodeFieldElementLabel el={el} />
<Flex w="full" gap={4}>