-
Notifications
You must be signed in to change notification settings - Fork 138
feat(metric): add new layout configurations #2666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mariairiartef
merged 82 commits into
elastic:main
from
mariairiartef:metric-new-positions
Aug 11, 2025
Merged
Changes from 70 commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
ffbcf1b
Extract titles block component and separate extra and value blocks
mariairiartef 8e5a961
Add ability to move value to the top and use grid for text handling
mariairiartef c97c469
Add default value position
mariairiartef 50449eb
Update width calculation when there is an icon for getting the font size
mariairiartef 593b3fc
Handle title font weight configuration
mariairiartef 1e4fb14
Take into account icon width for value font size calculation only if …
mariairiartef 797dc92
Avoid grid overflowing
mariairiartef 5fcef4d
Add breackpoints to new layout story
mariairiartef aa3a932
Update progress bar style
mariairiartef 8838f71
Update height when there is an horizontal progress bar
mariairiartef 7abb452
Support different progress bar thickness based on height
mariairiartef 23687a7
Fix typos
mariairiartef 2c7955d
Refactor progress bar types and styles
mariairiartef a00bccc
Allow smaller breakpoints
mariairiartef 7dc5b9c
Support different colors for subtitle and extra
mariairiartef 0455497
Refactor grid logic rows and columns calculation
mariairiartef cd7c6f0
Add secondary metric component
mariairiartef aced3a4
Extract badge component, update and re-organize styles
mariairiartef 03caf3f
Fix lint issues
mariairiartef 8bfbc3f
Re-organize new layout config story
mariairiartef d4c8d11
Merge branch 'main' into metric-new-positions
mariairiartef ba0d8de
Move SecondaryMetricProps type to specs and update api
mariairiartef 5757b84
Fix typos
mariairiartef fc433a1
Add test case for new config
mariairiartef 147a33a
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] baaffb4
Add resize to new story
mariairiartef 439ff18
Update progress bar styles
mariairiartef 6f6a86e
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] 7f74114
Fix progress bar styles border
mariairiartef 57ac6e3
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] 2525c01
Update target styles
mariairiartef c9f273b
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] 9690d35
Fix progress styles
mariairiartef 3fa66b6
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] cec8aa9
Add missing styles for zero baseline
mariairiartef 0ed6b85
Update e2e/tests/metric_stories.test.ts
mariairiartef f0d1895
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] 926bca1
Update height based sizes considering the width
mariairiartef 8cf460b
Add aria description to secondary metric
mariairiartef e2750f7
Update subtitle text color and use different color picker palette in …
mariairiartef e57cb11
Fix new metric layout story resizer
mariairiartef 1378c77
Add border color prop to badge component
mariairiartef baac74d
Update secondaty metric content styles
mariairiartef 784daef
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] 00ea9ab
Update api
mariairiartef a3d9cd5
Merge branch 'main' into metric-new-positions
mariairiartef 2a906ce
Rename layout story
mariairiartef 2fe1771
Delete comment
mariairiartef 2e788a8
Update font weight type
mariairiartef c051d23
Apply title suggestion
mariairiartef bdd449c
Create color tokens for badge
mariairiartef c64f4e3
Update metric style theme
mariairiartef 955035e
Update story test
mariairiartef bb4f5e7
Update styles when top element is center-aligned and there is an icon
mariairiartef 524e518
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] bcf8455
Fix styles when there is no label in secondary metric
mariairiartef a6d8a05
Add ability to add icon to badge component
mariairiartef 16a360f
Create file for metric scss variables
mariairiartef 15f42c7
Update badge styles when no value
mariairiartef cab7d3b
Add tests for different metric layout configurations
mariairiartef 954c671
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] a770838
Merge branch 'main' into metric-new-positions
mariairiartef 949b0ec
Fix prettier issue
mariairiartef 9a23af9
Update layout stories and tests
mariairiartef 26c2b94
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] b426ece
Delete snapshots
mariairiartef 09df91a
Update tests
mariairiartef cc7b4ef
Remove circular dependency
mariairiartef 1f2e878
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] eb7ef8e
Merge branch 'main' into metric-new-positions
mariairiartef 8b2d00c
Apply theme suggestions
mariairiartef aed04e7
Move variables into variables.scss file
mariairiartef df3f01f
Move text contrast options type
mariairiartef 79021ee
Rename getContrastRecommendation function
mariairiartef 8cc2b60
Apply suggestions
mariairiartef a7d3a86
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] 30755e1
Update tests
mariairiartef 0ce9bd8
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] 868fff0
Fix overflow body content and add test
mariairiartef 580fcd7
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] bd58c93
Update layout story and tests
mariairiartef 23debd5
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file modified
BIN
+2 Bytes
(100%)
...s/all.test.ts-snapshots/baselines/metric-alpha/array-of-values-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+101 Bytes
(100%)
...screenshots/all.test.ts-snapshots/baselines/metric-alpha/basic-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+35 Bytes
(100%)
...hots/all.test.ts-snapshots/baselines/metric-alpha/extra-badges-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+280 Bytes
(100%)
e2e/screenshots/all.test.ts-snapshots/baselines/metric-alpha/grid-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
...creenshots/all.test.ts-snapshots/baselines/metric-alpha/layout-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+38 Bytes
(100%)
...l.test.ts-snapshots/baselines/metric-alpha/trend-multiple-data-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-633 Bytes
(81%)
...horizontal/bullet-as-metric/should-render-with-negative-values-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-641 Bytes
(80%)
...l/bullet-as-metric/should-render-with-negative-values-reversed-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-357 Bytes
(87%)
...l/bullet-as-metric/should-render-with-positive-negative-values-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-364 Bytes
(87%)
...as-metric/should-render-with-positive-negative-values-reversed-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-641 Bytes
(80%)
...horizontal/bullet-as-metric/should-render-with-positive-values-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-642 Bytes
(80%)
...l/bullet-as-metric/should-render-with-positive-values-reversed-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+99 Bytes
(100%)
...rds-circle/bullet-as-metric/should-render-with-negative-values-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+100 Bytes
(100%)
...e/bullet-as-metric/should-render-with-negative-values-reversed-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+102 Bytes
(100%)
...e/bullet-as-metric/should-render-with-positive-negative-values-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+92 Bytes
(100%)
...as-metric/should-render-with-positive-negative-values-reversed-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+98 Bytes
(100%)
...rds-circle/bullet-as-metric/should-render-with-positive-values-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+105 Bytes
(100%)
...e/bullet-as-metric/should-render-with-positive-values-reversed-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.37 KB
(61%)
...c-vertical/bullet-as-metric/should-render-with-negative-values-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.36 KB
(61%)
...l/bullet-as-metric/should-render-with-negative-values-reversed-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.35 KB
(67%)
...l/bullet-as-metric/should-render-with-positive-negative-values-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.34 KB
(67%)
...as-metric/should-render-with-positive-negative-values-reversed-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.75 KB
(52%)
...c-vertical/bullet-as-metric/should-render-with-positive-values-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.75 KB
(52%)
...l/bullet-as-metric/should-render-with-positive-values-reversed-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+286 Bytes
(100%)
...izing/should-accommodate-chart-title-and-description-metric-sm-chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-6.74 KB
(72%)
...a-badge-props/extra-badge-with-big-breakpoints-with-trend-both-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
-5.44 KB
(75%)
...a-badge-props/extra-badge-with-big-breakpoints-with-trend-icon-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
-6.59 KB
(73%)
...-badge-props/extra-badge-with-big-breakpoints-with-trend-value-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+35 Bytes
(100%)
...badge-props/extra-badge-with-small-breakpoints-with-trend-both-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+16 Bytes
(100%)
...badge-props/extra-badge-with-small-breakpoints-with-trend-icon-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+12 Bytes
(100%)
...adge-props/extra-badge-with-small-breakpoints-with-trend-value-chrome-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.3 KB
...-configuration/with-default-secondary-and-after-badge-position-chrome-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.3 KB
...configuration/with-default-secondary-and-before-badge-position-chrome-linux.png
Oops, something went wrong.
Binary file added
BIN
+9.34 KB
...guration/with-default-secondary-metric-with-badge-and-no-label-chrome-linux.png
Oops, something went wrong.
Binary file added
BIN
+9.34 KB
...ation/with-default-secondary-metric-with-no-badge-and-no-label-chrome-linux.png
Oops, something went wrong.
Binary file added
BIN
+8.71 KB
...ration/with-titles-at-the-top-center-aligned-and-a-metric-icon-chrome-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.5 KB
...uration/with-value-at-the-top-center-aligned-and-a-metric-icon-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.59 KB
(88%)
...ar-type/dark-theme/should-render-metric-with-click-interaction-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.57 KB
(88%)
...ar-type/dark-theme/should-render-metric-with-hover-interaction-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.59 KB
(88%)
...type/dark-theme/should-render-metric-with-transparent-bg-color-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.5 KB
(88%)
...r-type/light-theme/should-render-metric-with-click-interaction-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.42 KB
(89%)
...r-type/light-theme/should-render-metric-with-hover-interaction-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.51 KB
(88%)
...ype/light-theme/should-render-metric-with-transparent-bg-color-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
-1.53 KB
(88%)
...ic/metric-bar-type/should-render-with-blended-background-color-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+28 Bytes
(100%)
...ne-type/dark-theme/should-render-metric-with-click-interaction-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+52 Bytes
(100%)
...ne-type/dark-theme/should-render-metric-with-hover-interaction-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+40 Bytes
(100%)
...type/dark-theme/should-render-metric-with-transparent-bg-color-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+45 Bytes
(100%)
...e-type/light-theme/should-render-metric-with-click-interaction-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+17 Bytes
(100%)
...e-type/light-theme/should-render-metric-with-hover-interaction-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+8 Bytes
(100%)
...ype/light-theme/should-render-metric-with-transparent-bg-color-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+40 Bytes
(100%)
...c/metric-none-type/should-render-with-blended-background-color-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+41 Bytes
(100%)
...nd-type/dark-theme/should-render-metric-with-click-interaction-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+25 Bytes
(100%)
...nd-type/dark-theme/should-render-metric-with-hover-interaction-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+51 Bytes
(100%)
...type/dark-theme/should-render-metric-with-transparent-bg-color-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+28 Bytes
(100%)
...d-type/light-theme/should-render-metric-with-click-interaction-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+23 Bytes
(100%)
...d-type/light-theme/should-render-metric-with-hover-interaction-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+2 Bytes
(100%)
...ype/light-theme/should-render-metric-with-transparent-bg-color-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+14 Bytes
(100%)
.../metric-trend-type/should-render-with-blended-background-color-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+284 Bytes
(100%)
...test.ts-snapshots/metric/should-render-horizontal-progress-bar-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+255 Bytes
(100%)
...hots/metric/should-render-horizontal-progress-bar-in-dark-mode-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+5 Bytes
(100%)
...t.ts-snapshots/metric/should-render-metric-value-fit-font-size-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+284 Bytes
(100%)
...stories.test.ts-snapshots/metric/should-render-no-progress-bar-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+255 Bytes
(100%)
...ts-snapshots/metric/should-render-no-progress-bar-in-dark-mode-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+202 Bytes
(100%)
...pshots/metric/should-render-vertical-progress-bar-in-dark-mode-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+225 Bytes
(100%)
.../metric/should-render-with-empty-and-missing-background-colors-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+18 Bytes
(100%)
...ies.test.ts-snapshots/metric/small-size-with-default-font-size-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+44 Bytes
(100%)
...stories.test.ts-snapshots/metric/small-size-with-fit-font-size-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+31 Bytes
(100%)
...ories.test.ts-snapshots/metric/small-size-with-fixed-font-size-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+83 Bytes
(100%)
.../metric_stories.test.ts-snapshots/metric/text-value-with-trend-chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+22 Bytes
(100%)
...ic_stories.test.ts-snapshots/metric/value-icon-and-value-color-chrome-linux.png
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.