@krizaka/ui 2.5.0 → 2.6.0
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/README.md +44 -1
- package/dist/action-bar.d.ts +38 -0
- package/dist/action-bar.js +52 -0
- package/dist/action-bar.js.map +1 -0
- package/dist/argument-card.d.ts +67 -0
- package/dist/argument-card.js +69 -0
- package/dist/argument-card.js.map +1 -0
- package/dist/audio-player.js +1 -1
- package/dist/block-link-BAg4eoZk.d.ts +12 -0
- package/dist/blocks.css +529 -0
- package/dist/button.js +5 -94
- package/dist/button.js.map +1 -1
- package/dist/card-grid.d.ts +42 -0
- package/dist/card-grid.js +47 -0
- package/dist/card-grid.js.map +1 -0
- package/dist/chunk-2AGSO3WH.js +20 -0
- package/dist/chunk-2AGSO3WH.js.map +1 -0
- package/dist/chunk-AB5D3KBG.js +37 -0
- package/dist/chunk-AB5D3KBG.js.map +1 -0
- package/dist/{chunk-YX6CNVJA.js → chunk-CPA5CF35.js} +1 -1
- package/dist/chunk-CPA5CF35.js.map +1 -0
- package/dist/chunk-K3SWZXYT.js +92 -0
- package/dist/chunk-K3SWZXYT.js.map +1 -0
- package/dist/{chunk-XUMJA5ZI.js → chunk-X6TW3X6Y.js} +2 -2
- package/dist/chunk-XCBVFMNV.js +41 -0
- package/dist/{chunk-YX6CNVJA.js.map → chunk-XCBVFMNV.js.map} +1 -1
- package/dist/chunk-XVLWVTQA.js +28 -0
- package/dist/chunk-XVLWVTQA.js.map +1 -0
- package/dist/chunk-Z6FUPB3Q.js +102 -0
- package/dist/chunk-Z6FUPB3Q.js.map +1 -0
- package/dist/code-block.d.ts +42 -0
- package/dist/code-block.js +202 -0
- package/dist/code-block.js.map +1 -0
- package/dist/combobox.js +2 -2
- package/dist/cta-panel.d.ts +23 -0
- package/dist/cta-panel.js +20 -0
- package/dist/cta-panel.js.map +1 -0
- package/dist/data-table.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/decision-list.d.ts +34 -0
- package/dist/decision-list.js +67 -0
- package/dist/decision-list.js.map +1 -0
- package/dist/file-upload.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/link-card.d.ts +35 -0
- package/dist/link-card.js +46 -0
- package/dist/link-card.js.map +1 -0
- package/dist/mascot-quote.d.ts +42 -0
- package/dist/mascot-quote.js +267 -0
- package/dist/mascot-quote.js.map +1 -0
- package/dist/media-capture.js +1 -1
- package/dist/motion.css +25 -1
- package/dist/page-hero.d.ts +44 -0
- package/dist/page-hero.js +41 -0
- package/dist/page-hero.js.map +1 -0
- package/dist/page.d.ts +116 -0
- package/dist/page.js +17 -0
- package/dist/page.js.map +1 -0
- package/dist/pagination.js +25 -44
- package/dist/pagination.js.map +1 -1
- package/dist/pointer-light.d.ts +20 -0
- package/dist/pointer-light.js +12 -0
- package/dist/pointer-light.js.map +1 -0
- package/dist/search-field.js +1 -1
- package/dist/section-backdrop.js +4 -22
- package/dist/section-backdrop.js.map +1 -1
- package/dist/tag-input.js +2 -2
- package/dist/terminal-replay.d.ts +68 -0
- package/dist/terminal-replay.js +231 -0
- package/dist/terminal-replay.js.map +1 -0
- package/dist/toc.d.ts +23 -0
- package/dist/toc.js +39 -0
- package/dist/toc.js.map +1 -0
- package/dist/video-player.js +1 -1
- package/package.json +192 -7
- package/registry/action-bar.json +205 -0
- package/registry/alert.json +1 -1
- package/registry/argument-card.json +327 -0
- package/registry/audio-player.json +2 -2
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/button.json +5 -5
- package/registry/card-grid.json +221 -0
- package/registry/card.json +3 -3
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/code-block.json +262 -0
- package/registry/combobox.json +2 -2
- package/registry/command.json +1 -1
- package/registry/confirm-button.json +3 -3
- package/registry/countdown.json +1 -1
- package/registry/cta-panel.json +154 -0
- package/registry/data-table.json +2 -2
- package/registry/date-picker.json +2 -2
- package/registry/decision-list.json +144 -0
- package/registry/dialog.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/examples/action-bar/buttons.d.ts +4 -0
- package/registry/examples/action-bar/buttons.js +22 -0
- package/registry/examples/action-bar/buttons.tsx +17 -0
- package/registry/examples/action-bar/icons.d.ts +4 -0
- package/registry/examples/action-bar/icons.js +24 -0
- package/registry/examples/action-bar/icons.tsx +23 -0
- package/registry/examples/argument-card/building-block.d.ts +4 -0
- package/registry/examples/argument-card/building-block.js +29 -0
- package/registry/examples/argument-card/building-block.tsx +29 -0
- package/registry/examples/argument-card/grid.d.ts +4 -0
- package/registry/examples/argument-card/grid.js +17 -0
- package/registry/examples/argument-card/grid.tsx +19 -0
- package/registry/examples/argument-card/unfold.d.ts +4 -0
- package/registry/examples/argument-card/unfold.js +26 -0
- package/registry/examples/argument-card/unfold.tsx +21 -0
- package/registry/examples/card-grid/products.d.ts +4 -0
- package/registry/examples/card-grid/products.js +16 -0
- package/registry/examples/card-grid/products.tsx +13 -0
- package/registry/examples/card-grid/reveal.d.ts +4 -0
- package/registry/examples/card-grid/reveal.js +13 -0
- package/registry/examples/card-grid/reveal.tsx +16 -0
- package/registry/examples/code-block/build-tools.d.ts +4 -0
- package/registry/examples/code-block/build-tools.js +30 -0
- package/registry/examples/code-block/build-tools.tsx +25 -0
- package/registry/examples/code-block/file.d.ts +4 -0
- package/registry/examples/code-block/file.js +17 -0
- package/registry/examples/code-block/file.tsx +13 -0
- package/registry/examples/cta-panel/discuss.d.ts +4 -0
- package/registry/examples/cta-panel/discuss.js +31 -0
- package/registry/examples/cta-panel/discuss.tsx +23 -0
- package/registry/examples/decision-list/product.d.ts +4 -0
- package/registry/examples/decision-list/product.js +35 -0
- package/registry/examples/decision-list/product.tsx +30 -0
- package/registry/examples/link-card/docs-hub.d.ts +4 -0
- package/registry/examples/link-card/docs-hub.js +18 -0
- package/registry/examples/link-card/docs-hub.tsx +20 -0
- package/registry/examples/link-card/external.d.ts +4 -0
- package/registry/examples/link-card/external.js +22 -0
- package/registry/examples/link-card/external.tsx +16 -0
- package/registry/examples/link-card/stack.d.ts +4 -0
- package/registry/examples/link-card/stack.js +26 -0
- package/registry/examples/link-card/stack.tsx +21 -0
- package/registry/examples/mascot-quote/callout.d.ts +4 -0
- package/registry/examples/mascot-quote/callout.js +11 -0
- package/registry/examples/mascot-quote/callout.tsx +10 -0
- package/registry/examples/mascot-quote/inline.d.ts +4 -0
- package/registry/examples/mascot-quote/inline.js +11 -0
- package/registry/examples/mascot-quote/inline.tsx +10 -0
- package/registry/examples/page/backdrop.d.ts +4 -0
- package/registry/examples/page/backdrop.js +23 -0
- package/registry/examples/page/backdrop.tsx +18 -0
- package/registry/examples/page/facts.d.ts +4 -0
- package/registry/examples/page/facts.js +24 -0
- package/registry/examples/page/facts.tsx +21 -0
- package/registry/examples/page/frame.d.ts +4 -0
- package/registry/examples/page/frame.js +15 -0
- package/registry/examples/page/frame.tsx +17 -0
- package/registry/examples/page/sections.d.ts +4 -0
- package/registry/examples/page/sections.js +14 -0
- package/registry/examples/page/sections.tsx +15 -0
- package/registry/examples/page-hero/building-block.d.ts +4 -0
- package/registry/examples/page-hero/building-block.js +24 -0
- package/registry/examples/page-hero/building-block.tsx +20 -0
- package/registry/examples/page-hero/hub.d.ts +4 -0
- package/registry/examples/page-hero/hub.js +21 -0
- package/registry/examples/page-hero/hub.tsx +15 -0
- package/registry/examples/pointer-light/list.d.ts +4 -0
- package/registry/examples/pointer-light/list.js +16 -0
- package/registry/examples/pointer-light/list.tsx +14 -0
- package/registry/examples/terminal-replay/at-rest.d.ts +4 -0
- package/registry/examples/terminal-replay/at-rest.js +32 -0
- package/registry/examples/terminal-replay/at-rest.tsx +26 -0
- package/registry/examples/terminal-replay/session.d.ts +4 -0
- package/registry/examples/terminal-replay/session.js +34 -0
- package/registry/examples/terminal-replay/session.tsx +28 -0
- package/registry/examples/toc/reading-page.d.ts +4 -0
- package/registry/examples/toc/reading-page.js +21 -0
- package/registry/examples/toc/reading-page.tsx +21 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +2 -2
- package/registry/filter-bar.json +2 -2
- package/registry/glow-card.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +241 -1
- package/registry/iso.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/link-card.json +279 -0
- package/registry/loader.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +191 -0
- package/registry/mascots.json +1 -1
- package/registry/media-capture.json +4 -4
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +254 -0
- package/registry/page.json +497 -0
- package/registry/pagination.json +2 -2
- package/registry/pointer-light.json +119 -0
- package/registry/popover.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/search-field.json +2 -2
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/skeleton.json +3 -3
- package/registry/slider.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/terminal-replay.json +317 -0
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +157 -0
- package/registry/tooltip.json +1 -1
- package/registry/video-player.json +4 -4
- package/registry/video-trimmer.json +3 -3
- /package/dist/{chunk-XUMJA5ZI.js.map → chunk-X6TW3X6Y.js.map} +0 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "terminal-replay",
|
|
3
|
+
"type": "primitive",
|
|
4
|
+
"title": "Terminal replay",
|
|
5
|
+
"summary": "A terminal session played back: each command typed at the prompt, its output line by line, the screen following the last line — or the whole session at rest, as the server renders it.",
|
|
6
|
+
"description": "A terminal session played back: each command typed at the prompt, its output line by line, the screen following the last line — or the whole session at rest, as the server renders it.",
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"category": "media",
|
|
9
|
+
"platforms": "web",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"Show how a command-line tool works from a recording of a real session: install, start, run.",
|
|
12
|
+
"A getting-started page where the reader should see the order of the commands and what each one answers."
|
|
13
|
+
],
|
|
14
|
+
"whenNotToUse": [
|
|
15
|
+
{
|
|
16
|
+
"when": "For commands the reader copies and runs, with nothing to watch.",
|
|
17
|
+
"use": "kbd"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"when": "For a video of an application's screens: record the screens, not a terminal.",
|
|
21
|
+
"use": "video-player"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"when": "For output you wrote by hand: replay what the tool really printed, or show none."
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"bestPractices": [
|
|
28
|
+
"Replay a real session, captured from the tool itself — never an invented output.",
|
|
29
|
+
"Keep each step short: a long output is trimmed where it repeats, and says it was trimmed.",
|
|
30
|
+
"Name the screen (`label`) by what it shows; the words of the controls arrive as props, translated.",
|
|
31
|
+
"Give the copy button (`copyLabel`) when the commands are meant to be run."
|
|
32
|
+
],
|
|
33
|
+
"accessibility": {
|
|
34
|
+
"keyboard": [
|
|
35
|
+
{
|
|
36
|
+
"keys": "Tab",
|
|
37
|
+
"action": "Focuses the play, pause or replay control, the copy button, then the screen, which scrolls with the arrow keys."
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"notes": [
|
|
41
|
+
"The screen is a named region holding the whole transcript for assistive technology; the characters being typed are hidden from it — never read letter by letter.",
|
|
42
|
+
"It starts when it scrolls into view and waits while it is off screen; a control pauses it, plays it or replays it (WCAG 2.2.2).",
|
|
43
|
+
"Under `prefers-reduced-motion`, without JavaScript and before it plays, the whole session is shown at rest; the caret does not blink.",
|
|
44
|
+
"The copy button says it copied in a polite live region."
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"related": [
|
|
48
|
+
"kbd",
|
|
49
|
+
"video-player",
|
|
50
|
+
"stepper"
|
|
51
|
+
],
|
|
52
|
+
"web": {
|
|
53
|
+
"entry": "@krizaka/ui/terminal-replay",
|
|
54
|
+
"import": "import { TerminalReplay } from \"@krizaka/ui/terminal-replay\";",
|
|
55
|
+
"props": [
|
|
56
|
+
{
|
|
57
|
+
"component": "TerminalReplay",
|
|
58
|
+
"description": "A terminal session played back: commands typed at the prompt, their output line by line — or the whole session at rest.",
|
|
59
|
+
"props": [
|
|
60
|
+
{
|
|
61
|
+
"name": "label",
|
|
62
|
+
"type": "string",
|
|
63
|
+
"default": null,
|
|
64
|
+
"description": "The accessible name of the screen (“Terminal session: install, start, dev”) — passed translated.",
|
|
65
|
+
"required": true
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "pauseLabel",
|
|
69
|
+
"type": "string",
|
|
70
|
+
"default": null,
|
|
71
|
+
"description": "The pause button's words (the replay is running).",
|
|
72
|
+
"required": true
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "playLabel",
|
|
76
|
+
"type": "string",
|
|
77
|
+
"default": null,
|
|
78
|
+
"description": "The play button's words (the replay is waiting or paused).",
|
|
79
|
+
"required": true
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "replayLabel",
|
|
83
|
+
"type": "string",
|
|
84
|
+
"default": null,
|
|
85
|
+
"description": "The replay button's words (the session is shown whole).",
|
|
86
|
+
"required": true
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "steps",
|
|
90
|
+
"type": "readonly TerminalStep[]",
|
|
91
|
+
"default": null,
|
|
92
|
+
"description": "The session, in order.",
|
|
93
|
+
"required": true
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "autoPlay",
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"default": "true",
|
|
99
|
+
"description": "Plays the first time it scrolls into view. `false`: the session rests whole until the reader presses play.",
|
|
100
|
+
"required": false
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "copiedLabel",
|
|
104
|
+
"type": "string",
|
|
105
|
+
"default": null,
|
|
106
|
+
"description": "What the copy button says once the commands are copied (announced politely).",
|
|
107
|
+
"required": false
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "copyLabel",
|
|
111
|
+
"type": "string",
|
|
112
|
+
"default": null,
|
|
113
|
+
"description": "The copy button's words: it copies the commands, one per line. Without it, no copy button.",
|
|
114
|
+
"required": false
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "lineDelay",
|
|
118
|
+
"type": "number",
|
|
119
|
+
"default": "70",
|
|
120
|
+
"description": "Milliseconds between two output lines.",
|
|
121
|
+
"required": false
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "prompt",
|
|
125
|
+
"type": "string",
|
|
126
|
+
"default": "$",
|
|
127
|
+
"description": "What the prompt shows before each command.",
|
|
128
|
+
"required": false
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "rows",
|
|
132
|
+
"type": "number",
|
|
133
|
+
"default": "18",
|
|
134
|
+
"description": "The screen's height, in lines; longer sessions scroll.",
|
|
135
|
+
"required": false
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "stepDelay",
|
|
139
|
+
"type": "number",
|
|
140
|
+
"default": "900",
|
|
141
|
+
"description": "Milliseconds between a command's last line and the next command.",
|
|
142
|
+
"required": false
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "title",
|
|
146
|
+
"type": "ReactNode",
|
|
147
|
+
"default": null,
|
|
148
|
+
"description": "The window's title, shown in its bar (`~/projects — zsh`).",
|
|
149
|
+
"required": false
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "typingSpeed",
|
|
153
|
+
"type": "number",
|
|
154
|
+
"default": "34",
|
|
155
|
+
"description": "Milliseconds per typed character.",
|
|
156
|
+
"required": false
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"examples": [
|
|
162
|
+
{
|
|
163
|
+
"name": "session",
|
|
164
|
+
"title": "A session",
|
|
165
|
+
"description": "Three commands typed one after the other, their output line by line; it starts when it scrolls into view.",
|
|
166
|
+
"path": "examples/terminal-replay/session.tsx",
|
|
167
|
+
"module": "@krizaka/ui/registry/examples/terminal-replay/session",
|
|
168
|
+
"code": "import { TerminalReplay } from \"@krizaka/ui/terminal-replay\";\n\n// A real session played back: each command typed at the prompt, then its output, line by line.\nexport default function TerminalReplaySession() {\n return (\n <TerminalReplay\n label=\"Terminal session: create, install, start\"\n title=\"~/projects — zsh\"\n playLabel=\"Play\"\n pauseLabel=\"Pause\"\n replayLabel=\"Replay\"\n copyLabel=\"Copy commands\"\n copiedLabel=\"Copied\"\n rows={12}\n steps={[\n { command: \"mkdir shop && cd shop\", output: [] },\n {\n command: \"npm install @krizaka/ui\",\n output: [{ text: \"added 12 packages in 2s\", tone: \"success\" }, { text: \"found 0 vulnerabilities\", tone: \"muted\" }],\n },\n {\n command: \"npm run dev\",\n output: [{ text: \"▲ Next.js 16\", tone: \"accent\" }, \"- Local: http://localhost:3000\", { text: \"✓ Ready in 1.4s\", tone: \"success\" }],\n },\n ]}\n />\n );\n}\n"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "at-rest",
|
|
172
|
+
"title": "At rest",
|
|
173
|
+
"description": "`autoPlay={false}`: the whole session is shown until the reader presses play — a page that should stay still.",
|
|
174
|
+
"path": "examples/terminal-replay/at-rest.tsx",
|
|
175
|
+
"module": "@krizaka/ui/registry/examples/terminal-replay/at-rest",
|
|
176
|
+
"code": "import { TerminalReplay } from \"@krizaka/ui/terminal-replay\";\n\n// At rest: the whole session is there to read; it plays only when the reader presses play.\nexport default function TerminalReplayAtRest() {\n return (\n <TerminalReplay\n autoPlay={false}\n label=\"Terminal session: check the tools\"\n title=\"~/projects — zsh\"\n playLabel=\"Play\"\n pauseLabel=\"Pause\"\n replayLabel=\"Replay\"\n rows={7}\n steps={[\n {\n command: \"node --version && git --version\",\n output: [\"v22.12.0\", \"git version 2.47.1\"],\n },\n {\n command: \"docker compose version\",\n output: [{ text: \"Docker Compose version v2.31.0\", tone: \"success\" }],\n },\n ]}\n />\n );\n}\n"
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
"native": null,
|
|
181
|
+
"files": [
|
|
182
|
+
{
|
|
183
|
+
"path": "glyphs.tsx",
|
|
184
|
+
"content": "// The small line glyphs the data and media primitives draw (play, volume, search, chevrons…): decorative, 24-unit\n// box, `currentColor`, sized by the caller's class. Shared by the entries that need them; never exported on its own —\n// a product draws its own icons with @krizaka/icons.\nimport type * as React from \"react\";\n\ntype GlyphProps = { className?: string };\n\nfunction Glyph({ className = \"h-4 w-4\", fill, children }: GlyphProps & { fill?: boolean; children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n className={className}\n fill={fill ? \"currentColor\" : \"none\"}\n stroke={fill ? \"none\" : \"currentColor\"}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n {children}\n </svg>\n );\n}\n\nexport const PlayGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <path d=\"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z\" />\n </Glyph>\n);\nexport const PauseGlyph = (p: GlyphProps) => (\n <Glyph {...p} fill>\n <rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n <rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\" />\n </Glyph>\n);\nexport const VolumeGlyph = ({ muted, ...p }: GlyphProps & { muted?: boolean }) => (\n <Glyph {...p}>\n <path d=\"M11 5 6 9H3v6h3l5 4V5Z\" />\n {muted ? <path d=\"m22 9-6 6m0-6 6 6\" /> : <path d=\"M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13\" />}\n </Glyph>\n);\nexport const FullscreenGlyph = ({ exit, ...p }: GlyphProps & { exit?: boolean }) => (\n <Glyph {...p}>\n {exit ? <path d=\"M9 4v5H4m11-5v5h5M9 20v-5H4m11 5v-5h5\" /> : <path d=\"M4 9V4h5m6 0h5v5M4 15v5h5m11-5v5h-5\" />}\n </Glyph>\n);\nexport const CaptionsGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M17 10.5a2 2 0 1 0 0 3\" />\n </Glyph>\n);\nexport const PipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <rect x=\"12\" y=\"12\" width=\"6\" height=\"4\" rx=\"1\" />\n </Glyph>\n);\nexport const SearchGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </Glyph>\n);\nexport const CloseGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </Glyph>\n);\nexport const ChevronGlyph = ({ direction = \"down\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" | \"up\" | \"down\" }) => (\n <Glyph {...p}>\n <path d={{ left: \"m15 6-6 6 6 6\", right: \"m9 6 6 6-6 6\", up: \"m6 15 6-6 6 6\", down: \"m6 9 6 6 6-6\" }[direction]} />\n </Glyph>\n);\nexport const CheckGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Glyph>\n);\nexport const PlusGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 5v14M5 12h14\" />\n </Glyph>\n);\nexport const CalendarGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M3 10h18M8 3v4M16 3v4\" />\n </Glyph>\n);\nexport const UploadGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 16V4m0 0L7 9m5-5 5 5\" />\n <path d=\"M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </Glyph>\n);\nexport const FileGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z\" />\n <path d=\"M14 3v5h5\" />\n </Glyph>\n);\nexport const CameraGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z\" />\n <circle cx=\"12\" cy=\"13.5\" r=\"3.5\" />\n </Glyph>\n);\nexport const FlipGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3\" />\n <path d=\"M18 3v4h-4M6 21v-4h4\" />\n </Glyph>\n);\nexport const RetryGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M4 12a8 8 0 1 0 2.3-5.7L4 8.5\" />\n <path d=\"M4 4v4.5h4.5\" />\n </Glyph>\n);\nexport const SortGlyph = ({ direction, ...p }: GlyphProps & { direction?: \"ascending\" | \"descending\" }) => (\n <Glyph {...p}>\n {direction === \"ascending\" ? <path d=\"m7 14 5-5 5 5\" /> : direction === \"descending\" ? <path d=\"m7 10 5 5 5-5\" /> : <path d=\"m8 9 4-4 4 4M8 15l4 4 4-4\" />}\n </Glyph>\n);\nexport const ArrowGlyph = ({ direction = \"right\", ...p }: GlyphProps & { direction?: \"left\" | \"right\" }) => (\n <Glyph {...p}>\n <path d={direction === \"left\" ? \"M19 12H5m0 0 6-6m-6 6 6 6\" : \"M5 12h14m0 0-6-6m6 6-6 6\"} />\n </Glyph>\n);\nexport const ExternalGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M14 4h6v6M20 4l-9 9\" />\n <path d=\"M18 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4\" />\n </Glyph>\n);\nexport const WarningGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <path d=\"M12 4 2.5 20h19L12 4Z\" />\n <path d=\"M12 10v4M12 17.2v.1\" />\n </Glyph>\n);\nexport const CopyGlyph = (p: GlyphProps) => (\n <Glyph {...p}>\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3\" />\n </Glyph>\n);\n"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"path": "meta.ts",
|
|
188
|
+
"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 krizaka.com renders as\n// /docs/ui/<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 | \"action-bar\"\n | \"alert\"\n | \"argument-card\"\n | \"audio-player\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"cta-panel\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"link-card\"\n | \"loader\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\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 */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layout\" | \"foundations\";\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 */\nexport interface Example {\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/** 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}\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 readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\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"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"path": "terminal-replay/index.ts",
|
|
192
|
+
"content": "/** @krizaka/ui/terminal-replay — `TerminalReplay`: a terminal session played back, command by command, or shown whole at rest. Client. */\nexport { type TerminalLine, TerminalReplay, type TerminalReplayProps, type TerminalStep, type TerminalTone } from \"./terminal-replay\";\n"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"path": "terminal-replay/meta.ts",
|
|
196
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Terminal replay\",\n summary:\n \"A terminal session played back: each command typed at the prompt, its output line by line, the screen following the last line — or the whole session at rest, as the server renders it.\",\n status: \"beta\",\n category: \"media\",\n platforms: \"web\",\n whenToUse: [\n \"Show how a command-line tool works from a recording of a real session: install, start, run.\",\n \"A getting-started page where the reader should see the order of the commands and what each one answers.\",\n ],\n whenNotToUse: [\n { when: \"For commands the reader copies and runs, with nothing to watch.\", use: \"kbd\" },\n { when: \"For a video of an application's screens: record the screens, not a terminal.\", use: \"video-player\" },\n { when: \"For output you wrote by hand: replay what the tool really printed, or show none.\" },\n ],\n bestPractices: [\n \"Replay a real session, captured from the tool itself — never an invented output.\",\n \"Keep each step short: a long output is trimmed where it repeats, and says it was trimmed.\",\n \"Name the screen (`label`) by what it shows; the words of the controls arrive as props, translated.\",\n \"Give the copy button (`copyLabel`) when the commands are meant to be run.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Tab\", action: \"Focuses the play, pause or replay control, the copy button, then the screen, which scrolls with the arrow keys.\" },\n ],\n notes: [\n \"The screen is a named region holding the whole transcript for assistive technology; the characters being typed are hidden from it — never read letter by letter.\",\n \"It starts when it scrolls into view and waits while it is off screen; a control pauses it, plays it or replays it (WCAG 2.2.2).\",\n \"Under `prefers-reduced-motion`, without JavaScript and before it plays, the whole session is shown at rest; the caret does not blink.\",\n \"The copy button says it copied in a polite live region.\",\n ],\n },\n related: [\"kbd\", \"video-player\", \"stepper\"],\n web: {\n imports: [\"TerminalReplay\"],\n examples: [\n { name: \"session\", title: \"A session\", description: \"Three commands typed one after the other, their output line by line; it starts when it scrolls into view.\" },\n { name: \"at-rest\", title: \"At rest\", description: \"`autoPlay={false}`: the whole session is shown until the reader presses play — a page that should stay still.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"path": "terminal-replay/terminal-replay.tsx",
|
|
200
|
+
"content": "// Client (a timer, an observer). A terminal session played back: each command is typed at the prompt, its output\n// arrives line by line, the screen follows the last line like a real terminal. What a reader sees without the motion\n// is the session itself: the server renders it whole (no JavaScript, reduced motion and assistive technology all get\n// the full transcript), the screen has a fixed height (no layout shift while it plays), the replay starts when it\n// scrolls into view, waits while it is off screen, and pauses or replays on demand (WCAG 2.2.2). A bounded chain of\n// timeouts, never a permanent animation frame.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { CheckGlyph, PauseGlyph, PlayGlyph, RetryGlyph } from \"../glyphs\";\n\n/** The colour of an output line — the tokens' text roles, all AA on the screen: secondary, accent, success, warning, danger. */\nexport type TerminalTone = \"muted\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\n\nexport interface TerminalLine {\n /** The line as the program printed it (no colour codes). */\n text: string;\n /** Its colour, when the program coloured it. */\n tone?: TerminalTone;\n}\n\nexport interface TerminalStep {\n /** What is typed at the prompt (`npx orazaka install`). */\n command: string;\n /** What it printed, line by line. */\n output?: readonly (string | TerminalLine)[];\n}\n\nexport type TerminalReplayProps = Omit<React.ComponentProps<\"figure\">, \"children\" | \"title\"> & {\n /** The session, in order. */\n steps: readonly TerminalStep[];\n /** The accessible name of the screen (“Terminal session: install, start, dev”) — passed translated. */\n label: string;\n /** The window's title, shown in its bar (`~/projects — zsh`). */\n title?: React.ReactNode;\n /**\n * What the prompt shows before each command.\n * @default \"$\"\n */\n prompt?: string;\n /** The play button's words (the replay is waiting or paused). */\n playLabel: string;\n /** The pause button's words (the replay is running). */\n pauseLabel: string;\n /** The replay button's words (the session is shown whole). */\n replayLabel: string;\n /** The copy button's words: it copies the commands, one per line. Without it, no copy button. */\n copyLabel?: string;\n /** What the copy button says once the commands are copied (announced politely). */\n copiedLabel?: string;\n /**\n * Milliseconds per typed character.\n * @default 34\n */\n typingSpeed?: number;\n /**\n * Milliseconds between two output lines.\n * @default 70\n */\n lineDelay?: number;\n /**\n * Milliseconds between a command's last line and the next command.\n * @default 900\n */\n stepDelay?: number;\n /**\n * The screen's height, in lines; longer sessions scroll.\n * @default 18\n */\n rows?: number;\n /**\n * Plays the first time it scrolls into view. `false`: the session rests whole until the reader presses play.\n * @default true\n */\n autoPlay?: boolean;\n};\n\ntype Phase = \"final\" | \"idle\" | \"playing\" | \"paused\" | \"done\";\ninterface Position {\n step: number;\n chars: number;\n lines: number;\n}\n\nconst TONE: Record<TerminalTone, string> = {\n muted: \"text-fg-secondary\",\n accent: \"text-fg-accent\",\n success: \"text-fg-success\",\n warning: \"text-fg-warning\",\n danger: \"text-fg-danger\",\n};\n\nconst line = (entry: string | TerminalLine): TerminalLine => (typeof entry === \"string\" ? { text: entry } : entry);\n\n/** The next position of the replay and how long to wait for it; null at the end of the session. */\nfunction advance(steps: readonly TerminalStep[], pos: Position, timing: { typing: number; line: number; step: number }): [Position, number] | null {\n const current = steps[pos.step];\n if (!current) return null;\n const output = current.output ?? [];\n if (pos.chars < current.command.length) {\n // A space is a beat longer: the rhythm of someone typing, not of a printer.\n const pause = current.command[pos.chars] === \" \" ? timing.typing * 2 : timing.typing;\n return [{ ...pos, chars: pos.chars + 1 }, pause];\n }\n if (pos.lines < output.length) return [{ ...pos, lines: pos.lines + 1 }, pos.lines === 0 ? timing.line * 4 : timing.line];\n if (pos.step < steps.length - 1) return [{ step: pos.step + 1, chars: 0, lines: 0 }, timing.step];\n return null;\n}\n\n/** A terminal session played back: commands typed at the prompt, their output line by line — or the whole session at rest. */\nexport function TerminalReplay({\n steps,\n label,\n title,\n prompt = \"$\",\n playLabel,\n pauseLabel,\n replayLabel,\n copyLabel,\n copiedLabel,\n typingSpeed = 34,\n lineDelay = 70,\n stepDelay = 900,\n rows = 18,\n autoPlay = true,\n className,\n style,\n ...props\n}: TerminalReplayProps) {\n const root = React.useRef<HTMLElement>(null);\n const screenRef = React.useRef<HTMLDivElement>(null);\n // The server renders the session whole; the client takes it over unless the reader asked for less motion.\n const [phase, setPhase] = React.useState<Phase>(\"final\");\n const [pos, setPos] = React.useState<Position>({ step: 0, chars: 0, lines: 0 });\n const [visible, setVisible] = React.useState(false);\n const [copied, setCopied] = React.useState(false);\n\n React.useEffect(() => {\n const el = root.current;\n if (!el || !autoPlay || window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n setPhase(\"idle\");\n // Starts the first time it is seen; off screen, it waits where it is.\n const io = new IntersectionObserver(\n ([entry]) => {\n const seen = Boolean(entry?.isIntersecting);\n setVisible(seen);\n if (seen) setPhase((current) => (current === \"idle\" ? \"playing\" : current));\n },\n { threshold: 0.35 },\n );\n io.observe(el);\n return () => io.disconnect();\n }, [autoPlay]);\n\n const ended = phase === \"playing\" && !advance(steps, pos, { typing: typingSpeed, line: lineDelay, step: stepDelay });\n // The end of the session is where the replay stands, not an event: derived, never set from an effect.\n const state: Phase = ended ? \"done\" : phase;\n\n React.useEffect(() => {\n if (phase !== \"playing\" || !visible) return;\n const next = advance(steps, pos, { typing: typingSpeed, line: lineDelay, step: stepDelay });\n if (!next) return;\n const timer = setTimeout(() => setPos(next[0]), next[1]);\n return () => clearTimeout(timer);\n }, [phase, visible, pos, steps, typingSpeed, lineDelay, stepDelay]);\n\n // The screen follows the last line while it plays, like a terminal.\n React.useEffect(() => {\n const el = screenRef.current;\n if (el && state === \"playing\") el.scrollTop = el.scrollHeight;\n }, [pos, state]);\n\n React.useEffect(() => {\n if (!copied) return;\n const timer = setTimeout(() => setCopied(false), 1800);\n return () => clearTimeout(timer);\n }, [copied]);\n\n const whole = state === \"final\" || state === \"done\";\n const shown = whole ? steps.length - 1 : pos.step;\n const toggle = () => {\n if (state === \"playing\") setPhase(\"paused\");\n else if (state === \"paused\" || state === \"idle\") setPhase(\"playing\");\n else {\n // Played on demand — also under reduced motion: the reader asked for it. Off screen it would wait: it is on screen.\n setVisible(true);\n setPos({ step: 0, chars: 0, lines: 0 });\n setPhase(\"playing\");\n }\n };\n const control =\n state === \"playing\"\n ? { text: pauseLabel, Glyph: PauseGlyph }\n : state === \"done\"\n ? { text: replayLabel, Glyph: RetryGlyph }\n : { text: playLabel, Glyph: PlayGlyph };\n const commands = steps.map((s) => s.command).join(\"\\n\");\n const transcript = steps.map((s) => [`${prompt} ${s.command}`, ...(s.output ?? []).map((o) => line(o).text)].join(\"\\n\")).join(\"\\n\\n\");\n\n return (\n <figure\n ref={root}\n data-state={state}\n data-autoplay={autoPlay ? \"\" : undefined}\n className={cn(\"kz-replay overflow-hidden rounded-xl border border-border-default bg-surface-1 shadow-md\", className)}\n style={{ \"--kz-replay-rows\": rows, ...style } as React.CSSProperties}\n {...props}\n >\n <figcaption className=\"flex items-center gap-3 border-b border-border-subtle bg-surface-2 px-3 py-2 text-xs text-fg-secondary\">\n <span aria-hidden className=\"flex shrink-0 gap-1.5\">\n <span className=\"h-2.5 w-2.5 rounded-full bg-border-strong\" />\n <span className=\"h-2.5 w-2.5 rounded-full bg-border-strong\" />\n <span className=\"h-2.5 w-2.5 rounded-full bg-border-strong\" />\n </span>\n <span className=\"min-w-0 flex-1 truncate font-mono\">{title}</span>\n <button\n type=\"button\"\n onClick={toggle}\n className=\"inline-flex shrink-0 items-center gap-1.5 rounded-md px-2 py-1 font-medium text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg focus-visible:outline-2 focus-visible:outline-ring\"\n >\n <control.Glyph className=\"h-3.5 w-3.5\" />\n {control.text}\n </button>\n {copyLabel && (\n <button\n type=\"button\"\n onClick={() => navigator.clipboard?.writeText(commands).then(() => setCopied(true))}\n data-copied={copied ? \"\" : undefined}\n className=\"inline-flex shrink-0 items-center gap-1.5 rounded-md px-2 py-1 font-medium text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg focus-visible:outline-2 focus-visible:outline-ring\"\n >\n {copied ? <CheckGlyph className=\"h-3.5 w-3.5\" /> : <CopyGlyph />}\n <span aria-live=\"polite\">{copied ? (copiedLabel ?? copyLabel) : copyLabel}</span>\n </button>\n )}\n </figcaption>\n <div\n ref={screenRef}\n role=\"region\"\n aria-label={label}\n tabIndex={0}\n className=\"kz-replay-screen relative overflow-auto bg-surface-0 px-4 py-3 font-mono text-[0.8125rem] leading-relaxed text-fg focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring\"\n >\n <div aria-hidden className=\"kz-replay-live\">\n {steps.slice(0, state === \"idle\" ? 0 : shown + 1).map((step, i) => {\n const current = !whole && i === shown;\n const typed = current ? step.command.slice(0, pos.chars) : step.command;\n const output = (step.output ?? []).slice(0, current ? pos.lines : undefined);\n const typing = current && pos.chars < step.command.length;\n return (\n <div key={i} className={i > 0 ? \"mt-3\" : undefined}>\n <div className=\"whitespace-pre\">\n <span className=\"text-fg-accent select-none\">{prompt} </span>\n <span className=\"font-medium\">{typed}</span>\n {typing && <span className=\"kz-replay-caret\" />}\n </div>\n {output.map((entry, j) => {\n const { text, tone } = line(entry);\n return (\n <div key={j} className={cn(\"min-h-[1lh] whitespace-pre\", tone ? TONE[tone] : \"text-fg\")}>\n {text}\n </div>\n );\n })}\n </div>\n );\n })}\n {(state === \"idle\" || whole) && (\n <div className={cn(\"whitespace-pre\", state !== \"idle\" && \"mt-3\")}>\n <span className=\"text-fg-accent select-none\">{prompt} </span>\n <span className=\"kz-replay-caret\" />\n </div>\n )}\n </div>\n <pre className=\"sr-only\">{transcript}</pre>\n </div>\n </figure>\n );\n}\n\n/** Two sheets, one over the other: copy. Drawn here, like the other glyphs of the primitives (decorative). */\nfunction CopyGlyph() {\n return (\n <svg viewBox=\"0 0 24 24\" className=\"h-3.5 w-3.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden focusable=\"false\">\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M5 15V6a2 2 0 0 1 2-2h8\" />\n </svg>\n );\n}\n"
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"dependencies": [],
|
|
204
|
+
"registryDependencies": [
|
|
205
|
+
"cn"
|
|
206
|
+
],
|
|
207
|
+
"demo": {
|
|
208
|
+
"path": "examples/terminal-replay/session.tsx",
|
|
209
|
+
"content": "import { TerminalReplay } from \"@krizaka/ui/terminal-replay\";\n\n// A real session played back: each command typed at the prompt, then its output, line by line.\nexport default function TerminalReplaySession() {\n return (\n <TerminalReplay\n label=\"Terminal session: create, install, start\"\n title=\"~/projects — zsh\"\n playLabel=\"Play\"\n pauseLabel=\"Pause\"\n replayLabel=\"Replay\"\n copyLabel=\"Copy commands\"\n copiedLabel=\"Copied\"\n rows={12}\n steps={[\n { command: \"mkdir shop && cd shop\", output: [] },\n {\n command: \"npm install @krizaka/ui\",\n output: [{ text: \"added 12 packages in 2s\", tone: \"success\" }, { text: \"found 0 vulnerabilities\", tone: \"muted\" }],\n },\n {\n command: \"npm run dev\",\n output: [{ text: \"▲ Next.js 16\", tone: \"accent\" }, \"- Local: http://localhost:3000\", { text: \"✓ Ready in 1.4s\", tone: \"success\" }],\n },\n ]}\n />\n );\n}\n"
|
|
210
|
+
},
|
|
211
|
+
"props": [
|
|
212
|
+
{
|
|
213
|
+
"component": "TerminalReplay",
|
|
214
|
+
"description": "A terminal session played back: commands typed at the prompt, their output line by line — or the whole session at rest.",
|
|
215
|
+
"props": [
|
|
216
|
+
{
|
|
217
|
+
"name": "label",
|
|
218
|
+
"type": "string",
|
|
219
|
+
"default": null,
|
|
220
|
+
"description": "The accessible name of the screen (“Terminal session: install, start, dev”) — passed translated.",
|
|
221
|
+
"required": true
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"name": "pauseLabel",
|
|
225
|
+
"type": "string",
|
|
226
|
+
"default": null,
|
|
227
|
+
"description": "The pause button's words (the replay is running).",
|
|
228
|
+
"required": true
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "playLabel",
|
|
232
|
+
"type": "string",
|
|
233
|
+
"default": null,
|
|
234
|
+
"description": "The play button's words (the replay is waiting or paused).",
|
|
235
|
+
"required": true
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"name": "replayLabel",
|
|
239
|
+
"type": "string",
|
|
240
|
+
"default": null,
|
|
241
|
+
"description": "The replay button's words (the session is shown whole).",
|
|
242
|
+
"required": true
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"name": "steps",
|
|
246
|
+
"type": "readonly TerminalStep[]",
|
|
247
|
+
"default": null,
|
|
248
|
+
"description": "The session, in order.",
|
|
249
|
+
"required": true
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"name": "autoPlay",
|
|
253
|
+
"type": "boolean",
|
|
254
|
+
"default": "true",
|
|
255
|
+
"description": "Plays the first time it scrolls into view. `false`: the session rests whole until the reader presses play.",
|
|
256
|
+
"required": false
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "copiedLabel",
|
|
260
|
+
"type": "string",
|
|
261
|
+
"default": null,
|
|
262
|
+
"description": "What the copy button says once the commands are copied (announced politely).",
|
|
263
|
+
"required": false
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"name": "copyLabel",
|
|
267
|
+
"type": "string",
|
|
268
|
+
"default": null,
|
|
269
|
+
"description": "The copy button's words: it copies the commands, one per line. Without it, no copy button.",
|
|
270
|
+
"required": false
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"name": "lineDelay",
|
|
274
|
+
"type": "number",
|
|
275
|
+
"default": "70",
|
|
276
|
+
"description": "Milliseconds between two output lines.",
|
|
277
|
+
"required": false
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "prompt",
|
|
281
|
+
"type": "string",
|
|
282
|
+
"default": "$",
|
|
283
|
+
"description": "What the prompt shows before each command.",
|
|
284
|
+
"required": false
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"name": "rows",
|
|
288
|
+
"type": "number",
|
|
289
|
+
"default": "18",
|
|
290
|
+
"description": "The screen's height, in lines; longer sessions scroll.",
|
|
291
|
+
"required": false
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"name": "stepDelay",
|
|
295
|
+
"type": "number",
|
|
296
|
+
"default": "900",
|
|
297
|
+
"description": "Milliseconds between a command's last line and the next command.",
|
|
298
|
+
"required": false
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"name": "title",
|
|
302
|
+
"type": "ReactNode",
|
|
303
|
+
"default": null,
|
|
304
|
+
"description": "The window's title, shown in its bar (`~/projects — zsh`).",
|
|
305
|
+
"required": false
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"name": "typingSpeed",
|
|
309
|
+
"type": "number",
|
|
310
|
+
"default": "34",
|
|
311
|
+
"description": "Milliseconds per typed character.",
|
|
312
|
+
"required": false
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
}
|
package/registry/theme.json
CHANGED
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"files": [
|
|
192
192
|
{
|
|
193
193
|
"path": "meta.ts",
|
|
194
|
-
"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 krizaka.com renders as\n// /docs/ui/<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 | \"alert\"\n | \"audio-player\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"cn\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"data-table\"\n | \"date-picker\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"loader\"\n | \"marquee\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page-header\"\n | \"pagination\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n
|
|
194
|
+
"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 krizaka.com renders as\n// /docs/ui/<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 | \"action-bar\"\n | \"alert\"\n | \"argument-card\"\n | \"audio-player\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"cta-panel\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"link-card\"\n | \"loader\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\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 */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layout\" | \"foundations\";\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 */\nexport interface Example {\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/** 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}\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 readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\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"
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
197
|
"path": "theme/index.ts",
|
package/registry/toast.json
CHANGED
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
"files": [
|
|
212
212
|
{
|
|
213
213
|
"path": "meta.ts",
|
|
214
|
-
"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 krizaka.com renders as\n// /docs/ui/<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 | \"alert\"\n | \"audio-player\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"cn\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"data-table\"\n | \"date-picker\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"loader\"\n | \"marquee\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page-header\"\n | \"pagination\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"theme\"\n | \"toast\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n
|
|
214
|
+
"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 krizaka.com renders as\n// /docs/ui/<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 | \"action-bar\"\n | \"alert\"\n | \"argument-card\"\n | \"audio-player\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"cta-panel\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"link-card\"\n | \"loader\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\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/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\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 */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layout\" | \"foundations\";\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 */\nexport interface Example {\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/** 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}\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 readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\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"
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
217
|
"path": "toast/index.ts",
|