Skip to content

Commit 7c66c2d

Browse files
authored
Merge branch 'master' into master
2 parents ea0bac6 + e7dc0fe commit 7c66c2d

8 files changed

Lines changed: 40 additions & 4 deletions

File tree

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

src/components/button/__snapshots__/button.test.js.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ exports[`Button states renders only icon 1`] = `
291291
width: 16px;
292292
opacity: 1;
293293
pointer-events: unset;
294+
transform: rotate(0deg);
294295
}
295296
296297
.c1 {
@@ -320,6 +321,7 @@ exports[`Button states renders only icon 1`] = `
320321
>
321322
<svg
322323
class="c2 button-icon"
324+
rotate="0"
323325
title="plus"
324326
>
325327
<use
@@ -410,6 +412,7 @@ exports[`Button states renders smaller only icon 1`] = `
410412
width: 16px;
411413
opacity: 1;
412414
pointer-events: unset;
415+
transform: rotate(0deg);
413416
}
414417
415418
.c1 {
@@ -439,6 +442,7 @@ exports[`Button states renders smaller only icon 1`] = `
439442
>
440443
<svg
441444
class="c2 button-icon"
445+
rotate="0"
442446
title="plus"
443447
>
444448
<use

src/components/button/styled.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ const getAccentColor = props => {
6767

6868
const getTransparent = getColor(["transparent", "full"])
6969

70-
const colorsByFlavour = ({ flavour = DEFAULT, danger, warning, iconColor }) => {
70+
const colorsByFlavour = ({ flavour = DEFAULT, danger, warning, iconColor, color }) => {
7171
const getErrorColor = danger ? getColor("error") : undefined
7272
const getWarningColor = warning ? getColor("warning") : undefined
73-
const getSpecialColor = getErrorColor || getWarningColor
73+
const getSpecialColor = getErrorColor || getWarningColor || (color ? getColor(color) : undefined)
7474
const getSpecialColorHover = getSpecialColor
7575
? props => lighten(0.2, getSpecialColor(props))
7676
: undefined

src/components/drops/menu/dropdown.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useMemo, useState, useRef } from "react"
22
import styled from "styled-components"
33
import { useVirtualizer } from "@tanstack/react-virtual"
44
import Flex from "@/components/templates/flex"
5+
import { Text } from "@/components/typography"
56
import Search from "@/components/search"
67
import Box from "@/components/templates/box"
78
import { mergeRefs } from "@/utils"
@@ -15,6 +16,14 @@ const Container = styled(Flex)`
1516

1617
const defaultEstimateSize = () => 28
1718

19+
const DefaultNoSearchResultsComponent = () => {
20+
return (
21+
<Flex padding={[2, 0]} justifyContent="center">
22+
<Text>No results were found</Text>
23+
</Flex>
24+
)
25+
}
26+
1827
const Dropdown = ({
1928
hideShadow,
2029
itemProps,
@@ -26,12 +35,15 @@ const Dropdown = ({
2635
Footer,
2736
value,
2837
hasSearch,
38+
renderComponent,
2939
searchMargin = [4],
3040
gap = 0,
3141
estimateSize = defaultEstimateSize,
3242
close,
3343
containerRef,
3444
ref: forwardedRef,
45+
showNoSearchResults = true,
46+
NoSearchResultsComponent = DefaultNoSearchResultsComponent,
3547
...rest
3648
}) => {
3749
const [searchValue, setSearchValue] = useState("")
@@ -41,7 +53,9 @@ const Dropdown = ({
4153

4254
const searchLowerCase = searchValue.toLowerCase()
4355

44-
return items.filter(({ label, value: val }) => {
56+
return items.filter(({ label, value: val, customFiltering }) => {
57+
if (typeof customFiltering === "function")
58+
return customFiltering({ searchValue, label, value: val })
4559
if (typeof label === "string" && label.toLowerCase().includes(searchLowerCase)) return true
4660
if (!label && typeof val === "string" && val.toLowerCase().includes(searchLowerCase))
4761
return true
@@ -80,6 +94,10 @@ const Dropdown = ({
8094
<Search data-testid="dropdown-search" placeholder="Search" onChange={setSearchValue} />
8195
</Box>
8296
)}
97+
{typeof renderComponent === "function" && renderComponent({ searchValue, filteredItems })}
98+
{showNoSearchResults && filteredItems.length === 0 && searchValue ? (
99+
<NoSearchResultsComponent />
100+
) : null}
83101
<div
84102
ref={mergeRefs(ref, forwardedRef)}
85103
style={{
Lines changed: 3 additions & 0 deletions
Loading

src/components/icon/iconsList.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ import google from "./assets/google.svg"
124124
import goToNode from "./assets/go_to_node.svg"
125125
import grid from "./assets/grid.svg"
126126
import group_by from "./assets/group_by.svg"
127+
import groupCreate from "./assets/group_create.svg"
127128
import h1 from "./assets/h1.svg"
128129
import h2 from "./assets/h2.svg"
129130
import hamburger from "./assets/hamburger.svg"
@@ -590,6 +591,7 @@ export const iconsList = {
590591
goToNode,
591592
grid,
592593
group_by,
594+
groupCreate,
593595
h1,
594596
h2,
595597
hamburger,

src/theme/dark/colors.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ const appColors = {
3434
primaryHighlightAI: rawColors.blue.blue130,
3535
secondaryColorAI: rawColors.blue.blue140,
3636
secondaryHighlightAI: rawColors.blue.blue70,
37+
// AI Graphics
38+
strokeMain: rawColors.blue.blue150,
39+
strokeHighlight: rawColors.blue.blue170,
40+
aiParticleMain: rawColors.blue.blue150,
41+
3742
//============Status=============\\
3843
success: rawColors.green.green100,
3944
successLite: rawColors.green.green190,

src/theme/default/colors.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ const appColors = {
3434
primaryHighlightAI: rawColors.blue.blue130,
3535
secondaryColorAI: rawColors.blue.blue120,
3636
secondaryHighlightAI: rawColors.blue.blue190,
37+
// AI Graphics
38+
strokeMain: rawColors.blue.blue100,
39+
strokeHighlight: rawColors.blue.blue120,
40+
aiParticleMain: rawColors.blue.blue180,
3741
//============Status=============\\
3842
success: rawColors.green.green100,
3943
successLite: rawColors.green.green190,

0 commit comments

Comments
 (0)