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.
29 lines
767 B
29 lines
767 B
|
5 months ago
|
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: ['eidos'],
|
||
|
|
parts: [
|
||
|
|
{
|
||
|
|
name: 'Provider',
|
||
|
|
kebab: 'provider',
|
||
|
|
archetype: 'provider',
|
||
|
|
kind: 'public',
|
||
|
|
defaultElement: 'time',
|
||
|
|
optional: false,
|
||
|
|
data: [],
|
||
|
|
aria: []
|
||
|
|
}
|
||
|
|
]
|
||
|
|
} as const satisfies Morfo;
|