Skip to content

fix(chart): align legend and tooltip spacings with Figma spec#238

Open
rmojica-godaddy wants to merge 3 commits into
mainfrom
rmb/adjust-chart-spacings
Open

fix(chart): align legend and tooltip spacings with Figma spec#238
rmojica-godaddy wants to merge 3 commits into
mainfrom
rmb/adjust-chart-spacings

Conversation

@rmojica-godaddy

@rmojica-godaddy rmojica-godaddy commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Aligns Legend and Tooltip chart component spacings with the Figma Data Visualization spec sheets. Spacings were verified by comparing each gap and padding value against the spec annotations (which use a 2× display scale), confirming the correct Box token mapping (sm = 1GU = 4px, md = 2GU = 8px, lg = 3GU = 12px).

Links

Previews deploy after the PR's CI finishes -- links may 404 until then.

modified components

Changes Made

  • Legend (chart/_internal/legend): corrects horizontal items gap from md (8px) to lg (12px) to match the Figma LGSpace spec (24px at 2× = 12px real).
  • Legend CSS: removes unused --legend-gap-items: var(--ux-1pfsknb) — the token --ux-1pfsknb does not exist in the intent map and the variable was never applied to any selector.
  • Tooltip CSS (chart/_internal/tooltip): adds display: inline-block to .tooltip root class.
  • Snapshots: updates legend, bar-chart, and line-chart node test snapshots to reflect the new gap:var(--sp-lg, 12px) value.

Test Plan

  • Verify Legend horizontal items gap looks correct in Storybook (see Links below).
  • Verify Legend vertical orientation is unchanged.
  • Verify Tooltip spacing is unchanged.
  • All existing node and browser tests pass locally (snapshots updated).

Checklist

  • My code follows the project's code style (biome)
  • I have added/updated tests that prove my fix is effective or that my feature works
  • I have added/updated documentation (README, Storybook stories, etc.)
  • All new and existing tests pass locally
  • I have added a changeset (run npm run changeset if this affects packages)
  • I have reviewed my own code and commented any complex areas

- legend: horizontal items gap md → lg (matches Figma LGSpace = 12px real)
- legend: remove unused --legend-gap-items referencing non-existent token
- tooltip: add display: inline-block to tooltip root
- snapshots: update legend, bar-chart, line-chart node test snapshots
@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7fd33ba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@godaddy/antares Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Docs Site Preview

Preview URL: https://godaddy.github.io/antares/pr-238-site/

Preview will be automatically deleted when this PR is closed.

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

📚 Storybook Preview

Preview URL: https://godaddy.github.io/antares/pr-238-storybook/

Preview will be automatically deleted when this PR is closed.

@rmojica-godaddy

Copy link
Copy Markdown
Contributor Author

/update-screenshots

@github-actions

Copy link
Copy Markdown
Contributor

📸 Updating screenshots... View workflow run

@github-actions

Copy link
Copy Markdown
Contributor

🎉 Successfully updated and committed screenshots!

@rmojica-godaddy rmojica-godaddy marked this pull request as ready for review June 23, 2026 14:58
@rmojica-godaddy rmojica-godaddy requested a review from a team as a code owner June 23, 2026 14:58
Copilot AI review requested due to automatic review settings June 23, 2026 14:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Aligns internal Chart Legend and Tooltip spacing behavior to match the Figma Data Visualization spec, ensuring consistent token usage (sm/md/lg) across rendered charts and snapshots.

Changes:

  • Updated Legend horizontal item gap from md to lg, and refreshed affected node snapshots (Legend, LineChart, BarChart).
  • Removed an unused Legend CSS custom property that referenced a non-existent token.
  • Updated Tooltip root styling to display: inline-block to match intended layout behavior.

Reviewed changes

Copilot reviewed 7 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/@godaddy/antares/components/chart/_internal/legend/src/index.tsx Changes horizontal legend item gap token from md to lg.
packages/@godaddy/antares/components/chart/_internal/legend/src/index.module.css Removes unused --legend-gap-items custom property.
packages/@godaddy/antares/components/chart/_internal/tooltip/src/index.module.css Sets .tooltip to display: inline-block.
packages/@godaddy/antares/components/chart/_internal/legend/test/snapshots/legend.node.test.tsx.snap Updates snapshots to reflect new legend gap token output.
packages/@godaddy/antares/components/chart/line-chart/test/snapshots/line-chart.node.test.tsx.snap Updates snapshots where legend gap output changes.
packages/@godaddy/antares/components/chart/bar-chart/test/snapshots/bar-chart.node.test.tsx.snap Updates snapshots where legend gap output changes.
.changeset/spotty-spiders-warn.md Adds a patch changeset for the spacing alignment fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants