Skip to content

Commit 22e5656

Browse files
authored
Changes on colors (#516)
* Add buttonProps to ButtonGroup * Change placeholder colors * Fix select options colors * v4.3.18
1 parent 1e3b51c commit 22e5656

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
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.17",
3+
"version": "4.3.18",
44
"description": "netdata UI kit",
55
"main": "dist/index.js",
66
"module": "dist/es6/index.js",

src/components/button/buttonGroup.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const Content = ({ children }) => {
3030
)
3131
}
3232

33-
const RadioButtons = ({ items, checked, onChange }) => (
33+
const RadioButtons = ({ items, checked, buttonProps = {}, onChange }) => (
3434
<>
3535
{items.map(({ label, value }, index) => {
3636
const buttonGroupProps = getButtonGroupProps(index, items.length)
@@ -41,16 +41,17 @@ const RadioButtons = ({ items, checked, onChange }) => (
4141
onClick={() => onChange(value)}
4242
{...(checked != value ? { flavour: "hollow" } : {})}
4343
{...buttonGroupProps}
44+
{...buttonProps}
4445
/>
4546
)
4647
})}
4748
</>
4849
)
4950

50-
export const ButtonGroup = ({ items, checked, onChange, children, ...props }) => (
51+
export const ButtonGroup = ({ items, checked, onChange, children, buttonProps, ...props }) => (
5152
<Flex alignItems="center" {...props}>
5253
{items?.length ? (
53-
<RadioButtons items={items} checked={checked} onChange={onChange} />
54+
<RadioButtons items={items} checked={checked} onChange={onChange} buttonProps={buttonProps} />
5455
) : (
5556
<Content>{children}</Content>
5657
)}

src/components/select/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import styled from "styled-components"
33
import ReactSelect, { components as defaultComponents } from "react-select"
44
import Creatable from "react-select/creatable"
55
import { Icon } from "@/components/icon"
6-
import { TextSmall } from "@/components/typography"
76

87
const useDataAttrs = (props, name) => {
98
const { "data-ga": dataGA, "data-testid": dataTestId } = props.selectProps
@@ -109,8 +108,12 @@ const makeCustomTheme = theme => selectTheme => {
109108

110109
const getOptionColor = (theme, state) => {
111110
if (state.isDisabled) return theme.colors.placeholder
112-
if (state.isSelected) return theme.colors.text
113-
return theme.colors.textDescription
111+
return theme.colors.text
112+
}
113+
114+
const getOptionBackground = (theme, state) => {
115+
if (state.isSelected) return theme.colors.menuItemSelected
116+
return null
114117
}
115118

116119
const makeCustomStyles = (theme, { minWidth, size, ...providedStyles } = {}) => ({
@@ -169,6 +172,7 @@ const makeCustomStyles = (theme, { minWidth, size, ...providedStyles } = {}) =>
169172
display: "flex",
170173
alignItems: "center",
171174
color: getOptionColor(theme, state),
175+
backgroundColor: getOptionBackground(theme, state),
172176
":hover": {
173177
backgroundColor: theme.colors.secondaryHighlight,
174178
color: theme.colors.text,

src/theme/dark/colors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const appColors = {
1818
modalTabsBackground: rawColors.neutral.grey20,
1919
modalBackground: rawColors.neutral.grey30,
2020
modalInfoBackground: rawColors.neutral.grey50,
21-
menuItemSelected: rawColors.green.green20,
21+
menuItemSelected: rawColors.green.green30,
2222
menuItemHover: rawColors.green.green10,
2323
//links
2424
link: rawColors.green.green110,
@@ -77,7 +77,7 @@ const appColors = {
7777
sectionTitle: rawColors.neutral.grey155,
7878
sectionDescription: rawColors.neutral.grey150,
7979
menuItem: rawColors.neutral.grey140,
80-
placeholder: rawColors.neutral.grey140,
80+
placeholder: rawColors.neutral.grey110,
8181
key: rawColors.neutral.iron,
8282
panel: rawColors.neutral.limedSpruce,
8383
panelBg: rawColors.neutral.grey25,

src/theme/default/colors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const appColors = {
7777
sectionHeaderBackground: rawColors.neutral.limedSpruce,
7878
sectionTitle: rawColors.neutral.grey100,
7979
sectionDescription: rawColors.neutral.grey120,
80-
placeholder: rawColors.neutral.grey120,
80+
placeholder: rawColors.neutral.grey140,
8181
key: rawColors.neutral.regentgrey,
8282
panel: rawColors.neutral.limedSpruce,
8383
panelBg: rawColors.neutral.grey190,

0 commit comments

Comments
 (0)