@frame-kit/utils
v0.1.0
Published
Framework-agnostic color and date utilities for FrameKit.
Readme
@frame-kit/utils
Framework-agnostic color and date utilities for FrameKit — no Angular, no framework dependency. Pure ESM, fully tree-shakeable.
Install
npm i @frame-kit/utilsUsage
import { Color, DateUtil } from '@frame-kit/utils';
// Color — parse, convert, manipulate, contrast, palette generation
const c = new Color('#2563eb');
c.toRgb(); // { r, g, b }
c.lighten(0.2).toHex();
c.contrastRatio('#ffffff'); // WCAG ratio
// DateUtil — parse, format, relative time, contextual labels, ranges
DateUtil.format(Date.now(), 'medium');
DateUtil.relative('2026-01-01'); // "5 months ago"
DateUtil.expiresIn(expiry); // contextual "Expires in 3 days"Exposes Color and DateUtil plus their supporting types (RgbColor, HslColor,
TailwindPalette, DateInput, DateFormatPreset, ExpiryStatus).
These were previously bundled inside
@frame-kit/ui-ngas Angular services. They now live here, framework-agnostic — wrap them in your own DI service if you want injectable access.
License
MIT
