Skip to content

feat(metric): add secondary badge text color#2799

Merged
maryam-saeidi merged 4 commits intoelastic:mainfrom
maryam-saeidi:kibana-251614-metric-badge-text-color
Mar 3, 2026
Merged

feat(metric): add secondary badge text color#2799
maryam-saeidi merged 4 commits intoelastic:mainfrom
maryam-saeidi:kibana-251614-metric-badge-text-color

Conversation

@maryam-saeidi
Copy link
Copy Markdown
Member

@maryam-saeidi maryam-saeidi commented Mar 2, 2026

Summary

EUI badge styling is moving to light background + colored text, and Lens needs elastic-charts’ resizable metric badge to support this pattern consistently. See elastic/kibana#251614.

Details

  • Adds badgeTextColor?: Color to SecondaryMetricProps so metric secondary badges can explicitly control text color (in addition to background).
  • Updates the metric layout Storybook example to use explicit TREND and COMPLEMENTARY palette background/text pairs based on EUI light theme tokens. (As shown below)
image

Issues

Related to elastic/kibana#251614

Checklist

  • The proper chart type label has been added (e.g. :xy, :partition)
  • All related issues have been linked (i.e. closes #123, fixes #123)
  • New public API exports have been added to packages/charts/src/index.ts
  • Unit tests have been added or updated to match the most common scenarios
  • The proper documentation and/or storybook story has been added or updated
  • The code has been checked for cross-browser compatibility (Chrome, Firefox, Safari, Edge)

Expose `badgeTextColor` on `SecondaryMetricProps` and thread it through the metric badge rendering.
Update the metric layout story to map TREND and COMPLEMENTARY selections to explicit EUI light theme background/text pairs.

Made-with: Cursor
@maryam-saeidi maryam-saeidi self-assigned this Mar 2, 2026
@maryam-saeidi maryam-saeidi added the :metric Related to Metric chart label Mar 2, 2026
@maryam-saeidi
Copy link
Copy Markdown
Member Author

buildkite update vrt

@mariairiartef mariairiartef self-requested a review March 2, 2026 16:45
Copy link
Copy Markdown
Contributor

@mariairiartef mariairiartef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@maryam-saeidi
Copy link
Copy Markdown
Member Author

buildkite build this

1 similar comment
@markov00
Copy link
Copy Markdown
Collaborator

markov00 commented Mar 3, 2026

buildkite build this

@maryam-saeidi maryam-saeidi enabled auto-merge (squash) March 3, 2026 17:50
@elastic-datavis
Copy link
Copy Markdown
Contributor

@maryam-saeidi maryam-saeidi merged commit 5c765e8 into elastic:main Mar 3, 2026
14 checks passed
@maryam-saeidi maryam-saeidi deleted the kibana-251614-metric-badge-text-color branch March 3, 2026 18:06
nickofthyme pushed a commit that referenced this pull request Mar 3, 2026
# [71.3.0](v71.2.0...v71.3.0) (2026-03-03)

### Features

* **metric:** add secondary badge text color ([#2799](#2799)) ([5c765e8](5c765e8))
* **metric:** expose medium (500) title font-weight in Metric chart ([#2792](#2792)) ([c582e81](c582e81))
maryam-saeidi added a commit to elastic/kibana that referenced this pull request Mar 3, 2026
## Summary

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@elastic/charts](https://togithub.com/elastic/elastic-charts) |
dependencies | minor | [`71.2.0` ->
`71.3.0`](elastic/elastic-charts@v71.2.0...v71.3.0)
|


### Release Notes
##
[71.3.0](elastic/elastic-charts@v71.2.0...v71.3.0)
(2026-03-03)


### Features

* **metric:** add secondary badge text color
([#2799](elastic/elastic-charts#2799))
([5c765e8](elastic/elastic-charts@5c765e8))
* **metric:** expose medium (500) title font-weight in Metric chart
([#2792](elastic/elastic-charts#2792))
([c582e81](elastic/elastic-charts@c582e81))
rbrtj pushed a commit to rbrtj/kibana that referenced this pull request Mar 5, 2026
## Summary

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@elastic/charts](https://togithub.com/elastic/elastic-charts) |
dependencies | minor | [`71.2.0` ->
`71.3.0`](elastic/elastic-charts@v71.2.0...v71.3.0)
|


### Release Notes
##
[71.3.0](elastic/elastic-charts@v71.2.0...v71.3.0)
(2026-03-03)


### Features

* **metric:** add secondary badge text color
([elastic#2799](elastic/elastic-charts#2799))
([5c765e8](elastic/elastic-charts@5c765e8))
* **metric:** expose medium (500) title font-weight in Metric chart
([elastic#2792](elastic/elastic-charts#2792))
([c582e81](elastic/elastic-charts@c582e81))
DennisKo pushed a commit to DennisKo/kibana that referenced this pull request Mar 6, 2026
## Summary

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@elastic/charts](https://togithub.com/elastic/elastic-charts) |
dependencies | minor | [`71.2.0` ->
`71.3.0`](elastic/elastic-charts@v71.2.0...v71.3.0)
|


### Release Notes
##
[71.3.0](elastic/elastic-charts@v71.2.0...v71.3.0)
(2026-03-03)


### Features

* **metric:** add secondary badge text color
([elastic#2799](elastic/elastic-charts#2799))
([5c765e8](elastic/elastic-charts@5c765e8))
* **metric:** expose medium (500) title font-weight in Metric chart
([elastic#2792](elastic/elastic-charts#2792))
([c582e81](elastic/elastic-charts@c582e81))
qn895 pushed a commit to qn895/kibana that referenced this pull request Mar 11, 2026
## Summary

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@elastic/charts](https://togithub.com/elastic/elastic-charts) |
dependencies | minor | [`71.2.0` ->
`71.3.0`](elastic/elastic-charts@v71.2.0...v71.3.0)
|


### Release Notes
##
[71.3.0](elastic/elastic-charts@v71.2.0...v71.3.0)
(2026-03-03)


### Features

* **metric:** add secondary badge text color
([elastic#2799](elastic/elastic-charts#2799))
([5c765e8](elastic/elastic-charts@5c765e8))
* **metric:** expose medium (500) title font-weight in Metric chart
([elastic#2792](elastic/elastic-charts#2792))
([c582e81](elastic/elastic-charts@c582e81))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:metric Related to Metric chart

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants