From 26ba1a2e2ef92783b1f6778182acba83f5193cdc Mon Sep 17 00:00:00 2001 From: burbuli8ra Date: Mon, 14 Nov 2022 15:35:51 +0200 Subject: [PATCH 1/3] chore(icon button): add ref support to component --- src/components/button/IconButton.js | 77 +++++++++++++++-------------- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/src/components/button/IconButton.js b/src/components/button/IconButton.js index a26b31588..da70fff09 100644 --- a/src/components/button/IconButton.js +++ b/src/components/button/IconButton.js @@ -1,12 +1,11 @@ -import { Button } from "./button" +import React, { forwardRef } from "react" import Box from "src/components/templates/box" import Flex from "src/components/templates/flex" - -import React from "react" import Tooltip from "src/components/drops/tooltip" import { TextSmall } from "src/components/typography" +import { Button } from "./button" -//this addition here has been done to be aligned with our current implemetation at cloud-frontend src/components/tooltips/customTooltip.js +//this addition here has been done to be aligned with our current implementation at cloud-frontend src/components/tooltips/customTooltip.js const tooltipBackground = ["neutral", "black"] @@ -16,37 +15,43 @@ const CustomTooltipContent = ({ content }) => ( ) -const IconButton = ({ - iconColor = "nodeBadgeColor", - flavour = "borderless", - icon, - disabled, - onClick, - width = "20px", - height = "20px", - iconSize, - tooltip = "", - ...props -}) => { - const isDefaultFlavour = flavour === "default" - return ( - }> - - - ) -} +const IconButton = forwardRef( + ( + { + iconColor = "nodeBadgeColor", + flavour = "borderless", + icon, + disabled, + onClick, + width = "20px", + height = "20px", + iconSize, + tooltip = "", + ...props + }, + ref + ) => { + const isDefaultFlavour = flavour === "default" + return ( + }> + + + ) + } +) export default IconButton From a00589c9396ac618759f511be96e99078b37726d Mon Sep 17 00:00:00 2001 From: burbuli8ra Date: Mon, 14 Nov 2022 16:20:37 +0200 Subject: [PATCH 2/3] chore(input): move input props at the end * Move input props at the end of input provided props, so they can be overwritten --- src/components/input/input.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/input/input.js b/src/components/input/input.js index 78577fdd4..4d5ee773a 100644 --- a/src/components/input/input.js +++ b/src/components/input/input.js @@ -118,7 +118,6 @@ export const TextInput = ({ > {iconLeft && } {iconRight && } {metaDisplayed && error && } />} From 3c58b464cae1f42a922be9ad097e3480bb285d85 Mon Sep 17 00:00:00 2001 From: burbuli8ra Date: Mon, 14 Nov 2022 16:24:51 +0200 Subject: [PATCH 3/3] v2.4.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b359ace36..45244bd0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@netdata/netdata-ui", - "version": "2.4.3", + "version": "2.4.4", "description": "netdata UI kit", "main": "./lib/index.js", "files": [