diff --git a/app/assets/tailwind/sure-design-system/components.css b/app/assets/tailwind/sure-design-system/components.css index 7d814388f..0594759c3 100644 --- a/app/assets/tailwind/sure-design-system/components.css +++ b/app/assets/tailwind/sure-design-system/components.css @@ -150,4 +150,31 @@ fill: var(--color-white); } } + + /* + Chart hover tooltip surface (see utils/chart_tooltip.js for the JS-side + contract). Matches the design reference exactly: hairline border ring + composed with a soft 8/24 drop shadow (Tailwind shadow utilities don't + compose, hence the component class), 10px radius, 12x14 padding, and an + 80ms left/top glide so the card eases between scrub positions instead of + teleporting. Dark mode swaps the ring to alpha-white; the drop shadow is + near-invisible there, which is fine — the ring carries the edge. + */ + .chart-tooltip { + background: var(--color-container); + border-radius: 10px; + padding: 12px 14px; + box-shadow: + 0 0 0 1px var(--color-alpha-black-50), + 0 8px 24px rgba(11, 11, 11, 0.12); + transition: + left 80ms ease-out, + top 80ms ease-out; + + @variant theme-dark { + box-shadow: + 0 0 0 1px var(--color-alpha-white-50), + 0 8px 24px rgba(11, 11, 11, 0.12); + } + } } diff --git a/app/javascript/controllers/sankey_chart_controller.js b/app/javascript/controllers/sankey_chart_controller.js index 2219ef4b6..8b0d4376e 100644 --- a/app/javascript/controllers/sankey_chart_controller.js +++ b/app/javascript/controllers/sankey_chart_controller.js @@ -528,7 +528,7 @@ export default class extends Controller { (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c], ); - const valueLine = `${this.#formatCurrency(value)} (${percentage || 0}%)`; + const valueLine = `${this.#formatCurrency(value)} (${percentage || 0}%)`; const content = title ? `