Skip to content

Commit 8f43d25

Browse files
committed
A few alignment fixes to match other themes
1 parent c3b5deb commit 8f43d25

File tree

7 files changed

+7527
-5122
lines changed

7 files changed

+7527
-5122
lines changed

packages/mantine/src/templates/ArrayFieldItemTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default function ArrayFieldItemTemplate<
2626
);
2727

2828
return (
29-
<Box key={`array-item-${index}`} className={className || 'array-item'} mb='xs'>
29+
<Box key={`array-item-${index}`} className={className || 'rjsf-array-item'} mb='xs'>
3030
<Flex gap='xs' align='end' justify='center'>
3131
<Box w='100%'>{children}</Box>
3232
{hasToolbar && (

packages/mantine/src/templates/ArrayFieldTemplate.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default function ArrayFieldTemplate<
7878
/>
7979
)}
8080

81-
<Box className='row array-item-list'>
81+
<Box className='row rjsf-array-item-list'>
8282
{items &&
8383
items.map(({ key, ...itemProps }: ArrayFieldItemTemplateType<T, S, F>) => (
8484
<ArrayFieldItemTemplate key={key} {...itemProps} />
@@ -89,7 +89,7 @@ export default function ArrayFieldTemplate<
8989
<Group justify='flex-end'>
9090
<AddButton
9191
id={buttonId<T>(idSchema, 'add')}
92-
className='array-item-add'
92+
className='rjsf-array-item-add'
9393
disabled={disabled || readonly}
9494
onClick={onAddClick}
9595
uiSchema={uiSchema}

packages/mantine/src/templates/FieldTemplate.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export default function FieldTemplate<
5959
{...otherProps}
6060
>
6161
{children}
62-
{displayLabel && rawDescription && description}
6362
{errors}
6463
{help}
6564
</WrapIfAdditionalTemplate>

packages/mantine/src/templates/ObjectFieldTemplate.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1+
import { Box, Container, Group, MantineSpacing, SimpleGrid } from '@mantine/core';
12
import {
23
buttonId,
3-
FormContextType,
4-
ObjectFieldTemplateProps,
5-
ObjectFieldTemplatePropertyType,
6-
RJSFSchema,
7-
StrictRJSFSchema,
84
canExpand,
95
descriptionId,
6+
FormContextType,
107
getTemplate,
118
getUiOptions,
9+
ObjectFieldTemplatePropertyType,
10+
ObjectFieldTemplateProps,
11+
RJSFSchema,
12+
StrictRJSFSchema,
1213
titleId,
1314
} from '@rjsf/utils';
14-
import { Container, Box, SimpleGrid, MantineSpacing } from '@mantine/core';
1515

1616
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
1717
* title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
@@ -54,7 +54,7 @@ export default function ObjectFieldTemplate<
5454
const gridVerticalSpacing = uiOptions?.gridVerticalSpacing;
5555

5656
return (
57-
<Container id={idSchema.$id}>
57+
<Container id={idSchema.$id} p={0}>
5858
{title && (
5959
<TitleFieldTemplate
6060
id={titleId<T>(idSchema)}
@@ -88,7 +88,7 @@ export default function ObjectFieldTemplate<
8888
</SimpleGrid>
8989

9090
{canExpand(schema, uiSchema, formData) && (
91-
<Box mt='xs'>
91+
<Group mt='xs' justify='flex-end'>
9292
<AddButton
9393
id={buttonId<T>(idSchema, 'add')}
9494
disabled={disabled || readonly}
@@ -97,7 +97,7 @@ export default function ObjectFieldTemplate<
9797
uiSchema={uiSchema}
9898
registry={registry}
9999
/>
100-
</Box>
100+
</Group>
101101
)}
102102
</Container>
103103
);

0 commit comments

Comments
 (0)