/** * A variant is a resolved token set, never a branch. Components read named tokens; * only `Table.tsx` knows which variant is active. * * PURITY: presets take a palette and return values — no Chakra, no React, no CSS. */ import type { PaletteProps } from "../../../Theme/tokens/types"; export type TableVariant = "classic" | "studio"; export type TableSlotRest = "checkbox" | "index"; export type TableStatusFill = "bleed" | "pill"; export type TableHoverScope = "cell" | "row"; export type TableChromeReveal = "always" | "hover"; /** Every field required: a preset that forgets one is a compile error, not a runtime gap. */ export type TableVariantTokens = { /** Header row look: fill, ink, type scale, height, column rules and when the filter kebab shows. */ header: { bg: string; ink: string; fontSize: number; fontWeight: number; textTransform: "capitalize" | "uppercase"; letterSpacing: string; height: string; ruleColor: string; showColumnRule: boolean; /** When the per-column filter kebab appears. Active columns always show it. */ actions: TableChromeReveal; }; /** Body row look: hover and selected fills, rules and the zebra stripe fill. */ row: { hoverBg: string; hoverScope: TableHoverScope; ruleColor: string; frozenRuleColor: string; selectedBg: string; selectedBarColor: string; showSelectedBar: boolean; /** Zebra fill for odd rows when `stripe` is on; a quiet step below `hoverBg`. */ stripeBg: string; }; /** Leading checkbox/index column: width, what rests in it and its ink. */ slot: { width: string; rest: TableSlotRest; indexInk: string; centered: boolean; }; /** Body cell ink and how status values render (bleed fill or pill). */ cells: { ink: string; statusFill: TableStatusFill; pillRadius: string; }; }; export type TableVariantPreset = (colors: PaletteProps, isDark: boolean) => TableVariantTokens;