@krizaka/ui 4.3.0 → 4.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/dist/account-menu.d.ts +1 -1
  2. package/dist/account-menu.js +1 -1
  3. package/dist/account-menu.js.map +1 -1
  4. package/dist/account-settings.d.ts +1 -1
  5. package/dist/account-settings.js +13 -6
  6. package/dist/account-settings.js.map +1 -1
  7. package/dist/agenda.d.ts +1 -1
  8. package/dist/agenda.js +2 -1
  9. package/dist/agenda.js.map +1 -1
  10. package/dist/analysis-report.js +19 -11
  11. package/dist/analysis-report.js.map +1 -1
  12. package/dist/app-frame.d.ts +1 -1
  13. package/dist/app-frame.js.map +1 -1
  14. package/dist/app-header/search.js +2 -2
  15. package/dist/app-header/search.js.map +1 -1
  16. package/dist/avatar/defaults.js +3 -1
  17. package/dist/avatar/defaults.js.map +1 -1
  18. package/dist/avatar.js +3 -1
  19. package/dist/avatar.js.map +1 -1
  20. package/dist/bird-plate.js +8 -2
  21. package/dist/bird-plate.js.map +1 -1
  22. package/dist/blocks.css +4 -0
  23. package/dist/chapter.js +7 -4
  24. package/dist/chapter.js.map +1 -1
  25. package/dist/chat.js +1 -1
  26. package/dist/chip.d.ts +1 -1
  27. package/dist/chip.js +1 -1
  28. package/dist/{chunk-SNSQLGGS.js → chunk-5VZ37TY3.js} +1 -1
  29. package/dist/{chunk-XWJDBQU7.js.map → chunk-5VZ37TY3.js.map} +1 -1
  30. package/dist/{chunk-MTVX4RRF.js → chunk-HP7BDMVK.js} +11 -3
  31. package/dist/chunk-HP7BDMVK.js.map +1 -0
  32. package/dist/{chunk-PK3L6WQT.js → chunk-LNAAWT4Y.js} +4 -2
  33. package/dist/{chunk-PK3L6WQT.js.map → chunk-LNAAWT4Y.js.map} +1 -1
  34. package/dist/{chunk-UIP3WX5O.js → chunk-MDSP7DJR.js} +2 -2
  35. package/dist/chunk-MDSP7DJR.js.map +1 -0
  36. package/dist/{chunk-IEGTRCDI.js → chunk-NQENOT6L.js} +2 -2
  37. package/dist/{chunk-IEGTRCDI.js.map → chunk-NQENOT6L.js.map} +1 -1
  38. package/dist/{chunk-FM42KOAU.js → chunk-P7AFIKWG.js} +5 -3
  39. package/dist/chunk-P7AFIKWG.js.map +1 -0
  40. package/dist/{chunk-BCD2CRFG.js → chunk-PJNR4NTS.js} +2 -2
  41. package/dist/chunk-PJNR4NTS.js.map +1 -0
  42. package/dist/{chunk-ZFR6ZNXD.js → chunk-PVQ2KKPZ.js} +1 -1
  43. package/dist/chunk-PVQ2KKPZ.js.map +1 -0
  44. package/dist/{chunk-U4XTZMB7.js → chunk-QA3WETWT.js} +1 -1
  45. package/dist/{chunk-U4XTZMB7.js.map → chunk-QA3WETWT.js.map} +1 -1
  46. package/dist/{chunk-YXETEQQJ.js → chunk-SG2RKUVJ.js} +2 -2
  47. package/dist/{chunk-EOWV6BNQ.js → chunk-TXFX4PMN.js} +4 -2
  48. package/dist/{chunk-EOWV6BNQ.js.map → chunk-TXFX4PMN.js.map} +1 -1
  49. package/dist/{chunk-XWJDBQU7.js → chunk-V5RO6JYI.js} +1 -1
  50. package/dist/{chunk-SNSQLGGS.js.map → chunk-V5RO6JYI.js.map} +1 -1
  51. package/dist/chunk-VZ6ZALIJ.js +13 -0
  52. package/dist/chunk-VZ6ZALIJ.js.map +1 -0
  53. package/dist/{chunk-2DHL7NJW.js → chunk-XVRKKYWU.js} +5 -3
  54. package/dist/{chunk-2DHL7NJW.js.map → chunk-XVRKKYWU.js.map} +1 -1
  55. package/dist/{chunk-CDNOT2KR.js → chunk-YTYNKMNS.js} +1 -1
  56. package/dist/chunk-YTYNKMNS.js.map +1 -0
  57. package/dist/code-block.js.map +1 -1
  58. package/dist/combobox.js +2 -2
  59. package/dist/copy-button.js +2 -2
  60. package/dist/copy-button.js.map +1 -1
  61. package/dist/data-table.js +3 -3
  62. package/dist/desktop-window.d.ts +1 -1
  63. package/dist/desktop-window.js +3 -1
  64. package/dist/desktop-window.js.map +1 -1
  65. package/dist/drop-overlay.js +8 -8
  66. package/dist/drop-overlay.js.map +1 -1
  67. package/dist/elephant.d.ts +1 -1
  68. package/dist/elephant.js.map +1 -1
  69. package/dist/embed-facade.d.ts +1 -1
  70. package/dist/embed-facade.js +3 -1
  71. package/dist/embed-facade.js.map +1 -1
  72. package/dist/engine-flow.js +7 -2
  73. package/dist/engine-flow.js.map +1 -1
  74. package/dist/entity-header.js +9 -3
  75. package/dist/entity-header.js.map +1 -1
  76. package/dist/file-upload.d.ts +1 -1
  77. package/dist/file-upload.js.map +1 -1
  78. package/dist/filter-bar.d.ts +4 -4
  79. package/dist/filter-bar.js +2 -2
  80. package/dist/flock.js +9 -6
  81. package/dist/flock.js.map +1 -1
  82. package/dist/form.d.ts +3 -3
  83. package/dist/form.js.map +1 -1
  84. package/dist/genui.js +3 -3
  85. package/dist/glossary-term.d.ts +1 -1
  86. package/dist/glossary-term.js.map +1 -1
  87. package/dist/glossary.d.ts +1 -1
  88. package/dist/glossary.js.map +1 -1
  89. package/dist/identity-card.js +1 -1
  90. package/dist/index.js +1 -1
  91. package/dist/kind-config-editor.d.ts +2 -2
  92. package/dist/kind-config-editor.js +1 -1
  93. package/dist/kind-config-editor.js.map +1 -1
  94. package/dist/kpi-explained.d.ts +1 -1
  95. package/dist/kpi-explained.js +4 -4
  96. package/dist/kpi-explained.js.map +1 -1
  97. package/dist/landing-page.d.ts +10 -3
  98. package/dist/landing-page.js +8 -6
  99. package/dist/landing-page.js.map +1 -1
  100. package/dist/{lightbox-Q45BZ3HW.js → lightbox-MRB2YZEP.js} +1 -1
  101. package/dist/lightbox-MRB2YZEP.js.map +1 -0
  102. package/dist/map/cards.js +4 -2
  103. package/dist/map/cards.js.map +1 -1
  104. package/dist/map/pin.js +2 -1
  105. package/dist/map/pin.js.map +1 -1
  106. package/dist/map.d.ts +1 -1
  107. package/dist/map.js.map +1 -1
  108. package/dist/mascot-quote.js +1 -1
  109. package/dist/mascot-state.js +1 -1
  110. package/dist/mascots.js +1 -1
  111. package/dist/match-dialog.js +1 -1
  112. package/dist/motion.d.ts +1 -1
  113. package/dist/motion.js.map +1 -1
  114. package/dist/native/form.d.ts +3 -3
  115. package/dist/native/form.js.map +1 -1
  116. package/dist/native/markdown.d.ts +1 -1
  117. package/dist/native/markdown.js.map +1 -1
  118. package/dist/native/vertical-video.js.map +1 -1
  119. package/dist/native.d.ts +12 -12
  120. package/dist/native.js +12 -7
  121. package/dist/native.js.map +1 -1
  122. package/dist/nav-bar.d.ts +2 -2
  123. package/dist/nav-bar.js +1 -1
  124. package/dist/nav-bar.js.map +1 -1
  125. package/dist/next-actions.d.ts +1 -1
  126. package/dist/next-actions.js.map +1 -1
  127. package/dist/notification-preferences.d.ts +1 -1
  128. package/dist/notification-preferences.js +5 -2
  129. package/dist/notification-preferences.js.map +1 -1
  130. package/dist/page-index.js +2 -2
  131. package/dist/page-index.js.map +1 -1
  132. package/dist/product-page.js +4 -4
  133. package/dist/product-page.js.map +1 -1
  134. package/dist/promo-code-field.d.ts +1 -1
  135. package/dist/promo-code-field.js.map +1 -1
  136. package/dist/qr-code.d.ts +1 -1
  137. package/dist/qr-code.js +1 -1
  138. package/dist/rail-nav.js +3 -3
  139. package/dist/rail-nav.js.map +1 -1
  140. package/dist/retro-tv.d.ts +1 -1
  141. package/dist/retro-tv.js.map +1 -1
  142. package/dist/reviews.d.ts +2 -2
  143. package/dist/reviews.js.map +1 -1
  144. package/dist/router.d.ts +1 -1
  145. package/dist/router.js +8 -8
  146. package/dist/router.js.map +1 -1
  147. package/dist/{schema-DgjBz7-8.d.ts → schema-Dd05m48Q.d.ts} +8 -8
  148. package/dist/service-card.js +22 -13
  149. package/dist/service-card.js.map +1 -1
  150. package/dist/settings-layout.js +1 -1
  151. package/dist/shop/booking.js.map +1 -1
  152. package/dist/shop/gallery.js +7 -6
  153. package/dist/shop/gallery.js.map +1 -1
  154. package/dist/shop/hero.js.map +1 -1
  155. package/dist/shop/look.d.ts +2 -2
  156. package/dist/shop/look.js +1 -1
  157. package/dist/shop/look.js.map +1 -1
  158. package/dist/shop/map-gate.d.ts +1 -1
  159. package/dist/shop/map-gate.js +2 -2
  160. package/dist/shop/map-gate.js.map +1 -1
  161. package/dist/shop/services.js.map +1 -1
  162. package/dist/shop-composer.d.ts +10 -10
  163. package/dist/shop-composer.js +27 -14
  164. package/dist/shop-composer.js.map +1 -1
  165. package/dist/shop-gallery.js +1 -1
  166. package/dist/shop.d.ts +2 -2
  167. package/dist/shop.js +2 -2
  168. package/dist/shop.js.map +1 -1
  169. package/dist/signature.js +2 -1
  170. package/dist/signature.js.map +1 -1
  171. package/dist/site-cahier.js +7 -3
  172. package/dist/site-cahier.js.map +1 -1
  173. package/dist/site-footer.js +6 -2
  174. package/dist/site-footer.js.map +1 -1
  175. package/dist/slot-picker.js +5 -2
  176. package/dist/slot-picker.js.map +1 -1
  177. package/dist/stat.js +1 -1
  178. package/dist/status-chip.d.ts +1 -1
  179. package/dist/status-chip.js.map +1 -1
  180. package/dist/tabs.js.map +1 -1
  181. package/dist/tag-input.js +2 -2
  182. package/dist/tag-selector.js +1 -1
  183. package/dist/text-style.js +4 -3
  184. package/dist/text-style.js.map +1 -1
  185. package/dist/usage.js +8 -3
  186. package/dist/usage.js.map +1 -1
  187. package/dist/versus-card.js +1 -1
  188. package/dist/versus-card.js.map +1 -1
  189. package/dist/vertical-video.js +1 -1
  190. package/dist/vertical-video.js.map +1 -1
  191. package/dist/wall.d.ts +4 -4
  192. package/dist/wall.js +1 -1
  193. package/dist/wall.js.map +1 -1
  194. package/package.json +6 -6
  195. package/registry/account-menu.json +1 -1
  196. package/registry/account-settings.json +2 -2
  197. package/registry/agenda.json +1 -1
  198. package/registry/analysis-report.json +2 -2
  199. package/registry/app-frame.json +3 -3
  200. package/registry/app-header.json +1 -1
  201. package/registry/avatar.json +1 -1
  202. package/registry/badge.json +2 -2
  203. package/registry/bird-plate.json +1 -1
  204. package/registry/chapter.json +1 -1
  205. package/registry/chip.json +1 -1
  206. package/registry/copy-button.json +1 -1
  207. package/registry/data-table.json +1 -1
  208. package/registry/desktop-window.json +1 -1
  209. package/registry/drop-overlay.json +1 -1
  210. package/registry/elephant.json +1 -1
  211. package/registry/embed-facade.json +2 -2
  212. package/registry/engine-flow.json +2 -2
  213. package/registry/entity-header.json +1 -1
  214. package/registry/examples/landing-page/showcase.d.ts +4 -0
  215. package/registry/examples/landing-page/showcase.js +45 -0
  216. package/registry/examples/landing-page/showcase.tsx +42 -0
  217. package/registry/file-upload.json +1 -1
  218. package/registry/filter-bar.json +1 -1
  219. package/registry/flock.json +2 -2
  220. package/registry/form.json +7 -7
  221. package/registry/glossary-term.json +1 -1
  222. package/registry/glossary.json +1 -1
  223. package/registry/index.json +19 -10
  224. package/registry/kind-config-editor.json +1 -1
  225. package/registry/kpi-explained.json +1 -1
  226. package/registry/landing-page.json +61 -21
  227. package/registry/map.json +4 -4
  228. package/registry/mascot-state.json +1 -1
  229. package/registry/mascots.json +2 -2
  230. package/registry/nav-bar.json +4 -4
  231. package/registry/next-actions.json +1 -1
  232. package/registry/notification-preferences.json +1 -1
  233. package/registry/page-index.json +1 -1
  234. package/registry/page.json +4 -0
  235. package/registry/product-page.json +1 -1
  236. package/registry/promo-code-field.json +1 -1
  237. package/registry/qr-code.json +2 -2
  238. package/registry/rail-nav.json +3 -3
  239. package/registry/retro-tv.json +1 -1
  240. package/registry/reviews.json +1 -1
  241. package/registry/router.json +1 -1
  242. package/registry/service-card.json +1 -1
  243. package/registry/settings-layout.json +1 -1
  244. package/registry/shop-composer.json +7 -7
  245. package/registry/shop-gallery.json +1 -1
  246. package/registry/shop.json +11 -11
  247. package/registry/signature.json +1 -1
  248. package/registry/site-cahier.json +1 -1
  249. package/registry/site-footer.json +3 -3
  250. package/registry/slot-picker.json +1 -1
  251. package/registry/stat.json +1 -1
  252. package/registry/status-chip.json +1 -1
  253. package/registry/tabs.json +1 -1
  254. package/registry/text-style.json +1 -1
  255. package/registry/usage.json +2 -2
  256. package/registry/versus-card.json +1 -1
  257. package/registry/vertical-video.json +1 -1
  258. package/registry/wall.json +5 -5
  259. package/registry/waveform.json +2 -2
  260. package/dist/chunk-BCD2CRFG.js.map +0 -1
  261. package/dist/chunk-CDNOT2KR.js.map +0 -1
  262. package/dist/chunk-FM42KOAU.js.map +0 -1
  263. package/dist/chunk-MTVX4RRF.js.map +0 -1
  264. package/dist/chunk-UIP3WX5O.js.map +0 -1
  265. package/dist/chunk-ZFR6ZNXD.js.map +0 -1
  266. package/dist/lightbox-Q45BZ3HW.js.map +0 -1
  267. /package/dist/{chunk-YXETEQQJ.js.map → chunk-SG2RKUVJ.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krizaka/ui",
3
- "version": "4.3.0",
3
+ "version": "4.4.1",
4
4
  "templatePurposes": {
5
5
  "convince": {
6
6
  "title": "Convince",
@@ -212,6 +212,15 @@
212
212
  "purpose": "show",
213
213
  "why": "A visitor browses real results, each with how it was made."
214
214
  },
215
+ {
216
+ "component": "landing-page",
217
+ "platform": "web",
218
+ "name": "showcase",
219
+ "title": "Showcase",
220
+ "description": "A text-only hero on the quiet backdrop, the proofs, then a full-width carousel before the features.",
221
+ "purpose": "show",
222
+ "why": "A visitor reads the promise, then watches the product at full width before any feature list."
223
+ },
215
224
  {
216
225
  "component": "longform-page",
217
226
  "platform": "web",
@@ -1004,7 +1013,7 @@
1004
1013
  "native": 0
1005
1014
  },
1006
1015
  "dependencies": [
1007
- "@krizaka/tokens@^4.3.0"
1016
+ "@krizaka/tokens@^4.4.1"
1008
1017
  ],
1009
1018
  "registryDependencies": [
1010
1019
  "account-menu",
@@ -3670,8 +3679,8 @@
3670
3679
  "name": "landing-page",
3671
3680
  "type": "primitive",
3672
3681
  "title": "Landing page",
3673
- "summary": "A landing page: the promise beside the product alive in a window, a band of proofs, the features as a bento where the main one takes the room, the closing call.",
3674
- "description": "A landing page: the promise beside the product alive in a window, a band of proofs, the features as a bento where the main one takes the room, the closing call.",
3682
+ "summary": "A landing page: the promise beside the product alive in a window (or alone, in one column), a band of proofs, a full-width showcase, the features as a bento where the main one takes the room, the closing call.",
3683
+ "description": "A landing page: the promise beside the product alive in a window (or alone, in one column), a band of proofs, a full-width showcase, the features as a bento where the main one takes the room, the closing call.",
3675
3684
  "status": "beta",
3676
3685
  "category": "templates",
3677
3686
  "platforms": "web",
@@ -3689,7 +3698,7 @@
3689
3698
  }
3690
3699
  },
3691
3700
  "examples": {
3692
- "web": 1,
3701
+ "web": 2,
3693
3702
  "native": 0
3694
3703
  },
3695
3704
  "dependencies": [],
@@ -4008,7 +4017,7 @@
4008
4017
  "native": 2
4009
4018
  },
4010
4019
  "dependencies": [
4011
- "@krizaka/tokens@^4.3.0",
4020
+ "@krizaka/tokens@^4.4.1",
4012
4021
  "@protomaps/basemaps@5.7.2",
4013
4022
  "tailwind-variants@^3.3.1"
4014
4023
  ],
@@ -4421,7 +4430,7 @@
4421
4430
  "native": 0
4422
4431
  },
4423
4432
  "dependencies": [
4424
- "@krizaka/tokens@^4.3.0",
4433
+ "@krizaka/tokens@^4.4.1",
4425
4434
  "radix-ui@^1.8.1",
4426
4435
  "tailwind-variants@^3.3.1"
4427
4436
  ],
@@ -5289,7 +5298,7 @@
5289
5298
  "native": 0
5290
5299
  },
5291
5300
  "dependencies": [
5292
- "@krizaka/tokens@^4.3.0",
5301
+ "@krizaka/tokens@^4.4.1",
5293
5302
  "radix-ui@^1.8.1",
5294
5303
  "tailwind-variants@^3.3.1"
5295
5304
  ],
@@ -5736,7 +5745,7 @@
5736
5745
  "native": 0
5737
5746
  },
5738
5747
  "dependencies": [
5739
- "@krizaka/tokens@^4.3.0",
5748
+ "@krizaka/tokens@^4.4.1",
5740
5749
  "zod@^4.6.7"
5741
5750
  ],
5742
5751
  "registryDependencies": [
@@ -5957,7 +5966,7 @@
5957
5966
  },
5958
5967
  "dependencies": [
5959
5968
  "@krizaka/icons@^0.10.0",
5960
- "@krizaka/tokens@^4.3.0",
5969
+ "@krizaka/tokens@^4.4.1",
5961
5970
  "radix-ui@^1.8.1",
5962
5971
  "tailwind-variants@^3.3.1"
5963
5972
  ],
@@ -404,7 +404,7 @@
404
404
  },
405
405
  {
406
406
  "path": "kind-config-editor/kind-config-editor.tsx",
407
- "content": "// Client (state, drag). The admin's editors of a kind's vocabulary (krizaka-ts#89, ADR-003 of krizaka-ts: « admin configures\n// everything »): the tag set (the presets of a variant, who writes, may people add their own, the most) and the status set\n// (the states in their order, each in French and English, its tone, final; the initial state; the moves from × to with the\n// roles, a confirmation and the reasons). Each takes the descriptor and gives it back (`value` / `onChange`) and never holds the\n// save logic: the product posts it, with the `version` it read. `problems` (from `kindConfigProblems`, the server's own rules)\n// are shown in place. What the contract forbids is kept by construction (model.ts): a final state has no way out, the initial\n// state is never final, a move goes to another state. Reorder: drag the handle, or the buttons, or Alt + ↑ ↓ in a name.\nimport type { Marker, StatusSet, StatusTone } from \"@krizaka/organize/contract\";\nimport * as React from \"react\";\n\nimport { Button } from \"../button\";\nimport { Chip, MarkerPicker, TagMarker } from \"../chip\";\nimport { cn } from \"../cn\";\nimport { Input, Select } from \"../field\";\nimport { SettingsRow } from \"../settings-layout\";\nimport { Switch } from \"../switch\";\nimport { type EditorRole, STATUS_TONES, type StatusSetEditorLabels, statusSetEditorLabels, type TagSetEditorLabels, tagSetEditorLabels } from \"./labels\";\nimport {\n addPreset,\n addReason,\n addState,\n clampMax,\n duplicatePresetNames,\n type Lang,\n movePreset,\n moveState,\n recolorPreset,\n removePreset,\n removeState,\n renamePreset,\n setFinal,\n setInitial,\n setStateLabel,\n setStateTone,\n setTransitionConfirm,\n setTransitionReasons,\n setTransitionRoles,\n type TagSetValue,\n transitionOf,\n} from \"./model\";\n\nexport type { EditorRole, Lang, StatusSetEditorLabels, TagSetEditorLabels, TagSetValue };\nexport { statusSetEditorLabels, tagSetEditorLabels };\n\n\n// --- shared ----------------------------------------------------------------------------------------------------------------\n\n/** The problems the server's rules found, shown where the admin is working: a polite alert above the list. */\nfunction Problems({ title, problems }: { title: string; problems: readonly string[] | undefined }) {\n if (!problems || problems.length === 0) return null;\n return (\n <div role=\"alert\" className=\"flex flex-col gap-1 rounded-lg border border-danger/40 bg-danger/10 px-3 py-2.5\">\n <p className=\"m-0 text-xs font-semibold text-fg-danger\">{title}</p>\n <ul className=\"m-0 flex list-disc flex-col gap-0.5 pl-5 text-xs text-fg\">\n {problems.map((problem) => (\n <li key={problem}>{problem}</li>\n ))}\n </ul>\n </div>\n );\n}\n\n/** Drag a row by its handle, or move it with Alt + ↑ ↓ from a field: one pair of helpers for both lists. */\nfunction useReorder(onMove: (from: number, to: number) => void) {\n const dragging = React.useRef<number | null>(null);\n return {\n row: (index: number) => ({\n onDragOver: (event: React.DragEvent) => {\n if (dragging.current !== null) event.preventDefault();\n },\n onDrop: (event: React.DragEvent) => {\n event.preventDefault();\n if (dragging.current !== null) onMove(dragging.current, index);\n dragging.current = null;\n },\n }),\n handle: (index: number) => ({\n draggable: true,\n onDragStart: (event: React.DragEvent) => {\n dragging.current = index;\n event.dataTransfer.effectAllowed = \"move\";\n event.dataTransfer.setData(\"text/plain\", String(index));\n },\n onDragEnd: () => {\n dragging.current = null;\n },\n }),\n keys: (index: number, last: number) => (event: React.KeyboardEvent) => {\n if (!event.altKey || (event.key !== \"ArrowUp\" && event.key !== \"ArrowDown\")) return;\n event.preventDefault();\n const to = event.key === \"ArrowUp\" ? index - 1 : index + 1;\n if (to < 0 || to > last) return;\n onMove(index, to);\n // The row has moved: its field is a new element, keep the focus on it for the next press.\n const field = event.currentTarget as HTMLElement;\n requestAnimationFrame(() => field.closest(\"ol\")?.querySelectorAll<HTMLElement>(`[data-reorder-field=\"${field.dataset.reorderField}\"]`)[to]?.focus());\n },\n };\n}\n\nconst grip = (\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"currentColor\" aria-hidden>\n {[7, 12, 17].flatMap((y) => [9, 15].map((x) => <circle key={`${x}-${y}`} cx={x} cy={y} r=\"1.4\" />))}\n </svg>\n);\nconst arrow = (up: boolean) => (\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={up ? \"m6 15 6-6 6 6\" : \"m6 9 6 6 6-6\"} />\n </svg>\n);\nconst IconButton = ({ label, className, ...props }: React.ComponentProps<\"button\"> & { label: string }) => (\n <button\n type=\"button\"\n aria-label={label}\n title={label}\n className={cn(\n \"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg\",\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-30\",\n className,\n )}\n {...props}\n />\n);\nconst Cross = () => (\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n);\n\n// --- the tag set -----------------------------------------------------------------------------------------------------------\n\nexport type TagSetEditorProps = {\n /** The `tags` of the kind's configuration (`KindConfig.tags`). */\n value: TagSetValue;\n /** Called with the whole set after every change. */\n onChange: (value: TagSetValue) => void;\n /** The variant whose presets are edited (a trade, or `default`). */\n variant: string;\n /** The roles of the product that can write tags. */\n roles: readonly EditorRole[];\n /** What `kindConfigProblems` found (the server's own rules), shown above the list. */\n problems?: readonly string[];\n /** The words, passed translated (English by default). */\n labels?: Partial<TagSetEditorLabels>;\n /** Not available. */\n disabled?: boolean;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The admin's tag set: the presets of a variant (name, colour, order), who writes, whether people add their own, the most. */\nexport function TagSetEditor({ value, onChange, variant, roles, problems, labels: given, disabled, className }: TagSetEditorProps) {\n const labels: TagSetEditorLabels = { ...tagSetEditorLabels, ...given, markerNames: { ...tagSetEditorLabels.markerNames, ...given?.markerNames } };\n const presets = value.presets[variant] ?? [];\n const twins = duplicatePresetNames(presets);\n const [draft, setDraft] = React.useState(\"\");\n const [draftMarker, setDraftMarker] = React.useState<Marker>(\"blue\");\n const reorder = useReorder((from, to) => onChange(movePreset(value, variant, from, to)));\n const id = React.useId();\n const add = () => {\n const next = addPreset(value, variant, draft, draftMarker);\n if (next === value) return;\n onChange(next);\n setDraft(\"\");\n };\n return (\n <div className={cn(\"flex flex-col gap-4\", className)}>\n <Problems title={labels.problems} problems={problems} />\n <section aria-labelledby={`${id}-presets`} className=\"flex flex-col gap-2\">\n <h3 id={`${id}-presets`} className=\"m-0 text-sm font-semibold text-fg\">\n {labels.presets}\n </h3>\n {presets.length === 0 ? (\n <p className=\"m-0 text-sm text-fg-secondary\">{labels.empty}</p>\n ) : (\n <ol className=\"m-0 flex list-none flex-col gap-2 p-0\">\n {presets.map((preset, index) => {\n const shown = preset.name || String(index + 1);\n const twin = twins.has(index);\n return (\n <li key={index} {...reorder.row(index)} className=\"flex flex-wrap items-center gap-x-2 gap-y-1 rounded-lg border border-border-default bg-surface-1 px-2 py-1.5\">\n <span {...reorder.handle(index)} aria-hidden title={labels.drag(shown)} className=\"inline-flex h-9 w-6 cursor-grab items-center justify-center text-fg-muted active:cursor-grabbing max-md:hidden\">\n {grip}\n </span>\n <TagMarker marker={preset.marker} />\n <div className=\"flex min-w-40 flex-1 flex-col gap-1\">\n <Input\n aria-label={labels.name(index + 1)}\n data-reorder-field=\"name\"\n value={preset.name}\n disabled={disabled}\n invalid={twin || !preset.name.trim()}\n aria-describedby={twin ? `${id}-dup-${index}` : undefined}\n onChange={(event) => onChange(renamePreset(value, variant, index, event.target.value))}\n onBlur={(event) => event.target.value !== event.target.value.replace(/\\s+/g, \" \").trim() && onChange(renamePreset(value, variant, index, event.target.value.replace(/\\s+/g, \" \").trim()))}\n onKeyDown={reorder.keys(index, presets.length - 1)}\n className=\"h-9\"\n />\n {twin ? (\n <span id={`${id}-dup-${index}`} className=\"text-xs text-fg-danger\">\n {labels.duplicate}\n </span>\n ) : null}\n </div>\n <MarkerPicker label={labels.marker(shown)} names={labels.markerNames} value={preset.marker} disabled={disabled} onValueChange={(marker) => onChange(recolorPreset(value, variant, index, marker))} />\n <IconButton label={labels.moveUp(shown)} disabled={disabled || index === 0} onClick={() => onChange(movePreset(value, variant, index, index - 1))}>\n {arrow(true)}\n </IconButton>\n <IconButton label={labels.moveDown(shown)} disabled={disabled || index === presets.length - 1} onClick={() => onChange(movePreset(value, variant, index, index + 1))}>\n {arrow(false)}\n </IconButton>\n <IconButton label={labels.remove(shown)} disabled={disabled} onClick={() => onChange(removePreset(value, variant, index))}>\n <Cross />\n </IconButton>\n </li>\n );\n })}\n </ol>\n )}\n <div className=\"flex flex-wrap items-center gap-2\">\n <Input\n aria-label={labels.add}\n value={draft}\n maxLength={80}\n disabled={disabled}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n event.preventDefault();\n add();\n }\n }}\n placeholder={labels.add}\n className=\"h-9 min-w-40 flex-1\"\n />\n <MarkerPicker label={labels.marker(draft.trim() || labels.add)} names={labels.markerNames} value={draftMarker} disabled={disabled} onValueChange={setDraftMarker} />\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" disabled={disabled || !draft.trim()} onClick={add}>\n {labels.addButton}\n </Button>\n </div>\n </section>\n <div className=\"flex flex-col\">\n <SettingsRow label={labels.writers} description={labels.writersHint}>\n <Chip.Group type=\"multiple\" size=\"sm\" label={labels.writers} value={value.writers} disabled={disabled} onValueChange={(writers) => onChange({ ...value, writers })}>\n {roles.map((role) => (\n <Chip key={role.key} value={role.key}>\n {role.label}\n </Chip>\n ))}\n </Chip.Group>\n </SettingsRow>\n <SettingsRow label={labels.userTags} description={labels.userTagsHint}>\n <Switch label={labels.userTags} checked={value.userTags} disabled={disabled} onCheckedChange={(userTags) => onChange({ ...value, userTags })} />\n </SettingsRow>\n <SettingsRow label={labels.max} description={labels.maxHint} htmlFor={`${id}-max`}>\n <Input\n id={`${id}-max`}\n type=\"number\"\n inputMode=\"numeric\"\n min={1}\n max={200}\n value={value.max}\n disabled={disabled}\n invalid={!Number.isInteger(value.max) || value.max < 1 || value.max > 200}\n onChange={(event) => onChange({ ...value, max: event.target.value === \"\" ? 0 : Number(event.target.value) })}\n onBlur={() => onChange({ ...value, max: clampMax(value.max) })}\n className=\"h-9 w-24\"\n />\n </SettingsRow>\n </div>\n </div>\n );\n}\n\n// --- the status set --------------------------------------------------------------------------------------------------------\n\nexport type StatusSetEditorProps = {\n /** The kind's status set (`KindConfig.status`). */\n value: StatusSet;\n /** Called with the whole set after every change. */\n onChange: (value: StatusSet) => void;\n /** The roles of the product that can make a move. */\n roles: readonly EditorRole[];\n /** The language the states are named in elsewhere in the editor (the moves' names). */\n locale?: Lang;\n /** What `kindConfigProblems` found (the server's own rules), shown above the list. */\n problems?: readonly string[];\n /** The words, passed translated (English by default). */\n labels?: Partial<StatusSetEditorLabels>;\n /** Not available. */\n disabled?: boolean;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The admin's status set: the states in their order (FR and EN, tone, final), the initial state, and the moves from × to. */\nexport function StatusSetEditor({ value, onChange, roles, locale = \"en\", problems, labels: given, disabled, className }: StatusSetEditorProps) {\n const labels: StatusSetEditorLabels = { ...statusSetEditorLabels, ...given };\n const [chosen, setChosen] = React.useState<{ from: string; to: string } | null>(null);\n const reorder = useReorder((from, to) => onChange(moveState(value, from, to)));\n const id = React.useId();\n const nameOf = (key: string) => value.states.find((s) => s.key === key)?.label[locale] || key;\n const roleLabel = (key: string) => roles.find((r) => r.key === key)?.label ?? key;\n const open = chosen && value.states.some((x) => x.key === chosen.from) && value.states.some((x) => x.key === chosen.to) ? chosen : null;\n const detail = open ? transitionOf(value, open.from, open.to) : undefined;\n\n if (value.mode === \"derived\") {\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n <Problems title={labels.problems} problems={problems} />\n <p className=\"m-0 text-sm text-fg-secondary\">{labels.derived}</p>\n <ol aria-label={labels.states} className=\"m-0 flex list-none flex-wrap gap-2 p-0\">\n {value.states.map((state) => (\n <li key={state.key} className=\"inline-flex items-center gap-1.5 rounded-sm bg-surface-3 px-2 py-0.5 text-[11px] font-semibold text-fg-secondary\" data-tone={state.tone}>\n <span aria-hidden className=\"h-1.5 w-1.5 rounded-full bg-current\" />\n {state.label[locale]}\n </li>\n ))}\n </ol>\n </div>\n );\n }\n\n return (\n <div className={cn(\"flex flex-col gap-5\", className)}>\n <Problems title={labels.problems} problems={problems} />\n <section aria-labelledby={`${id}-states`} className=\"flex flex-col gap-2\">\n <h3 id={`${id}-states`} className=\"m-0 text-sm font-semibold text-fg\">\n {labels.states}\n </h3>\n <ol className=\"m-0 flex list-none flex-col gap-2 p-0\">\n {value.states.map((state, index) => {\n const n = index + 1;\n const isInitial = value.initial === state.key;\n const name = state.label[locale] || String(n);\n return (\n <li key={state.key} {...reorder.row(index)} data-state-key={state.key} className=\"flex flex-wrap items-start gap-x-3 gap-y-2 rounded-lg border border-border-default bg-surface-1 p-2.5\">\n <span {...reorder.handle(index)} aria-hidden title={labels.drag(name)} className=\"mt-1.5 inline-flex h-9 w-6 cursor-grab items-center justify-center text-fg-muted active:cursor-grabbing max-md:hidden\">\n {grip}\n </span>\n {([\"fr\", \"en\"] as const).map((lang) => (\n <Input\n key={lang}\n aria-label={labels.stateLabel(labels.languages[lang], n)}\n data-reorder-field={lang}\n lang={lang}\n value={state.label[lang]}\n maxLength={40}\n disabled={disabled}\n invalid={!state.label[lang].trim()}\n onChange={(event) => onChange(setStateLabel(value, state.key, lang, event.target.value))}\n onKeyDown={reorder.keys(index, value.states.length - 1)}\n className=\"h-9 min-w-36 flex-1\"\n />\n ))}\n <Select aria-label={labels.tone(n)} value={state.tone} disabled={disabled} onChange={(event) => onChange(setStateTone(value, state.key, event.target.value as StatusTone))} className=\"h-9 w-36\">\n {STATUS_TONES.map((tone) => (\n <option key={tone} value={tone}>\n {labels.tones[tone]}\n </option>\n ))}\n </Select>\n <div className=\"flex items-center gap-1.5 text-xs text-fg-secondary\">\n <Switch size=\"sm\" label={labels.final(n)} checked={Boolean(state.final)} disabled={disabled || isInitial} onCheckedChange={(final) => onChange(setFinal(value, state.key, final))} />\n <span aria-hidden>{isInitial ? labels.initialNotFinal : labels.finalHint}</span>\n </div>\n <label className=\"flex items-center gap-1.5 text-xs text-fg-secondary\">\n <input type=\"radio\" name={`${id}-initial`} aria-label={labels.initial(n)} checked={isInitial} disabled={disabled || Boolean(state.final)} onChange={() => onChange(setInitial(value, state.key))} className=\"h-4 w-4 accent-(--kz-accent)\" />\n <span aria-hidden>{labels.initial(n)}</span>\n </label>\n <code className=\"text-[11px] text-fg-muted\">{state.key}</code>\n <div className=\"ml-auto flex\">\n <IconButton label={labels.moveUp(name)} disabled={disabled || index === 0} onClick={() => onChange(moveState(value, index, index - 1))}>\n {arrow(true)}\n </IconButton>\n <IconButton label={labels.moveDown(name)} disabled={disabled || index === value.states.length - 1} onClick={() => onChange(moveState(value, index, index + 1))}>\n {arrow(false)}\n </IconButton>\n <IconButton label={labels.remove(name)} disabled={disabled || value.states.length <= 2} onClick={() => onChange(removeState(value, state.key))}>\n <Cross />\n </IconButton>\n </div>\n </li>\n );\n })}\n </ol>\n <div>\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" disabled={disabled || value.states.length >= 12} onClick={() => onChange(addState(value, labels.newState))}>\n {labels.addState}\n </Button>\n </div>\n </section>\n\n <section aria-labelledby={`${id}-moves`} className=\"flex flex-col gap-3\">\n <div className=\"flex flex-col gap-0.5\">\n <h3 id={`${id}-moves`} className=\"m-0 text-sm font-semibold text-fg\">\n {labels.moves}\n </h3>\n <p className=\"m-0 text-xs text-fg-secondary\">{labels.movesHint}</p>\n </div>\n {value.states.map((from) => (\n <div key={from.key} role=\"group\" aria-label={labels.from(nameOf(from.key))} className=\"flex flex-wrap items-center gap-2\">\n <span className=\"min-w-28 text-xs font-semibold text-fg\">{nameOf(from.key)}</span>\n {from.final ? (\n <span className=\"text-xs text-fg-secondary\">{labels.noWayOut}</span>\n ) : (\n value.states\n .filter((to) => to.key !== from.key)\n .map((to) => {\n const move = transitionOf(value, from.key, to.key);\n const summary = move ? move.roles.map(roleLabel).join(\", \") : labels.none;\n const on = open?.from === from.key && open.to === to.key;\n return (\n <button\n key={to.key}\n type=\"button\"\n aria-pressed={on}\n data-on={move ? \"\" : undefined}\n disabled={disabled}\n onClick={() => setChosen(on ? null : { from: from.key, to: to.key })}\n className={cn(\n \"inline-flex min-h-9 items-center gap-1.5 rounded-sm border px-2.5 py-1 text-xs transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40\",\n move ? \"border-accent bg-accent-soft text-fg\" : \"border-dashed border-border-control text-fg-secondary hover:border-border-strong\",\n on && \"ring-2 ring-ring\",\n )}\n >\n {/* The name is the sentence for a screen reader; the arrow and the short words are what the eye reads. */}\n <span className=\"sr-only\">{labels.move(nameOf(from.key), nameOf(to.key), summary)}</span>\n <span aria-hidden>→ {nameOf(to.key)}</span>\n <span aria-hidden className=\"text-fg\">\n {summary}\n </span>\n </button>\n );\n })\n )}\n </div>\n ))}\n\n {open && chosen ? (\n <div role=\"region\" aria-label={labels.moveDetail(nameOf(open.from), nameOf(open.to))} className=\"flex flex-col gap-3 rounded-lg border border-border-default bg-surface-1 p-3\">\n <h4 className=\"m-0 text-sm font-semibold text-fg\">{labels.moveDetail(nameOf(open.from), nameOf(open.to))}</h4>\n <div className=\"flex flex-col gap-1.5\">\n <span className=\"text-xs font-semibold text-fg-secondary\">{labels.roles}</span>\n <Chip.Group\n type=\"multiple\"\n size=\"sm\"\n label={labels.roles}\n value={detail?.roles ? [...detail.roles] : []}\n disabled={disabled}\n onValueChange={(next) => {\n onChange(setTransitionRoles(value, open.from, open.to, next));\n }}\n >\n {roles.map((role) => (\n <Chip key={role.key} value={role.key}>\n {role.label}\n </Chip>\n ))}\n </Chip.Group>\n </div>\n {detail ? (\n <>\n <div className=\"flex items-center gap-2 text-xs text-fg-secondary\">\n <Switch size=\"sm\" label={labels.confirm} checked={Boolean(detail?.confirm)} disabled={disabled} onCheckedChange={(on) => onChange(setTransitionConfirm(value, open.from, open.to, on))} />\n <span aria-hidden>{labels.confirm}</span>\n </div>\n <div className=\"flex flex-col gap-2\">\n <span className=\"text-xs font-semibold text-fg-secondary\">{labels.reasons}</span>\n {(detail?.reasons ?? []).map((reason, at) => (\n <div key={reason.key} className=\"flex flex-wrap items-center gap-2\">\n {([\"fr\", \"en\"] as const).map((lang) => (\n <Input\n key={lang}\n lang={lang}\n aria-label={labels.reasonLabel(labels.languages[lang], at + 1)}\n value={reason.label[lang]}\n maxLength={40}\n disabled={disabled}\n invalid={!reason.label[lang].trim()}\n onChange={(event) =>\n onChange(setTransitionReasons(value, open.from, open.to, (detail?.reasons ?? []).map((r) => (r.key === reason.key ? { ...r, label: { ...r.label, [lang]: event.target.value } } : r))))\n }\n className=\"h-9 min-w-36 flex-1\"\n />\n ))}\n <IconButton label={labels.removeReason(at + 1)} disabled={disabled} onClick={() => onChange(setTransitionReasons(value, open.from, open.to, (detail?.reasons ?? []).filter((r) => r.key !== reason.key)))}>\n <Cross />\n </IconButton>\n </div>\n ))}\n <div>\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" disabled={disabled || (detail?.reasons?.length ?? 0) >= 12} onClick={() => onChange(addReason(value, open.from, open.to, { fr: \"\", en: \"\" }))}>\n {labels.addReason}\n </Button>\n </div>\n </div>\n </>\n ) : null}\n </div>\n ) : null}\n </section>\n </div>\n );\n}\n"
407
+ "content": "// Client (state, drag). The admin's editors of a kind's vocabulary (krizaka-ts#89, ADR-003 of krizaka-ts: « admin configures\n// everything »): the tag set (the presets of a variant, who writes, may people add their own, the most) and the status set\n// (the states in their order, each in French and English, its tone, final; the initial state; the moves from × to with the\n// roles, a confirmation and the reasons). Each takes the descriptor and gives it back (`value` / `onChange`) and never holds the\n// save logic: the product posts it, with the `version` it read. `problems` (from `kindConfigProblems`, the server's own rules)\n// are shown in place. What the contract forbids is kept by construction (model.ts): a final state has no way out, the initial\n// state is never final, a move goes to another state. Reorder: drag the handle, or the buttons, or Alt + ↑ ↓ in a name.\nimport type { Marker, StatusSet, StatusTone } from \"@krizaka/organize/contract\";\nimport * as React from \"react\";\n\nimport { Button } from \"../button\";\nimport { Chip, MarkerPicker, TagMarker } from \"../chip\";\nimport { cn } from \"../cn\";\nimport { Input, Select } from \"../field\";\nimport { SettingsRow } from \"../settings-layout\";\nimport { Switch } from \"../switch\";\nimport { type EditorRole, STATUS_TONES, type StatusSetEditorLabels, statusSetEditorLabels, type TagSetEditorLabels, tagSetEditorLabels } from \"./labels\";\nimport {\n addPreset,\n addReason,\n addState,\n clampMax,\n duplicatePresetNames,\n type Lang,\n movePreset,\n moveState,\n recolorPreset,\n removePreset,\n removeState,\n renamePreset,\n setFinal,\n setInitial,\n setStateLabel,\n setStateTone,\n setTransitionConfirm,\n setTransitionReasons,\n setTransitionRoles,\n type TagSetValue,\n transitionOf,\n} from \"./model\";\n\nexport type { EditorRole, Lang, StatusSetEditorLabels, TagSetEditorLabels, TagSetValue };\nexport { statusSetEditorLabels, tagSetEditorLabels };\n\n\n// --- shared ----------------------------------------------------------------------------------------------------------------\n\n/** The problems the server's rules found, shown where the admin is working: a polite alert above the list. */\nfunction Problems({ title, problems }: Readonly<{ title: string; problems: readonly string[] | undefined }>) {\n if (!problems || problems.length === 0) return null;\n return (\n <div role=\"alert\" className=\"flex flex-col gap-1 rounded-lg border border-danger/40 bg-danger/10 px-3 py-2.5\">\n <p className=\"m-0 text-xs font-semibold text-fg-danger\">{title}</p>\n <ul className=\"m-0 flex list-disc flex-col gap-0.5 pl-5 text-xs text-fg\">\n {problems.map((problem) => (\n <li key={problem}>{problem}</li>\n ))}\n </ul>\n </div>\n );\n}\n\n/** Drag a row by its handle, or move it with Alt + ↑ ↓ from a field: one pair of helpers for both lists. */\nfunction useReorder(onMove: (from: number, to: number) => void) {\n const dragging = React.useRef<number | null>(null);\n return {\n row: (index: number) => ({\n onDragOver: (event: React.DragEvent) => {\n if (dragging.current !== null) event.preventDefault();\n },\n onDrop: (event: React.DragEvent) => {\n event.preventDefault();\n if (dragging.current !== null) onMove(dragging.current, index);\n dragging.current = null;\n },\n }),\n handle: (index: number) => ({\n draggable: true,\n onDragStart: (event: React.DragEvent) => {\n dragging.current = index;\n event.dataTransfer.effectAllowed = \"move\";\n event.dataTransfer.setData(\"text/plain\", String(index));\n },\n onDragEnd: () => {\n dragging.current = null;\n },\n }),\n keys: (index: number, last: number) => (event: React.KeyboardEvent) => {\n if (!event.altKey || (event.key !== \"ArrowUp\" && event.key !== \"ArrowDown\")) return;\n event.preventDefault();\n const to = event.key === \"ArrowUp\" ? index - 1 : index + 1;\n if (to < 0 || to > last) return;\n onMove(index, to);\n // The row has moved: its field is a new element, keep the focus on it for the next press.\n const field = event.currentTarget as HTMLElement;\n requestAnimationFrame(() => field.closest(\"ol\")?.querySelectorAll<HTMLElement>(`[data-reorder-field=\"${field.dataset.reorderField}\"]`)[to]?.focus());\n },\n };\n}\n\nconst grip = (\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"currentColor\" aria-hidden>\n {[7, 12, 17].flatMap((y) => [9, 15].map((x) => <circle key={`${x}-${y}`} cx={x} cy={y} r=\"1.4\" />))}\n </svg>\n);\nconst arrow = (up: boolean) => (\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={up ? \"m6 15 6-6 6 6\" : \"m6 9 6 6 6-6\"} />\n </svg>\n);\nconst IconButton = ({ label, className, ...props }: React.ComponentProps<\"button\"> & { label: string }) => (\n <button\n type=\"button\"\n aria-label={label}\n title={label}\n className={cn(\n \"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg\",\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-30\",\n className,\n )}\n {...props}\n />\n);\nconst Cross = () => (\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n);\n\n// --- the tag set -----------------------------------------------------------------------------------------------------------\n\nexport type TagSetEditorProps = {\n /** The `tags` of the kind's configuration (`KindConfig.tags`). */\n value: TagSetValue;\n /** Called with the whole set after every change. */\n onChange: (value: TagSetValue) => void;\n /** The variant whose presets are edited (a trade, or `default`). */\n variant: string;\n /** The roles of the product that can write tags. */\n roles: readonly EditorRole[];\n /** What `kindConfigProblems` found (the server's own rules), shown above the list. */\n problems?: readonly string[];\n /** The words, passed translated (English by default). */\n labels?: Partial<TagSetEditorLabels>;\n /** Not available. */\n disabled?: boolean;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The admin's tag set: the presets of a variant (name, colour, order), who writes, whether people add their own, the most. */\nexport function TagSetEditor({ value, onChange, variant, roles, problems, labels: given, disabled, className }: Readonly<TagSetEditorProps>) {\n const labels: TagSetEditorLabels = { ...tagSetEditorLabels, ...given, markerNames: { ...tagSetEditorLabels.markerNames, ...given?.markerNames } };\n const presets = value.presets[variant] ?? [];\n const twins = duplicatePresetNames(presets);\n const [draft, setDraft] = React.useState(\"\");\n const [draftMarker, setDraftMarker] = React.useState<Marker>(\"blue\");\n const reorder = useReorder((from, to) => onChange(movePreset(value, variant, from, to)));\n const id = React.useId();\n const add = () => {\n const next = addPreset(value, variant, draft, draftMarker);\n if (next === value) return;\n onChange(next);\n setDraft(\"\");\n };\n return (\n <div className={cn(\"flex flex-col gap-4\", className)}>\n <Problems title={labels.problems} problems={problems} />\n <section aria-labelledby={`${id}-presets`} className=\"flex flex-col gap-2\">\n <h3 id={`${id}-presets`} className=\"m-0 text-sm font-semibold text-fg\">\n {labels.presets}\n </h3>\n {presets.length === 0 ? (\n <p className=\"m-0 text-sm text-fg-secondary\">{labels.empty}</p>\n ) : (\n <ol className=\"m-0 flex list-none flex-col gap-2 p-0\">\n {presets.map((preset, index) => {\n const shown = preset.name || String(index + 1);\n const twin = twins.has(index);\n return (\n <li key={index} {...reorder.row(index)} className=\"flex flex-wrap items-center gap-x-2 gap-y-1 rounded-lg border border-border-default bg-surface-1 px-2 py-1.5\">\n <span {...reorder.handle(index)} aria-hidden title={labels.drag(shown)} className=\"inline-flex h-9 w-6 cursor-grab items-center justify-center text-fg-muted active:cursor-grabbing max-md:hidden\">\n {grip}\n </span>\n <TagMarker marker={preset.marker} />\n <div className=\"flex min-w-40 flex-1 flex-col gap-1\">\n <Input\n aria-label={labels.name(index + 1)}\n data-reorder-field=\"name\"\n value={preset.name}\n disabled={disabled}\n invalid={twin || !preset.name.trim()}\n aria-describedby={twin ? `${id}-dup-${index}` : undefined}\n onChange={(event) => onChange(renamePreset(value, variant, index, event.target.value))}\n onBlur={(event) => event.target.value !== event.target.value.replace(/\\s+/g, \" \").trim() && onChange(renamePreset(value, variant, index, event.target.value.replace(/\\s+/g, \" \").trim()))}\n onKeyDown={reorder.keys(index, presets.length - 1)}\n className=\"h-9\"\n />\n {twin ? (\n <span id={`${id}-dup-${index}`} className=\"text-xs text-fg-danger\">\n {labels.duplicate}\n </span>\n ) : null}\n </div>\n <MarkerPicker label={labels.marker(shown)} names={labels.markerNames} value={preset.marker} disabled={disabled} onValueChange={(marker) => onChange(recolorPreset(value, variant, index, marker))} />\n <IconButton label={labels.moveUp(shown)} disabled={disabled || index === 0} onClick={() => onChange(movePreset(value, variant, index, index - 1))}>\n {arrow(true)}\n </IconButton>\n <IconButton label={labels.moveDown(shown)} disabled={disabled || index === presets.length - 1} onClick={() => onChange(movePreset(value, variant, index, index + 1))}>\n {arrow(false)}\n </IconButton>\n <IconButton label={labels.remove(shown)} disabled={disabled} onClick={() => onChange(removePreset(value, variant, index))}>\n <Cross />\n </IconButton>\n </li>\n );\n })}\n </ol>\n )}\n <div className=\"flex flex-wrap items-center gap-2\">\n <Input\n aria-label={labels.add}\n value={draft}\n maxLength={80}\n disabled={disabled}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n event.preventDefault();\n add();\n }\n }}\n placeholder={labels.add}\n className=\"h-9 min-w-40 flex-1\"\n />\n <MarkerPicker label={labels.marker(draft.trim() || labels.add)} names={labels.markerNames} value={draftMarker} disabled={disabled} onValueChange={setDraftMarker} />\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" disabled={disabled || !draft.trim()} onClick={add}>\n {labels.addButton}\n </Button>\n </div>\n </section>\n <div className=\"flex flex-col\">\n <SettingsRow label={labels.writers} description={labels.writersHint}>\n <Chip.Group type=\"multiple\" size=\"sm\" label={labels.writers} value={value.writers} disabled={disabled} onValueChange={(writers) => onChange({ ...value, writers })}>\n {roles.map((role) => (\n <Chip key={role.key} value={role.key}>\n {role.label}\n </Chip>\n ))}\n </Chip.Group>\n </SettingsRow>\n <SettingsRow label={labels.userTags} description={labels.userTagsHint}>\n <Switch label={labels.userTags} checked={value.userTags} disabled={disabled} onCheckedChange={(userTags) => onChange({ ...value, userTags })} />\n </SettingsRow>\n <SettingsRow label={labels.max} description={labels.maxHint} htmlFor={`${id}-max`}>\n <Input\n id={`${id}-max`}\n type=\"number\"\n inputMode=\"numeric\"\n min={1}\n max={200}\n value={value.max}\n disabled={disabled}\n invalid={!Number.isInteger(value.max) || value.max < 1 || value.max > 200}\n onChange={(event) => onChange({ ...value, max: event.target.value === \"\" ? 0 : Number(event.target.value) })}\n onBlur={() => onChange({ ...value, max: clampMax(value.max) })}\n className=\"h-9 w-24\"\n />\n </SettingsRow>\n </div>\n </div>\n );\n}\n\n// --- the status set --------------------------------------------------------------------------------------------------------\n\nexport type StatusSetEditorProps = {\n /** The kind's status set (`KindConfig.status`). */\n value: StatusSet;\n /** Called with the whole set after every change. */\n onChange: (value: StatusSet) => void;\n /** The roles of the product that can make a move. */\n roles: readonly EditorRole[];\n /** The language the states are named in elsewhere in the editor (the moves' names). */\n locale?: Lang;\n /** What `kindConfigProblems` found (the server's own rules), shown above the list. */\n problems?: readonly string[];\n /** The words, passed translated (English by default). */\n labels?: Partial<StatusSetEditorLabels>;\n /** Not available. */\n disabled?: boolean;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The admin's status set: the states in their order (FR and EN, tone, final), the initial state, and the moves from × to. */\nexport function StatusSetEditor({ value, onChange, roles, locale = \"en\", problems, labels: given, disabled, className }: Readonly<StatusSetEditorProps>) {\n const labels: StatusSetEditorLabels = { ...statusSetEditorLabels, ...given };\n const [chosen, setChosen] = React.useState<{ from: string; to: string } | null>(null);\n const reorder = useReorder((from, to) => onChange(moveState(value, from, to)));\n const id = React.useId();\n const nameOf = (key: string) => value.states.find((s) => s.key === key)?.label[locale] || key;\n const roleLabel = (key: string) => roles.find((r) => r.key === key)?.label ?? key;\n const open = chosen && value.states.some((x) => x.key === chosen.from) && value.states.some((x) => x.key === chosen.to) ? chosen : null;\n const detail = open ? transitionOf(value, open.from, open.to) : undefined;\n\n if (value.mode === \"derived\") {\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n <Problems title={labels.problems} problems={problems} />\n <p className=\"m-0 text-sm text-fg-secondary\">{labels.derived}</p>\n <ol aria-label={labels.states} className=\"m-0 flex list-none flex-wrap gap-2 p-0\">\n {value.states.map((state) => (\n <li key={state.key} className=\"inline-flex items-center gap-1.5 rounded-sm bg-surface-3 px-2 py-0.5 text-[11px] font-semibold text-fg-secondary\" data-tone={state.tone}>\n <span aria-hidden className=\"h-1.5 w-1.5 rounded-full bg-current\" />\n {state.label[locale]}\n </li>\n ))}\n </ol>\n </div>\n );\n }\n\n return (\n <div className={cn(\"flex flex-col gap-5\", className)}>\n <Problems title={labels.problems} problems={problems} />\n <section aria-labelledby={`${id}-states`} className=\"flex flex-col gap-2\">\n <h3 id={`${id}-states`} className=\"m-0 text-sm font-semibold text-fg\">\n {labels.states}\n </h3>\n <ol className=\"m-0 flex list-none flex-col gap-2 p-0\">\n {value.states.map((state, index) => {\n const n = index + 1;\n const isInitial = value.initial === state.key;\n const name = state.label[locale] || String(n);\n return (\n <li key={state.key} {...reorder.row(index)} data-state-key={state.key} className=\"flex flex-wrap items-start gap-x-3 gap-y-2 rounded-lg border border-border-default bg-surface-1 p-2.5\">\n <span {...reorder.handle(index)} aria-hidden title={labels.drag(name)} className=\"mt-1.5 inline-flex h-9 w-6 cursor-grab items-center justify-center text-fg-muted active:cursor-grabbing max-md:hidden\">\n {grip}\n </span>\n {([\"fr\", \"en\"] as const).map((lang) => (\n <Input\n key={lang}\n aria-label={labels.stateLabel(labels.languages[lang], n)}\n data-reorder-field={lang}\n lang={lang}\n value={state.label[lang]}\n maxLength={40}\n disabled={disabled}\n invalid={!state.label[lang].trim()}\n onChange={(event) => onChange(setStateLabel(value, state.key, lang, event.target.value))}\n onKeyDown={reorder.keys(index, value.states.length - 1)}\n className=\"h-9 min-w-36 flex-1\"\n />\n ))}\n <Select aria-label={labels.tone(n)} value={state.tone} disabled={disabled} onChange={(event) => onChange(setStateTone(value, state.key, event.target.value as StatusTone))} className=\"h-9 w-36\">\n {STATUS_TONES.map((tone) => (\n <option key={tone} value={tone}>\n {labels.tones[tone]}\n </option>\n ))}\n </Select>\n <div className=\"flex items-center gap-1.5 text-xs text-fg-secondary\">\n <Switch size=\"sm\" label={labels.final(n)} checked={Boolean(state.final)} disabled={disabled || isInitial} onCheckedChange={(final) => onChange(setFinal(value, state.key, final))} />\n <span aria-hidden>{isInitial ? labels.initialNotFinal : labels.finalHint}</span>\n </div>\n <label className=\"flex items-center gap-1.5 text-xs text-fg-secondary\">\n <input type=\"radio\" name={`${id}-initial`} aria-label={labels.initial(n)} checked={isInitial} disabled={disabled || Boolean(state.final)} onChange={() => onChange(setInitial(value, state.key))} className=\"h-4 w-4 accent-(--kz-accent)\" />\n <span aria-hidden>{labels.initial(n)}</span>\n </label>\n <code className=\"text-[11px] text-fg-muted\">{state.key}</code>\n <div className=\"ml-auto flex\">\n <IconButton label={labels.moveUp(name)} disabled={disabled || index === 0} onClick={() => onChange(moveState(value, index, index - 1))}>\n {arrow(true)}\n </IconButton>\n <IconButton label={labels.moveDown(name)} disabled={disabled || index === value.states.length - 1} onClick={() => onChange(moveState(value, index, index + 1))}>\n {arrow(false)}\n </IconButton>\n <IconButton label={labels.remove(name)} disabled={disabled || value.states.length <= 2} onClick={() => onChange(removeState(value, state.key))}>\n <Cross />\n </IconButton>\n </div>\n </li>\n );\n })}\n </ol>\n <div>\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" disabled={disabled || value.states.length >= 12} onClick={() => onChange(addState(value, labels.newState))}>\n {labels.addState}\n </Button>\n </div>\n </section>\n\n <section aria-labelledby={`${id}-moves`} className=\"flex flex-col gap-3\">\n <div className=\"flex flex-col gap-0.5\">\n <h3 id={`${id}-moves`} className=\"m-0 text-sm font-semibold text-fg\">\n {labels.moves}\n </h3>\n <p className=\"m-0 text-xs text-fg-secondary\">{labels.movesHint}</p>\n </div>\n {value.states.map((from) => (\n <div key={from.key} role=\"group\" aria-label={labels.from(nameOf(from.key))} className=\"flex flex-wrap items-center gap-2\">\n <span className=\"min-w-28 text-xs font-semibold text-fg\">{nameOf(from.key)}</span>\n {from.final ? (\n <span className=\"text-xs text-fg-secondary\">{labels.noWayOut}</span>\n ) : (\n value.states\n .filter((to) => to.key !== from.key)\n .map((to) => {\n const move = transitionOf(value, from.key, to.key);\n const summary = move ? move.roles.map(roleLabel).join(\", \") : labels.none;\n const on = open?.from === from.key && open.to === to.key;\n return (\n <button\n key={to.key}\n type=\"button\"\n aria-pressed={on}\n data-on={move ? \"\" : undefined}\n disabled={disabled}\n onClick={() => setChosen(on ? null : { from: from.key, to: to.key })}\n className={cn(\n \"inline-flex min-h-9 items-center gap-1.5 rounded-sm border px-2.5 py-1 text-xs transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40\",\n move ? \"border-accent bg-accent-soft text-fg\" : \"border-dashed border-border-control text-fg-secondary hover:border-border-strong\",\n on && \"ring-2 ring-ring\",\n )}\n >\n {/* The name is the sentence for a screen reader; the arrow and the short words are what the eye reads. */}\n <span className=\"sr-only\">{labels.move(nameOf(from.key), nameOf(to.key), summary)}</span>\n <span aria-hidden>→ {nameOf(to.key)}</span>\n <span aria-hidden className=\"text-fg\">\n {summary}\n </span>\n </button>\n );\n })\n )}\n </div>\n ))}\n\n {open && chosen ? (\n <div role=\"region\" aria-label={labels.moveDetail(nameOf(open.from), nameOf(open.to))} className=\"flex flex-col gap-3 rounded-lg border border-border-default bg-surface-1 p-3\">\n <h4 className=\"m-0 text-sm font-semibold text-fg\">{labels.moveDetail(nameOf(open.from), nameOf(open.to))}</h4>\n <div className=\"flex flex-col gap-1.5\">\n <span className=\"text-xs font-semibold text-fg-secondary\">{labels.roles}</span>\n <Chip.Group\n type=\"multiple\"\n size=\"sm\"\n label={labels.roles}\n value={detail?.roles ? [...detail.roles] : []}\n disabled={disabled}\n onValueChange={(next) => {\n onChange(setTransitionRoles(value, open.from, open.to, next));\n }}\n >\n {roles.map((role) => (\n <Chip key={role.key} value={role.key}>\n {role.label}\n </Chip>\n ))}\n </Chip.Group>\n </div>\n {detail ? (\n <>\n <div className=\"flex items-center gap-2 text-xs text-fg-secondary\">\n <Switch size=\"sm\" label={labels.confirm} checked={Boolean(detail?.confirm)} disabled={disabled} onCheckedChange={(on) => onChange(setTransitionConfirm(value, open.from, open.to, on))} />\n <span aria-hidden>{labels.confirm}</span>\n </div>\n <div className=\"flex flex-col gap-2\">\n <span className=\"text-xs font-semibold text-fg-secondary\">{labels.reasons}</span>\n {(detail?.reasons ?? []).map((reason, at) => (\n <div key={reason.key} className=\"flex flex-wrap items-center gap-2\">\n {([\"fr\", \"en\"] as const).map((lang) => (\n <Input\n key={lang}\n lang={lang}\n aria-label={labels.reasonLabel(labels.languages[lang], at + 1)}\n value={reason.label[lang]}\n maxLength={40}\n disabled={disabled}\n invalid={!reason.label[lang].trim()}\n onChange={(event) =>\n onChange(setTransitionReasons(value, open.from, open.to, (detail?.reasons ?? []).map((r) => (r.key === reason.key ? { ...r, label: { ...r.label, [lang]: event.target.value } } : r))))\n }\n className=\"h-9 min-w-36 flex-1\"\n />\n ))}\n <IconButton label={labels.removeReason(at + 1)} disabled={disabled} onClick={() => onChange(setTransitionReasons(value, open.from, open.to, (detail?.reasons ?? []).filter((r) => r.key !== reason.key)))}>\n <Cross />\n </IconButton>\n </div>\n ))}\n <div>\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" disabled={disabled || (detail?.reasons?.length ?? 0) >= 12} onClick={() => onChange(addReason(value, open.from, open.to, { fr: \"\", en: \"\" }))}>\n {labels.addReason}\n </Button>\n </div>\n </div>\n </>\n ) : null}\n </div>\n ) : null}\n </section>\n </div>\n );\n}\n"
408
408
  },
409
409
  {
410
410
  "path": "kind-config-editor/labels.ts",
@@ -217,7 +217,7 @@
217
217
  },
218
218
  {
219
219
  "path": "kpi-explained/kpi-explained.tsx",
220
- "content": "// Server-safe. A figure whose meaning, formula, source and freshness travel with its value.\nimport { type DateInput, formatDate, formatMoney, formatNumber, formatPercent, type Locale } from \"@krizaka/intl\";\nimport * as React from \"react\";\n\nexport type KpiNumberOptions = Omit<Intl.NumberFormatOptions, \"style\" | \"currency\" | \"currencyDisplay\">;\n\nexport type KpiFormat =\n | { type: \"money\"; currency: string; minorUnitDigits?: number }\n | { type: \"number\"; options?: KpiNumberOptions }\n | { type: \"percent\"; options?: KpiNumberOptions };\n\nexport type KpiState = \"ok\" | \"watch\" | \"act\";\n\nexport interface KpiExplainedProps extends Omit<React.ComponentProps<\"article\">, \"children\"> {\n /** The figure's name. */\n label: React.ReactNode;\n /** The raw number: money is integer minor units; percentages are ratios such as 0.125. */\n value: number;\n /** How to format the value with `@krizaka/intl`. */\n format: KpiFormat;\n /** The app's locale, e.g. `fr-CA`. */\n locale: Locale;\n /** The IANA time zone for freshness dates; defaults to UTC for deterministic rendering. */\n timeZone?: string;\n /** One plain-language sentence about what the figure means. */\n meaning: string;\n /** The localized label for the formula row. */\n formulaLabel: React.ReactNode;\n /** The calculation in words, e.g. “dépenses TTC ÷ ventes TTC”. */\n formula: string;\n /** The localized label for the source row. */\n sourceLabel: React.ReactNode;\n /** The source link or file name, supplied by the host. */\n source: React.ReactNode;\n /** A host-provided action such as “Verify”, next to the source. */\n verify?: React.ReactNode;\n /** Host-provided thresholds in the same units as `value`. */\n thresholds: {\n direction: \"above\" | \"below\";\n watchAt: number;\n actAt: number;\n };\n /** Host-provided words for the derived state. */\n stateLabels: Record<KpiState, React.ReactNode>;\n /** Reading time and the expected next reading time (the host derives it from its cadence). */\n freshness: {\n lastRead: DateInput;\n expectedAt: DateInput;\n now: DateInput;\n lastReadLabel: React.ReactNode;\n staleLabel: React.ReactNode;\n };\n /** An optional Sparkline from `@krizaka/charts`, with its own accessible summary. */\n sparkline?: React.ReactNode;\n /** Replace every non-space character in the value while preserving its formatted shape. */\n masked?: boolean;\n /** The accessible name shown instead of the value when masked. */\n maskedLabel: string;\n}\n\nfunction formatValue(value: number, format: KpiFormat, locale: Locale): string {\n switch (format.type) {\n case \"money\":\n return formatMoney(value, { currency: format.currency, locale, minorUnitDigits: format.minorUnitDigits });\n case \"percent\":\n return formatPercent(value, { locale, ...format.options });\n case \"number\":\n return formatNumber(value, { locale, ...format.options });\n }\n}\n\nfunction stateFor(value: number, thresholds: KpiExplainedProps[\"thresholds\"]): KpiState {\n if (thresholds.direction === \"above\") {\n return value >= thresholds.actAt ? \"act\" : value >= thresholds.watchAt ? \"watch\" : \"ok\";\n }\n return value <= thresholds.actAt ? \"act\" : value <= thresholds.watchAt ? \"watch\" : \"ok\";\n}\n\nfunction maskValue(value: string): string {\n return value.replace(/[^\\s]/gu, \"•\");\n}\n\n/** A key figure that explains what it means, how it is calculated and where it came from. */\nexport function KpiExplained({\n label,\n value,\n format,\n locale,\n timeZone = \"UTC\",\n meaning,\n formulaLabel,\n formula,\n sourceLabel,\n source,\n verify,\n thresholds,\n stateLabels,\n freshness,\n sparkline,\n masked = false,\n maskedLabel,\n className,\n ...props\n}: KpiExplainedProps) {\n const id = React.useId();\n const state = stateFor(value, thresholds);\n const formattedValue = formatValue(value, format, locale);\n const lastRead = new Date(freshness.lastRead);\n const stale = new Date(freshness.now) >= new Date(freshness.expectedAt);\n\n return (\n <article aria-labelledby={`${id}-label`} className={[\"kz-kpi\", className].filter(Boolean).join(\" \")} data-state={state} {...props}>\n <header className=\"kz-kpi-head\">\n <h3 id={`${id}-label`} className=\"kz-kpi-label\">{label}</h3>\n <span className=\"kz-kpi-state\" data-state={state}>{stateLabels[state]}</span>\n </header>\n <p className=\"kz-kpi-value\">\n {masked ? <span role=\"img\" aria-label={maskedLabel}>{maskValue(formattedValue)}</span> : formattedValue}\n </p>\n <p className=\"kz-kpi-meaning\">{meaning}</p>\n <dl className=\"kz-kpi-details\">\n <div><dt>{formulaLabel}</dt><dd>{formula}</dd></div>\n <div><dt>{sourceLabel}</dt><dd>{source}{verify ? <span className=\"kz-kpi-verify\">{verify}</span> : null}</dd></div>\n </dl>\n <p className=\"kz-kpi-freshness\">\n <span>{freshness.lastReadLabel}: </span>\n <time dateTime={lastRead.toISOString()}>{formatDate(lastRead, { locale, style: \"medium\", timeStyle: \"short\", timeZone })}</time>\n {stale ? <span className=\"kz-kpi-stale\" role=\"status\">{freshness.staleLabel}</span> : null}\n </p>\n {sparkline ? <div className=\"kz-kpi-sparkline\">{sparkline}</div> : null}\n </article>\n );\n}\n"
220
+ "content": "// Server-safe. A figure whose meaning, formula, source and freshness travel with its value.\nimport { type DateInput, formatDate, formatMoney, formatNumber, formatPercent, type Locale } from \"@krizaka/intl\";\nimport * as React from \"react\";\n\nexport type KpiNumberOptions = Omit<Intl.NumberFormatOptions, \"style\" | \"currency\" | \"currencyDisplay\">;\n\nexport type KpiFormat =\n | { type: \"money\"; currency: string; minorUnitDigits?: number }\n | { type: \"number\"; options?: KpiNumberOptions }\n | { type: \"percent\"; options?: KpiNumberOptions };\n\nexport type KpiState = \"ok\" | \"watch\" | \"act\";\n\nexport interface KpiExplainedProps extends Omit<React.ComponentProps<\"article\">, \"children\"> {\n /** The figure's name. */\n label: React.ReactNode;\n /** The raw number: money is integer minor units; percentages are ratios such as 0.125. */\n value: number;\n /** How to format the value with `@krizaka/intl`. */\n format: KpiFormat;\n /** The app's locale, e.g. `fr-CA`. */\n locale: Locale;\n /** The IANA time zone for freshness dates; defaults to UTC for deterministic rendering. */\n timeZone?: string;\n /** One plain-language sentence about what the figure means. */\n meaning: string;\n /** The localized label for the formula row. */\n formulaLabel: React.ReactNode;\n /** The calculation in words, e.g. “dépenses TTC ÷ ventes TTC”. */\n formula: string;\n /** The localized label for the source row. */\n sourceLabel: React.ReactNode;\n /** The source link or file name, supplied by the host. */\n source: React.ReactNode;\n /** A host-provided action such as “Verify”, next to the source. */\n verify?: React.ReactNode;\n /** Host-provided thresholds in the same units as `value`. */\n thresholds: {\n direction: \"above\" | \"below\";\n watchAt: number;\n actAt: number;\n };\n /** Host-provided words for the derived state. */\n stateLabels: Record<KpiState, React.ReactNode>;\n /** Reading time and the expected next reading time (the host derives it from its cadence). */\n freshness: {\n lastRead: DateInput;\n expectedAt: DateInput;\n now: DateInput;\n lastReadLabel: React.ReactNode;\n staleLabel: React.ReactNode;\n };\n /** An optional Sparkline from `@krizaka/charts`, with its own accessible summary. */\n sparkline?: React.ReactNode;\n /** Replace every non-space character in the value while preserving its formatted shape. */\n masked?: boolean;\n /** The accessible name shown instead of the value when masked. */\n maskedLabel: string;\n}\n\nfunction formatValue(value: number, format: KpiFormat, locale: Locale): string {\n switch (format.type) {\n case \"money\":\n return formatMoney(value, { currency: format.currency, locale, minorUnitDigits: format.minorUnitDigits });\n case \"percent\":\n return formatPercent(value, { locale, ...format.options });\n case \"number\":\n return formatNumber(value, { locale, ...format.options });\n }\n}\n\nfunction stateFor(value: number, thresholds: KpiExplainedProps[\"thresholds\"]): KpiState {\n const reaches = thresholds.direction === \"above\" ? (level: number) => value >= level : (level: number) => value <= level;\n if (reaches(thresholds.actAt)) return \"act\";\n if (reaches(thresholds.watchAt)) return \"watch\";\n return \"ok\";\n}\n\nfunction maskValue(value: string): string {\n return value.replace(/[^\\s]/gu, \"•\");\n}\n\n/** A key figure that explains what it means, how it is calculated and where it came from. */\nexport function KpiExplained({\n label,\n value,\n format,\n locale,\n timeZone = \"UTC\",\n meaning,\n formulaLabel,\n formula,\n sourceLabel,\n source,\n verify,\n thresholds,\n stateLabels,\n freshness,\n sparkline,\n masked = false,\n maskedLabel,\n className,\n ...props\n}: Readonly<KpiExplainedProps>) {\n const id = React.useId();\n const state = stateFor(value, thresholds);\n const formattedValue = formatValue(value, format, locale);\n const lastRead = new Date(freshness.lastRead);\n const stale = new Date(freshness.now) >= new Date(freshness.expectedAt);\n\n return (\n <article aria-labelledby={`${id}-label`} className={[\"kz-kpi\", className].filter(Boolean).join(\" \")} data-state={state} {...props}>\n <header className=\"kz-kpi-head\">\n <h3 id={`${id}-label`} className=\"kz-kpi-label\">{label}</h3>\n <span className=\"kz-kpi-state\" data-state={state}>{stateLabels[state]}</span>\n </header>\n <p className=\"kz-kpi-value\">\n {masked ? <span role=\"img\" aria-label={maskedLabel}>{maskValue(formattedValue)}</span> : formattedValue}\n </p>\n <p className=\"kz-kpi-meaning\">{meaning}</p>\n <dl className=\"kz-kpi-details\">\n <div><dt>{formulaLabel}</dt><dd>{formula}</dd></div>\n <div><dt>{sourceLabel}</dt><dd>{source}{verify ? <span className=\"kz-kpi-verify\">{verify}</span> : null}</dd></div>\n </dl>\n <p className=\"kz-kpi-freshness\">\n <span>{freshness.lastReadLabel}: </span>\n <time dateTime={lastRead.toISOString()}>{formatDate(lastRead, { locale, style: \"medium\", timeStyle: \"short\", timeZone })}</time>\n {stale ? <span className=\"kz-kpi-stale\" role=\"status\">{freshness.staleLabel}</span> : null}\n </p>\n {sparkline ? <div className=\"kz-kpi-sparkline\">{sparkline}</div> : null}\n </article>\n );\n}\n"
221
221
  },
222
222
  {
223
223
  "path": "kpi-explained/meta.ts",
@@ -2,8 +2,8 @@
2
2
  "name": "landing-page",
3
3
  "type": "primitive",
4
4
  "title": "Landing page",
5
- "summary": "A landing page: the promise beside the product alive in a window, a band of proofs, the features as a bento where the main one takes the room, the closing call.",
6
- "description": "A landing page: the promise beside the product alive in a window, a band of proofs, the features as a bento where the main one takes the room, the closing call.",
5
+ "summary": "A landing page: the promise beside the product alive in a window (or alone, in one column), a band of proofs, a full-width showcase, the features as a bento where the main one takes the room, the closing call.",
6
+ "description": "A landing page: the promise beside the product alive in a window (or alone, in one column), a band of proofs, a full-width showcase, the features as a bento where the main one takes the room, the closing call.",
7
7
  "status": "beta",
8
8
  "deprecated": null,
9
9
  "category": "templates",
@@ -38,7 +38,8 @@
38
38
  ],
39
39
  "bestPractices": [
40
40
  "One `lg` feature in the bento: the one the visitor came for.",
41
- "The window shows the real product (a recording, a demo), never a mock-up.",
41
+ "The window shows the real product (a recording, a demo), never a mock-up; without one, omit `visual` and the hero is one column.",
42
+ "A home that leads with text and a wide demo: no `visual`, `backdrop=\"quiet\"`, a `MediaCarousel` in `showcase`.",
42
43
  "Three or four proofs, each a fact that can be checked.",
43
44
  "Words and content arrive as props; the motion is the platform's (`[data-reveal]`, still under reduced motion)."
44
45
  ],
@@ -75,13 +76,6 @@
75
76
  "description": "The promise: the page's `h1`.",
76
77
  "required": true
77
78
  },
78
- {
79
- "name": "visual",
80
- "type": "ReactNode",
81
- "default": null,
82
- "description": "The product, alive, beside the words: a recording, a live demo (framed as a window).",
83
- "required": true
84
- },
85
79
  {
86
80
  "name": "actions",
87
81
  "type": "ReactNode",
@@ -89,6 +83,13 @@
89
83
  "description": "The hero's actions (the main one cut, with shimmer).",
90
84
  "required": false
91
85
  },
86
+ {
87
+ "name": "backdrop",
88
+ "type": "\"grid\" | \"quiet\"",
89
+ "default": "grid",
90
+ "description": "The hero's backdrop: `grid` (the dome, the grid and the slow drift) or `quiet` (the still dome only: no grid layer, no drift).",
91
+ "required": false
92
+ },
92
93
  {
93
94
  "name": "closing",
94
95
  "type": "{ title: ReactNode; body?: ReactNode; actions: ReactNode; }",
@@ -124,6 +125,20 @@
124
125
  "description": "Figures or facts in a band under the hero: `{ value, label }`.",
125
126
  "required": false
126
127
  },
128
+ {
129
+ "name": "showcase",
130
+ "type": "ReactNode",
131
+ "default": null,
132
+ "description": "Full width, between the proofs and the features: a carousel, a demo, a wide plate.",
133
+ "required": false
134
+ },
135
+ {
136
+ "name": "visual",
137
+ "type": "ReactNode",
138
+ "default": null,
139
+ "description": "The product, alive, beside the words: a recording, a live demo (framed as a window). Absent: a single-column hero, no empty stage.",
140
+ "required": false
141
+ },
127
142
  {
128
143
  "name": "visualLabel",
129
144
  "type": "ReactNode",
@@ -135,6 +150,17 @@
135
150
  }
136
151
  ],
137
152
  "examples": [
153
+ {
154
+ "name": "showcase",
155
+ "title": "Showcase",
156
+ "description": "A text-only hero on the quiet backdrop, the proofs, then a full-width carousel before the features.",
157
+ "template": true,
158
+ "purpose": "show",
159
+ "why": "A visitor reads the promise, then watches the product at full width before any feature list.",
160
+ "path": "examples/landing-page/showcase.tsx",
161
+ "module": "@krizaka/ui/registry/examples/landing-page/showcase",
162
+ "code": "import { Button } from \"@krizaka/ui/button\";\nimport { LandingPage } from \"@krizaka/ui/landing-page\";\nimport { MediaCarousel } from \"@krizaka/ui/media-carousel\";\nimport { Section } from \"@krizaka/ui/page\";\n\nconst PIC = (a: string, b: string) => `data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 900'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0' stop-color='${a}'/><stop offset='1' stop-color='${b}'/></linearGradient></defs><rect width='1600' height='900' fill='url(#g)'/></svg>`)}`;\n\n// TEMPLATE — a home that leads with words and a full-width demo: no `visual` (a single-column hero), the quiet backdrop,\n// a carousel in `showcase` between the proofs and the features.\nexport default function LandingPageShowcase() {\n return (\n <LandingPage\n backdrop=\"quiet\"\n title=\"An AI that never leaves your server\"\n lead=\"Chat, image and voice on your own machine, every run recorded.\"\n actions={<Button variant=\"primary\" size=\"lg\">Install</Button>}\n proofs={[\n { value: \"0\", label: \"calls to the outside\" },\n { value: \"128\", label: \"runs measured, each with its record\" },\n ]}\n showcase={\n <Section spacing=\"sm\" title=\"See it work\" id=\"showcase-title\" lead=\"Three minutes, no cuts.\">\n <MediaCarousel\n label=\"Sovkora at work\"\n autoplay\n caption=\"bar\"\n textVersion\n slides={[\n { id: \"a\", src: PIC(\"#1d3f6b\", \"#4d7fb8\"), alt: \"A chat answered on the local server\", caption: \"Fig. 1a — a chat, answered locally\" },\n { id: \"b\", src: PIC(\"#23496f\", \"#6b9bc9\"), alt: \"The run's cost and model, side by side\", caption: \"Fig. 1b — the run, accounted for\" },\n ]}\n />\n </Section>\n }\n featuresHeading={{ title: \"What it does\" }}\n features={[\n { id: \"chat\", size: \"lg\", title: \"Chat\", text: \"Answers from models that run on your server.\" },\n { id: \"image\", title: \"Image\", text: \"Generated and kept in your storage.\" },\n ]}\n />\n );\n}\n"
163
+ },
138
164
  {
139
165
  "name": "krizaka",
140
166
  "title": "Krizaka",
@@ -156,11 +182,11 @@
156
182
  },
157
183
  {
158
184
  "path": "landing-page/landing-page.tsx",
159
- "content": "// Server-safe. A landing page (blocks.css `.kz-tpl-*`): a split hero — the promise and its actions beside the product\n// alive (a recording, a demo) — a band of proofs, the features as a bento where the main one takes the room, then the\n// closing call. The blocks come through their package entries, so their client parts keep their boundary.\nimport { CtaPanel } from \"@krizaka/ui/cta-panel\";\nimport { Page, Section } from \"@krizaka/ui/page\";\nimport { SectionBackdrop } from \"@krizaka/ui/section-backdrop\";\nimport type * as React from \"react\";\n\nexport interface LandingFeature {\n /** A stable key. */\n id: string;\n /** Its name. */\n title: React.ReactNode;\n /** One or two sentences. */\n text: React.ReactNode;\n /** A signature icon above the title. */\n icon?: React.ReactNode;\n /** A visual at the bottom of the tile (a chart, a screenshot, a code line). */\n visual?: React.ReactNode;\n /**\n * Its weight in the bento: `lg` (four columns, two rows — the main one), `md` (three), `sm` (two).\n * @default \"sm\"\n */\n size?: \"lg\" | \"md\" | \"sm\";\n}\n\nexport type LandingPageProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** A mono line above the title. */\n eyebrow?: React.ReactNode;\n /** The promise: the page's `h1`. */\n title: React.ReactNode;\n /** One or two sentences under it. */\n lead?: React.ReactNode;\n /** The hero's actions (the main one cut, with shimmer). */\n actions?: React.ReactNode;\n /** The product, alive, beside the words: a recording, a live demo (framed as a window). */\n visual: React.ReactNode;\n /** The window's caption (`studio.app — studio`). */\n visualLabel?: React.ReactNode;\n /** Figures or facts in a band under the hero: `{ value, label }`. */\n proofs?: readonly { value: React.ReactNode; label: React.ReactNode }[];\n /** The features' section: its eyebrow, title and lead. */\n featuresHeading?: { eyebrow?: React.ReactNode; title: React.ReactNode; lead?: React.ReactNode };\n /** The features, as a bento. */\n features: readonly LandingFeature[];\n /** Between the features and the closing call: a story, a quote, testimonials. */\n children?: React.ReactNode;\n /** The closing call: its title, body and actions. */\n closing?: { title: React.ReactNode; body?: React.ReactNode; actions: React.ReactNode };\n};\n\n/** A landing page: split hero with the product alive, proofs, a bento of features, the closing call. */\nexport function LandingPage({ eyebrow, title, lead, actions, visual, visualLabel, proofs, featuresHeading, features, closing, children, ...props }: LandingPageProps) {\n return (\n <div {...props}>\n <SectionBackdrop as=\"header\" grid className=\"kz-hero\">\n <Page className=\"kz-tpl-hero-frame\">\n <div className=\"kz-tpl-split\">\n <div className=\"kz-hero-text\">\n {eyebrow && <p className=\"kz-eyebrow\">{eyebrow}</p>}\n <h1 className=\"kz-hero-title\">{title}</h1>\n {lead && <p className=\"kz-hero-lead\">{lead}</p>}\n {actions && <div className=\"kz-tpl-actions kz-hero-extra\">{actions}</div>}\n </div>\n <figure className=\"kz-tpl-stage\">\n <div className=\"kz-tpl-stage-bar\" aria-hidden>\n {visualLabel && <span>{visualLabel}</span>}\n </div>\n {visual}\n </figure>\n </div>\n </Page>\n </SectionBackdrop>\n {proofs && proofs.length > 0 && (\n <Page>\n <dl className=\"kz-tpl-band\">\n {proofs.map((p, i) => (\n <div key={i}>\n <dt>{p.value}</dt>\n <dd>{p.label}</dd>\n </div>\n ))}\n </dl>\n </Page>\n )}\n <Section id=\"features\" eyebrow={featuresHeading?.eyebrow} title={featuresHeading?.title} lead={featuresHeading?.lead} reveal aria-label={featuresHeading ? undefined : \"Features\"}>\n <ul className=\"kz-tpl-bento\">\n {features.map((f) => (\n <li key={f.id} data-size={f.size === \"sm\" ? undefined : f.size} data-reveal=\"\">\n {f.icon && <span className=\"kz-block-icon\" aria-hidden>{f.icon}</span>}\n <h3>{f.title}</h3>\n <p>{f.text}</p>\n {f.visual && <div className=\"kz-tpl-bento-visual\">{f.visual}</div>}\n </li>\n ))}\n </ul>\n </Section>\n {children}\n {closing && (\n <Section spacing=\"sm\" aria-labelledby=\"landing-closing\">\n <CtaPanel id=\"landing-closing\" title={closing.title} body={closing.body} reveal>\n {closing.actions}\n </CtaPanel>\n </Section>\n )}\n </div>\n );\n}\n"
185
+ "content": "// Server-safe. A landing page (blocks.css `.kz-tpl-*`): a split hero — the promise and its actions beside the product\n// alive (a recording, a demo; without one, a single column) — a band of proofs, the features as a bento where the main one takes the room, then the\n// closing call. The blocks come through their package entries, so their client parts keep their boundary.\nimport { CtaPanel } from \"@krizaka/ui/cta-panel\";\nimport { Page, Section } from \"@krizaka/ui/page\";\nimport { SectionBackdrop } from \"@krizaka/ui/section-backdrop\";\nimport type * as React from \"react\";\n\nimport { HeroStage } from \"../page/hero-stage\";\n\nexport interface LandingFeature {\n /** A stable key. */\n id: string;\n /** Its name. */\n title: React.ReactNode;\n /** One or two sentences. */\n text: React.ReactNode;\n /** A signature icon above the title. */\n icon?: React.ReactNode;\n /** A visual at the bottom of the tile (a chart, a screenshot, a code line). */\n visual?: React.ReactNode;\n /**\n * Its weight in the bento: `lg` (four columns, two rows — the main one), `md` (three), `sm` (two).\n * @default \"sm\"\n */\n size?: \"lg\" | \"md\" | \"sm\";\n}\n\nexport type LandingPageProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** A mono line above the title. */\n eyebrow?: React.ReactNode;\n /** The promise: the page's `h1`. */\n title: React.ReactNode;\n /** One or two sentences under it. */\n lead?: React.ReactNode;\n /** The hero's actions (the main one cut, with shimmer). */\n actions?: React.ReactNode;\n /** The product, alive, beside the words: a recording, a live demo (framed as a window). Absent: a single-column hero, no empty stage. */\n visual?: React.ReactNode;\n /** The window's caption (`studio.app — studio`). */\n visualLabel?: React.ReactNode;\n /** Figures or facts in a band under the hero: `{ value, label }`. */\n proofs?: readonly { value: React.ReactNode; label: React.ReactNode }[];\n /** Full width, between the proofs and the features: a carousel, a demo, a wide plate. */\n showcase?: React.ReactNode;\n /**\n * The hero's backdrop: `grid` (the dome, the grid and the slow drift) or `quiet` (the still dome only: no grid layer, no drift).\n * @default \"grid\"\n */\n backdrop?: \"grid\" | \"quiet\";\n /** The features' section: its eyebrow, title and lead. */\n featuresHeading?: { eyebrow?: React.ReactNode; title: React.ReactNode; lead?: React.ReactNode };\n /** The features, as a bento. */\n features: readonly LandingFeature[];\n /** Between the features and the closing call: a story, a quote, testimonials. */\n children?: React.ReactNode;\n /** The closing call: its title, body and actions. */\n closing?: { title: React.ReactNode; body?: React.ReactNode; actions: React.ReactNode };\n};\n\n/** A landing page: split hero with the product alive, proofs, a bento of features, the closing call. */\nexport function LandingPage({ eyebrow, title, lead, actions, visual, visualLabel, proofs, showcase, backdrop = \"grid\", featuresHeading, features, closing, children, ...props }: LandingPageProps) {\n return (\n <div {...props}>\n <SectionBackdrop as=\"header\" grid={backdrop === \"grid\"} animated={backdrop === \"grid\"} className=\"kz-hero\">\n <Page className=\"kz-tpl-hero-frame\">\n <div className=\"kz-tpl-split\" data-single={visual ? undefined : \"\"}>\n <div className=\"kz-hero-text\">\n {eyebrow && <p className=\"kz-eyebrow\">{eyebrow}</p>}\n <h1 className=\"kz-hero-title\">{title}</h1>\n {lead && <p className=\"kz-hero-lead\">{lead}</p>}\n {actions && <div className=\"kz-tpl-actions kz-hero-extra\">{actions}</div>}\n </div>\n {visual && <HeroStage visual={visual} label={visualLabel} />}\n </div>\n </Page>\n </SectionBackdrop>\n {proofs && proofs.length > 0 && (\n <Page>\n <dl className=\"kz-tpl-band\">\n {proofs.map((p, i) => (\n <div key={i}>\n <dt>{p.value}</dt>\n <dd>{p.label}</dd>\n </div>\n ))}\n </dl>\n </Page>\n )}\n {showcase && (\n <Page data-landing-showcase=\"\" className=\"kz-tpl-showcase\">\n {showcase}\n </Page>\n )}\n <Section id=\"features\" eyebrow={featuresHeading?.eyebrow} title={featuresHeading?.title} lead={featuresHeading?.lead} reveal aria-label={featuresHeading ? undefined : \"Features\"}>\n <ul className=\"kz-tpl-bento\">\n {features.map((f) => (\n <li key={f.id} data-size={f.size === \"sm\" ? undefined : f.size} data-reveal=\"\">\n {f.icon && <span className=\"kz-block-icon\" aria-hidden>{f.icon}</span>}\n <h3>{f.title}</h3>\n <p>{f.text}</p>\n {f.visual && <div className=\"kz-tpl-bento-visual\">{f.visual}</div>}\n </li>\n ))}\n </ul>\n </Section>\n {children}\n {closing && (\n <Section spacing=\"sm\" aria-labelledby=\"landing-closing\">\n <CtaPanel id=\"landing-closing\" title={closing.title} body={closing.body} reveal>\n {closing.actions}\n </CtaPanel>\n </Section>\n )}\n </div>\n );\n}\n"
160
186
  },
161
187
  {
162
188
  "path": "landing-page/meta.ts",
163
- "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Landing page\",\n summary: \"A landing page: the promise beside the product alive in a window, a band of proofs, the features as a bento where the main one takes the room, the closing call.\",\n status: \"beta\",\n category: \"templates\",\n domain: \"page-blocks\",\n platforms: \"web\",\n parity: { native: { status: \"n/a\", reason: \"A whole page of a public site; a phone app's screens are built from Screen, Header and the native primitives.\" }, desktop: { status: \"n/a\", reason: \"A public site's page, not a window of the Mac app.\" } },\n whenToUse: [\"The home of a company or a product line.\", \"A campaign page that must sell in one screen.\"],\n whenNotToUse: [\n { when: \"For one product's page, with its traps and decisions.\" },\n { when: \"For a list of entry points.\", use: \"docs-hub-page\" },\n ],\n bestPractices: [\"One `lg` feature in the bento: the one the visitor came for.\", \"The window shows the real product (a recording, a demo), never a mock-up.\", \"Three or four proofs, each a fact that can be checked.\", \"Words and content arrive as props; the motion is the platform's (`[data-reveal]`, still under reduced motion).\"],\n accessibility: {\n keyboard: [],\n notes: [\"The hero's title is the page's `h1`; the window is a `figure`, its bar decorative.\", \"Proofs are a description list; the bento a list of features.\"],\n },\n related: [\"page-hero\", \"card-grid\"],\n web: {\n imports: [\"LandingPage\"],\n examples: [\n { name: \"krizaka\", title: \"Krizaka\", description: \"The studio's landing: the promise, the console alive, proofs, three products in a bento.\", template: true, purpose: \"convince\", why: \"A visitor gets the promise in one screen, the product alive, the proofs and one call to act.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
189
+ "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Landing page\",\n summary: \"A landing page: the promise beside the product alive in a window (or alone, in one column), a band of proofs, a full-width showcase, the features as a bento where the main one takes the room, the closing call.\",\n status: \"beta\",\n category: \"templates\",\n domain: \"page-blocks\",\n platforms: \"web\",\n parity: { native: { status: \"n/a\", reason: \"A whole page of a public site; a phone app's screens are built from Screen, Header and the native primitives.\" }, desktop: { status: \"n/a\", reason: \"A public site's page, not a window of the Mac app.\" } },\n whenToUse: [\"The home of a company or a product line.\", \"A campaign page that must sell in one screen.\"],\n whenNotToUse: [\n { when: \"For one product's page, with its traps and decisions.\" },\n { when: \"For a list of entry points.\", use: \"docs-hub-page\" },\n ],\n bestPractices: [\"One `lg` feature in the bento: the one the visitor came for.\", \"The window shows the real product (a recording, a demo), never a mock-up; without one, omit `visual` and the hero is one column.\", \"A home that leads with text and a wide demo: no `visual`, `backdrop=\\\"quiet\\\"`, a `MediaCarousel` in `showcase`.\", \"Three or four proofs, each a fact that can be checked.\", \"Words and content arrive as props; the motion is the platform's (`[data-reveal]`, still under reduced motion).\"],\n accessibility: {\n keyboard: [],\n notes: [\"The hero's title is the page's `h1`; the window is a `figure`, its bar decorative.\", \"Proofs are a description list; the bento a list of features.\"],\n },\n related: [\"page-hero\", \"card-grid\"],\n web: {\n imports: [\"LandingPage\"],\n examples: [\n { name: \"showcase\", title: \"Showcase\", description: \"A text-only hero on the quiet backdrop, the proofs, then a full-width carousel before the features.\", template: true, purpose: \"show\", why: \"A visitor reads the promise, then watches the product at full width before any feature list.\" },\n { name: \"krizaka\", title: \"Krizaka\", description: \"The studio's landing: the promise, the console alive, proofs, three products in a bento.\", template: true, purpose: \"convince\", why: \"A visitor gets the promise in one screen, the product alive, the proofs and one call to act.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
164
190
  },
165
191
  {
166
192
  "path": "meta.ts",
@@ -174,8 +200,8 @@
174
200
  "section-backdrop"
175
201
  ],
176
202
  "demo": {
177
- "path": "examples/landing-page/krizaka.tsx",
178
- "content": "import { Button } from \"@krizaka/ui/button\";\nimport { LandingPage } from \"@krizaka/ui/landing-page\";\nimport { Meter } from \"@krizaka/ui/meter\";\n\n// TEMPLATE — a company's landing (krizaka.com): the promise beside the product alive, a band of proofs, the features\n// as a bento where the main one takes the room, the closing call. On a phone the window follows the words, the bento\n// is one column, the proofs stack.\nexport default function LandingPageKrizaka() {\n return (\n <LandingPage\n eyebrow=\"Software studio · Montréal\"\n title=\"Products that keep what is yours\"\n lead=\"Krizaka builds sovereign AI and a platform where creators are paid — open source, on your servers or ours.\"\n actions={\n <>\n <Button variant=\"primary\" size=\"lg\">See the products</Button>\n <Button variant=\"secondary\" size=\"lg\">Read the docs</Button>\n </>\n }\n visualLabel=\"sovkora.local — console\"\n visual={\n <div className=\"grid gap-3 p-5\">\n <p className=\"font-mono text-xs text-fg-secondary\">$ npx sovkora install</p>\n <p className=\"font-mono text-xs text-fg-success\">✓ 1,284 answers this week, none left the server</p>\n <Meter label=\"Credits\" value={3800} max={12000} valueText=\"3,800 of 12,000\" showLabel />\n </div>\n }\n proofs={[\n { value: \"34\", label: \"public repositories\" },\n { value: \"Apache-2.0\", label: \"every line\" },\n { value: \"0\", label: \"telemetry calls\" },\n ]}\n featuresHeading={{ eyebrow: \"What we build\", title: \"Three products, one way of building\" }}\n features={[\n { id: \"sovkora\", size: \"lg\", title: \"Sovkora — the AI that never leaves home\", text: \"Chat, image, voice and video on your own server, one governed pipeline.\" },\n { id: \"verikora\", title: \"Verikora\", text: \"Reads your leases, contracts and invoices.\" },\n { id: \"folioviv\", title: \"Folioviv\", text: \"Running a shop in Québec, for less — coming.\" },\n { id: \"blocks\", size: \"md\", title: \"Open building blocks\", text: \"Users, billing, notifications — on Maven Central and npm.\" },\n { id: \"ui\", size: \"md\", title: \"One design system\", text: \"Krizaka UI, web and mobile, documented from its code.\" },\n ]}\n closing={{ title: \"Something to build together?\", body: \"Tell us what you need; a person answers within two days.\", actions: <Button variant=\"primary\" size=\"lg\">Contact us</Button> }}\n />\n );\n}\n"
203
+ "path": "examples/landing-page/showcase.tsx",
204
+ "content": "import { Button } from \"@krizaka/ui/button\";\nimport { LandingPage } from \"@krizaka/ui/landing-page\";\nimport { MediaCarousel } from \"@krizaka/ui/media-carousel\";\nimport { Section } from \"@krizaka/ui/page\";\n\nconst PIC = (a: string, b: string) => `data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 900'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0' stop-color='${a}'/><stop offset='1' stop-color='${b}'/></linearGradient></defs><rect width='1600' height='900' fill='url(#g)'/></svg>`)}`;\n\n// TEMPLATE — a home that leads with words and a full-width demo: no `visual` (a single-column hero), the quiet backdrop,\n// a carousel in `showcase` between the proofs and the features.\nexport default function LandingPageShowcase() {\n return (\n <LandingPage\n backdrop=\"quiet\"\n title=\"An AI that never leaves your server\"\n lead=\"Chat, image and voice on your own machine, every run recorded.\"\n actions={<Button variant=\"primary\" size=\"lg\">Install</Button>}\n proofs={[\n { value: \"0\", label: \"calls to the outside\" },\n { value: \"128\", label: \"runs measured, each with its record\" },\n ]}\n showcase={\n <Section spacing=\"sm\" title=\"See it work\" id=\"showcase-title\" lead=\"Three minutes, no cuts.\">\n <MediaCarousel\n label=\"Sovkora at work\"\n autoplay\n caption=\"bar\"\n textVersion\n slides={[\n { id: \"a\", src: PIC(\"#1d3f6b\", \"#4d7fb8\"), alt: \"A chat answered on the local server\", caption: \"Fig. 1a — a chat, answered locally\" },\n { id: \"b\", src: PIC(\"#23496f\", \"#6b9bc9\"), alt: \"The run's cost and model, side by side\", caption: \"Fig. 1b — the run, accounted for\" },\n ]}\n />\n </Section>\n }\n featuresHeading={{ title: \"What it does\" }}\n features={[\n { id: \"chat\", size: \"lg\", title: \"Chat\", text: \"Answers from models that run on your server.\" },\n { id: \"image\", title: \"Image\", text: \"Generated and kept in your storage.\" },\n ]}\n />\n );\n}\n"
179
205
  },
180
206
  "props": [
181
207
  {
@@ -196,13 +222,6 @@
196
222
  "description": "The promise: the page's `h1`.",
197
223
  "required": true
198
224
  },
199
- {
200
- "name": "visual",
201
- "type": "ReactNode",
202
- "default": null,
203
- "description": "The product, alive, beside the words: a recording, a live demo (framed as a window).",
204
- "required": true
205
- },
206
225
  {
207
226
  "name": "actions",
208
227
  "type": "ReactNode",
@@ -210,6 +229,13 @@
210
229
  "description": "The hero's actions (the main one cut, with shimmer).",
211
230
  "required": false
212
231
  },
232
+ {
233
+ "name": "backdrop",
234
+ "type": "\"grid\" | \"quiet\"",
235
+ "default": "grid",
236
+ "description": "The hero's backdrop: `grid` (the dome, the grid and the slow drift) or `quiet` (the still dome only: no grid layer, no drift).",
237
+ "required": false
238
+ },
213
239
  {
214
240
  "name": "closing",
215
241
  "type": "{ title: ReactNode; body?: ReactNode; actions: ReactNode; }",
@@ -245,6 +271,20 @@
245
271
  "description": "Figures or facts in a band under the hero: `{ value, label }`.",
246
272
  "required": false
247
273
  },
274
+ {
275
+ "name": "showcase",
276
+ "type": "ReactNode",
277
+ "default": null,
278
+ "description": "Full width, between the proofs and the features: a carousel, a demo, a wide plate.",
279
+ "required": false
280
+ },
281
+ {
282
+ "name": "visual",
283
+ "type": "ReactNode",
284
+ "default": null,
285
+ "description": "The product, alive, beside the words: a recording, a live demo (framed as a window). Absent: a single-column hero, no empty stage.",
286
+ "required": false
287
+ },
248
288
  {
249
289
  "name": "visualLabel",
250
290
  "type": "ReactNode",