From 4112b3b19aea3e325dad2f08d132ea8a2f7b12da Mon Sep 17 00:00:00 2001 From: Donald Labaj Date: Tue, 21 Nov 2023 13:28:40 -0500 Subject: [PATCH 1/3] fix(battery): Css fix for batteries. --- packages/module/src/Battery/Battery.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/module/src/Battery/Battery.tsx b/packages/module/src/Battery/Battery.tsx index 32f1b650..ed40d810 100644 --- a/packages/module/src/Battery/Battery.tsx +++ b/packages/module/src/Battery/Battery.tsx @@ -32,6 +32,12 @@ const batteryCritical = { } }; +const batteryLineColor = { + '& svg': { + '& path': { stroke: 'var(--pf-v5-global--palette--black-500)' } + } +}; + const useStyles = createUseStyles({ battery: { display: 'inline-block', @@ -48,6 +54,7 @@ const useStyles = createUseStyles({ batteryMedium, batteryHigh, batteryCritical, + batteryLineColor }); const batteryLevels = (severity: BatterySeverity, classMode?: boolean) => { @@ -91,17 +98,15 @@ const Battery: React.FunctionComponent = ({ severity, label, label const classes = useStyles(); const batteryClasses = clsx(classes.battery, classes[String(batteryLevels(severity, true))], className); - let ariaLabels = {}; - if (labelHidden) { - ariaLabels = { ['aria-label']: `${severity} ${label}` }; - } + const title = { ['title']: `${severity} ${label}` }; + const batteryVariant = useMemo(() => batteryLevels(severity) , [ severity ]) return ( {/* eslint-disable-next-line react/no-unknown-property */} - + = ({ severity, label, label style={{ fill: 'none', fillOpacity: 1, - stroke: '#969696', + stroke: batteryLineColor['& svg']['& path'].stroke, strokeWidth: 41.96378708, strokeLinejoin: 'round', strokeMiterlimit: 4, From fcd334258e0682a0aa847cfa9cff32cb39212541 Mon Sep 17 00:00:00 2001 From: Donald Labaj Date: Tue, 21 Nov 2023 14:52:31 -0500 Subject: [PATCH 2/3] fix(battery): Css fix for batteries. --- .../__snapshots__/Batery.test.tsx.snap | 66 +++++++++++-------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/packages/module/src/Battery/__snapshots__/Batery.test.tsx.snap b/packages/module/src/Battery/__snapshots__/Batery.test.tsx.snap index eb13acf7..12f23ff4 100644 --- a/packages/module/src/Battery/__snapshots__/Batery.test.tsx.snap +++ b/packages/module/src/Battery/__snapshots__/Batery.test.tsx.snap @@ -3,10 +3,10 @@ exports[`Battery component API should hide label 1`] = `
Date: Tue, 21 Nov 2023 15:28:49 -0500 Subject: [PATCH 3/3] fix(battery): Updated with review comments. --- packages/module/src/Battery/Battery.tsx | 4 +-- .../__snapshots__/Batery.test.tsx.snap | 26 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/module/src/Battery/Battery.tsx b/packages/module/src/Battery/Battery.tsx index ed40d810..3587f7a6 100644 --- a/packages/module/src/Battery/Battery.tsx +++ b/packages/module/src/Battery/Battery.tsx @@ -4,7 +4,7 @@ import { createUseStyles } from 'react-jss' const batteryDefault = { '& svg': { - '& path': { fill: 'var(--pf-v5-global--disabled-color--200)' } + '& path': { fill: 'var(--pf-v5-global--icon--Color--light)' } } }; @@ -34,7 +34,7 @@ const batteryCritical = { const batteryLineColor = { '& svg': { - '& path': { stroke: 'var(--pf-v5-global--palette--black-500)' } + '& path': { stroke: 'var(--pf-v5-global--BorderColor--100)' } } }; diff --git a/packages/module/src/Battery/__snapshots__/Batery.test.tsx.snap b/packages/module/src/Battery/__snapshots__/Batery.test.tsx.snap index 12f23ff4..9381cd31 100644 --- a/packages/module/src/Battery/__snapshots__/Batery.test.tsx.snap +++ b/packages/module/src/Battery/__snapshots__/Batery.test.tsx.snap @@ -18,7 +18,7 @@ exports[`Battery component API should hide label 1`] = ` >