03568c88e3
- frontend/functions/core/format_datetime_short.md - frontend/functions/core/format_datetime_short.test.ts - frontend/functions/core/format_datetime_short.ts - frontend/functions/core/format_duration.md - frontend/functions/core/format_duration.test.ts - frontend/functions/core/format_duration.ts - frontend/functions/core/month_grid.md - frontend/functions/core/month_grid.test.ts - frontend/functions/core/month_grid.ts - frontend/functions/core/string_hash_palette.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4.5 KiB
4.5 KiB
name, kind, lang, domain, version, framework, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, props, emits, has_state, params, output, file_path
| name | kind | lang | domain | version | framework | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | props | emits | has_state | params | output | file_path | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| month_heatmap | component | ts | ui | 1.0.0 | react | pure | MonthHeatmap(props: MonthHeatmapProps): JSX.Element | Grid mensual de calor (heatmap) con inicio en lunes. Renderiza 7 columnas con header de dias de semana y celdas que muestran numero del dia, hasta dos contadores con icono, borde azul para hoy y fondo tintado segun valores primary/secondary. |
|
|
false |
|
false |
|
false |
|
Componente React que renderiza un grid de 7 columnas con el calendario del mes indicado. Celdas de relleno vacias, celdas del mes con numero, contadores opcionales e iconos, borde azul en el dia de hoy y fondo tintado segun presencia de valores. | frontend/functions/ui/month_heatmap.tsx |
Ejemplo
import { MonthHeatmap, type MonthHeatmapCell } from "@fn_library/ui/month_heatmap";
const cells = new Map<string, MonthHeatmapCell>([
["2026-05-01", { primary: 3 }],
["2026-05-09", { primary: 1, secondary: 2 }],
["2026-05-15", { secondary: 4 }],
]);
<MonthHeatmap
month={new Date(2026, 4, 1)}
cells={cells}
/>
Ejemplo con iconos y colores custom
import { IconBug, IconCheck } from "@tabler/icons-react";
<MonthHeatmap
month={new Date(2026, 4, 1)}
cells={cells}
primaryIcon={<IconBug size={10} />}
secondaryIcon={<IconCheck size={10} />}
primaryColor="red"
secondaryColor="teal"
cellMinHeight={88}
/>
Notas
Componente puro (sin estado propio, sin efectos). El calculo del grid se delega a
month_grid_ts_core (monthGrid(year, month)), que genera un array de celdas
de longitud multiplo de 7 con date: null para el padding.
La deteccion de "hoy" usa Date nativo sin dayjs para no introducir dependencias.
El fondo tintado prioriza secondary sobre primary cuando ambos son > 0,
replicando la logica del componente original en apps/kanban.
Compatible con Mantine v9. No usa CSS variables custom — emplea props de Mantine
(c, fw, p, gap, radius) y solo dos style inline para minHeight
y borderColor condicional (que no tienen equivalente en props Mantine).