You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte-kit-vice/src/uix/morfo/components/relative-time.ts

29 lines
766 B

import type { Morfo } from '../types';
/**
* RelativeTime — service component that renders a Date / timestamp /
* ISO string as a relative time string ("hace 2 horas" / "in 3 days")
* via `Intl.RelativeTimeFormat`. Auto-refreshes at a configurable
* cadence so the displayed text stays accurate as time passes.
*
* Family with `<Trans>`, `<FormatNumber>`, `<FormatDate>` — service
* primitive wrapping a runtime API. Pure eidos, no events.
*/
export const relativeTimeMorfo = {
name: 'RelativeTime',
kebab: 'relative-time',
scope: ['soma'],
parts: [
{
name: 'Provider',
kebab: 'provider',
archetype: 'provider',
kind: 'public',
defaultElement: 'time',
optional: false,
data: [],
aria: []
}
]
} as const satisfies Morfo;

Powered by TurnKey Linux.