Skip to content

Commit 33c552f

Browse files
authored
[Lens] Use eui component instead of custom color stops (#85239)
1 parent f3d60c5 commit 33c552f

2 files changed

Lines changed: 14 additions & 15 deletions

File tree

x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@
114114
right: 0;
115115
}
116116

117-
.lnsLayerPanel__paletteColor {
118-
height: $euiSizeXS;
117+
.lnsLayerPanel__palette {
118+
border-radius: 0 0 ($euiBorderRadius - 1px) ($euiBorderRadius - 1px);
119+
120+
&::after {
121+
border: none;
122+
}
119123
}
120124

121125
.lnsLayerPanel__dimensionLink {

x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/palette_indicator.tsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,18 @@
55
*/
66

77
import React from 'react';
8-
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
8+
import { EuiColorPaletteDisplay } from '@elastic/eui';
99
import { AccessorConfig } from '../../../types';
1010

1111
export function PaletteIndicator({ accessorConfig }: { accessorConfig: AccessorConfig }) {
1212
if (accessorConfig.triggerIcon !== 'colorBy' || !accessorConfig.palette) return null;
1313
return (
14-
<EuiFlexGroup className="lnsLayerPanel__paletteContainer" gutterSize="none" alignItems="center">
15-
{accessorConfig.palette.map((color) => (
16-
<EuiFlexItem
17-
key={color}
18-
className="lnsLayerPanel__paletteColor"
19-
grow={true}
20-
style={{
21-
backgroundColor: color,
22-
}}
23-
/>
24-
))}
25-
</EuiFlexGroup>
14+
<div className="lnsLayerPanel__paletteContainer">
15+
<EuiColorPaletteDisplay
16+
className="lnsLayerPanel__palette"
17+
size="xs"
18+
palette={accessorConfig.palette}
19+
/>
20+
</div>
2621
);
2722
}

0 commit comments

Comments
 (0)