fix(insights): pass theme tokens instead of raw hex on four HealthKit metric pages

grip-strength, waist, waist-to-height, and pain shipped stock hex chart
colours (#22c55e / #0ea5e9 / #8b5cf6 / #f97316) while every sibling page
passes var(--token) — the four charts ignored both themes and any token
retune. Map them to var(--success) / var(--info) / var(--chart-1) /
var(--warning) and narrow the scaffold's color prop to a `var(--…)`
template-literal type so a raw hex no longer typechecks.
This commit is contained in:
Marc-André Bombeck committed 2026-07-05 16:23:24 +02:00
1 parent 3ce6236406
commit d3ed9b8225
6 files changed
+12 -7

No files matched your search

@@ -70,7 +70,7 @@ const baseProps = {
insightMetric: "HEART_RATE_VARIABILITY" as const,
chartKey: "hrv" as const,
i18nPrefix: "insights.hrv",
color: "#bd93f9",
color: "var(--chart-1)" as const,
unit: "ms",
emptyStateIcon: null,
};
@@ -82,8 +82,13 @@ export interface HealthKitMetricPageProps {
* sub-key off the prefix.
*/
i18nPrefix: string;
/** Single canonical colour for the chart line. */
color: string;
/**
* Single canonical colour for the chart line. Typed as a `var(--…)`
* template so pages can only pass a theme token (`"var(--success)"`),
* never a raw hex — raw stock hex ignores both themes and every future
* token retune (see UI standards, colour token rules).
*/
color: `var(--${string})`;
/** Unit suffix the chart renders next to the value. */
unit: string;
/** Optional y-axis label shown above the unit. */