Vendor relative-time-element as local web component (#36853)

Replace the `@github/relative-time-element` npm dependency with a
vendored, simplified implementation.

- Support 24h format rendering [PR
329](https://github.com/github/relative-time-element/pull/329)
- Enable `::selection` styling in Firefox [PR
341](https://github.com/github/relative-time-element/pull/341)
- Remove timezone from tooltips (It's always local timezone)
- Clean up previous `title` workaround in tippy
- Remove unused features
- Use native `Intl.DurationFormat` with fallback for older browsers,
remove dead polyfill
- Add MIT license header to vendored file
- Add unit tests
- Add dedicated devtest page for all component variants

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude claude-opus-4-6 20250630 <noreply@anthropic.com>
This commit is contained in:
silverwind
2026-03-13 11:43:17 +01:00
committed by GitHub
parent 2601f50026
commit 28e09ffc67
12 changed files with 734 additions and 73 deletions

8
pnpm-lock.yaml generated
View File

@@ -44,9 +44,6 @@ importers:
'@github/paste-markdown':
specifier: 1.5.3
version: 1.5.3
'@github/relative-time-element':
specifier: 5.0.0
version: 5.0.0
'@github/text-expander-element':
specifier: 2.9.4
version: 2.9.4
@@ -745,9 +742,6 @@ packages:
'@github/paste-markdown@1.5.3':
resolution: {integrity: sha512-PzZ1b3PaqBzYqbT4fwKEhiORf38h2OcGp2+JdXNNM7inZ7egaSmfmhyNkQILpqWfS0AYtRS3CDq6z03eZ8yOMQ==}
'@github/relative-time-element@5.0.0':
resolution: {integrity: sha512-L/2r0DNR/rMbmHWcsdmhtOiy2gESoGOhItNFD4zJ3nZfHl79Dx3N18Vfx/pYr2lruMOdk1cJZb4wEumm+Dxm1w==}
'@github/text-expander-element@2.9.4':
resolution: {integrity: sha512-+zxSlek2r0NrbFmRfymVtYhES9YU033acc/mouXUkN2bs8DaYScPucvBhwg/5d0hsEb2rIykKnkA/2xxWSqCTw==}
@@ -4636,8 +4630,6 @@ snapshots:
'@github/paste-markdown@1.5.3': {}
'@github/relative-time-element@5.0.0': {}
'@github/text-expander-element@2.9.4':
dependencies:
'@github/combobox-nav': 2.3.1