@krizaka/ui 3.63.0 → 3.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-settings.js +1 -1
- package/dist/action-bar.js +4 -4
- package/dist/analysis-report.d.ts +274 -0
- package/dist/analysis-report.js +207 -0
- package/dist/analysis-report.js.map +1 -0
- package/dist/argument-card.d.ts +1 -1
- package/dist/argument-card.js +5 -5
- package/dist/badge.js +4 -34
- package/dist/badge.js.map +1 -1
- package/dist/blocks.css +99 -8
- package/dist/button.js +1 -1
- package/dist/captcha.js +1 -1
- package/dist/chunk-5PFCELGW.js +41 -0
- package/dist/chunk-5PFCELGW.js.map +1 -0
- package/dist/chunk-5RWHDX5J.js +37 -0
- package/dist/chunk-5RWHDX5J.js.map +1 -0
- package/dist/{chunk-5LANVCK7.js → chunk-BG5APGX6.js} +2 -2
- package/dist/{chunk-WOZP3JLW.js → chunk-DJ5ZPPWL.js} +1 -1
- package/dist/chunk-DJ5ZPPWL.js.map +1 -0
- package/dist/{chunk-UV4HBVH7.js → chunk-EB45EVPJ.js} +2 -2
- package/dist/{chunk-SJS6RJIT.js.map → chunk-EB45EVPJ.js.map} +1 -1
- package/dist/{chunk-6EAHUURY.js → chunk-GHAN7OOE.js} +2 -2
- package/dist/chunk-JT7ZKZT5.js +1 -0
- package/dist/chunk-JT7ZKZT5.js.map +1 -0
- package/dist/{chunk-3DHNN5V7.js → chunk-M3GEYLMR.js} +2 -2
- package/dist/{chunk-3DHNN5V7.js.map → chunk-M3GEYLMR.js.map} +1 -1
- package/dist/{chunk-7J2L4HOD.js → chunk-MTVX4RRF.js} +2 -2
- package/dist/{chunk-7J2L4HOD.js.map → chunk-MTVX4RRF.js.map} +1 -1
- package/dist/{chunk-YKEIOYJ5.js → chunk-NPMGYLJV.js} +1 -1
- package/dist/chunk-NPMGYLJV.js.map +1 -0
- package/dist/{chunk-HEKDKM5Y.js → chunk-QVHSV6RA.js} +1 -1
- package/dist/{chunk-7JG3VR4C.js → chunk-RCKXJEDQ.js} +5 -5
- package/dist/chunk-U4XTZMB7.js +103 -0
- package/dist/chunk-U4XTZMB7.js.map +1 -0
- package/dist/{chunk-SJS6RJIT.js → chunk-V7W4RLRW.js} +2 -2
- package/dist/{chunk-UV4HBVH7.js.map → chunk-V7W4RLRW.js.map} +1 -1
- package/dist/command.js +2 -2
- package/dist/confirm-button.js +1 -1
- package/dist/continue-prompt.js +1 -1
- package/dist/continue-prompt.js.map +1 -1
- package/dist/cover-hero.js +1 -1
- package/dist/data-table.js +2 -2
- package/dist/date-picker.d.ts +15 -15
- package/dist/dialog.js +2 -2
- package/dist/embed-facade.d.ts +37 -0
- package/dist/embed-facade.js +96 -0
- package/dist/embed-facade.js.map +1 -0
- package/dist/filter-bar.d.ts +3 -3
- package/dist/force-update-screen.js +1 -1
- package/dist/genui.js +2 -2
- package/dist/kind-config-editor.js +1 -1
- package/dist/language-switch.d.ts +9 -9
- package/dist/link-card.js +2 -2
- package/dist/maintenance-screen.js +1 -1
- package/dist/map.js +6 -0
- package/dist/map.js.map +1 -1
- package/dist/margin-layout.d.ts +71 -0
- package/dist/margin-layout.js +29 -0
- package/dist/margin-layout.js.map +1 -0
- package/dist/match-dialog.js +1 -1
- package/dist/media-grid.js +1 -1
- package/dist/meter.js +2 -1
- package/dist/native/map.js +6 -0
- package/dist/native/map.js.map +1 -1
- package/dist/native.d.ts +88 -2
- package/dist/native.js +1667 -1529
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.js +1 -1
- package/dist/page-DPHDmDAQ.d.ts +131 -0
- package/dist/page-hero.js +4 -4
- package/dist/page.d.ts +7 -125
- package/dist/page.js +13 -1
- package/dist/page.js.map +1 -1
- package/dist/quota-meter.js +2 -1
- package/dist/quota-meter.js.map +1 -1
- package/dist/retro-tv.d.ts +6 -3
- package/dist/retro-tv.js +6 -5
- package/dist/retro-tv.js.map +1 -1
- package/dist/reviews.d.ts +49 -0
- package/dist/reviews.js +66 -0
- package/dist/reviews.js.map +1 -0
- package/dist/separator.d.ts +26 -3
- package/dist/separator.js +19 -1
- package/dist/separator.js.map +1 -1
- package/dist/service-card.d.ts +56 -63
- package/dist/service-card.js +49 -10
- package/dist/service-card.js.map +1 -1
- package/dist/settings-layout.js +1 -1
- package/dist/site-cahier.js +1 -1
- package/dist/specimen-tag.d.ts +15 -3
- package/dist/specimen-tag.js +4 -27
- package/dist/specimen-tag.js.map +1 -1
- package/dist/stat.d.ts +87 -5
- package/dist/stat.js +9 -53
- package/dist/stat.js.map +1 -1
- package/dist/sticky-action.d.ts +7 -2
- package/dist/sticky-action.js +24 -3
- package/dist/sticky-action.js.map +1 -1
- package/dist/theme.js +1 -1
- package/dist/update-prompt.js +1 -1
- package/dist/usage.d.ts +229 -0
- package/dist/usage.js +189 -0
- package/dist/usage.js.map +1 -0
- package/dist/vertical-video.js +1 -1
- package/dist/wall.d.ts +24 -12
- package/dist/wall.js +106 -43
- package/dist/wall.js.map +1 -1
- package/package.json +87 -8
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +1 -1
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/analysis-report.json +445 -0
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-header.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +3 -3
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +2 -2
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/doodle.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +2 -2
- package/registry/embed-facade.json +243 -0
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/analysis-report/document-validation.d.ts +4 -0
- package/registry/examples/analysis-report/document-validation.js +47 -0
- package/registry/examples/analysis-report/document-validation.tsx +29 -0
- package/registry/examples/analysis-report/native/document-validation.d.ts +4 -0
- package/registry/examples/analysis-report/native/document-validation.dark.png +0 -0
- package/registry/examples/analysis-report/native/document-validation.js +48 -0
- package/registry/examples/analysis-report/native/document-validation.light.png +0 -0
- package/registry/examples/analysis-report/native/document-validation.tsx +32 -0
- package/registry/examples/analysis-report/streaming.d.ts +4 -0
- package/registry/examples/analysis-report/streaming.js +42 -0
- package/registry/examples/analysis-report/streaming.tsx +23 -0
- package/registry/examples/embed-facade/tiktok.d.ts +4 -0
- package/registry/examples/embed-facade/tiktok.js +20 -0
- package/registry/examples/embed-facade/tiktok.tsx +16 -0
- package/registry/examples/embed-facade/youtube.d.ts +4 -0
- package/registry/examples/embed-facade/youtube.js +22 -0
- package/registry/examples/embed-facade/youtube.tsx +20 -0
- package/registry/examples/margin-layout/findings.d.ts +4 -0
- package/registry/examples/margin-layout/findings.js +15 -0
- package/registry/examples/margin-layout/findings.tsx +18 -0
- package/registry/examples/margin-layout/steps.d.ts +4 -0
- package/registry/examples/margin-layout/steps.js +15 -0
- package/registry/examples/margin-layout/steps.tsx +16 -0
- package/registry/examples/page/kraft.d.ts +4 -0
- package/registry/examples/page/kraft.js +14 -0
- package/registry/examples/page/kraft.tsx +12 -0
- package/registry/examples/page/papers.d.ts +4 -0
- package/registry/examples/page/papers.js +14 -0
- package/registry/examples/page/papers.tsx +13 -0
- package/registry/examples/retro-tv/facade.d.ts +4 -0
- package/registry/examples/retro-tv/facade.js +12 -0
- package/registry/examples/retro-tv/facade.tsx +13 -0
- package/registry/examples/reviews/card.d.ts +4 -0
- package/registry/examples/reviews/card.js +23 -0
- package/registry/examples/reviews/card.tsx +19 -0
- package/registry/examples/reviews/summary.d.ts +4 -0
- package/registry/examples/reviews/summary.js +23 -0
- package/registry/examples/reviews/summary.tsx +17 -0
- package/registry/examples/separator/hand.d.ts +4 -0
- package/registry/examples/separator/hand.js +19 -0
- package/registry/examples/separator/hand.tsx +16 -0
- package/registry/examples/service-card/index-card.d.ts +4 -0
- package/registry/examples/service-card/index-card.js +15 -0
- package/registry/examples/service-card/index-card.tsx +12 -0
- package/registry/examples/service-card/index-list.d.ts +4 -0
- package/registry/examples/service-card/index-list.js +14 -0
- package/registry/examples/service-card/index-list.tsx +11 -0
- package/registry/examples/specimen-tag/facts.d.ts +4 -0
- package/registry/examples/specimen-tag/facts.js +23 -0
- package/registry/examples/specimen-tag/facts.tsx +18 -0
- package/registry/examples/stat/strip.d.ts +4 -0
- package/registry/examples/stat/strip.js +25 -0
- package/registry/examples/stat/strip.tsx +25 -0
- package/registry/examples/sticky-action/hide-while-visible.d.ts +4 -0
- package/registry/examples/sticky-action/hide-while-visible.js +16 -0
- package/registry/examples/sticky-action/hide-while-visible.tsx +17 -0
- package/registry/examples/usage/credits-page.d.ts +4 -0
- package/registry/examples/usage/credits-page.js +45 -0
- package/registry/examples/usage/credits-page.tsx +40 -0
- package/registry/examples/usage/empty.d.ts +4 -0
- package/registry/examples/usage/empty.js +15 -0
- package/registry/examples/usage/empty.tsx +12 -0
- package/registry/examples/wall/brick.js +1 -1
- package/registry/examples/wall/brick.tsx +1 -1
- package/registry/examples/wall/composition-fr.js +1 -1
- package/registry/examples/wall/composition-fr.tsx +1 -1
- package/registry/examples/wall/composition.js +1 -1
- package/registry/examples/wall/composition.tsx +1 -1
- package/registry/examples/wall/pinned-note.js +2 -2
- package/registry/examples/wall/pinned-note.tsx +3 -2
- package/registry/examples/wall/plaster.js +1 -1
- package/registry/examples/wall/plaster.tsx +1 -1
- package/registry/examples/wall/ridge.js +1 -1
- package/registry/examples/wall/ridge.tsx +1 -1
- package/registry/examples/wall/shop-sign.js +5 -4
- package/registry/examples/wall/shop-sign.tsx +7 -4
- package/registry/examples/wall/zellige.js +1 -1
- package/registry/examples/wall/zellige.tsx +1 -1
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +1 -1
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +184 -17
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/margin-layout.json +200 -0
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +1 -1
- package/registry/media-gallery.json +1 -1
- package/registry/media-grid.json +1 -1
- package/registry/meta-row.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/opening-hours.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +53 -11
- package/registry/pagination.json +1 -1
- package/registry/photo-grid.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/rail-nav.json +2 -2
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +45 -29
- package/registry/reviews.json +361 -0
- package/registry/router.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +71 -6
- package/registry/service-card.json +55 -6
- package/registry/settings-layout.json +1 -1
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +2 -2
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +57 -5
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +61 -9
- package/registry/status-chip.json +1 -1
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +27 -4
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +1 -1
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/text-style.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/usage.json +542 -0
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +3 -3
- package/registry/virtual.json +1 -1
- package/registry/wall.json +128 -40
- package/registry/waveform.json +1 -1
- package/dist/chunk-WOZP3JLW.js.map +0 -1
- package/dist/chunk-YKEIOYJ5.js.map +0 -1
- /package/dist/{chunk-5LANVCK7.js.map → chunk-BG5APGX6.js.map} +0 -0
- /package/dist/{chunk-6EAHUURY.js.map → chunk-GHAN7OOE.js.map} +0 -0
- /package/dist/{chunk-HEKDKM5Y.js.map → chunk-QVHSV6RA.js.map} +0 -0
- /package/dist/{chunk-7JG3VR4C.js.map → chunk-RCKXJEDQ.js.map} +0 -0
package/registry/retro-tv.json
CHANGED
|
@@ -4,12 +4,8 @@
|
|
|
4
4
|
"title": "Retro TV",
|
|
5
5
|
"summary": "A vertical video presented in a detailed television cabinet, with an accessible player, channel label, scanlines and an animated off-state.",
|
|
6
6
|
"description": "A vertical video presented in a detailed television cabinet, with an accessible player, channel label, scanlines and an animated off-state.",
|
|
7
|
-
"status": "
|
|
8
|
-
"deprecated":
|
|
9
|
-
"since": "3.55.0",
|
|
10
|
-
"removedIn": "4.0.0",
|
|
11
|
-
"reason": "No product or site imports it and no filed need names it (ADR-006 audit, 2026-10-25): there is no replacement."
|
|
12
|
-
},
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"deprecated": null,
|
|
13
9
|
"category": "media",
|
|
14
10
|
"platforms": "web",
|
|
15
11
|
"parity": {
|
|
@@ -42,7 +38,8 @@
|
|
|
42
38
|
"bestPractices": [
|
|
43
39
|
"Give the player a title, poster and translated `labels`; pass WebVTT captions as `tracks`.",
|
|
44
40
|
"Keep autoplay muted; it starts only while the player is on screen and waits under reduced motion.",
|
|
45
|
-
"Use `off` for the static screen; the video is not loaded or played in this state."
|
|
41
|
+
"Use `off` for the static screen; the video is not loaded or played in this state.",
|
|
42
|
+
"A platform's short video (TikTok, YouTube Shorts, Instagram) goes in as `children`, an `EmbedFacade`: the television's screen shows the facade, and nothing is requested from the platform before the visitor's click."
|
|
46
43
|
],
|
|
47
44
|
"accessibility": {
|
|
48
45
|
"keyboard": [
|
|
@@ -64,7 +61,8 @@
|
|
|
64
61
|
"related": [
|
|
65
62
|
"video-player",
|
|
66
63
|
"vertical-video",
|
|
67
|
-
"audio-player"
|
|
64
|
+
"audio-player",
|
|
65
|
+
"embed-facade"
|
|
68
66
|
],
|
|
69
67
|
"web": {
|
|
70
68
|
"entry": "@krizaka/ui/retro-tv",
|
|
@@ -74,13 +72,6 @@
|
|
|
74
72
|
"component": "RetroTv",
|
|
75
73
|
"description": "A vertical video presented in an old-school television; the existing player remains fully accessible.",
|
|
76
74
|
"props": [
|
|
77
|
-
{
|
|
78
|
-
"name": "src",
|
|
79
|
-
"type": "string | (() => Promise<string>)",
|
|
80
|
-
"default": null,
|
|
81
|
-
"description": "The address of the video (MP4, WebM, or an HLS `.m3u8`), or a function that resolves a signed one when needed.",
|
|
82
|
-
"required": true
|
|
83
|
-
},
|
|
84
75
|
{
|
|
85
76
|
"name": "title",
|
|
86
77
|
"type": "string",
|
|
@@ -102,6 +93,13 @@
|
|
|
102
93
|
"description": "A short channel label shown on the cabinet, for example `\"CH 3 · Plateau\"`.",
|
|
103
94
|
"required": false
|
|
104
95
|
},
|
|
96
|
+
{
|
|
97
|
+
"name": "children",
|
|
98
|
+
"type": "ReactNode",
|
|
99
|
+
"default": null,
|
|
100
|
+
"description": "What the screen shows instead of the video player: an `EmbedFacade` for a platform's short video.",
|
|
101
|
+
"required": false
|
|
102
|
+
},
|
|
105
103
|
{
|
|
106
104
|
"name": "className",
|
|
107
105
|
"type": "string",
|
|
@@ -221,6 +219,13 @@
|
|
|
221
219
|
"description": "How much to fetch before playback. Default `none` for lazy loading.",
|
|
222
220
|
"required": false
|
|
223
221
|
},
|
|
222
|
+
{
|
|
223
|
+
"name": "src",
|
|
224
|
+
"type": "string | (() => Promise<string>)",
|
|
225
|
+
"default": null,
|
|
226
|
+
"description": "The video's address. Optional when the screen shows `children`.",
|
|
227
|
+
"required": false
|
|
228
|
+
},
|
|
224
229
|
{
|
|
225
230
|
"name": "tracks",
|
|
226
231
|
"type": "readonly VideoTrack[]",
|
|
@@ -261,22 +266,26 @@
|
|
|
261
266
|
"path": "examples/retro-tv/portable.tsx",
|
|
262
267
|
"module": "@krizaka/ui/registry/examples/retro-tv/portable",
|
|
263
268
|
"code": "import { RetroTv } from \"@krizaka/ui/retro-tv\";\n\nexport default function RetroTvPortable() {\n return <div className=\"w-72 max-w-full\"><RetroTv variant=\"portable\" title=\"Film: the world of Krizaka\" src=\"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.aa28980db3.mp4\" poster=\"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-9x16.8133fbbaa5.jpg\" channel=\"CH 3 · Plateau\" /></div>;\n}\n"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"name": "facade",
|
|
272
|
+
"title": "A platform's reel behind a facade",
|
|
273
|
+
"description": "`children`: an `EmbedFacade` on the screen, nothing loaded until the click.",
|
|
274
|
+
"path": "examples/retro-tv/facade.tsx",
|
|
275
|
+
"module": "@krizaka/ui/registry/examples/retro-tv/facade",
|
|
276
|
+
"code": "import { EmbedFacade } from \"@krizaka/ui/embed-facade\";\nimport { RetroTv } from \"@krizaka/ui/retro-tv\";\n\n// The latest reel of a platform on the shop's television: the screen shows the facade, nothing loads before the click.\nexport default function RetroTvFacade() {\n return (\n <div className=\"w-72 max-w-full\">\n <RetroTv title=\"Latest reel\" channel=\"CH 3 · Plateau\">\n <EmbedFacade platform=\"instagram\" url=\"https://www.instagram.com/reel/C1abcDEF123/\" title=\"Latest reel\" playLabel=\"Load Instagram and play\" />\n </RetroTv>\n </div>\n );\n}\n"
|
|
264
277
|
}
|
|
265
278
|
]
|
|
266
279
|
},
|
|
267
280
|
"native": null,
|
|
268
281
|
"files": [
|
|
269
|
-
{
|
|
270
|
-
"path": "deprecated.ts",
|
|
271
|
-
"content": "// The development warning of a deprecated entry (ADR-006 §7, krizaka-ui#674). An entry is deprecated in a minor and\n// removed in the next major; until then it works exactly as before and says so once per page, in development only —\n// never in production, never twice. The same facts live in the entry's `meta.ts` (`status: \"deprecated\"`), which\n// ui.krizaka.com reads for its badge.\n\n/** The release that deprecated the batch. */\nexport const DEPRECATED_SINCE = \"3.55.0\";\n/** The major that removes it. */\nexport const REMOVED_IN = \"4.0.0\";\n\nconst warned = new Set<string>();\n\n/**\n * Warns once per page, in development, that `@krizaka/ui/<entry>` is deprecated. Call it at the top of the entry's\n * components; it costs a `Set` lookup and nothing in production.\n * @param entry the entry's name as imported: `tree-view` for `@krizaka/ui/tree-view`.\n * @param since the release that deprecated it, when it is not this batch's.\n */\nexport function warnDeprecated(entry: string, since: string = DEPRECATED_SINCE): void {\n if (typeof process === \"undefined\" || process.env.NODE_ENV === \"production\" || warned.has(entry)) return;\n warned.add(entry);\n console.warn(\n `@krizaka/ui/${entry} is deprecated since ${since} and is removed in ${REMOVED_IN} (ADR-006): no product uses it. ` +\n `Keep it? Comment on krizaka-ui#674 with the issue that needs it. https://ui.krizaka.com/components/${entry.replace(/^native\\//, \"\")}`,\n );\n}\n\n/** Forgets what was warned (tests only). */\nexport function resetDeprecationWarnings(): void {\n warned.clear();\n}\n"
|
|
272
|
-
},
|
|
273
282
|
{
|
|
274
283
|
"path": "media.ts",
|
|
275
284
|
"content": "// Shared by the data and media primitives (client): the clock format, the reduced-motion preference, the\n// in-view observer, a debounced callback. Never an entry of its own.\nimport * as React from \"react\";\n\n/** Seconds as a clock: `75` → `1:15`, `3725` → `1:02:05`. Negative or unknown values read `0:00`. */\nexport function formatClock(seconds: number): string {\n const s = Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0;\n const h = Math.floor(s / 3600);\n const m = Math.floor((s % 3600) / 60);\n const rest = String(s % 60).padStart(2, \"0\");\n return h > 0 ? `${h}:${String(m).padStart(2, \"0\")}:${rest}` : `${m}:${rest}`;\n}\n\n/** Clamps `value` between `min` and `max`. */\nexport const clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n\nconst REDUCE = \"(prefers-reduced-motion: reduce)\";\nconst subscribeReduce = (notify: () => void) => {\n if (typeof window === \"undefined\" || !window.matchMedia) return () => undefined;\n const query = window.matchMedia(REDUCE);\n query.addEventListener?.(\"change\", notify);\n return () => query.removeEventListener?.(\"change\", notify);\n};\n\n/** `true` when the person asked for less motion (`prefers-reduced-motion: reduce`); follows a change of the setting. */\nexport function usePrefersReducedMotion(): boolean {\n return React.useSyncExternalStore(\n subscribeReduce,\n () => (typeof window !== \"undefined\" && window.matchMedia ? window.matchMedia(REDUCE).matches : false),\n () => false,\n );\n}\n\n/** The latest value of a callback, for an effect or an event that must not re-subscribe when it changes. */\nexport function useLatest<T>(value: T) {\n const ref = React.useRef(value);\n React.useLayoutEffect(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/** Calls `onChange(visible)` when at least `threshold` of the element enters or leaves the viewport. */\nexport function useInView(ref: React.RefObject<Element | null>, onChange: (visible: boolean) => void, enabled = true, threshold = 0.25) {\n const latest = useLatest(onChange);\n React.useEffect(() => {\n const element = ref.current;\n if (!enabled || !element || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(([entry]) => entry && latest.current(entry.isIntersecting), { threshold });\n observer.observe(element);\n return () => observer.disconnect();\n }, [ref, enabled, threshold, latest]);\n}\n\n/** A value controlled by a prop when it is given, held inside otherwise; `set` calls `onChange` either way. */\nexport function useControllable<T>(value: T | undefined, defaultValue: T, onChange?: (next: T) => void) {\n const [inner, setInner] = React.useState(defaultValue);\n const controlled = value !== undefined;\n const current = controlled ? value : inner;\n const set = React.useCallback(\n (next: T) => {\n if (!controlled) setInner(next);\n onChange?.(next);\n },\n [controlled, onChange],\n );\n return [current, set] as const;\n}\n\n/** Starts a media element without an unhandled rejection (autoplay refused, the source replaced meanwhile). */\nexport function playSafely(media: HTMLMediaElement | null | undefined) {\n try {\n const started = media?.play() as Promise<void> | undefined;\n started?.catch?.(() => undefined);\n } catch {\n // Not playable here (no media support): the controls stay as they are.\n }\n}\n"
|
|
276
285
|
},
|
|
277
286
|
{
|
|
278
287
|
"path": "meta.ts",
|
|
279
|
-
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"iso\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"meta-row\"\n | \"waveform\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"media-grid\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"photo-grid\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Orazaka Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"stable\" | \"beta\" | \"deprecated\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
288
|
+
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"iso\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"meta-row\"\n | \"waveform\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"media-grid\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"photo-grid\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Orazaka Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"stable\" | \"beta\" | \"deprecated\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
280
289
|
},
|
|
281
290
|
{
|
|
282
291
|
"path": "retro-tv/index.ts",
|
|
@@ -284,11 +293,11 @@
|
|
|
284
293
|
},
|
|
285
294
|
{
|
|
286
295
|
"path": "retro-tv/meta.ts",
|
|
287
|
-
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Retro TV\",\n summary: \"A vertical video presented in a detailed television cabinet, with an accessible player, channel label, scanlines and an animated off-state.\",\n status: \"
|
|
296
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Retro TV\",\n summary: \"A vertical video presented in a detailed television cabinet, with an accessible player, channel label, scanlines and an animated off-state.\",\n status: \"beta\",\n category: \"media\",\n platforms: \"web\",\n parity: {\n native: { status: \"n/a\", reason: \"The CSS cabinet and SVG static belong to the web presentation; use the native video player for mobile playback.\", use: \"video-player\" },\n desktop: \"web\",\n },\n whenToUse: [\n \"To give a shop's latest reel or story a place on its wall, while keeping the video itself the focus.\",\n \"For a vertical clip whose presentation should feel like a television, in either cabinet or portable style.\",\n ],\n whenNotToUse: [\n { when: \"For video without a decorative television frame: use the accessible video player.\", use: \"video-player\" },\n { when: \"For a feed of creator clips with an action rail and caption: use vertical video.\", use: \"vertical-video\" },\n ],\n bestPractices: [\n \"Give the player a title, poster and translated `labels`; pass WebVTT captions as `tracks`.\",\n \"Keep autoplay muted; it starts only while the player is on screen and waits under reduced motion.\",\n \"Use `off` for the static screen; the video is not loaded or played in this state.\",\n \"A platform's short video (TikTok, YouTube Shorts, Instagram) goes in as `children`, an `EmbedFacade`: the television's screen shows the facade, and nothing is requested from the platform before the visitor's click.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Space / K\", action: \"Play or pause the focused video.\" },\n { keys: \"Tab\", action: \"Move through the player's named controls.\" },\n ],\n notes: [\n \"The cabinet, scanlines and static are decorative; the embedded video player keeps its named region and keyboard-accessible controls.\",\n \"The focus ring remains visible around the screen, and the channel name is visible text.\",\n \"Under reduced motion the power-on and static effects stop, and autoplay waits for a gesture.\",\n ],\n },\n related: [\"video-player\", \"vertical-video\", \"audio-player\", \"embed-facade\"],\n web: {\n imports: [\"RetroTv\"],\n examples: [\n { name: \"cabinet\", title: \"Wood cabinet\", description: \"A vertical shop story in the cabinet television, with its channel label and player controls.\" },\n { name: \"portable\", title: \"Portable set\", description: \"The same vertical story in a compact cream television cabinet.\" },\n { name: \"facade\", title: \"A platform's reel behind a facade\", description: \"`children`: an `EmbedFacade` on the screen, nothing loaded until the click.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
288
297
|
},
|
|
289
298
|
{
|
|
290
299
|
"path": "retro-tv/retro-tv.tsx",
|
|
291
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { warnDeprecated } from \"../deprecated\";\nimport { useInView, usePrefersReducedMotion } from \"../media\";\nimport { VideoPlayer, type VideoPlayerProps } from \"../video-player/video-player\";\n\nconst styles = `\n.kz-rtv{position:relative;isolation:isolate;width:100%;aspect-ratio:4/5;max-width:100%;color:var(--kz-text-primary)}\n.kz-rtv-cabinet{position:absolute;inset:0;overflow:hidden}\n.kz-rtv-body{position:absolute;inset:4% 4% 16%;border:1px solid var(--kz-border-strong);border-radius:8% / 6%;background:linear-gradient(145deg,var(--kz-surface-sheen),transparent 35%),linear-gradient(145deg,color-mix(in srgb,var(--kz-warning) 18%,var(--kz-surface-3)),color-mix(in srgb,var(--kz-warning-text) 10%,var(--kz-surface-2)) 48%,var(--kz-surface-1));box-shadow:inset 0 1px 0 var(--kz-surface-sheen),inset 0 -3px 6px color-mix(in srgb,var(--kz-scrim-strong) 30%,transparent),0 1.2rem 2rem color-mix(in srgb,var(--kz-scrim-strong) 24%,transparent)}\n.kz-rtv[data-variant=portable] .kz-rtv-body{border-radius:12% / 8%;background:linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-2) 55%,var(--kz-surface-3))}\n.kz-rtv-body:after{position:absolute;inset:0;border-radius:inherit;background:repeating-linear-gradient(115deg,transparent 0 7px,color-mix(in srgb,var(--kz-border-subtle) 35%,transparent) 8px 9px);content:\"\";opacity:.4;pointer-events:none}\n.kz-rtv-bezel{position:absolute;top:0;bottom:0;left:6%;width:61%;border:1px solid var(--kz-border-strong);border-radius:14% / 7%;background:linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-3));box-shadow:inset 0 2px 5px color-mix(in srgb,var(--kz-scrim-strong) 35%,transparent),0 1px 2px color-mix(in srgb,var(--kz-surface-sheen) 60%,transparent)}\n.kz-rtv[data-variant=portable] .kz-rtv-bezel{border-radius:19% / 9%;background:linear-gradient(145deg,var(--kz-surface-0),var(--kz-surface-2))}\n.kz-rtv-controls{position:absolute;top:16%;right:7%;display:flex;width:23%;flex-direction:column;align-items:center;gap:1.1rem}\n.kz-rtv-knob{position:relative;display:block;width:2.3rem;max-width:70%;aspect-ratio:1;border:2px solid var(--kz-border-strong);border-radius:50%;background:radial-gradient(circle at 35% 28%,var(--kz-surface-sheen),transparent 30%),linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-3));box-shadow:inset 0 -2px 3px color-mix(in srgb,var(--kz-scrim-strong) 35%,transparent),0 2px 4px color-mix(in srgb,var(--kz-scrim-strong) 25%,transparent);color:var(--kz-accent)}\n.kz-rtv-knob[data-hue=accent]{background:radial-gradient(circle at 35% 28%,var(--kz-surface-sheen),transparent 30%),linear-gradient(145deg,var(--kz-accent-text),var(--kz-accent))}\n.kz-rtv-knob:after{position:absolute;top:14%;left:calc(50% - 1px);width:2px;height:27%;border-radius:2px;background:var(--kz-on-accent);content:\"\"}\n.kz-rtv[data-variant=portable] .kz-rtv-knob{width:1.9rem}\n.kz-rtv-speaker{position:absolute;right:7%;bottom:9%;display:flex;width:23%;flex-direction:column;gap:3px}\n.kz-rtv-speaker i{height:2px;border-radius:2px;background:var(--kz-border-strong);box-shadow:0 1px 0 var(--kz-surface-sheen)}\n.kz-rtv[data-variant=portable] .kz-rtv-speaker{display:none}\n.kz-rtv-stand{position:absolute;bottom:4%;left:36%;width:28%;height:12%;border-bottom:1px solid var(--kz-border-strong);border-radius:0 0 30% 30%;background:linear-gradient(180deg,var(--kz-surface-2),var(--kz-surface-3));clip-path:polygon(25% 0,75% 0,88% 78%,100% 100%,0 100%,12% 78%)}\n.kz-rtv[data-variant=portable] .kz-rtv-stand{left:40%;width:20%;height:8%;border-radius:50%;clip-path:ellipse(50% 50% at 50% 50%)}\n.kz-rtv-screen{position:absolute;top:4%;left:9.5%;width:56%;height:80%;overflow:hidden;border:2px solid color-mix(in srgb,var(--kz-border-strong) 72%,var(--kz-accent));border-radius:13% / 7%;background:var(--kz-scrim-strong);box-shadow:0 0 1.1rem color-mix(in srgb,var(--kz-accent) 30%,transparent),inset 0 0 1.2rem var(--kz-scrim-strong)}\n.kz-rtv[data-variant=portable] .kz-rtv-screen{border-radius:18% / 9%}\n.kz-rtv-screen .kz-rtv-player{height:100%;width:100%;border-radius:inherit}\n.kz-rtv-player video,.kz-rtv-player img{object-fit:cover}\n.kz-rtv-effects{position:absolute;z-index:5;inset:0;overflow:hidden;border-radius:inherit;pointer-events:none}\n.kz-rtv-effects:before{position:absolute;inset:0;background:repeating-linear-gradient(to bottom,transparent 0 3px,color-mix(in srgb,var(--kz-scrim-strong) 25%,transparent) 4px 5px);content:\"\";opacity:.46}\n.kz-rtv-effects:after{position:absolute;inset:-1px;background:radial-gradient(ellipse at center,transparent 55%,var(--kz-scrim-strong) 100%);content:\"\";opacity:.52}\n.kz-rtv-glow{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 45%,color-mix(in srgb,var(--kz-accent) 14%,transparent),transparent 68%);opacity:.7}\n.kz-rtv-noise{position:absolute;inset:0;height:100%;width:100%;opacity:.55;filter:contrast(1.3) brightness(.85)}\n.kz-rtv-glass{position:absolute;inset:0;height:100%;width:100%;opacity:.28}\n.kz-rtv-power{position:absolute;inset:0;background:var(--kz-text-on-media);opacity:0;transform:scaleY(.01);transform-origin:center;pointer-events:none}\n.kz-rtv[data-powered=true] .kz-rtv-power{animation:kz-rtv-power .65s ease-out both}\n.kz-rtv-channel{position:absolute;z-index:7;top:9%;right:5%;width:28%;overflow:hidden;color:var(--kz-text-primary);font:600 clamp(.42rem,1.2vw,.55rem)/1.2 var(--kz-font-mono,monospace);text-align:center;text-overflow:ellipsis;white-space:nowrap}\n.kz-rtv[data-variant=portable] .kz-rtv-channel{top:7%}\n.kz-rtv:focus-within .kz-rtv-screen{outline:2px solid var(--kz-ring);outline-offset:3px}\n@keyframes kz-rtv-power{0%{opacity:1;transform:scaleY(.01)}45%{opacity:.9;transform:scaleY(1)}100%{opacity:0;transform:scaleY(1)}}\n@keyframes kz-rtv-noise{0%,100%{opacity:.38}50%{opacity:.62}}\n@media (prefers-reduced-motion:no-preference){.kz-rtv[data-off=true] .kz-rtv-noise{animation:kz-rtv-noise .18s steps(2,end) infinite}}\n@media (prefers-reduced-motion:reduce){.kz-rtv-power{display:none!important}.kz-rtv-noise{animation:none!important}}\n`;\n\n/** A vertical video in a CSS-and-SVG television cabinet. */\nexport interface RetroTvProps extends Omit<VideoPlayerProps, \"aspectRatio\" | \"autoPlay\" | \"className\" | \"loop\" | \"muted\" | \"preload\"> {\n /** The cabinet style. */\n variant?: \"cabinet\" | \"portable\";\n /** A short channel label shown on the cabinet, for example `\"CH 3 · Plateau\"`. */\n channel?: string;\n /** Shows animated static instead of loading or playing the video. */\n off?: boolean;\n /** Starts muted and plays only while on screen; reduced motion waits for a gesture. Default `true`. */\n autoPlay?: boolean;\n /** Starts the player muted. Default `true`. */\n muted?: boolean;\n /** Plays the video again from the start when it ends. Default `true`. */\n loop?: boolean;\n /** How much to fetch before playback. Default `none` for lazy loading. */\n preload?: VideoPlayerProps[\"preload\"];\n /** Additional classes on the television frame. */\n className?: string;\n}\n\n/**\n * A vertical video presented in an old-school television; the existing player remains fully accessible.\n * @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.\n */\nexport function RetroTv({\n variant = \"cabinet\",\n channel,\n off = false,\n autoPlay = true,\n muted = true,\n loop = true,\n preload = \"none\",\n className,\n ...playerProps\n}: RetroTvProps) {\n warnDeprecated(\"retro-tv\");\n const root = React.useRef<HTMLDivElement>(null);\n const [powered, setPowered] = React.useState(false);\n const reducedMotion = usePrefersReducedMotion();\n const uid = React.useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const noiseId = `${uid}-noise`;\n const glassId = `${uid}-glass`;\n const shineId = `${uid}-shine`;\n\n useInView(root, setPowered);\n\n return (\n <div ref={root} className={[\"kz-rtv\", className].filter(Boolean).join(\" \")} data-variant={variant} data-powered={powered && !reducedMotion ? \"true\" : undefined} data-off={off ? \"true\" : undefined}>\n <style>{styles}</style>\n <div className=\"kz-rtv-cabinet\" aria-hidden=\"true\">\n <div className=\"kz-rtv-body\">\n <div className=\"kz-rtv-bezel\" />\n <div className=\"kz-rtv-controls\">\n <span className=\"kz-rtv-knob\" data-hue=\"accent\" />\n <span className=\"kz-rtv-knob\" data-hue=\"accent\" />\n </div>\n <div className=\"kz-rtv-speaker\">{Array.from({ length: 7 }, (_, index) => <i key={index} />)}</div>\n </div>\n <div className=\"kz-rtv-stand\" />\n </div>\n {channel && <span className=\"kz-rtv-channel\">{channel}</span>}\n <div className=\"kz-rtv-screen\">\n {off ? (\n <svg className=\"kz-rtv-noise\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\n <filter id={noiseId}><feTurbulence type=\"fractalNoise\" baseFrequency=\".85\" numOctaves=\"2\" stitchTiles=\"stitch\" /><feColorMatrix type=\"saturate\" values=\"0\" /></filter>\n <rect width=\"100%\" height=\"100%\" filter={`url(#${noiseId})`} />\n </svg>\n ) : (\n <VideoPlayer {...playerProps} className=\"kz-rtv-player\" aspectRatio=\"9 / 16\" autoPlay={autoPlay} muted={muted} loop={loop} preload={preload} />\n )}\n <div className=\"kz-rtv-effects\" aria-hidden=\"true\">\n <svg className=\"kz-rtv-glass\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\">\n <defs>\n <radialGradient id={shineId} cx=\"50%\" cy=\"42%\" r=\"68%\">\n <stop offset=\"0\" stopColor=\"var(--kz-surface-sheen)\" stopOpacity=\".12\" />\n <stop offset=\"1\" stopColor=\"var(--kz-scrim-strong)\" stopOpacity=\".2\" />\n </radialGradient>\n <filter id={glassId}>\n <feTurbulence baseFrequency=\".01 .04\" numOctaves=\"1\" seed=\"2\" result=\"curve\" />\n <feDisplacementMap in=\"SourceGraphic\" in2=\"curve\" scale=\"1.2\" xChannelSelector=\"R\" yChannelSelector=\"G\" />\n </filter>\n </defs>\n <rect width=\"100\" height=\"100\" fill={`url(#${shineId})`} filter={`url(#${glassId})`} />\n </svg>\n <span className=\"kz-rtv-glow\" />\n <span className=\"kz-rtv-power\" />\n </div>\n </div>\n {off && <span className=\"sr-only\">{playerProps.title}</span>}\n </div>\n );\n}\n"
|
|
300
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { useInView, usePrefersReducedMotion } from \"../media\";\nimport { VideoPlayer, type VideoPlayerProps } from \"../video-player/video-player\";\n\nconst styles = `\n.kz-rtv{position:relative;isolation:isolate;width:100%;aspect-ratio:4/5;max-width:100%;color:var(--kz-text-primary)}\n.kz-rtv-cabinet{position:absolute;inset:0;overflow:hidden}\n.kz-rtv-body{position:absolute;inset:4% 4% 16%;border:1px solid var(--kz-border-strong);border-radius:8% / 6%;background:linear-gradient(145deg,var(--kz-surface-sheen),transparent 35%),linear-gradient(145deg,color-mix(in srgb,var(--kz-warning) 18%,var(--kz-surface-3)),color-mix(in srgb,var(--kz-warning-text) 10%,var(--kz-surface-2)) 48%,var(--kz-surface-1));box-shadow:inset 0 1px 0 var(--kz-surface-sheen),inset 0 -3px 6px color-mix(in srgb,var(--kz-scrim-strong) 30%,transparent),0 1.2rem 2rem color-mix(in srgb,var(--kz-scrim-strong) 24%,transparent)}\n.kz-rtv[data-variant=portable] .kz-rtv-body{border-radius:12% / 8%;background:linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-2) 55%,var(--kz-surface-3))}\n.kz-rtv-body:after{position:absolute;inset:0;border-radius:inherit;background:repeating-linear-gradient(115deg,transparent 0 7px,color-mix(in srgb,var(--kz-border-subtle) 35%,transparent) 8px 9px);content:\"\";opacity:.4;pointer-events:none}\n.kz-rtv-bezel{position:absolute;top:0;bottom:0;left:6%;width:61%;border:1px solid var(--kz-border-strong);border-radius:14% / 7%;background:linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-3));box-shadow:inset 0 2px 5px color-mix(in srgb,var(--kz-scrim-strong) 35%,transparent),0 1px 2px color-mix(in srgb,var(--kz-surface-sheen) 60%,transparent)}\n.kz-rtv[data-variant=portable] .kz-rtv-bezel{border-radius:19% / 9%;background:linear-gradient(145deg,var(--kz-surface-0),var(--kz-surface-2))}\n.kz-rtv-controls{position:absolute;top:16%;right:7%;display:flex;width:23%;flex-direction:column;align-items:center;gap:1.1rem}\n.kz-rtv-knob{position:relative;display:block;width:2.3rem;max-width:70%;aspect-ratio:1;border:2px solid var(--kz-border-strong);border-radius:50%;background:radial-gradient(circle at 35% 28%,var(--kz-surface-sheen),transparent 30%),linear-gradient(145deg,var(--kz-surface-1),var(--kz-surface-3));box-shadow:inset 0 -2px 3px color-mix(in srgb,var(--kz-scrim-strong) 35%,transparent),0 2px 4px color-mix(in srgb,var(--kz-scrim-strong) 25%,transparent);color:var(--kz-accent)}\n.kz-rtv-knob[data-hue=accent]{background:radial-gradient(circle at 35% 28%,var(--kz-surface-sheen),transparent 30%),linear-gradient(145deg,var(--kz-accent-text),var(--kz-accent))}\n.kz-rtv-knob:after{position:absolute;top:14%;left:calc(50% - 1px);width:2px;height:27%;border-radius:2px;background:var(--kz-on-accent);content:\"\"}\n.kz-rtv[data-variant=portable] .kz-rtv-knob{width:1.9rem}\n.kz-rtv-speaker{position:absolute;right:7%;bottom:9%;display:flex;width:23%;flex-direction:column;gap:3px}\n.kz-rtv-speaker i{height:2px;border-radius:2px;background:var(--kz-border-strong);box-shadow:0 1px 0 var(--kz-surface-sheen)}\n.kz-rtv[data-variant=portable] .kz-rtv-speaker{display:none}\n.kz-rtv-stand{position:absolute;bottom:4%;left:36%;width:28%;height:12%;border-bottom:1px solid var(--kz-border-strong);border-radius:0 0 30% 30%;background:linear-gradient(180deg,var(--kz-surface-2),var(--kz-surface-3));clip-path:polygon(25% 0,75% 0,88% 78%,100% 100%,0 100%,12% 78%)}\n.kz-rtv[data-variant=portable] .kz-rtv-stand{left:40%;width:20%;height:8%;border-radius:50%;clip-path:ellipse(50% 50% at 50% 50%)}\n.kz-rtv-screen{position:absolute;top:4%;left:9.5%;width:56%;height:80%;overflow:hidden;border:2px solid color-mix(in srgb,var(--kz-border-strong) 72%,var(--kz-accent));border-radius:13% / 7%;background:var(--kz-scrim-strong);box-shadow:0 0 1.1rem color-mix(in srgb,var(--kz-accent) 30%,transparent),inset 0 0 1.2rem var(--kz-scrim-strong)}\n.kz-rtv[data-variant=portable] .kz-rtv-screen{border-radius:18% / 9%}\n.kz-rtv-screen .kz-rtv-player{height:100%;width:100%;border-radius:inherit}\n.kz-rtv-screen .kz-embed{height:100%;width:100%;aspect-ratio:auto;border-radius:inherit}\n.kz-rtv-player video,.kz-rtv-player img{object-fit:cover}\n.kz-rtv-effects{position:absolute;z-index:5;inset:0;overflow:hidden;border-radius:inherit;pointer-events:none}\n.kz-rtv-effects:before{position:absolute;inset:0;background:repeating-linear-gradient(to bottom,transparent 0 3px,color-mix(in srgb,var(--kz-scrim-strong) 25%,transparent) 4px 5px);content:\"\";opacity:.46}\n.kz-rtv-effects:after{position:absolute;inset:-1px;background:radial-gradient(ellipse at center,transparent 55%,var(--kz-scrim-strong) 100%);content:\"\";opacity:.52}\n.kz-rtv-glow{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 45%,color-mix(in srgb,var(--kz-accent) 14%,transparent),transparent 68%);opacity:.7}\n.kz-rtv-noise{position:absolute;inset:0;height:100%;width:100%;opacity:.55;filter:contrast(1.3) brightness(.85)}\n.kz-rtv-glass{position:absolute;inset:0;height:100%;width:100%;opacity:.28}\n.kz-rtv-power{position:absolute;inset:0;background:var(--kz-text-on-media);opacity:0;transform:scaleY(.01);transform-origin:center;pointer-events:none}\n.kz-rtv[data-powered=true] .kz-rtv-power{animation:kz-rtv-power .65s ease-out both}\n.kz-rtv-channel{position:absolute;z-index:7;top:9%;right:5%;width:28%;overflow:hidden;color:var(--kz-text-primary);font:600 clamp(.42rem,1.2vw,.55rem)/1.2 var(--kz-font-mono,monospace);text-align:center;text-overflow:ellipsis;white-space:nowrap}\n.kz-rtv[data-variant=portable] .kz-rtv-channel{top:7%}\n.kz-rtv:focus-within .kz-rtv-screen{outline:2px solid var(--kz-ring);outline-offset:3px}\n@keyframes kz-rtv-power{0%{opacity:1;transform:scaleY(.01)}45%{opacity:.9;transform:scaleY(1)}100%{opacity:0;transform:scaleY(1)}}\n@keyframes kz-rtv-noise{0%,100%{opacity:.38}50%{opacity:.62}}\n@media (prefers-reduced-motion:no-preference){.kz-rtv[data-off=true] .kz-rtv-noise{animation:kz-rtv-noise .18s steps(2,end) infinite}}\n@media (prefers-reduced-motion:reduce){.kz-rtv-power{display:none!important}.kz-rtv-noise{animation:none!important}}\n`;\n\n/** A vertical video in a CSS-and-SVG television cabinet. */\nexport interface RetroTvProps extends Omit<VideoPlayerProps, \"aspectRatio\" | \"autoPlay\" | \"className\" | \"loop\" | \"muted\" | \"preload\" | \"src\"> {\n /** The video's address. Optional when the screen shows `children`. */\n src?: VideoPlayerProps[\"src\"];\n /** What the screen shows instead of the video player: an `EmbedFacade` for a platform's short video. */\n children?: React.ReactNode;\n /** The cabinet style. */\n variant?: \"cabinet\" | \"portable\";\n /** A short channel label shown on the cabinet, for example `\"CH 3 · Plateau\"`. */\n channel?: string;\n /** Shows animated static instead of loading or playing the video. */\n off?: boolean;\n /** Starts muted and plays only while on screen; reduced motion waits for a gesture. Default `true`. */\n autoPlay?: boolean;\n /** Starts the player muted. Default `true`. */\n muted?: boolean;\n /** Plays the video again from the start when it ends. Default `true`. */\n loop?: boolean;\n /** How much to fetch before playback. Default `none` for lazy loading. */\n preload?: VideoPlayerProps[\"preload\"];\n /** Additional classes on the television frame. */\n className?: string;\n}\n\n/**\n * A vertical video presented in an old-school television; the existing player remains fully accessible.\n */\nexport function RetroTv({\n variant = \"cabinet\",\n channel,\n off = false,\n autoPlay = true,\n muted = true,\n loop = true,\n preload = \"none\",\n className,\n children,\n src,\n ...playerProps\n}: RetroTvProps) {\n const root = React.useRef<HTMLDivElement>(null);\n const [powered, setPowered] = React.useState(false);\n const reducedMotion = usePrefersReducedMotion();\n const uid = React.useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const noiseId = `${uid}-noise`;\n const glassId = `${uid}-glass`;\n const shineId = `${uid}-shine`;\n\n useInView(root, setPowered);\n const player = src ? <VideoPlayer {...playerProps} src={src} className=\"kz-rtv-player\" aspectRatio=\"9 / 16\" autoPlay={autoPlay} muted={muted} loop={loop} preload={preload} /> : null;\n const screen = children ?? player;\n\n return (\n <div ref={root} className={[\"kz-rtv\", className].filter(Boolean).join(\" \")} data-variant={variant} data-powered={powered && !reducedMotion ? \"true\" : undefined} data-off={off ? \"true\" : undefined}>\n <style>{styles}</style>\n <div className=\"kz-rtv-cabinet\" aria-hidden=\"true\">\n <div className=\"kz-rtv-body\">\n <div className=\"kz-rtv-bezel\" />\n <div className=\"kz-rtv-controls\">\n <span className=\"kz-rtv-knob\" data-hue=\"accent\" />\n <span className=\"kz-rtv-knob\" data-hue=\"accent\" />\n </div>\n <div className=\"kz-rtv-speaker\">{Array.from({ length: 7 }, (_, index) => <i key={index} />)}</div>\n </div>\n <div className=\"kz-rtv-stand\" />\n </div>\n {channel && <span className=\"kz-rtv-channel\">{channel}</span>}\n <div className=\"kz-rtv-screen\">\n {off ? (\n <svg className=\"kz-rtv-noise\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\n <filter id={noiseId}><feTurbulence type=\"fractalNoise\" baseFrequency=\".85\" numOctaves=\"2\" stitchTiles=\"stitch\" /><feColorMatrix type=\"saturate\" values=\"0\" /></filter>\n <rect width=\"100%\" height=\"100%\" filter={`url(#${noiseId})`} />\n </svg>\n ) : (\n screen\n )}\n <div className=\"kz-rtv-effects\" aria-hidden=\"true\">\n <svg className=\"kz-rtv-glass\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\">\n <defs>\n <radialGradient id={shineId} cx=\"50%\" cy=\"42%\" r=\"68%\">\n <stop offset=\"0\" stopColor=\"var(--kz-surface-sheen)\" stopOpacity=\".12\" />\n <stop offset=\"1\" stopColor=\"var(--kz-scrim-strong)\" stopOpacity=\".2\" />\n </radialGradient>\n <filter id={glassId}>\n <feTurbulence baseFrequency=\".01 .04\" numOctaves=\"1\" seed=\"2\" result=\"curve\" />\n <feDisplacementMap in=\"SourceGraphic\" in2=\"curve\" scale=\"1.2\" xChannelSelector=\"R\" yChannelSelector=\"G\" />\n </filter>\n </defs>\n <rect width=\"100\" height=\"100\" fill={`url(#${shineId})`} filter={`url(#${glassId})`} />\n </svg>\n <span className=\"kz-rtv-glow\" />\n <span className=\"kz-rtv-power\" />\n </div>\n </div>\n {off && <span className=\"sr-only\">{playerProps.title}</span>}\n </div>\n );\n}\n"
|
|
292
301
|
}
|
|
293
302
|
],
|
|
294
303
|
"dependencies": [],
|
|
@@ -304,13 +313,6 @@
|
|
|
304
313
|
"component": "RetroTv",
|
|
305
314
|
"description": "A vertical video presented in an old-school television; the existing player remains fully accessible.",
|
|
306
315
|
"props": [
|
|
307
|
-
{
|
|
308
|
-
"name": "src",
|
|
309
|
-
"type": "string | (() => Promise<string>)",
|
|
310
|
-
"default": null,
|
|
311
|
-
"description": "The address of the video (MP4, WebM, or an HLS `.m3u8`), or a function that resolves a signed one when needed.",
|
|
312
|
-
"required": true
|
|
313
|
-
},
|
|
314
316
|
{
|
|
315
317
|
"name": "title",
|
|
316
318
|
"type": "string",
|
|
@@ -332,6 +334,13 @@
|
|
|
332
334
|
"description": "A short channel label shown on the cabinet, for example `\"CH 3 · Plateau\"`.",
|
|
333
335
|
"required": false
|
|
334
336
|
},
|
|
337
|
+
{
|
|
338
|
+
"name": "children",
|
|
339
|
+
"type": "ReactNode",
|
|
340
|
+
"default": null,
|
|
341
|
+
"description": "What the screen shows instead of the video player: an `EmbedFacade` for a platform's short video.",
|
|
342
|
+
"required": false
|
|
343
|
+
},
|
|
335
344
|
{
|
|
336
345
|
"name": "className",
|
|
337
346
|
"type": "string",
|
|
@@ -451,6 +460,13 @@
|
|
|
451
460
|
"description": "How much to fetch before playback. Default `none` for lazy loading.",
|
|
452
461
|
"required": false
|
|
453
462
|
},
|
|
463
|
+
{
|
|
464
|
+
"name": "src",
|
|
465
|
+
"type": "string | (() => Promise<string>)",
|
|
466
|
+
"default": null,
|
|
467
|
+
"description": "The video's address. Optional when the screen shows `children`.",
|
|
468
|
+
"required": false
|
|
469
|
+
},
|
|
454
470
|
{
|
|
455
471
|
"name": "tracks",
|
|
456
472
|
"type": "readonly VideoTrack[]",
|