feature to reset value in select field (#6067)
Fixes #6064 https://github.com/twentyhq/twenty/assets/55168611/8c553422-6ad2-4e6b-bd00-962dd81c0a93 --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -16,14 +16,17 @@ const spacing1 = THEME_COMMON.spacing(1);
|
||||
|
||||
const StyledTag = styled.h3<{
|
||||
theme: ThemeType;
|
||||
color: ThemeColor;
|
||||
color: TagColor;
|
||||
weight: TagWeight;
|
||||
variant: TagVariant;
|
||||
preventShrink?: boolean;
|
||||
}>`
|
||||
align-items: center;
|
||||
background: ${({ color, theme }) => theme.tag.background[color]};
|
||||
background: ${({ color, theme }) =>
|
||||
color === 'transparent' ? color : theme.tag.background[color]};
|
||||
border-radius: ${BORDER_COMMON.radius.sm};
|
||||
color: ${({ color, theme }) => theme.tag.text[color]};
|
||||
color: ${({ color, theme }) =>
|
||||
color === 'transparent' ? theme.tag.text['gray'] : theme.tag.text[color]};
|
||||
display: inline-flex;
|
||||
font-size: ${({ theme }) => theme.font.size.md};
|
||||
font-style: normal;
|
||||
@ -35,6 +38,8 @@ const StyledTag = styled.h3<{
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
padding: 0 ${spacing2};
|
||||
border: ${({ variant, theme }) =>
|
||||
variant === 'outline' ? `2px dashed ${theme.tag.background['gray']}` : ''};
|
||||
|
||||
gap: ${spacing1};
|
||||
|
||||
@ -58,14 +63,17 @@ const StyledIconContainer = styled.div`
|
||||
`;
|
||||
|
||||
type TagWeight = 'regular' | 'medium';
|
||||
type TagVariant = 'solid' | 'outline';
|
||||
type TagColor = ThemeColor | 'transparent';
|
||||
|
||||
type TagProps = {
|
||||
className?: string;
|
||||
color: ThemeColor;
|
||||
color: TagColor;
|
||||
text: string;
|
||||
Icon?: IconComponent;
|
||||
onClick?: () => void;
|
||||
weight?: TagWeight;
|
||||
variant?: TagVariant;
|
||||
preventShrink?: boolean;
|
||||
};
|
||||
|
||||
@ -77,6 +85,7 @@ export const Tag = ({
|
||||
Icon,
|
||||
onClick,
|
||||
weight = 'regular',
|
||||
variant = 'solid',
|
||||
preventShrink,
|
||||
}: TagProps) => {
|
||||
const { theme } = useContext(ThemeContext);
|
||||
@ -88,6 +97,7 @@ export const Tag = ({
|
||||
color={color}
|
||||
onClick={onClick}
|
||||
weight={weight}
|
||||
variant={variant}
|
||||
preventShrink={preventShrink}
|
||||
>
|
||||
{!!Icon && (
|
||||
|
||||
Reference in New Issue
Block a user