feat: add EnumFieldDisplay and Enum field preview (#2487)

Closes #2428

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Thaïs
2023-11-17 23:15:35 +01:00
committed by GitHub
parent e72917c69c
commit fea0bbeb2a
15 changed files with 200 additions and 18 deletions

View File

@ -35,10 +35,17 @@ const StyledTag = styled.h3<{
gap: ${({ theme }) => theme.spacing(2)};
height: ${({ theme }) => theme.spacing(5)};
margin: 0;
overflow: hidden;
padding-left: ${({ theme }) => theme.spacing(2)};
padding-right: ${({ theme }) => theme.spacing(2)};
`;
const StyledContent = styled.span`
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`;
export type TagProps = {
className?: string;
color: ThemeColor;
@ -52,6 +59,6 @@ export const Tag = ({ className, color, text, onClick }: TagProps) => (
color={castToTagColor(color)}
onClick={onClick}
>
{text}
<StyledContent>{text}</StyledContent>
</StyledTag>
);

View File

@ -34,6 +34,17 @@ export const Default: Story = {
},
};
export const WithLongText: Story = {
decorators: [ComponentDecorator],
args: {
color: 'green',
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
},
parameters: {
container: { width: 100 },
},
};
export const Catalog: CatalogStory<Story, typeof Tag> = {
args: { text: 'Urgent' },
argTypes: {