/** * Countdown Component * * Displays time remaining until a target date, refreshed every second. * * Two layouts share one `--ff-countdown-*` token set: * - "cells" (default): one box per time unit * - "inline": a single line that fits inside a sentence, a ledger row or a button * * The visual layouts are `aria-hidden`; one visually-hidden sibling carries * `role="timer"`, so exactly one live region exists whatever the container * width makes visible. * * With a server-anchored clock in scope (``) the * remaining time is corrected for device skew; with none it derives from the * device clock. */ export type CountdownSize = "default" | "hero"; export type CountdownTone = "calm" | "warning" | "critical" | "auto"; export interface CountdownProps { /** Target date/time to count down to */ targetDate: Date | string | number; /** Callback when countdown reaches zero */ onComplete?: () => void; /** Label to show when expired */ expiredLabel?: string; /** Additional CSS classes */ className?: string; /** Show days in countdown */ showDays?: boolean; /** Show hours in countdown */ showHours?: boolean; /** Show minutes in countdown */ showMinutes?: boolean; /** Show seconds in countdown */ showSeconds?: boolean; /** Layout: "cells" for a box per unit, "inline" for a single line */ layout?: "cells" | "inline"; /** Numeral granularity under `layout="cells"`: one text node per unit, or one box per digit. */ cells?: "unit" | "digit"; /** * How the time is spelled wherever it is written as one line: the inline * layout, the narrow fallback the cells layout falls back to, and — always in * `clock` spelling — the string assistive technology is given. * `labelled` renders `14m 57s`, with a literal space between units. * `clock` renders `02:00` / `1:15:17`, and always carries minutes and seconds * whatever `showMinutes` and `showSeconds` say. */ format?: "labelled" | "clock"; /** * Hold the last rendered value. A paused countdown runs no interval, never * calls `onComplete` and stops announcing; on resume it re-reads the clock * rather than continuing from the held value. */ paused?: boolean; /** Size: "default" (compact display) or "hero" (the larger urgency-driver); the two differ only in scale. */ size?: CountdownSize; /** * Presentational urgency tone, published as `data-tone` on both layout roots * and on each cell, and coloured from the `--ff-countdown-tone-*` tokens. * - calm: numeral colour (default) * - warning: warning tone colour * - critical: critical tone colour (in retro, also flips the unit container bg) * - auto: resolved from the time remaining on every tick */ tone?: CountdownTone; } type TimeRemaining = { days: number; hours: number; minutes: number; seconds: number; total: number; }; /** Which units the caller allows on screen; a hidden unit rolls into the next shown one. */ type ShownUnits = { days: boolean; hours: boolean; minutes: boolean; seconds: boolean; }; /** Time left on a target, decomposed across the units the caller shows. */ export declare function calculateTimeRemaining(targetDate: Date | string | number, shown: ShownUnits, nowMs?: number): TimeRemaining; export declare function Countdown(props: CountdownProps): import("solid-js").JSX.Element; export declare namespace Countdown { var displayName: string; } export {};