/** * Shared types + design-system constants for the Table Properties drawer * and related data-table primitives (filter chips, sort cards, * conditional formatting rules). * * Product-specific seed data (`FILTER_FIELDS` and `COLUMNS` arrays * tailored to the Placements hub) intentionally stays in * `apps/web/components/table-properties/types.ts` — those values are * **product data**, not design-system primitives, and the package must * not know about Placement specializations, supervisor labels, etc. * * Consumers compose their own `FilterFieldDef[]` / `ColDef[]` arrays * tailored to their entity (Team members, Compliance items, Question * bank rows, …) and pass them into the drawer through props. */ /** Comparison operator vocabulary used by every filter row + conditional rule. */ type FilterOperator = "is" | "is_not" | "contains" | "not_contains"; /** * Input mask for `type: "text"` filters. Maps to a * [Shadcn Studio input-mask](https://shadcnstudio.com/docs/components/input-mask) * pattern key. Add new keys here (and in your concrete `exxatMaskPatterns` * map) when a new column needs a structured text format. */ type FilterTextMask = "phone" | "zip" | "dateMDY"; /** Persistent format helper for masked text filters (SC 3.3.2). */ declare const FILTER_TEXT_MASK_FORMAT_HINT: Record; interface FilterFieldDef { key: string; label: string; icon: string; type: "select" | "text" | "date" | "date-range" | "range"; operators: FilterOperator[]; selectVariant?: "default" | "person"; dataBounds?: boolean; /** Select options, or for `date` fields used by conditional rules (exact row strings). */ options?: { value: string; label: string; }[]; /** When `type` is `text`, optional `use-mask-input` pattern for the value field. */ textMask?: FilterTextMask; rangeMin?: number; rangeMax?: number; rangeStep?: number; rangeUnit?: string; } interface ActiveFilter { id: string; fieldKey: string; operator: FilterOperator; values: string[]; } interface SortRule { id: string; fieldKey: string; direction: "asc" | "desc"; } /** Operator → human-readable label map (centralized so chips, drawer, and CSV exports stay aligned). */ declare const OPERATOR_LABELS: Record; /** Column descriptor for `TableProperties` views (Columns / Sort / Group panels). */ interface ColDef { key: string; label: string; sortable: boolean; sortKey?: string; minWidth: number; } interface ConditionalRule { id: string; /** Column key to evaluate */ fieldKey: string; operator: FilterOperator; /** Selected option values (select) or text (single entry) when operator needs values */ values: string[]; /** Resolved CSS background color string */ bgColor: string; } /** * Predefined palette for conditional rule backgrounds. * * Backgrounds are exposed as CSS custom properties so theming swaps the * palette per brand without code edits (`--conditional-rule-green`, * `--conditional-rule-yellow`, etc., declared in * `packages/ui/src/globals.css`). */ declare const RULE_COLORS: { name: string; bg: string; }[]; export { type ActiveFilter, type ColDef, type ConditionalRule, FILTER_TEXT_MASK_FORMAT_HINT, type FilterFieldDef, type FilterOperator, type FilterTextMask, OPERATOR_LABELS, RULE_COLORS, type SortRule };