import { ButtonMetadata } from '../../types'; /** * Optional status chip rendered as an eyebrow at the top-left of the card. * Rendered via `val-pill` (badge mode). */ export interface EntityCardChip { /** Already-resolved label string. */ label: string; /** Ionic color name (`primary`…`dark`) or CSS color. Default: `medium`. */ color?: string; } /** * Configuration for `val-entity-card`. * * Presentational molecule — every text field is an already-resolved string * (the consumer translates via `I18nService.t()`). No i18n of its own. * * Covers two real use-cases: * * 1. **Navigable entity** — set `clickable: true` (and no `actions`). The whole * card becomes a button: shows a chevron, gains `role="button"` + keyboard * support, and emits `(cardClick)` with `token`. * * 2. **Row with action(s)** — provide `actions` (e.g. a prize row with an * "edit"/"assign" button). Each button emits `(actionClick)` with its token. * When `actions` is present the card is NOT navigable (no chevron). * * @example Navigable event * ```html * * ``` * * @example Prize row with an action * ```html * * ``` */ export interface EntityCardMetadata { /** Optional status badge, top-left of the card. Rendered with `val-pill`. */ chip?: EntityCardChip; /** Main text (weight 700). Already resolved. */ title: string; /** Secondary muted line. Already resolved. */ subtitle?: string; /** Additional secondary note (e.g. "Ganador: X"), muted, below `subtitle`. */ endNote?: string; /** Action buttons rendered on the right (one `val-button` each). */ actions?: ButtonMetadata[]; /** * When `true`, action buttons are rendered in a row **below** the text block * instead of inline on the right. Useful when button labels are long and * horizontal space is tight (e.g. on mobile). */ actionsBelow?: boolean; /** * When `true` and there are NO `actions`, the whole card is navigable: * shows a chevron, `role="button"` + `tabindex`, keyboard activation, and * emits `(cardClick)`. */ clickable?: boolean; /** Identifier emitted on `(cardClick)`. */ token?: string; /** * Optional leading icon (Ionicons name, e.g. `card-outline`). Rendered to the * left of the text block. Use it to tell apart cards that share a shape but * mean different things — a list of settings entries, a catalog, a menu of * sections. A list of homogeneous records (all events, all users) reads * better WITHOUT icons: repeating the same glyph adds noise, not meaning. */ icon?: string; /** * Optional accent. Tints the card with a soft diagonal gradient of the given * Ionic color and matches the border, so ONE card can stand out inside a list * of otherwise identical cards (the live event among the drafts). * * Deliberately subtle: it must read as emphasis, not as a status color. If * several cards in the same list carry an accent, none of them stands out. */ accent?: 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger'; }