Skip to content

Commit a9ea8f3

Browse files
committed
v4.3.15
1 parent 078d5f6 commit a9ea8f3

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@netdata/netdata-ui",
3-
"version": "4.3.14",
3+
"version": "4.3.15",
44
"description": "netdata UI kit",
55
"main": "dist/index.js",
66
"module": "dist/es6/index.js",

src/components/select/index.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React, { useMemo } from "react"
22
import styled from "styled-components"
33
import ReactSelect, { components as defaultComponents } from "react-select"
44
import Creatable from "react-select/creatable"
5+
import { Icon } from "@/components/icon"
6+
import { TextSmall } from "@/components/typography"
57

68
const useDataAttrs = (props, name) => {
79
const { "data-ga": dataGA, "data-testid": dataTestId } = props.selectProps
@@ -38,6 +40,21 @@ const withDOMDataAttrs = (Component, name) => props => {
3840
return <Component {...props} {...dataProps} />
3941
}
4042

43+
const OriginalOption = defaultComponents.Option
44+
45+
const Option = props => {
46+
if (props.data.icon) {
47+
return (
48+
<OriginalOption {...props}>
49+
<Icon name={props.data.icon} color="textLite" margin={[0, 1, 0, 0]} />
50+
<span>{props.data.label}</span>
51+
</OriginalOption>
52+
)
53+
}
54+
55+
return <OriginalOption {...props} />
56+
}
57+
4158
const customComponents = {
4259
...defaultComponents,
4360
ClearIndicator: withDataAttrs(defaultComponents.ClearIndicator, "ClearIndicator"),
@@ -60,7 +77,7 @@ const customComponents = {
6077
MultiValueLabel: withDataAttrs(defaultComponents.MultiValueLabel, "MultiValueLabel"),
6178
MultiValueRemove: withDataAttrs(defaultComponents.MultiValueRemove, "MultiValueRemove"),
6279
NoOptionsMessage: withDataAttrs(defaultComponents.NoOptionsMessage, "NoOptionsMessage"),
63-
Option: withDataAttrs(defaultComponents.Option, "Option"),
80+
Option: withDataAttrs(Option, "Option"),
6481
Placeholder: withDataAttrs(defaultComponents.Placeholder, "Placeholder"),
6582
SelectContainer: withDataAttrs(defaultComponents.SelectContainer, "SelectContainer"),
6683
SingleValue: withDataAttrs(defaultComponents.SingleValue, "SingleValue"),
@@ -92,7 +109,7 @@ const makeCustomTheme = theme => selectTheme => {
92109

93110
const getOptionColor = (theme, state) => {
94111
if (state.isDisabled) return theme.colors.placeholder
95-
if (state.isSelected) return theme.colors.bright
112+
if (state.isSelected) return theme.colors.text
96113
return theme.colors.textDescription
97114
}
98115

@@ -149,10 +166,12 @@ const makeCustomStyles = (theme, { minWidth, size, ...providedStyles } = {}) =>
149166
}),
150167
option: (styles, state) => ({
151168
...styles,
169+
display: "flex",
170+
alignItems: "center",
152171
color: getOptionColor(theme, state),
153172
":hover": {
154-
backgroundColor: theme.colors.dropdown,
155-
color: theme.colors.bright,
173+
backgroundColor: theme.colors.secondaryHighlight,
174+
color: theme.colors.text,
156175
},
157176
...(size === "tiny" ? { fontSize: "12px", minHeight: 28, padding: "4px 8px" } : {}),
158177
}),

src/theme/dark/colors.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ const appColors = {
8989
spaceSelected: rawColors.neutral.grey85,
9090
spaceIdle: rawColors.neutral.grey50,
9191
spaceHovered: rawColors.neutral.grey65,
92-
miniChartsContainer: rawColors.neutral.grey40,
9392

9493
topBarBg: rawColors.neutral.grey35,
9594
elevationLevelOne: rawColors.neutral.grey60,

src/theme/default/colors.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ const appColors = {
9090
spaceIdle: rawColors.neutral.grey195,
9191
spaceHovered: rawColors.neutral.grey180,
9292
menuItem: rawColors.neutral.grey120,
93-
nodesViewMiniCharts: rawColors.neutral.iron,
9493
topBarBg: rawColors.neutral.grey190,
9594
elevationLevelOne: rawColors.neutral.grey185,
9695
//Input colors

0 commit comments

Comments
 (0)