JSON Visualizer: ensure labels are 24px tall as all other elements (#11535)
## Before  ## After 
This commit is contained in:
committed by
GitHub
parent
162c6bcaa3
commit
897684f995
@ -4,6 +4,7 @@ import { IconComponent } from '@ui/display';
|
|||||||
import { JsonArrow } from '@ui/json-visualizer/components/internal/JsonArrow';
|
import { JsonArrow } from '@ui/json-visualizer/components/internal/JsonArrow';
|
||||||
import { JsonList } from '@ui/json-visualizer/components/internal/JsonList';
|
import { JsonList } from '@ui/json-visualizer/components/internal/JsonList';
|
||||||
import { JsonNodeLabel } from '@ui/json-visualizer/components/internal/JsonNodeLabel';
|
import { JsonNodeLabel } from '@ui/json-visualizer/components/internal/JsonNodeLabel';
|
||||||
|
import { JsonNodeValue } from '@ui/json-visualizer/components/internal/JsonNodeValue';
|
||||||
import { JsonNode } from '@ui/json-visualizer/components/JsonNode';
|
import { JsonNode } from '@ui/json-visualizer/components/JsonNode';
|
||||||
import { useJsonTreeContextOrThrow } from '@ui/json-visualizer/hooks/useJsonTreeContextOrThrow';
|
import { useJsonTreeContextOrThrow } from '@ui/json-visualizer/hooks/useJsonTreeContextOrThrow';
|
||||||
import { JsonNodeHighlighting } from '@ui/json-visualizer/types/JsonNodeHighlighting';
|
import { JsonNodeHighlighting } from '@ui/json-visualizer/types/JsonNodeHighlighting';
|
||||||
@ -82,7 +83,7 @@ export const JsonNestedNode = ({
|
|||||||
depth={depth}
|
depth={depth}
|
||||||
>
|
>
|
||||||
{elements.length === 0 ? (
|
{elements.length === 0 ? (
|
||||||
<StyledEmptyState>{emptyElementsText}</StyledEmptyState>
|
<JsonNodeValue valueAsString={emptyElementsText} />
|
||||||
) : (
|
) : (
|
||||||
elements.map(({ id, label, value }) => {
|
elements.map(({ id, label, value }) => {
|
||||||
const nextKeyPath = isNonEmptyString(keyPath)
|
const nextKeyPath = isNonEmptyString(keyPath)
|
||||||
|
|||||||
@ -5,12 +5,16 @@ import { JsonNodeHighlighting } from '@ui/json-visualizer/types/JsonNodeHighligh
|
|||||||
const StyledText = styled.span<{
|
const StyledText = styled.span<{
|
||||||
highlighting: JsonNodeHighlighting | undefined;
|
highlighting: JsonNodeHighlighting | undefined;
|
||||||
}>`
|
}>`
|
||||||
|
align-items: center;
|
||||||
|
box-sizing: border-box;
|
||||||
color: ${({ theme, highlighting }) =>
|
color: ${({ theme, highlighting }) =>
|
||||||
highlighting === 'blue'
|
highlighting === 'blue'
|
||||||
? theme.adaptiveColors.blue4
|
? theme.adaptiveColors.blue4
|
||||||
: highlighting === 'red'
|
: highlighting === 'red'
|
||||||
? theme.adaptiveColors.red4
|
? theme.adaptiveColors.red4
|
||||||
: theme.font.color.tertiary};
|
: theme.font.color.tertiary};
|
||||||
|
display: inline-flex;
|
||||||
|
height: 24px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const JsonNodeValue = ({
|
export const JsonNodeValue = ({
|
||||||
|
|||||||
Reference in New Issue
Block a user