Add suggested values for variable dropdown (#9437)
<img width="378" alt="Capture d’écran 2025-01-07 à 15 37 20" src="https://github.com/user-attachments/assets/c15abcac-684a-4c3b-ad12-62cf91afe927" /> Here is a first version: - simple fields have a suggested value - composite do not, but sub values of composite do - json, arrays or complex values do not
This commit is contained in:
@ -14,6 +14,10 @@ import {
|
||||
StyledMenuItemLeftContent,
|
||||
} from './StyledMenuItemBase';
|
||||
|
||||
const StyledMainText = styled.div`
|
||||
flex-shrink: 0;
|
||||
`;
|
||||
|
||||
const StyledContextualText = styled.div`
|
||||
color: ${({ theme }) => theme.color.gray35};
|
||||
font-family: inherit;
|
||||
@ -29,6 +33,7 @@ const StyledContextualText = styled.div`
|
||||
white-space: nowrap;
|
||||
|
||||
padding-left: ${({ theme }) => theme.spacing(1)};
|
||||
flex-shrink: 1;
|
||||
`;
|
||||
|
||||
type MenuItemLeftContentProps = {
|
||||
@ -67,7 +72,13 @@ export const MenuItemLeftContent = ({
|
||||
<LeftIcon size={theme.icon.size.md} stroke={theme.icon.stroke.sm} />
|
||||
)}
|
||||
<StyledMenuItemLabel hasLeftIcon={!!LeftIcon}>
|
||||
{isString(text) ? <OverflowingTextWithTooltip text={text} /> : text}
|
||||
{isString(text) ? (
|
||||
<StyledMainText>
|
||||
<OverflowingTextWithTooltip text={text} />
|
||||
</StyledMainText>
|
||||
) : (
|
||||
text
|
||||
)}
|
||||
{isString(contextualText) ? (
|
||||
<StyledContextualText>{`· ${contextualText}`}</StyledContextualText>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user