@krizaka/ui 3.67.1 → 3.69.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.
Files changed (301) hide show
  1. package/README.md +1 -0
  2. package/dist/chunk-E4FMPPDL.js +134 -0
  3. package/dist/chunk-E4FMPPDL.js.map +1 -0
  4. package/dist/{chunk-E4X3V7QX.js → chunk-GRVIZTT2.js} +2 -2
  5. package/dist/chunk-PZ4FJOD5.js +44 -0
  6. package/dist/chunk-PZ4FJOD5.js.map +1 -0
  7. package/dist/{chunk-PFPOBIHL.js → chunk-T5NZSKWT.js} +15 -12
  8. package/dist/{chunk-PFPOBIHL.js.map → chunk-T5NZSKWT.js.map} +1 -1
  9. package/dist/{chunk-6BMKLAZ7.js → chunk-Z47KIPCT.js} +7 -2
  10. package/dist/{chunk-6BMKLAZ7.js.map → chunk-Z47KIPCT.js.map} +1 -1
  11. package/dist/copy-button.d.ts +29 -0
  12. package/dist/copy-button.js +56 -0
  13. package/dist/copy-button.js.map +1 -0
  14. package/dist/data-table.js +3 -3
  15. package/dist/date-picker.d.ts +15 -15
  16. package/dist/filter-bar.d.ts +3 -3
  17. package/dist/filter-bar.js +1 -1
  18. package/dist/genui.js +3 -3
  19. package/dist/index.js +3 -3
  20. package/dist/kind-config-editor.js +106 -129
  21. package/dist/kind-config-editor.js.map +1 -1
  22. package/dist/lightbox-D5NAHFEA.js +95 -0
  23. package/dist/lightbox-D5NAHFEA.js.map +1 -0
  24. package/dist/match-dialog.js +17 -140
  25. package/dist/match-dialog.js.map +1 -1
  26. package/dist/money-input.d.ts +29 -0
  27. package/dist/money-input.js +78 -0
  28. package/dist/money-input.js.map +1 -0
  29. package/dist/nav-bar.d.ts +28 -4
  30. package/dist/nav-bar.js +20 -10
  31. package/dist/nav-bar.js.map +1 -1
  32. package/dist/promo-code-field.d.ts +38 -0
  33. package/dist/promo-code-field.js +94 -0
  34. package/dist/promo-code-field.js.map +1 -0
  35. package/dist/radio-group.js +1 -1
  36. package/dist/retro-tv.d.ts +39 -4
  37. package/dist/retro-tv.js +217 -40
  38. package/dist/retro-tv.js.map +1 -1
  39. package/dist/shop/booking.d.ts +22 -3
  40. package/dist/shop/booking.js +33 -1
  41. package/dist/shop/booking.js.map +1 -1
  42. package/dist/shop-composer.d.ts +1 -1
  43. package/dist/shop-composer.js +109 -85
  44. package/dist/shop-composer.js.map +1 -1
  45. package/dist/shop-gallery.d.ts +47 -0
  46. package/dist/shop-gallery.js +121 -0
  47. package/dist/shop-gallery.js.map +1 -0
  48. package/dist/shop.d.ts +1 -1
  49. package/dist/shop.js +1 -1
  50. package/dist/shop.js.map +1 -1
  51. package/dist/status-chip.js +1 -1
  52. package/dist/tag-selector.js +5 -5
  53. package/dist/tag-selector.js.map +1 -1
  54. package/dist/terminal-replay.js +1 -1
  55. package/dist/virtual.d.ts +3 -3
  56. package/package.json +63 -5
  57. package/registry/account-menu.json +1 -1
  58. package/registry/account-settings.json +1 -1
  59. package/registry/achievement.json +1 -1
  60. package/registry/action-bar.json +1 -1
  61. package/registry/activity-feed.json +1 -1
  62. package/registry/agenda.json +1 -1
  63. package/registry/alert.json +1 -1
  64. package/registry/analysis-report.json +1 -1
  65. package/registry/anatomy-plate.json +1 -1
  66. package/registry/app-frame.json +2 -2
  67. package/registry/app-header.json +1 -1
  68. package/registry/app-shell.json +1 -1
  69. package/registry/argument-card.json +1 -1
  70. package/registry/audio-player.json +1 -1
  71. package/registry/auth-layout.json +1 -1
  72. package/registry/avatar.json +1 -1
  73. package/registry/badge.json +1 -1
  74. package/registry/bird-plate.json +1 -1
  75. package/registry/button.json +1 -1
  76. package/registry/captcha.json +1 -1
  77. package/registry/card-grid.json +1 -1
  78. package/registry/card.json +1 -1
  79. package/registry/catalogue-page.json +1 -1
  80. package/registry/changelog-page.json +1 -1
  81. package/registry/chapter.json +1 -1
  82. package/registry/chat.json +1 -1
  83. package/registry/checkbox.json +1 -1
  84. package/registry/chip-link.json +1 -1
  85. package/registry/chip-row.json +1 -1
  86. package/registry/chip.json +1 -1
  87. package/registry/choice-grid.json +1 -1
  88. package/registry/code-block.json +1 -1
  89. package/registry/collection-switcher.json +1 -1
  90. package/registry/combobox.json +1 -1
  91. package/registry/command.json +1 -1
  92. package/registry/comparison-table.json +1 -1
  93. package/registry/component-page.json +1 -1
  94. package/registry/confirm-button.json +1 -1
  95. package/registry/contact-page.json +1 -1
  96. package/registry/continue-prompt.json +1 -1
  97. package/registry/copy-button.json +382 -0
  98. package/registry/countdown.json +1 -1
  99. package/registry/cover-hero.json +1 -1
  100. package/registry/cta-panel.json +1 -1
  101. package/registry/dashboard-layout.json +1 -1
  102. package/registry/data-table.json +1 -1
  103. package/registry/date-picker.json +1 -1
  104. package/registry/decision-list.json +1 -1
  105. package/registry/description-list.json +1 -1
  106. package/registry/desktop-window.json +1 -1
  107. package/registry/detail-layout.json +1 -1
  108. package/registry/dialog.json +1 -1
  109. package/registry/docs-article-page.json +1 -1
  110. package/registry/docs-hub-page.json +1 -1
  111. package/registry/docs-layout.json +1 -1
  112. package/registry/docs-nav.json +1 -1
  113. package/registry/document-viewer.json +1 -1
  114. package/registry/doodle.json +1 -1
  115. package/registry/drop-overlay.json +1 -1
  116. package/registry/dropdown-menu.json +1 -1
  117. package/registry/elephant.json +2 -2
  118. package/registry/embed-facade.json +1 -1
  119. package/registry/empty-state.json +1 -1
  120. package/registry/engine-flow.json +1 -1
  121. package/registry/entity-header.json +1 -1
  122. package/registry/environment-notice.json +1 -1
  123. package/registry/error-page.json +1 -1
  124. package/registry/examples/copy-button/default.d.ts +4 -0
  125. package/registry/examples/copy-button/default.js +11 -0
  126. package/registry/examples/copy-button/default.tsx +7 -0
  127. package/registry/examples/copy-button/icon-only.d.ts +4 -0
  128. package/registry/examples/copy-button/icon-only.js +11 -0
  129. package/registry/examples/copy-button/icon-only.tsx +7 -0
  130. package/registry/examples/money-input/currencies.d.ts +4 -0
  131. package/registry/examples/money-input/currencies.js +18 -0
  132. package/registry/examples/money-input/currencies.tsx +16 -0
  133. package/registry/examples/money-input/default.d.ts +4 -0
  134. package/registry/examples/money-input/default.js +18 -0
  135. package/registry/examples/money-input/default.tsx +16 -0
  136. package/registry/examples/promo-code-field/applied.d.ts +4 -0
  137. package/registry/examples/promo-code-field/applied.js +11 -0
  138. package/registry/examples/promo-code-field/applied.tsx +7 -0
  139. package/registry/examples/promo-code-field/default.d.ts +4 -0
  140. package/registry/examples/promo-code-field/default.js +19 -0
  141. package/registry/examples/promo-code-field/default.tsx +14 -0
  142. package/registry/examples/promo-code-field/expired.d.ts +4 -0
  143. package/registry/examples/promo-code-field/expired.js +11 -0
  144. package/registry/examples/promo-code-field/expired.tsx +7 -0
  145. package/registry/examples/retro-tv/playlist-channel.d.ts +4 -0
  146. package/registry/examples/retro-tv/playlist-channel.js +15 -0
  147. package/registry/examples/retro-tv/playlist-channel.tsx +10 -0
  148. package/registry/examples/retro-tv/playlist-crossfade.d.ts +4 -0
  149. package/registry/examples/retro-tv/playlist-crossfade.js +15 -0
  150. package/registry/examples/retro-tv/playlist-crossfade.tsx +10 -0
  151. package/registry/examples/retro-tv/playlist-slide.d.ts +4 -0
  152. package/registry/examples/retro-tv/playlist-slide.js +15 -0
  153. package/registry/examples/retro-tv/playlist-slide.tsx +10 -0
  154. package/registry/examples/shop/booking-closing-closed.d.ts +4 -0
  155. package/registry/examples/shop/booking-closing-closed.js +26 -0
  156. package/registry/examples/shop/booking-closing-closed.tsx +22 -0
  157. package/registry/examples/shop/booking-closing-mark.d.ts +4 -0
  158. package/registry/examples/shop/booking-closing-mark.js +13 -0
  159. package/registry/examples/shop/booking-closing-mark.tsx +12 -0
  160. package/registry/examples/shop/booking-closing.d.ts +4 -0
  161. package/registry/examples/shop/booking-closing.js +27 -0
  162. package/registry/examples/shop/booking-closing.tsx +23 -0
  163. package/registry/examples/shop-gallery/five.d.ts +4 -0
  164. package/registry/examples/shop-gallery/five.js +14 -0
  165. package/registry/examples/shop-gallery/five.tsx +10 -0
  166. package/registry/examples/shop-gallery/three.d.ts +4 -0
  167. package/registry/examples/shop-gallery/three.js +14 -0
  168. package/registry/examples/shop-gallery/three.tsx +10 -0
  169. package/registry/examples/shop-gallery/twelve.d.ts +4 -0
  170. package/registry/examples/shop-gallery/twelve.js +14 -0
  171. package/registry/examples/shop-gallery/twelve.tsx +10 -0
  172. package/registry/field.json +1 -1
  173. package/registry/file-upload.json +1 -1
  174. package/registry/filter-bar.json +2 -2
  175. package/registry/flock.json +1 -1
  176. package/registry/footnote.json +1 -1
  177. package/registry/force-update-screen.json +1 -1
  178. package/registry/form.json +1 -1
  179. package/registry/gallery-page.json +1 -1
  180. package/registry/genui.json +1 -1
  181. package/registry/glossary-term.json +1 -1
  182. package/registry/glossary.json +1 -1
  183. package/registry/glow-card.json +1 -1
  184. package/registry/goal-gauge.json +1 -1
  185. package/registry/grade-stamp.json +1 -1
  186. package/registry/how-it-works-page.json +1 -1
  187. package/registry/image-cropper.json +1 -1
  188. package/registry/index.json +142 -10
  189. package/registry/iso.json +1 -1
  190. package/registry/kanban.json +1 -1
  191. package/registry/kbd.json +1 -1
  192. package/registry/kind-config-editor.json +1 -1
  193. package/registry/kpi-explained.json +1 -1
  194. package/registry/landing-page.json +1 -1
  195. package/registry/landscape.json +1 -1
  196. package/registry/language-switch.json +1 -1
  197. package/registry/legal-page.json +1 -1
  198. package/registry/link-card.json +1 -1
  199. package/registry/list.json +1 -1
  200. package/registry/loader.json +1 -1
  201. package/registry/longform-page.json +1 -1
  202. package/registry/maintenance-screen.json +1 -1
  203. package/registry/map.json +2 -2
  204. package/registry/margin-layout.json +1 -1
  205. package/registry/markdown.json +1 -1
  206. package/registry/marketing-layout.json +1 -1
  207. package/registry/marquee.json +1 -1
  208. package/registry/mascot-quote.json +1 -1
  209. package/registry/mascot-state.json +1 -1
  210. package/registry/mascots.json +1 -1
  211. package/registry/match-dialog.json +1 -1
  212. package/registry/media-capture.json +1 -1
  213. package/registry/media-gallery.json +1 -1
  214. package/registry/media-grid.json +1 -1
  215. package/registry/meta-row.json +1 -1
  216. package/registry/meter.json +1 -1
  217. package/registry/money-input.json +236 -0
  218. package/registry/nav-bar.json +22 -8
  219. package/registry/next-actions.json +1 -1
  220. package/registry/notification-preferences.json +1 -1
  221. package/registry/number-ticker.json +1 -1
  222. package/registry/opening-hours.json +1 -1
  223. package/registry/page-header.json +1 -1
  224. package/registry/page-hero.json +1 -1
  225. package/registry/page-index.json +1 -1
  226. package/registry/page.json +1 -1
  227. package/registry/pagination.json +1 -1
  228. package/registry/photo-grid.json +1 -1
  229. package/registry/pointer-light.json +1 -1
  230. package/registry/popover.json +1 -1
  231. package/registry/pricing-page.json +1 -1
  232. package/registry/product-page.json +1 -1
  233. package/registry/profile-card.json +1 -1
  234. package/registry/progress.json +1 -1
  235. package/registry/promise-card.json +1 -1
  236. package/registry/promo-code-field.json +258 -0
  237. package/registry/qr-code.json +1 -1
  238. package/registry/quota-meter.json +1 -1
  239. package/registry/radio-group.json +1 -1
  240. package/registry/rail-nav.json +2 -2
  241. package/registry/recipes.json +1 -1
  242. package/registry/retro-tv.json +120 -8
  243. package/registry/reviews.json +1 -1
  244. package/registry/router.json +1 -1
  245. package/registry/scroll-stage.json +1 -1
  246. package/registry/search-field.json +1 -1
  247. package/registry/section-backdrop.json +1 -1
  248. package/registry/separator.json +1 -1
  249. package/registry/service-card.json +1 -1
  250. package/registry/settings-layout.json +1 -1
  251. package/registry/shop-composer.json +1 -1
  252. package/registry/shop-gallery.json +209 -0
  253. package/registry/shop.json +30 -6
  254. package/registry/showcase.json +1 -1
  255. package/registry/signature.json +1 -1
  256. package/registry/site-cahier.json +1 -1
  257. package/registry/site-footer.json +2 -2
  258. package/registry/sites.json +1 -1
  259. package/registry/skeleton.json +1 -1
  260. package/registry/skip-link.json +1 -1
  261. package/registry/slider.json +1 -1
  262. package/registry/slot-picker.json +1 -1
  263. package/registry/slot.json +1 -1
  264. package/registry/specimen-tag.json +1 -1
  265. package/registry/speed-lines.json +1 -1
  266. package/registry/spinner.json +1 -1
  267. package/registry/split-view.json +1 -1
  268. package/registry/stage-banner.json +1 -1
  269. package/registry/stat.json +1 -1
  270. package/registry/status-chip.json +1 -1
  271. package/registry/status-page.json +1 -1
  272. package/registry/step-progress.json +1 -1
  273. package/registry/step-showcase.json +1 -1
  274. package/registry/stepper.json +1 -1
  275. package/registry/sticky-action.json +1 -1
  276. package/registry/stuck.json +1 -1
  277. package/registry/swipe-deck.json +1 -1
  278. package/registry/switch.json +1 -1
  279. package/registry/tabs.json +1 -1
  280. package/registry/tag-input.json +1 -1
  281. package/registry/tag-selector.json +2 -2
  282. package/registry/taped-photo.json +1 -1
  283. package/registry/terminal-replay.json +1 -1
  284. package/registry/text-style.json +1 -1
  285. package/registry/theme.json +1 -1
  286. package/registry/toast.json +1 -1
  287. package/registry/toc.json +1 -1
  288. package/registry/tooltip.json +1 -1
  289. package/registry/tree-view.json +1 -1
  290. package/registry/update-prompt.json +1 -1
  291. package/registry/upload-queue.json +1 -1
  292. package/registry/usage.json +1 -1
  293. package/registry/verified-badge.json +1 -1
  294. package/registry/versus-card.json +1 -1
  295. package/registry/vertical-video.json +1 -1
  296. package/registry/video-player.json +1 -1
  297. package/registry/video-trimmer.json +1 -1
  298. package/registry/virtual.json +1 -1
  299. package/registry/wall.json +1 -1
  300. package/registry/waveform.json +1 -1
  301. /package/dist/{chunk-E4X3V7QX.js.map → chunk-GRVIZTT2.js.map} +0 -0
@@ -0,0 +1,236 @@
1
+ {
2
+ "name": "money-input",
3
+ "type": "primitive",
4
+ "title": "Money input",
5
+ "summary": "An amount in integer minor units (cents) and a currency, typed the way the locale writes it, never as a float.",
6
+ "description": "An amount in integer minor units (cents) and a currency, typed the way the locale writes it, never as a float.",
7
+ "status": "beta",
8
+ "deprecated": null,
9
+ "category": "forms",
10
+ "platforms": "web",
11
+ "parity": {
12
+ "web": {
13
+ "state": "yes"
14
+ },
15
+ "native": {
16
+ "state": "gap",
17
+ "reason": "The native twins of PromoCodeField, MoneyInput and CopyButton are a follow-up of the coupons surfaces.",
18
+ "issue": "krizaka/krizaka-ui#782"
19
+ },
20
+ "desktop": {
21
+ "state": "yes"
22
+ }
23
+ },
24
+ "whenToUse": [
25
+ "For a price, a discount or a budget the app stores as cents.",
26
+ "When the person may pick the currency among a short list."
27
+ ],
28
+ "whenNotToUse": [
29
+ {
30
+ "when": "For a plain number (a quantity).",
31
+ "use": "field"
32
+ }
33
+ ],
34
+ "bestPractices": [
35
+ "Hold the integer in your state; the field formats it by `locale` (`fr-CA` writes “12,50”).",
36
+ "Pair it with `Field.Label` and `Field.Error`.",
37
+ "A currency without decimals (JPY) accepts none; one with three (BHD) accepts three."
38
+ ],
39
+ "accessibility": {
40
+ "keyboard": [
41
+ {
42
+ "keys": "Type",
43
+ "action": "Digits and the locale's decimal mark; more decimals than the currency has are refused."
44
+ }
45
+ ],
46
+ "notes": [
47
+ "A text input with a decimal keypad on phones.",
48
+ "The currency select needs `currencyLabel` as its accessible name.",
49
+ "On blur the amount is rewritten grouped and padded (“1 299,00”)."
50
+ ]
51
+ },
52
+ "related": [
53
+ "field",
54
+ "combobox"
55
+ ],
56
+ "web": {
57
+ "entry": "@krizaka/ui/money-input",
58
+ "import": "import { MoneyInput, parseMinorUnits, formatMinorUnits } from \"@krizaka/ui/money-input\";",
59
+ "props": [
60
+ {
61
+ "component": "MoneyInput",
62
+ "description": "An amount field in minor units. The caller holds an integer; the person sees their locale's decimal.",
63
+ "props": [
64
+ {
65
+ "name": "currency",
66
+ "type": "string",
67
+ "default": null,
68
+ "description": "ISO 4217 code: `\"CAD\"`.",
69
+ "required": true
70
+ },
71
+ {
72
+ "name": "locale",
73
+ "type": "string",
74
+ "default": null,
75
+ "description": "BCP 47 locale for the separators: `\"fr-CA\"`, `\"en-CA\"`.",
76
+ "required": true
77
+ },
78
+ {
79
+ "name": "onValueChange",
80
+ "type": "(minorUnits: number | null) => void",
81
+ "default": null,
82
+ "description": "Called with the new amount in minor units, or `null` when the field is emptied.",
83
+ "required": true
84
+ },
85
+ {
86
+ "name": "value",
87
+ "type": "number | null",
88
+ "default": null,
89
+ "description": "The amount in minor units (cents), an integer, or `null` when empty.",
90
+ "required": true
91
+ },
92
+ {
93
+ "name": "currencies",
94
+ "type": "readonly string[]",
95
+ "default": null,
96
+ "description": "The currencies to choose among (ISO codes). Omitted: the currency is fixed.",
97
+ "required": false
98
+ },
99
+ {
100
+ "name": "currencyLabel",
101
+ "type": "string",
102
+ "default": null,
103
+ "description": "The currency select's accessible name, passed translated: \"Currency\".",
104
+ "required": false
105
+ },
106
+ {
107
+ "name": "invalid",
108
+ "type": "boolean",
109
+ "default": null,
110
+ "description": "Marks the amount invalid (pair it with a `Field.Error`).",
111
+ "required": false
112
+ },
113
+ {
114
+ "name": "onCurrencyChange",
115
+ "type": "((currency: string) => void)",
116
+ "default": null,
117
+ "description": "Called with the chosen currency (required with `currencies`).",
118
+ "required": false
119
+ }
120
+ ]
121
+ }
122
+ ],
123
+ "examples": [
124
+ {
125
+ "name": "default",
126
+ "title": "Fixed currency",
127
+ "description": "3900 cents in en-CA.",
128
+ "path": "examples/money-input/default.tsx",
129
+ "module": "@krizaka/ui/registry/examples/money-input/default",
130
+ "code": "\"use client\";\n\nimport { Field } from \"@krizaka/ui/field\";\nimport { MoneyInput } from \"@krizaka/ui/money-input\";\nimport { useState } from \"react\";\n\nexport default function MoneyInputDefault() {\n const [cents, setCents] = useState<number | null>(3900);\n return (\n <Field.Root>\n <Field.Label htmlFor=\"price\">Price</Field.Label>\n <MoneyInput id=\"price\" value={cents} onValueChange={setCents} currency=\"CAD\" locale=\"en-CA\" />\n <Field.Hint>{cents === null ? \"Empty\" : `${cents} cents`}</Field.Hint>\n </Field.Root>\n );\n}\n"
131
+ },
132
+ {
133
+ "name": "currencies",
134
+ "title": "Chosen currency",
135
+ "description": "fr-CA, four currencies; JPY drops the decimals.",
136
+ "path": "examples/money-input/currencies.tsx",
137
+ "module": "@krizaka/ui/registry/examples/money-input/currencies",
138
+ "code": "\"use client\";\n\nimport { Field } from \"@krizaka/ui/field\";\nimport { MoneyInput } from \"@krizaka/ui/money-input\";\nimport { useState } from \"react\";\n\nexport default function MoneyInputCurrencies() {\n const [cents, setCents] = useState<number | null>(129900);\n const [currency, setCurrency] = useState(\"CAD\");\n return (\n <Field.Root>\n <Field.Label htmlFor=\"amount\">Montant</Field.Label>\n <MoneyInput id=\"amount\" value={cents} onValueChange={setCents} currency={currency} onCurrencyChange={setCurrency} currencies={[\"CAD\", \"USD\", \"EUR\", \"JPY\"]} currencyLabel=\"Devise\" locale=\"fr-CA\" />\n </Field.Root>\n );\n}\n"
139
+ }
140
+ ]
141
+ },
142
+ "native": null,
143
+ "files": [
144
+ {
145
+ "path": "meta.ts",
146
+ "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-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\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 | \"copy-button\"\n | \"money-input\"\n | \"promo-code-field\"\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 | \"qr-code\"\n | \"entity-header\"\n | \"collection-switcher\"\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 | \"shop-gallery\"\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 | \"shop\"\n | \"shop-composer\"\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"
147
+ },
148
+ {
149
+ "path": "money-input/index.ts",
150
+ "content": "/** @krizaka/ui/money-input — `MoneyInput` (an amount in integer minor units and a currency), with its pure parse/format. Client (\"use client\"). */\nexport { formatMinorUnits, MoneyInput, type MoneyInputProps, parseMinorUnits } from \"./money-input\";\n"
151
+ },
152
+ {
153
+ "path": "money-input/meta.ts",
154
+ "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Money input\",\n summary: \"An amount in integer minor units (cents) and a currency, typed the way the locale writes it, never as a float.\",\n status: \"beta\",\n category: \"forms\",\n platforms: \"web\",\n parity: { native: { status: \"gap\", issue: \"krizaka/krizaka-ui#782\", reason: \"The native twins of PromoCodeField, MoneyInput and CopyButton are a follow-up of the coupons surfaces.\" }, desktop: \"web\" },\n whenToUse: [\"For a price, a discount or a budget the app stores as cents.\", \"When the person may pick the currency among a short list.\"],\n whenNotToUse: [{ when: \"For a plain number (a quantity).\", use: \"field\" }],\n bestPractices: [\"Hold the integer in your state; the field formats it by `locale` (`fr-CA` writes “12,50”).\", \"Pair it with `Field.Label` and `Field.Error`.\", \"A currency without decimals (JPY) accepts none; one with three (BHD) accepts three.\"],\n accessibility: {\n keyboard: [{ keys: \"Type\", action: \"Digits and the locale's decimal mark; more decimals than the currency has are refused.\" }],\n notes: [\"A text input with a decimal keypad on phones.\", \"The currency select needs `currencyLabel` as its accessible name.\", \"On blur the amount is rewritten grouped and padded (“1 299,00”).\"],\n },\n related: [\"field\", \"combobox\"],\n web: {\n imports: [\"MoneyInput\", \"parseMinorUnits\", \"formatMinorUnits\"],\n examples: [\n { name: \"default\", title: \"Fixed currency\", description: \"3900 cents in en-CA.\" },\n { name: \"currencies\", title: \"Chosen currency\", description: \"fr-CA, four currencies; JPY drops the decimals.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
155
+ },
156
+ {
157
+ "path": "money-input/money-input.tsx",
158
+ "content": "// Client (the text being typed). An amount in INTEGER minor units (cents) plus a currency. The person types a\n// decimal in their locale's way; it is read as a string (never a float) into cents, refused beyond the currency's own\n// decimals, and written back grouped and padded on blur. The currency can be chosen among `currencies` (a native\n// select). Words arrive as props.\nimport { currencyDigits } from \"@krizaka/intl\";\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Input, Select } from \"../field/field\";\n\nexport type MoneyInputProps = Omit<React.ComponentProps<\"input\">, \"value\" | \"defaultValue\" | \"onChange\" | \"type\" | \"inputMode\"> & {\n /** The amount in minor units (cents), an integer, or `null` when empty. */\n value: number | null;\n /** Called with the new amount in minor units, or `null` when the field is emptied. */\n onValueChange: (minorUnits: number | null) => void;\n /** ISO 4217 code: `\"CAD\"`. */\n currency: string;\n /** BCP 47 locale for the separators: `\"fr-CA\"`, `\"en-CA\"`. */\n locale: string;\n /** The currencies to choose among (ISO codes). Omitted: the currency is fixed. */\n currencies?: readonly string[];\n /** Called with the chosen currency (required with `currencies`). */\n onCurrencyChange?: (currency: string) => void;\n /** The currency select's accessible name, passed translated: \"Currency\". */\n currencyLabel?: string;\n /** Marks the amount invalid (pair it with a `Field.Error`). */\n invalid?: boolean;\n};\n\nconst separators = (locale: string) => {\n const parts = new Intl.NumberFormat(locale, { useGrouping: true, minimumFractionDigits: 1 }).formatToParts(1234567.1);\n return { decimal: parts.find((p) => p.type === \"decimal\")?.value ?? \".\", group: parts.find((p) => p.type === \"group\")?.value ?? \",\" };\n};\n\n/** \"12,50\" → 1250 without a float; `undefined` when the text is not an amount or has too many decimals. */\nexport function parseMinorUnits(text: string, locale: string, digits: number): number | null | undefined {\n const { decimal } = separators(locale);\n const cleaned = text.replace(/\\s/g, \"\");\n if (cleaned === \"\") return null;\n // The locale's decimal mark, and \".\" or \",\" as a typed alternative; any other mark is a thousands separator.\n const marks = [...cleaned].filter((c) => c === \".\" || c === \",\" || c === decimal);\n if (!/^[\\d.,]+$/.test(cleaned.replaceAll(decimal, \"\"))) return undefined;\n const last = marks.length ? Math.max(cleaned.lastIndexOf(\".\"), cleaned.lastIndexOf(\",\"), cleaned.lastIndexOf(decimal)) : -1;\n const whole = (last >= 0 ? cleaned.slice(0, last) : cleaned).replace(/\\D/g, \"\");\n const fraction = last >= 0 ? cleaned.slice(last + 1) : \"\";\n if (!/^\\d*$/.test(fraction) || fraction.length > digits || (digits === 0 && last >= 0)) return undefined;\n const minor = Number(`${whole || \"0\"}${fraction.padEnd(digits, \"0\")}`);\n return Number.isSafeInteger(minor) ? minor : undefined;\n}\n\n/** Minor units → \"1 234,50\" in the locale, exact (BigInt), padded to the currency's decimals. */\nexport function formatMinorUnits(minor: number, locale: string, digits: number): string {\n const { decimal } = separators(locale);\n const abs = BigInt(Math.abs(minor)).toString().padStart(digits + 1, \"0\");\n const whole = new Intl.NumberFormat(locale).format(BigInt(digits ? abs.slice(0, -digits) : abs));\n return `${minor < 0 ? \"-\" : \"\"}${whole}${digits ? decimal + abs.slice(-digits) : \"\"}`;\n}\n\n/** An amount field in minor units. The caller holds an integer; the person sees their locale's decimal. */\nexport function MoneyInput({ value, onValueChange, currency, locale, currencies, onCurrencyChange, currencyLabel, invalid, className, onBlur, disabled, ...props }: MoneyInputProps) {\n const digits = currencyDigits(currency);\n const [text, setText] = React.useState(() => (value === null ? \"\" : formatMinorUnits(value, locale, digits)));\n const typed = React.useRef<number | null>(value);\n // Follow the caller when the value changes from outside (a reset, another currency's digits).\n React.useEffect(() => {\n if (typed.current !== value) setText(value === null ? \"\" : formatMinorUnits(value, locale, digits));\n typed.current = value;\n }, [value, locale, digits]);\n return (\n <span className={cn(\"flex w-full items-stretch gap-2\", className)}>\n <Input\n {...props}\n type=\"text\"\n inputMode={digits ? \"decimal\" : \"numeric\"}\n autoComplete=\"off\"\n disabled={disabled}\n invalid={invalid}\n data-currency={currency}\n value={text}\n onChange={(event) => {\n const parsed = parseMinorUnits(event.target.value, locale, digits);\n if (parsed === undefined) return; // refused: not an amount, or more decimals than the currency has\n setText(event.target.value);\n typed.current = parsed;\n onValueChange(parsed);\n }}\n onBlur={(event) => {\n onBlur?.(event);\n if (value !== null) setText(formatMinorUnits(value, locale, digits));\n }}\n />\n {currencies ? (\n <Select aria-label={currencyLabel} disabled={disabled} value={currency} onChange={(event) => onCurrencyChange?.(event.target.value)} className=\"w-28\">\n {currencies.map((code) => (\n <option key={code} value={code}>\n {code}\n </option>\n ))}\n </Select>\n ) : (\n <span className=\"flex items-center text-sm font-medium text-fg-secondary\">{currency}</span>\n )}\n </span>\n );\n}\n"
159
+ }
160
+ ],
161
+ "dependencies": [
162
+ "@krizaka/intl@^0.4.1"
163
+ ],
164
+ "registryDependencies": [
165
+ "cn",
166
+ "field"
167
+ ],
168
+ "demo": {
169
+ "path": "examples/money-input/default.tsx",
170
+ "content": "\"use client\";\n\nimport { Field } from \"@krizaka/ui/field\";\nimport { MoneyInput } from \"@krizaka/ui/money-input\";\nimport { useState } from \"react\";\n\nexport default function MoneyInputDefault() {\n const [cents, setCents] = useState<number | null>(3900);\n return (\n <Field.Root>\n <Field.Label htmlFor=\"price\">Price</Field.Label>\n <MoneyInput id=\"price\" value={cents} onValueChange={setCents} currency=\"CAD\" locale=\"en-CA\" />\n <Field.Hint>{cents === null ? \"Empty\" : `${cents} cents`}</Field.Hint>\n </Field.Root>\n );\n}\n"
171
+ },
172
+ "props": [
173
+ {
174
+ "component": "MoneyInput",
175
+ "description": "An amount field in minor units. The caller holds an integer; the person sees their locale's decimal.",
176
+ "props": [
177
+ {
178
+ "name": "currency",
179
+ "type": "string",
180
+ "default": null,
181
+ "description": "ISO 4217 code: `\"CAD\"`.",
182
+ "required": true
183
+ },
184
+ {
185
+ "name": "locale",
186
+ "type": "string",
187
+ "default": null,
188
+ "description": "BCP 47 locale for the separators: `\"fr-CA\"`, `\"en-CA\"`.",
189
+ "required": true
190
+ },
191
+ {
192
+ "name": "onValueChange",
193
+ "type": "(minorUnits: number | null) => void",
194
+ "default": null,
195
+ "description": "Called with the new amount in minor units, or `null` when the field is emptied.",
196
+ "required": true
197
+ },
198
+ {
199
+ "name": "value",
200
+ "type": "number | null",
201
+ "default": null,
202
+ "description": "The amount in minor units (cents), an integer, or `null` when empty.",
203
+ "required": true
204
+ },
205
+ {
206
+ "name": "currencies",
207
+ "type": "readonly string[]",
208
+ "default": null,
209
+ "description": "The currencies to choose among (ISO codes). Omitted: the currency is fixed.",
210
+ "required": false
211
+ },
212
+ {
213
+ "name": "currencyLabel",
214
+ "type": "string",
215
+ "default": null,
216
+ "description": "The currency select's accessible name, passed translated: \"Currency\".",
217
+ "required": false
218
+ },
219
+ {
220
+ "name": "invalid",
221
+ "type": "boolean",
222
+ "default": null,
223
+ "description": "Marks the amount invalid (pair it with a `Field.Error`).",
224
+ "required": false
225
+ },
226
+ {
227
+ "name": "onCurrencyChange",
228
+ "type": "((currency: string) => void)",
229
+ "default": null,
230
+ "description": "Called with the chosen currency (required with `currencies`).",
231
+ "required": false
232
+ }
233
+ ]
234
+ }
235
+ ]
236
+ }
@@ -48,7 +48,7 @@
48
48
  "bestPractices": [
49
49
  "The company's bar: `<NavBar.Brand href=… org={org} />` with `org` of `@krizaka/org` is the Krizaka mark and the brand name, so no site writes the company's name by hand; a product keeps its own children.",
50
50
  "A product's bar ends with `ProductBarActions`: the primary action is using the app (« Sign in » while sign-up is closed, « Try » once it opens, from the product's `signupOpen` setting), « Sign in » never twice, and no « Contact » or « Talk to us » — contact is a plain link in the footer. krizaka.com, the company site, keeps its « Contact us ».",
51
- "Who is here is one contract for every product: `GET /api/me` answers 200 `{ signedIn, signupOpen, account? }` with `Cache-Control: private, no-store` and `Vary: Cookie` (`import { meResponse } from \"@krizaka/ui/nav-bar/me\"` in a route handler or server module), signed out is never a 401. `NavBar.Session` (in `NavBar.Actions`, needs a `@krizaka/query` provider) asks it and shows your `ProductBarActions` or your account menu — never a local copy of the island.",
51
+ "Who is here is one contract for every product: `GET /api/me` answers 200 `{ signedIn, signupOpen, account? }` with `Cache-Control: private, no-store` and `Vary: Cookie` (`import { meResponse } from \"@krizaka/ui/nav-bar/me\"` in a route handler or server module), signed out is never a 401. `NavBar.Session` (in `NavBar.Actions`, needs a `@krizaka/query` provider) asks it and shows your `ProductBarActions` or your account menu — never a local copy of the island. Pending is neither state (the bar reserves its place), a failed refetch keeps the last known state, and a dynamic page passes `initial` (its server-read session) so the first paint is the answer; `useNavSession` is the same reading for a hero or closing action, so they never disagree.",
52
52
  "Five items at most on the bar; group the rest in a menu, each link with a name and one short line (`NavBar.MenuLink`, one line, ≤ 45 characters).",
53
53
  "A product's site (dev.<product>, see Navigation in the family): the product's mark alone (no `NavBar.Family`, no badge — the version goes in the footer), then **Product ▾** (what it does: how it works, its features, the demo) · **Platforms ▾** (web, mobile, desktop, self-host — omitted for a single-platform product) · **Docs** · Pricing when it exists; never a lone entry that belongs to a group (no top-level Demo, Mobile or Mac). The phone panel repeats the groups with `NavBar.MobileGroup`, in the same order.",
54
54
  "A menu of three links or fewer is not a menu: `NavBar.Menu` puts them in the bar as plain links (the current one marked, no dropdown) — `inlineUpTo`, 3 by default, `0` to keep a dropdown. Above three, the dropdown. The phone panel groups them with `NavBar.MobileGroup` either way.",
@@ -344,7 +344,7 @@
344
344
  },
345
345
  {
346
346
  "component": "NavBarSession",
347
- "description": "The bar's session island: put it in `NavBar.Actions`. While the answer is on its way it reserves the place and says\n`hint` politely; if the request fails it shows the signed-out actions (the visitor can still sign in).",
347
+ "description": "The bar's session island: put it in `NavBar.Actions`. While the answer is on its way it reserves the place and says\n`hint` politely (or, given `initial`, draws the server's answer at once); if the first request fails it shows the\nsigned-out actions (the visitor can still sign in).",
348
348
  "props": [
349
349
  {
350
350
  "name": "hint",
@@ -380,6 +380,13 @@
380
380
  "default": "/api/me",
381
381
  "description": "Where the contract is served.",
382
382
  "required": false
383
+ },
384
+ {
385
+ "name": "initial",
386
+ "type": "MeResponse<TAccount>",
387
+ "default": null,
388
+ "description": "The session the server already knows (a dynamic page reading its cookie): the first paint then IS the answer, with no\nplaceholder and no swap. Leave it out on a static page; the bar reserves its place until the answer comes.",
389
+ "required": false
383
390
  }
384
391
  ]
385
392
  },
@@ -686,11 +693,11 @@
686
693
  },
687
694
  {
688
695
  "path": "meta.ts",
689
- "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-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\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 | \"qr-code\"\n | \"entity-header\"\n | \"collection-switcher\"\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 | \"shop\"\n | \"shop-composer\"\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"
696
+ "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-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\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 | \"copy-button\"\n | \"money-input\"\n | \"promo-code-field\"\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 | \"qr-code\"\n | \"entity-header\"\n | \"collection-switcher\"\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 | \"shop-gallery\"\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 | \"shop\"\n | \"shop-composer\"\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"
690
697
  },
691
698
  {
692
699
  "path": "nav-bar/index.ts",
693
- "content": "/** @krizaka/ui/nav-bar — `NavBar` (Root, Brand, Family, Badge, Items, Link, Menu, MenuLink, Actions, Repo, Mobile, MobileGroup, MobileLink), `navBar`. Client. */\nexport { meHeaders, type MeResponse, meResponse, meSchema } from \"./me\";\nexport {\n NavBar,\n navBar,\n NavBarActions,\n NavBarBadge,\n type NavBarBadgeProps,\n NavBarBrand,\n type NavBarBrandProps,\n NavBarFamily,\n type NavBarFamilyProps,\n NavBarItems,\n type NavBarItemsProps,\n NavBarLanguage,\n type NavBarLanguageProps,\n NavBarLink,\n type NavBarLinkProps,\n NavBarMenu,\n NavBarMenuLink,\n type NavBarMenuLinkProps,\n type NavBarMenuProps,\n NavBarMobile,\n NavBarMobileGroup,\n type NavBarMobileGroupProps,\n NavBarMobileLink,\n type NavBarMobileLinkProps,\n NavBarMobilePreferences,\n type NavBarMobilePreferencesProps,\n type NavBarMobileProps,\n NavBarRepo,\n type NavBarRepoProps,\n NavBarRoot,\n type NavBarRootProps,\n} from \"./nav-bar\";\nexport { type PlacePanel,placePanel } from \"./placement\";\nexport { ProductBarAction, ProductBarActions, productBarActions, type ProductBarActionsProps, type ProductBarLink, type ProductBarState } from \"./product-actions\";\nexport { NavBarSession, type NavBarSessionProps, sessionKey } from \"./session\";\n"
700
+ "content": "/** @krizaka/ui/nav-bar — `NavBar` (Root, Brand, Family, Badge, Items, Link, Menu, MenuLink, Actions, Repo, Mobile, MobileGroup, MobileLink), `navBar`. Client. */\nexport { meHeaders, type MeResponse, meResponse, meSchema } from \"./me\";\nexport {\n NavBar,\n navBar,\n NavBarActions,\n NavBarBadge,\n type NavBarBadgeProps,\n NavBarBrand,\n type NavBarBrandProps,\n NavBarFamily,\n type NavBarFamilyProps,\n NavBarItems,\n type NavBarItemsProps,\n NavBarLanguage,\n type NavBarLanguageProps,\n NavBarLink,\n type NavBarLinkProps,\n NavBarMenu,\n NavBarMenuLink,\n type NavBarMenuLinkProps,\n type NavBarMenuProps,\n NavBarMobile,\n NavBarMobileGroup,\n type NavBarMobileGroupProps,\n NavBarMobileLink,\n type NavBarMobileLinkProps,\n NavBarMobilePreferences,\n type NavBarMobilePreferencesProps,\n type NavBarMobileProps,\n NavBarRepo,\n type NavBarRepoProps,\n NavBarRoot,\n type NavBarRootProps,\n} from \"./nav-bar\";\nexport { type PlacePanel,placePanel } from \"./placement\";\nexport { ProductBarAction, ProductBarActions, productBarActions, type ProductBarActionsProps, type ProductBarLink, type ProductBarState } from \"./product-actions\";\nexport { NavBarSession, type NavBarSessionProps, type NavSession, sessionKey, useNavSession } from \"./session\";\n"
694
701
  },
695
702
  {
696
703
  "path": "nav-bar/me.ts",
@@ -698,7 +705,7 @@
698
705
  },
699
706
  {
700
707
  "path": "nav-bar/meta.ts",
701
- "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Nav bar\",\n summary:\n \"The Krizaka navigation bar, the same on every site of the family: a floating pill that tightens as the page scrolls, the family switcher on the brand, one light that glides to the item under the pointer or the focus and rests on the current page, accessible menus with rich links, and a mobile panel.\",\n status: \"beta\",\n category: \"navigation\",\n platforms: \"web\",\n parity: { native: { status: \"n/a\", reason: \"A site's top bar; an app on a phone navigates with its tab bar.\", use: \"tab-bar\" }, desktop: { status: \"n/a\", reason: \"A public site's page, not a window of the Mac app.\" } },\n whenToUse: [\n \"The top navigation of a site or a product: a brand, a few links, one or two menus, actions on the right.\",\n \"A section bar inside an app (`floating={false}`): videos, earnings, auctions.\",\n \"Every site of the Krizaka family (www, ui., java., dev.<product>, admin.<product>): the brand and `NavBar.Family` on the left, at most four of the site's sections in the middle, the tools on the right.\",\n ],\n whenNotToUse: [\n { when: \"To switch views inside a page without changing the address.\", use: \"tabs\" },\n { when: \"For a list of actions on one object.\", use: \"dropdown-menu\" },\n { when: \"For search and commands across the app.\", use: \"command\" },\n { when: \"To link to another site of the family from the bar's middle: the family switcher holds them.\", use: \"sites\" },\n ],\n bestPractices: [\n \"The company's bar: `<NavBar.Brand href=… org={org} />` with `org` of `@krizaka/org` is the Krizaka mark and the brand name, so no site writes the company's name by hand; a product keeps its own children.\",\n \"A product's bar ends with `ProductBarActions`: the primary action is using the app (« Sign in » while sign-up is closed, « Try » once it opens, from the product's `signupOpen` setting), « Sign in » never twice, and no « Contact » or « Talk to us » — contact is a plain link in the footer. krizaka.com, the company site, keeps its « Contact us ».\",\n \"Who is here is one contract for every product: `GET /api/me` answers 200 `{ signedIn, signupOpen, account? }` with `Cache-Control: private, no-store` and `Vary: Cookie` (`import { meResponse } from \\\"@krizaka/ui/nav-bar/me\\\"` in a route handler or server module), signed out is never a 401. `NavBar.Session` (in `NavBar.Actions`, needs a `@krizaka/query` provider) asks it and shows your `ProductBarActions` or your account menu — never a local copy of the island.\",\n \"Five items at most on the bar; group the rest in a menu, each link with a name and one short line (`NavBar.MenuLink`, one line, ≤ 45 characters).\",\n \"A product's site (dev.<product>, see Navigation in the family): the product's mark alone (no `NavBar.Family`, no badge — the version goes in the footer), then **Product ▾** (what it does: how it works, its features, the demo) · **Platforms ▾** (web, mobile, desktop, self-host — omitted for a single-platform product) · **Docs** · Pricing when it exists; never a lone entry that belongs to a group (no top-level Demo, Mobile or Mac). The phone panel repeats the groups with `NavBar.MobileGroup`, in the same order.\",\n \"A menu of three links or fewer is not a menu: `NavBar.Menu` puts them in the bar as plain links (the current one marked, no dropdown) — `inlineUpTo`, 3 by default, `0` to keep a dropdown. Above three, the dropdown. The phone panel groups them with `NavBar.MobileGroup` either way.\",\n \"Light one item at most: the group that holds the page (`active` on its `NavBar.Menu`), never two.\",\n \"Mark the current page with `active`: the light rests on it, `aria-current=\\\"page\\\"` says it.\",\n \"Use your router's link with `asChild` on `NavBar.Link`, `NavBar.MenuLink` and `NavBar.MobileLink`.\",\n \"One primary action at most in `NavBar.Actions` (a `Button` `size=\\\"sm\\\"` `shape=\\\"pill\\\"`).\",\n \"Wrap it in a `sticky top-3` (floating) or `sticky top-0` container to keep it on screen.\",\n \"Three zones on every Krizaka site: who I am (`NavBar.Brand` + `NavBar.Family current=\\\"<site>\\\"`, then `NavBar.Badge` with the version or `DEV · v1.2.3`), this site (at most four sections, never a link to another site), tools (search when there is something to search, `NavBar.Repo`, theme, language, one primary action).\",\n \"The language is `NavBar.Language`, the same on every site: a globe and the current code (`FR`) opening a menu of the languages named in their own language (`languagesFor(pathname)`), never a pill naming the other language. In `NavBar.Mobile` it renders as a row, inside `NavBar.MobilePreferences` with the theme.\",\n \"Menu links: a name and a description that wraps on two lines at most (≤ 90 characters); the panel is 28 rem wide (40 rem in two columns), aligned under its trigger and kept inside the page.\",\n \"Place a second `NavBar.Family` as the last child of `NavBar.Mobile`: below `md` the family is the panel's last group.\",\n \"Pass the family's words translated: `labels={familyLabels[locale]}` from `@krizaka/ui/sites`.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Tab\", action: \"Moves between the brand, the items and the actions; leaving an open menu closes it.\" },\n { keys: \"Enter / Space / ↓\", action: \"Opens a menu and moves into it.\" },\n { keys: \"↑ / ↓ · Home / End\", action: \"Walks the links of an open menu.\" },\n { keys: \"← / →\", action: \"Moves between the items of the bar.\" },\n { keys: \"Esc\", action: \"Closes the menu, the family or the mobile panel and returns the focus to its trigger.\" },\n { keys: \"Click outside\", action: \"Closes the open menu or the mobile panel.\" },\n { keys: \"Enter / Space / ↓ (family)\", action: \"Opens the family from its chevron; ↑ / ↓ walk the sites. It never opens on hover.\" },\n ],\n notes: [\n \"A `nav` named by `label`, a list of links and menu triggers (Radix NavigationMenu): `aria-expanded` and `aria-controls` on each trigger.\",\n \"The mobile panel is a disclosure (no focus trap): its toggle is named by `openLabel` / `closeLabel` and says `aria-expanded`; a press outside closes it. `NavBar.MobileGroup` is a `group` named by its heading.\",\n \"Menus open on click, Enter, Space or ↓, or when the pointer rests on the trigger (`delayDuration`, 200 ms) — passing over the bar opens nothing. While a menu is open the light stays on its trigger; moving on to a plain link closes the menu.\",\n \"The light, the chevron and the tightening do not move under `prefers-reduced-motion`; the current page is tinted before scripts load.\",\n \"The family is its own `nav` named by `labels.family`; its chevron is a button with the same name, `aria-expanded` and `aria-controls`. Each group is a list named by its heading, the current site says `aria-current=\\\"true\\\"` and “You are here”, a site not released says its status in words.\",\n \"`NavBar.Repo` is an icon link named by `label`; `NavBar.Badge` is plain text (`DEV · v1.2.3`), hidden below `sm`.\",\n ],\n },\n related: [\"language-switch\", \"sites\", \"site-footer\", \"tabs\", \"dropdown-menu\", \"command\", \"button\"],\n web: {\n imports: [\"NavBar\", \"ProductBarActions\", \"productBarActions\"],\n examples: [\n { name: \"family-www\", title: \"www.krizaka.com\", description: \"The company's bar: the mark and the family switcher, Products · Open source · Our story, the repository and Contact. Open the chevron: every site of Krizaka, grouped, the current one marked.\" },\n { name: \"family-ui\", title: \"ui.krizaka.com\", description: \"Krizaka UI: the family, the version of the packages, Get started · Foundations · Components · Templates, the repository.\" },\n { name: \"family-java\", title: \"java.krizaka.com\", description: \"Krizaka Java: the family, the version of the building blocks, Get started · Building blocks · Guides.\" },\n { name: \"family-product\", title: \"dev.<product>\", description: \"A product's site, the standard of every Krizaka product: its mark alone, Product ▾ · Platforms ▾ · Docs with menus (icon · title · a description of two lines), the repository, the theme, the language, Sign in and “Talk to us”; the phone panel groups the same entries and ends with the preferences.\" },\n { name: \"family-admin\", title: \"admin.<product>\", description: \"A console: the mark, the family and `DEV`, no sections, a full-width bar.\" },\n { name: \"site\", title: \"A site's bar\", description: \"Brand, a Products menu, links, a call to action, a mobile panel — hover the items: one light glides between them.\" },\n { name: \"menu-open\", title: \"A rich menu\", description: \"Two columns of links with icons whose node lights up, the current page tinted.\" },\n { name: \"app-bar\", title: \"Inside an app\", description: \"`floating={false}`: a full-width bar with a hairline, for an app's sections.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
708
+ "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Nav bar\",\n summary:\n \"The Krizaka navigation bar, the same on every site of the family: a floating pill that tightens as the page scrolls, the family switcher on the brand, one light that glides to the item under the pointer or the focus and rests on the current page, accessible menus with rich links, and a mobile panel.\",\n status: \"beta\",\n category: \"navigation\",\n platforms: \"web\",\n parity: { native: { status: \"n/a\", reason: \"A site's top bar; an app on a phone navigates with its tab bar.\", use: \"tab-bar\" }, desktop: { status: \"n/a\", reason: \"A public site's page, not a window of the Mac app.\" } },\n whenToUse: [\n \"The top navigation of a site or a product: a brand, a few links, one or two menus, actions on the right.\",\n \"A section bar inside an app (`floating={false}`): videos, earnings, auctions.\",\n \"Every site of the Krizaka family (www, ui., java., dev.<product>, admin.<product>): the brand and `NavBar.Family` on the left, at most four of the site's sections in the middle, the tools on the right.\",\n ],\n whenNotToUse: [\n { when: \"To switch views inside a page without changing the address.\", use: \"tabs\" },\n { when: \"For a list of actions on one object.\", use: \"dropdown-menu\" },\n { when: \"For search and commands across the app.\", use: \"command\" },\n { when: \"To link to another site of the family from the bar's middle: the family switcher holds them.\", use: \"sites\" },\n ],\n bestPractices: [\n \"The company's bar: `<NavBar.Brand href=… org={org} />` with `org` of `@krizaka/org` is the Krizaka mark and the brand name, so no site writes the company's name by hand; a product keeps its own children.\",\n \"A product's bar ends with `ProductBarActions`: the primary action is using the app (« Sign in » while sign-up is closed, « Try » once it opens, from the product's `signupOpen` setting), « Sign in » never twice, and no « Contact » or « Talk to us » — contact is a plain link in the footer. krizaka.com, the company site, keeps its « Contact us ».\",\n \"Who is here is one contract for every product: `GET /api/me` answers 200 `{ signedIn, signupOpen, account? }` with `Cache-Control: private, no-store` and `Vary: Cookie` (`import { meResponse } from \\\"@krizaka/ui/nav-bar/me\\\"` in a route handler or server module), signed out is never a 401. `NavBar.Session` (in `NavBar.Actions`, needs a `@krizaka/query` provider) asks it and shows your `ProductBarActions` or your account menu — never a local copy of the island. Pending is neither state (the bar reserves its place), a failed refetch keeps the last known state, and a dynamic page passes `initial` (its server-read session) so the first paint is the answer; `useNavSession` is the same reading for a hero or closing action, so they never disagree.\",\n \"Five items at most on the bar; group the rest in a menu, each link with a name and one short line (`NavBar.MenuLink`, one line, ≤ 45 characters).\",\n \"A product's site (dev.<product>, see Navigation in the family): the product's mark alone (no `NavBar.Family`, no badge — the version goes in the footer), then **Product ▾** (what it does: how it works, its features, the demo) · **Platforms ▾** (web, mobile, desktop, self-host — omitted for a single-platform product) · **Docs** · Pricing when it exists; never a lone entry that belongs to a group (no top-level Demo, Mobile or Mac). The phone panel repeats the groups with `NavBar.MobileGroup`, in the same order.\",\n \"A menu of three links or fewer is not a menu: `NavBar.Menu` puts them in the bar as plain links (the current one marked, no dropdown) — `inlineUpTo`, 3 by default, `0` to keep a dropdown. Above three, the dropdown. The phone panel groups them with `NavBar.MobileGroup` either way.\",\n \"Light one item at most: the group that holds the page (`active` on its `NavBar.Menu`), never two.\",\n \"Mark the current page with `active`: the light rests on it, `aria-current=\\\"page\\\"` says it.\",\n \"Use your router's link with `asChild` on `NavBar.Link`, `NavBar.MenuLink` and `NavBar.MobileLink`.\",\n \"One primary action at most in `NavBar.Actions` (a `Button` `size=\\\"sm\\\"` `shape=\\\"pill\\\"`).\",\n \"Wrap it in a `sticky top-3` (floating) or `sticky top-0` container to keep it on screen.\",\n \"Three zones on every Krizaka site: who I am (`NavBar.Brand` + `NavBar.Family current=\\\"<site>\\\"`, then `NavBar.Badge` with the version or `DEV · v1.2.3`), this site (at most four sections, never a link to another site), tools (search when there is something to search, `NavBar.Repo`, theme, language, one primary action).\",\n \"The language is `NavBar.Language`, the same on every site: a globe and the current code (`FR`) opening a menu of the languages named in their own language (`languagesFor(pathname)`), never a pill naming the other language. In `NavBar.Mobile` it renders as a row, inside `NavBar.MobilePreferences` with the theme.\",\n \"Menu links: a name and a description that wraps on two lines at most (≤ 90 characters); the panel is 28 rem wide (40 rem in two columns), aligned under its trigger and kept inside the page.\",\n \"Place a second `NavBar.Family` as the last child of `NavBar.Mobile`: below `md` the family is the panel's last group.\",\n \"Pass the family's words translated: `labels={familyLabels[locale]}` from `@krizaka/ui/sites`.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Tab\", action: \"Moves between the brand, the items and the actions; leaving an open menu closes it.\" },\n { keys: \"Enter / Space / ↓\", action: \"Opens a menu and moves into it.\" },\n { keys: \"↑ / ↓ · Home / End\", action: \"Walks the links of an open menu.\" },\n { keys: \"← / →\", action: \"Moves between the items of the bar.\" },\n { keys: \"Esc\", action: \"Closes the menu, the family or the mobile panel and returns the focus to its trigger.\" },\n { keys: \"Click outside\", action: \"Closes the open menu or the mobile panel.\" },\n { keys: \"Enter / Space / ↓ (family)\", action: \"Opens the family from its chevron; ↑ / ↓ walk the sites. It never opens on hover.\" },\n ],\n notes: [\n \"A `nav` named by `label`, a list of links and menu triggers (Radix NavigationMenu): `aria-expanded` and `aria-controls` on each trigger.\",\n \"The mobile panel is a disclosure (no focus trap): its toggle is named by `openLabel` / `closeLabel` and says `aria-expanded`; a press outside closes it. `NavBar.MobileGroup` is a `group` named by its heading.\",\n \"Menus open on click, Enter, Space or ↓, or when the pointer rests on the trigger (`delayDuration`, 200 ms) — passing over the bar opens nothing. While a menu is open the light stays on its trigger; moving on to a plain link closes the menu.\",\n \"The light, the chevron and the tightening do not move under `prefers-reduced-motion`; the current page is tinted before scripts load.\",\n \"The family is its own `nav` named by `labels.family`; its chevron is a button with the same name, `aria-expanded` and `aria-controls`. Each group is a list named by its heading, the current site says `aria-current=\\\"true\\\"` and “You are here”, a site not released says its status in words.\",\n \"`NavBar.Repo` is an icon link named by `label`; `NavBar.Badge` is plain text (`DEV · v1.2.3`), hidden below `sm`.\",\n ],\n },\n related: [\"language-switch\", \"sites\", \"site-footer\", \"tabs\", \"dropdown-menu\", \"command\", \"button\"],\n web: {\n imports: [\"NavBar\", \"ProductBarActions\", \"productBarActions\"],\n examples: [\n { name: \"family-www\", title: \"www.krizaka.com\", description: \"The company's bar: the mark and the family switcher, Products · Open source · Our story, the repository and Contact. Open the chevron: every site of Krizaka, grouped, the current one marked.\" },\n { name: \"family-ui\", title: \"ui.krizaka.com\", description: \"Krizaka UI: the family, the version of the packages, Get started · Foundations · Components · Templates, the repository.\" },\n { name: \"family-java\", title: \"java.krizaka.com\", description: \"Krizaka Java: the family, the version of the building blocks, Get started · Building blocks · Guides.\" },\n { name: \"family-product\", title: \"dev.<product>\", description: \"A product's site, the standard of every Krizaka product: its mark alone, Product ▾ · Platforms ▾ · Docs with menus (icon · title · a description of two lines), the repository, the theme, the language, Sign in and “Talk to us”; the phone panel groups the same entries and ends with the preferences.\" },\n { name: \"family-admin\", title: \"admin.<product>\", description: \"A console: the mark, the family and `DEV`, no sections, a full-width bar.\" },\n { name: \"site\", title: \"A site's bar\", description: \"Brand, a Products menu, links, a call to action, a mobile panel — hover the items: one light glides between them.\" },\n { name: \"menu-open\", title: \"A rich menu\", description: \"Two columns of links with icons whose node lights up, the current page tinted.\" },\n { name: \"app-bar\", title: \"Inside an app\", description: \"`floating={false}`: a full-width bar with a hairline, for an app's sections.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
702
709
  },
703
710
  {
704
711
  "path": "nav-bar/nav-bar.tsx",
@@ -714,7 +721,7 @@
714
721
  },
715
722
  {
716
723
  "path": "nav-bar/session.tsx",
717
- "content": "// Client. The bar's « who is here » island, the same for every product: it asks `GET /api/me` (the contract of ./me)\n// through @krizaka/query and shows the product's account menu or its sign-in actions. It needs a QueryClient above it.\nimport { krizakaFetch, useQuery } from \"@krizaka/query\";\nimport type * as React from \"react\";\n\nimport { type MeResponse, meSchema } from \"./me\";\n\nexport type NavBarSessionProps<TAccount = unknown> = {\n /**\n * Where the contract is served.\n * @default \"/api/me\"\n */\n endpoint?: string;\n /** Signed out: the product's `ProductBarActions`, told whether sign-up is open. */\n signedOut: (state: { signupOpen: boolean }) => React.ReactNode;\n /** Signed in: the product's `AccountMenu`, given the account. */\n signedIn: (account: TAccount, state: { signupOpen: boolean }) => React.ReactNode;\n /** The hint's words while the answer is on its way (“Checking your session…”) — passed translated. */\n hint: string;\n /** Classes of the loading placeholder. */\n className?: string;\n};\n\nexport const sessionKey = (endpoint: string) => [\"krizaka\", \"session\", endpoint] as const;\n\n/**\n * The bar's session island: put it in `NavBar.Actions`. While the answer is on its way it reserves the place and says\n * `hint` politely; if the request fails it shows the signed-out actions (the visitor can still sign in).\n */\nexport function NavBarSession<TAccount = unknown>({ endpoint = \"/api/me\", signedOut, signedIn, hint, className }: NavBarSessionProps<TAccount>) {\n const { data, isPending, isError } = useQuery({\n queryKey: sessionKey(endpoint),\n queryFn: ({ signal }) => krizakaFetch(endpoint, { schema: meSchema, signal, cache: \"no-store\" }),\n staleTime: 30_000,\n retry: false,\n throwOnError: false,\n });\n if (isPending) {\n return (\n <span role=\"status\" aria-live=\"polite\" data-state=\"loading\" className={className}>\n <span className=\"sr-only\">{hint}</span>\n </span>\n );\n }\n const me = (!isError && data ? data : { signedIn: false, signupOpen: false }) as MeResponse<TAccount>;\n const state = { signupOpen: me.signupOpen };\n return <>{me.signedIn && me.account !== undefined ? signedIn(me.account, state) : signedOut(state)}</>;\n}\n"
724
+ "content": "// Client. The bar's « who is here » island, the same for every product: it asks `GET /api/me` (the contract of ./me)\n// through @krizaka/query and shows the product's account menu or its sign-in actions. It needs a QueryClient above it.\nimport { krizakaFetch, useQuery } from \"@krizaka/query\";\nimport type * as React from \"react\";\n\nimport { type MeResponse, meSchema } from \"./me\";\n\nexport type NavBarSessionProps<TAccount = unknown> = {\n /**\n * Where the contract is served.\n * @default \"/api/me\"\n */\n endpoint?: string;\n /**\n * The session the server already knows (a dynamic page reading its cookie): the first paint then IS the answer, with no\n * placeholder and no swap. Leave it out on a static page; the bar reserves its place until the answer comes.\n */\n initial?: MeResponse<TAccount>;\n /** Signed out: the product's `ProductBarActions`, told whether sign-up is open. */\n signedOut: (state: { signupOpen: boolean }) => React.ReactNode;\n /** Signed in: the product's `AccountMenu`, given the account. */\n signedIn: (account: TAccount, state: { signupOpen: boolean }) => React.ReactNode;\n /** The hint's words while the answer is on its way (“Checking your session…”) — passed translated. */\n hint: string;\n /** Classes of the loading placeholder. */\n className?: string;\n};\n\nexport const sessionKey = (endpoint: string) => [\"krizaka\", \"session\", endpoint] as const;\n\n/** What the bar knows of the visitor: `pending` is NOT « signed out » — nothing is drawn as either until the answer comes. */\nexport type NavSession<TAccount = unknown> = { status: \"pending\" } | { status: \"in\"; account: TAccount; signupOpen: boolean } | { status: \"out\"; signupOpen: boolean };\n\n/**\n * The one « who is here » reading of the family (the bar, a hero's action, a closing call all read this and so never\n * disagree). Three rules, krizaka-ui#800: (1) `pending` is its own state, never drawn as signed out; (2) only an answer\n * (`GET /api/me` 200) changes the state — a failed or throttled refetch keeps the last known state instead of flipping a\n * signed-in person to « Sign in »; (3) with no answer at all (the first request failed) the visitor can still sign in.\n */\nexport function useNavSession<TAccount = unknown>(endpoint = \"/api/me\", initial?: MeResponse<TAccount>): NavSession<TAccount> {\n const { data, isPending, isError } = useQuery({\n queryKey: sessionKey(endpoint),\n queryFn: ({ signal }) => krizakaFetch(endpoint, { schema: meSchema, signal, cache: \"no-store\" }),\n staleTime: 30_000,\n retry: false,\n throwOnError: false,\n ...(initial ? { initialData: initial as MeResponse } : {}),\n });\n if (data) {\n const me = data as MeResponse<TAccount>;\n return me.signedIn && me.account !== undefined ? { status: \"in\", account: me.account, signupOpen: me.signupOpen } : { status: \"out\", signupOpen: me.signupOpen };\n }\n if (isPending && !isError) return { status: \"pending\" };\n return { status: \"out\", signupOpen: false };\n}\n\n/**\n * The bar's session island: put it in `NavBar.Actions`. While the answer is on its way it reserves the place and says\n * `hint` politely (or, given `initial`, draws the server's answer at once); if the first request fails it shows the\n * signed-out actions (the visitor can still sign in).\n */\nexport function NavBarSession<TAccount = unknown>({ endpoint = \"/api/me\", initial, signedOut, signedIn, hint, className }: NavBarSessionProps<TAccount>) {\n const session = useNavSession<TAccount>(endpoint, initial);\n if (session.status === \"pending\") {\n return (\n <span role=\"status\" aria-live=\"polite\" data-state=\"loading\" className={className}>\n <span className=\"sr-only\">{hint}</span>\n </span>\n );\n }\n const state = { signupOpen: session.signupOpen };\n return <>{session.status === \"in\" ? signedIn(session.account, state) : signedOut(state)}</>;\n}\n"
718
725
  },
719
726
  {
720
727
  "path": "sliding-indicator.ts",
@@ -722,7 +729,7 @@
722
729
  }
723
730
  ],
724
731
  "dependencies": [
725
- "@krizaka/tokens@^3.67.1",
732
+ "@krizaka/tokens@^3.69.0",
726
733
  "radix-ui@^1.8.1",
727
734
  "tailwind-variants@^3.3.1"
728
735
  ],
@@ -965,7 +972,7 @@
965
972
  },
966
973
  {
967
974
  "component": "NavBarSession",
968
- "description": "The bar's session island: put it in `NavBar.Actions`. While the answer is on its way it reserves the place and says\n`hint` politely; if the request fails it shows the signed-out actions (the visitor can still sign in).",
975
+ "description": "The bar's session island: put it in `NavBar.Actions`. While the answer is on its way it reserves the place and says\n`hint` politely (or, given `initial`, draws the server's answer at once); if the first request fails it shows the\nsigned-out actions (the visitor can still sign in).",
969
976
  "props": [
970
977
  {
971
978
  "name": "hint",
@@ -1001,6 +1008,13 @@
1001
1008
  "default": "/api/me",
1002
1009
  "description": "Where the contract is served.",
1003
1010
  "required": false
1011
+ },
1012
+ {
1013
+ "name": "initial",
1014
+ "type": "MeResponse<TAccount>",
1015
+ "default": null,
1016
+ "description": "The session the server already knows (a dynamic page reading its cookie): the first paint then IS the answer, with no\nplaceholder and no swap. Leave it out on a static page; the bar reserves its place until the answer comes.",
1017
+ "required": false
1004
1018
  }
1005
1019
  ]
1006
1020
  },