Relation background

This commit is contained in:
Julie Plantey 2022-08-17 11:49:59 +02:00
parent c096ece4db
commit 24d0f3b9c5
3 changed files with 37 additions and 20 deletions

View File

@ -4,6 +4,7 @@ import { Meta, ArgsTable, Canvas, Story } from '@storybook/addon-docs';
import { BaseLink } from '@strapi/design-system/BaseLink';
import { Badge } from '@strapi/design-system/Badge';
import { Icon } from '@strapi/design-system/Icon';
import { Box } from '@strapi/design-system/Box';
import Cross from '@strapi/icons/Cross';
import { RelationInput } from './RelationInput';
import { relations } from './relationsDataMock';
@ -18,26 +19,33 @@ WIP
<Canvas>
<Story name="base">
<RelationInput label="Relations" labelLoadMore="Load More" name="options" relations={{
data: {
pages: [
{
id: 1,
href: '',
title: 'Relation 1',
isDraft: false
<Box padding={8}>
<RelationInput
label="Relations"
labelLoadMore="Load More"
name="options"
relations={{
data: {
pages: [
{
id: 1,
href: '',
title: 'Relation 1',
isDraft: false,
},
{
id: 2,
href: '',
title: 'Relation 2',
isDraft: false,
},
],
},
{
id: 2,
href: '',
title: 'Relation 2',
isDraft: false
}
],
},
isLoading: false,
isSuccess: true
}} />
isLoading: false,
isSuccess: true,
}}
/>
</Box>
</Story>
</Canvas>

View File

@ -6,7 +6,15 @@ import { Flex } from '@strapi/design-system/Flex';
export const Relation = ({ children, loadMore, search, ...props }) => {
return (
<Stack spacing={3}>
<Stack
spacing={3}
paddingTop={4}
paddingBottom={4}
paddingLeft={6}
paddingRight={6}
hasRadius
background="neutral100"
>
<Flex justifyContent="space-between" alignItems="end">
<Stack width="55%" spacing={1} {...props}>
{search}

View File

@ -25,6 +25,7 @@ export const RelationItem = ({ children, endAction, ...props }) => {
paddingRight={4}
hasRadius
borderSize={1}
background="neutral0"
borderColor="neutral200"
justifyContent="space-between"
as="li"