@krizaka/ui 3.87.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (655) hide show
  1. package/README.md +14 -14
  2. package/dist/account-menu.d.ts +1 -1
  3. package/dist/account-menu.js +1 -1
  4. package/dist/account-settings.d.ts +1 -1
  5. package/dist/account-settings.js +1 -1
  6. package/dist/achievement.d.ts +2 -2
  7. package/dist/achievement.js +1 -1
  8. package/dist/achievement.js.map +1 -1
  9. package/dist/activity-feed.d.ts +4 -4
  10. package/dist/activity-feed.js +11 -5
  11. package/dist/activity-feed.js.map +1 -1
  12. package/dist/app-frame.d.ts +4 -4
  13. package/dist/app-frame.js.map +1 -1
  14. package/dist/app-header.d.ts +2 -2
  15. package/dist/app-header.js.map +1 -1
  16. package/dist/app-shell.d.ts +1 -1
  17. package/dist/app-shell.js +1 -1
  18. package/dist/app-shell.js.map +1 -1
  19. package/dist/auth-layout.d.ts +1 -1
  20. package/dist/auth-layout.js.map +1 -1
  21. package/dist/avatar/defaults.d.ts +2 -2
  22. package/dist/avatar/defaults.js +4 -4
  23. package/dist/avatar/defaults.js.map +1 -1
  24. package/dist/{avatar-CNV6ld8l.d.ts → avatar-Cd2uJgRh.d.ts} +2 -2
  25. package/dist/avatar.d.ts +3 -3
  26. package/dist/avatar.js +4 -4
  27. package/dist/avatar.js.map +1 -1
  28. package/dist/bird-plate.d.ts +1 -1
  29. package/dist/bird-plate.js +1 -1
  30. package/dist/blocks.css +5 -5
  31. package/dist/card-grid.d.ts +1 -1
  32. package/dist/card-grid.js.map +1 -1
  33. package/dist/changelog-page.d.ts +1 -1
  34. package/dist/changelog-page.js +18 -6
  35. package/dist/changelog-page.js.map +1 -1
  36. package/dist/chat.js +1 -1
  37. package/dist/chip.js +1 -1
  38. package/dist/choice-grid.d.ts +2 -2
  39. package/dist/choice-grid.js +1 -1
  40. package/dist/choice-grid.js.map +1 -1
  41. package/dist/{chunk-RCHKIOVV.js → chunk-2DHL7NJW.js} +2 -2
  42. package/dist/chunk-2DHL7NJW.js.map +1 -0
  43. package/dist/{chunk-TN5JJ6JI.js → chunk-2YBG4ZCY.js} +23 -2
  44. package/dist/{chunk-TN5JJ6JI.js.map → chunk-2YBG4ZCY.js.map} +1 -1
  45. package/dist/{chunk-6KZDARNX.js → chunk-54WTUZWE.js} +16 -12
  46. package/dist/chunk-54WTUZWE.js.map +1 -0
  47. package/dist/{chunk-DSDFXPL6.js → chunk-757ZTGU5.js} +2 -2
  48. package/dist/chunk-CDNOT2KR.js +310 -0
  49. package/dist/chunk-CDNOT2KR.js.map +1 -0
  50. package/dist/{chunk-IOTY5HYG.js → chunk-EOWV6BNQ.js} +4 -4
  51. package/dist/chunk-EOWV6BNQ.js.map +1 -0
  52. package/dist/{chunk-DRTIE44Z.js → chunk-FM42KOAU.js} +2 -2
  53. package/dist/chunk-FM42KOAU.js.map +1 -0
  54. package/dist/{chunk-CEW3LQOZ.js → chunk-IEGTRCDI.js} +5 -5
  55. package/dist/{chunk-KVDB4GXV.js → chunk-KR2W4ONJ.js} +2 -2
  56. package/dist/{chunk-TPITVAUW.js → chunk-LH5J3VLZ.js} +1 -1
  57. package/dist/{chunk-TPITVAUW.js.map → chunk-LH5J3VLZ.js.map} +1 -1
  58. package/dist/{chunk-E46AEUPH.js → chunk-PK3L6WQT.js} +4 -4
  59. package/dist/chunk-PK3L6WQT.js.map +1 -0
  60. package/dist/{chunk-GOGEYAYK.js → chunk-PRD7JRQX.js} +3 -3
  61. package/dist/{chunk-VYZFQE3P.js → chunk-QD6SNXF5.js} +2 -2
  62. package/dist/{chunk-M3T5RQYV.js → chunk-SB5WSVPI.js} +1 -1
  63. package/dist/chunk-SB5WSVPI.js.map +1 -0
  64. package/dist/{chunk-UYGUSYIC.js → chunk-SNSQLGGS.js} +1 -1
  65. package/dist/{chunk-BQ4EOR2O.js.map → chunk-SNSQLGGS.js.map} +1 -1
  66. package/dist/{chunk-YQWYGQTV.js → chunk-UIP3WX5O.js} +2 -2
  67. package/dist/{chunk-EHTXLZSM.js → chunk-VS3MWRBX.js} +1 -1
  68. package/dist/{chunk-EHTXLZSM.js.map → chunk-VS3MWRBX.js.map} +1 -1
  69. package/dist/{chunk-BQ4EOR2O.js → chunk-XWJDBQU7.js} +1 -1
  70. package/dist/{chunk-UYGUSYIC.js.map → chunk-XWJDBQU7.js.map} +1 -1
  71. package/dist/{chunk-ZKKMYIDN.js → chunk-Y3P5B4XS.js} +2 -2
  72. package/dist/{chunk-GW5EI7MI.js → chunk-YXETEQQJ.js} +3 -3
  73. package/dist/{chunk-FZBWEDQI.js → chunk-ZSCNMFE6.js} +1 -1
  74. package/dist/{chunk-FZBWEDQI.js.map → chunk-ZSCNMFE6.js.map} +1 -1
  75. package/dist/collection-switcher.d.ts +1 -1
  76. package/dist/combobox.js +3 -3
  77. package/dist/continue-prompt.js +1 -1
  78. package/dist/dashboard-layout.js +1 -1
  79. package/dist/dashboard-layout.js.map +1 -1
  80. package/dist/data-table.js +6 -6
  81. package/dist/date-picker.js +1 -1
  82. package/dist/{default-avatar-Bh4atFDo.d.ts → default-avatar-DHv7g-K1.d.ts} +1 -1
  83. package/dist/detail-layout.js.map +1 -1
  84. package/dist/docs-hub-page.d.ts +1 -1
  85. package/dist/docs-hub-page.js.map +1 -1
  86. package/dist/document-viewer.js +1 -1
  87. package/dist/engine-flow.d.ts +6 -6
  88. package/dist/engine-flow.js.map +1 -1
  89. package/dist/entity-header.d.ts +1 -1
  90. package/dist/file-upload.js +1 -1
  91. package/dist/filter-bar.d.ts +3 -3
  92. package/dist/filter-bar.js +2 -2
  93. package/dist/flock.js +1 -1
  94. package/dist/{frame-CNZ5VgDD.d.ts → frame-CmDztC_y.d.ts} +1 -1
  95. package/dist/genui.js +6 -6
  96. package/dist/genui.js.map +1 -1
  97. package/dist/{geometry-DDlFDtiQ.d.ts → geometry-8O5Nq-yA.d.ts} +2 -2
  98. package/dist/{geometry-DuUQyHZ1.d.ts → geometry-haB2EgO4.d.ts} +2 -2
  99. package/dist/goal-gauge.d.ts +1 -1
  100. package/dist/goal-gauge.js +1 -1
  101. package/dist/goal-gauge.js.map +1 -1
  102. package/dist/image-cropper.js +1 -1
  103. package/dist/index.d.ts +27 -38
  104. package/dist/index.js +10 -18
  105. package/dist/index.js.map +1 -1
  106. package/dist/kind-config-editor.js +1 -1
  107. package/dist/list.js +1 -1
  108. package/dist/loader.d.ts +1 -1
  109. package/dist/loader.js +2 -2
  110. package/dist/loader.js.map +1 -1
  111. package/dist/map.js +3 -3
  112. package/dist/map.js.map +1 -1
  113. package/dist/mascot-quote.d.ts +1 -1
  114. package/dist/mascot-quote.js +1 -1
  115. package/dist/mascot-state.js +1 -1
  116. package/dist/mascots.d.ts +2 -2
  117. package/dist/mascots.js +1 -1
  118. package/dist/match-dialog.js +1 -1
  119. package/dist/media-capture.js +1 -1
  120. package/dist/media-carousel.d.ts +115 -45
  121. package/dist/media-carousel.js +378 -56
  122. package/dist/media-carousel.js.map +1 -1
  123. package/dist/media-gallery.d.ts +3 -3
  124. package/dist/media-guard-bin.js +171 -0
  125. package/dist/media-guard-bin.js.map +1 -0
  126. package/dist/media-guard.d.ts +88 -0
  127. package/dist/media-guard.js +153 -0
  128. package/dist/media-guard.js.map +1 -0
  129. package/dist/media-player.d.ts +3 -3
  130. package/dist/media-player.js +3 -3
  131. package/dist/native/map.js +3 -3
  132. package/dist/native/map.js.map +1 -1
  133. package/dist/native.d.ts +43 -43
  134. package/dist/native.js +1233 -1210
  135. package/dist/native.js.map +1 -1
  136. package/dist/nav-bar.d.ts +1 -1
  137. package/dist/nav-bar.js +2 -2
  138. package/dist/notification-preferences.js +1 -1
  139. package/dist/pausable-loop.js +3 -13
  140. package/dist/pausable-loop.js.map +1 -1
  141. package/dist/{player-lightbox-ASFOSUSD.js → player-lightbox-BYQ57OXT.js} +3 -3
  142. package/dist/product-page.d.ts +1 -1
  143. package/dist/product-page.js.map +1 -1
  144. package/dist/profile-card.d.ts +2 -2
  145. package/dist/profile-card.js +1 -1
  146. package/dist/profile-card.js.map +1 -1
  147. package/dist/promise-card.d.ts +1 -1
  148. package/dist/promise-card.js +1 -1
  149. package/dist/promise-card.js.map +1 -1
  150. package/dist/rail-nav.d.ts +6 -6
  151. package/dist/rail-nav.js.map +1 -1
  152. package/dist/retro-tv-playlist.js.map +1 -1
  153. package/dist/retro-tv.js +2 -2
  154. package/dist/schema-form.d.ts +13 -1
  155. package/dist/schema-form.js +24 -13
  156. package/dist/schema-form.js.map +1 -1
  157. package/dist/scroll-stage.d.ts +1 -1
  158. package/dist/scroll-stage.js +1 -1
  159. package/dist/scroll-stage.js.map +1 -1
  160. package/dist/search-field.js +2 -2
  161. package/dist/shop/booking.js +1 -1
  162. package/dist/shop/bulletin.js +1 -1
  163. package/dist/shop/faq.js +1 -1
  164. package/dist/shop/gallery.js +1 -1
  165. package/dist/shop/look.js.map +1 -1
  166. package/dist/shop/policies.js +1 -1
  167. package/dist/shop/reviews.js +1 -1
  168. package/dist/shop/services.js +1 -1
  169. package/dist/shop/social.js +1 -1
  170. package/dist/shop/story.js +1 -1
  171. package/dist/shop/team.js +1 -1
  172. package/dist/shop/video.js +1 -1
  173. package/dist/shop/visit.js +1 -1
  174. package/dist/shop-composer.d.ts +1 -1
  175. package/dist/shop-composer.js +2 -2
  176. package/dist/shop-composer.js.map +1 -1
  177. package/dist/shop.d.ts +1 -1
  178. package/dist/shop.js +2 -2
  179. package/dist/shop.js.map +1 -1
  180. package/dist/site-cahier.d.ts +1 -1
  181. package/dist/site-cahier.js +188 -181
  182. package/dist/site-cahier.js.map +1 -1
  183. package/dist/site-footer.d.ts +1 -1
  184. package/dist/site-footer.js +2 -2
  185. package/dist/{sites-CSBwUnbJ.d.ts → sites-A5cNWG2Z.d.ts} +1 -1
  186. package/dist/sites.d.ts +2 -2
  187. package/dist/sites.js +15 -11
  188. package/dist/sites.js.map +1 -1
  189. package/dist/stage-banner.d.ts +1 -1
  190. package/dist/stage-banner.js +1 -1
  191. package/dist/stage-banner.js.map +1 -1
  192. package/dist/status-page.d.ts +1 -1
  193. package/dist/status-page.js.map +1 -1
  194. package/dist/step-showcase.d.ts +2 -2
  195. package/dist/step-showcase.js.map +1 -1
  196. package/dist/swipe-deck.js +1 -1
  197. package/dist/tag-input.js +3 -3
  198. package/dist/tag-selector.js +1 -1
  199. package/dist/terminal-replay.d.ts +1 -1
  200. package/dist/terminal-replay.js.map +1 -1
  201. package/dist/tree-view.js +1 -1
  202. package/dist/update-prompt.d.ts +1 -1
  203. package/dist/update-prompt.js.map +1 -1
  204. package/dist/versus-card.js +1 -1
  205. package/dist/vertical-video.js +1 -1
  206. package/dist/video-player.js +2 -2
  207. package/dist/video-trimmer.js +1 -1
  208. package/dist/virtual.js +2 -2
  209. package/dist/waveform.js.map +1 -1
  210. package/package.json +24 -11
  211. package/registry/account-menu.json +3 -3
  212. package/registry/account-settings.json +6 -6
  213. package/registry/achievement.json +8 -8
  214. package/registry/action-bar.json +4 -4
  215. package/registry/activity-feed.json +24 -24
  216. package/registry/agenda.json +3 -3
  217. package/registry/alert.json +1 -1
  218. package/registry/analysis-report.json +3 -3
  219. package/registry/anatomy-plate.json +1 -1
  220. package/registry/app-frame.json +33 -29
  221. package/registry/app-header.json +16 -16
  222. package/registry/app-shell.json +13 -13
  223. package/registry/argument-card.json +3 -3
  224. package/registry/auth-layout.json +9 -9
  225. package/registry/avatar.json +8 -8
  226. package/registry/badge.json +1 -1
  227. package/registry/bird-plate.json +2 -2
  228. package/registry/button.json +1 -1
  229. package/registry/captcha.json +1 -1
  230. package/registry/card-grid.json +9 -9
  231. package/registry/card.json +1 -1
  232. package/registry/catalogue-page.json +2 -2
  233. package/registry/changelog-page.json +2 -2
  234. package/registry/chapter.json +5 -5
  235. package/registry/chat.json +1 -1
  236. package/registry/checkbox.json +1 -1
  237. package/registry/chip-link.json +1 -1
  238. package/registry/chip-row.json +1 -1
  239. package/registry/chip.json +2 -2
  240. package/registry/choice-grid.json +6 -6
  241. package/registry/code-block.json +1 -1
  242. package/registry/collection-switcher.json +2 -2
  243. package/registry/combobox.json +2 -2
  244. package/registry/command.json +1 -1
  245. package/registry/comparison-table.json +5 -5
  246. package/registry/component-page.json +1 -1
  247. package/registry/confirm-button.json +1 -1
  248. package/registry/contact-page.json +1 -1
  249. package/registry/continue-prompt.json +2 -2
  250. package/registry/copy-button.json +1 -1
  251. package/registry/countdown.json +1 -1
  252. package/registry/cover-hero.json +1 -1
  253. package/registry/cta-panel.json +3 -3
  254. package/registry/dashboard-layout.json +11 -11
  255. package/registry/data-table.json +2 -2
  256. package/registry/date-picker.json +2 -2
  257. package/registry/decision-list.json +1 -1
  258. package/registry/description-list.json +1 -1
  259. package/registry/desktop-window.json +5 -5
  260. package/registry/detail-layout.json +7 -7
  261. package/registry/dialog.json +1 -1
  262. package/registry/docs-article-page.json +6 -6
  263. package/registry/docs-hub-page.json +4 -4
  264. package/registry/docs-layout.json +3 -3
  265. package/registry/docs-nav.json +1 -1
  266. package/registry/document-viewer.json +4 -4
  267. package/registry/doodle.json +1 -1
  268. package/registry/drop-overlay.json +3 -3
  269. package/registry/dropdown-menu.json +1 -1
  270. package/registry/elephant.json +1 -1
  271. package/registry/embed-facade.json +1 -1
  272. package/registry/empty-state.json +2 -2
  273. package/registry/engine-flow.json +8 -8
  274. package/registry/entity-header.json +1 -1
  275. package/registry/environment-notice.json +1 -1
  276. package/registry/error-page.json +1 -1
  277. package/registry/examples/account-menu/default.js +2 -2
  278. package/registry/examples/account-menu/default.tsx +2 -2
  279. package/registry/examples/account-settings/appearance.js +2 -2
  280. package/registry/examples/account-settings/appearance.tsx +2 -2
  281. package/registry/examples/account-settings/avatar-picker-folder.js +1 -1
  282. package/registry/examples/account-settings/avatar-picker-folder.tsx +1 -1
  283. package/registry/examples/account-settings/avatar-picker.js +1 -1
  284. package/registry/examples/account-settings/avatar-picker.tsx +1 -1
  285. package/registry/examples/account-settings/profile.js +2 -2
  286. package/registry/examples/account-settings/profile.tsx +3 -3
  287. package/registry/examples/achievement/arcade.js +1 -1
  288. package/registry/examples/achievement/arcade.tsx +1 -1
  289. package/registry/examples/action-bar/buttons.js +1 -1
  290. package/registry/examples/action-bar/buttons.tsx +1 -1
  291. package/registry/examples/action-bar/icons.js +1 -1
  292. package/registry/examples/action-bar/icons.tsx +1 -1
  293. package/registry/examples/activity-feed/job-activity.tsx +1 -1
  294. package/registry/examples/app-frame/admin.js +3 -3
  295. package/registry/examples/app-frame/admin.tsx +3 -3
  296. package/registry/examples/app-frame/app.js +5 -5
  297. package/registry/examples/app-frame/app.tsx +6 -6
  298. package/registry/examples/app-frame/touch.js +3 -3
  299. package/registry/examples/app-frame/touch.tsx +3 -3
  300. package/registry/examples/app-header/basic.js +2 -2
  301. package/registry/examples/app-header/basic.tsx +2 -2
  302. package/registry/examples/app-header/family.js +3 -3
  303. package/registry/examples/app-header/family.tsx +3 -3
  304. package/registry/examples/app-header/native/family.dark.png +0 -0
  305. package/registry/examples/app-header/native/family.js +2 -2
  306. package/registry/examples/app-header/native/family.light.png +0 -0
  307. package/registry/examples/app-header/native/family.tsx +2 -2
  308. package/registry/examples/app-shell/admin-console.js +1 -1
  309. package/registry/examples/app-shell/admin-console.tsx +1 -1
  310. package/registry/examples/app-shell/basic.js +1 -1
  311. package/registry/examples/app-shell/basic.tsx +1 -1
  312. package/registry/examples/app-shell/collapse-overflow.js +4 -4
  313. package/registry/examples/app-shell/collapse-overflow.tsx +4 -4
  314. package/registry/examples/app-shell/creator-studio.js +2 -2
  315. package/registry/examples/app-shell/creator-studio.tsx +2 -2
  316. package/registry/examples/app-shell/desktop.js +3 -3
  317. package/registry/examples/app-shell/desktop.tsx +1 -1
  318. package/registry/examples/argument-card/building-block.js +1 -1
  319. package/registry/examples/argument-card/building-block.tsx +1 -1
  320. package/registry/examples/auth-layout/onboarding.js +2 -2
  321. package/registry/examples/auth-layout/onboarding.tsx +2 -2
  322. package/registry/examples/auth-layout/sign-in.js +2 -2
  323. package/registry/examples/auth-layout/sign-in.tsx +2 -2
  324. package/registry/examples/avatar/default.js +1 -1
  325. package/registry/examples/avatar/default.tsx +1 -1
  326. package/registry/examples/bird-plate/single.tsx +1 -1
  327. package/registry/examples/card-grid/aligned.js +3 -3
  328. package/registry/examples/card-grid/aligned.tsx +3 -3
  329. package/registry/examples/card-grid/foundation.js +6 -6
  330. package/registry/examples/card-grid/foundation.tsx +6 -6
  331. package/registry/examples/card-grid/hover-quiet.js +3 -3
  332. package/registry/examples/card-grid/hover-quiet.tsx +3 -3
  333. package/registry/examples/card-grid/products.js +2 -2
  334. package/registry/examples/card-grid/products.tsx +2 -2
  335. package/registry/examples/catalogue-page/clients.js +1 -1
  336. package/registry/examples/catalogue-page/clients.tsx +1 -1
  337. package/registry/examples/chapter/detail.js +1 -1
  338. package/registry/examples/chapter/detail.tsx +1 -1
  339. package/registry/examples/chapter/foot.js +1 -1
  340. package/registry/examples/chapter/foot.tsx +1 -1
  341. package/registry/examples/chapter/index.js +1 -1
  342. package/registry/examples/chapter/index.tsx +1 -1
  343. package/registry/examples/choice-grid/line-up.js +2 -2
  344. package/registry/examples/choice-grid/line-up.tsx +2 -2
  345. package/registry/examples/collection-switcher/entity.js +2 -2
  346. package/registry/examples/collection-switcher/entity.tsx +2 -2
  347. package/registry/examples/comparison-table/versus.js +5 -5
  348. package/registry/examples/comparison-table/versus.tsx +5 -5
  349. package/registry/examples/cta-panel/discuss.js +1 -1
  350. package/registry/examples/cta-panel/discuss.tsx +1 -1
  351. package/registry/examples/dashboard-layout/{orazaka-eric.js → sovkora-eric.js} +4 -4
  352. package/registry/examples/dashboard-layout/{orazaka-eric.tsx → sovkora-eric.tsx} +3 -3
  353. package/registry/examples/dashboard-layout/today.js +1 -1
  354. package/registry/examples/dashboard-layout/today.tsx +1 -1
  355. package/registry/examples/desktop-window/library.js +2 -2
  356. package/registry/examples/desktop-window/library.tsx +1 -1
  357. package/registry/examples/detail-layout/checkout.js +1 -1
  358. package/registry/examples/detail-layout/checkout.tsx +1 -1
  359. package/registry/examples/detail-layout/client.js +1 -1
  360. package/registry/examples/detail-layout/client.tsx +1 -1
  361. package/registry/examples/detail-layout/new-invoice.js +1 -1
  362. package/registry/examples/detail-layout/new-invoice.tsx +1 -1
  363. package/registry/examples/detail-layout/profile.js +1 -1
  364. package/registry/examples/detail-layout/profile.tsx +1 -1
  365. package/registry/examples/detail-layout/video.js +1 -1
  366. package/registry/examples/detail-layout/video.tsx +1 -1
  367. package/registry/examples/docs-article-page/cli.js +5 -5
  368. package/registry/examples/docs-article-page/cli.tsx +6 -6
  369. package/registry/examples/docs-article-page/faq.js +4 -4
  370. package/registry/examples/docs-article-page/faq.tsx +4 -4
  371. package/registry/examples/docs-hub-page/krizaka.js +5 -5
  372. package/registry/examples/docs-hub-page/krizaka.tsx +5 -5
  373. package/registry/examples/docs-layout/page.js +1 -1
  374. package/registry/examples/docs-layout/page.tsx +1 -1
  375. package/registry/examples/empty-state/library.js +1 -1
  376. package/registry/examples/empty-state/library.tsx +1 -1
  377. package/registry/examples/engine-flow/calm.js +4 -4
  378. package/registry/examples/engine-flow/calm.tsx +4 -4
  379. package/registry/examples/engine-flow/compact.js +5 -5
  380. package/registry/examples/engine-flow/compact.tsx +5 -5
  381. package/registry/examples/engine-flow/radial.js +6 -6
  382. package/registry/examples/engine-flow/radial.tsx +6 -6
  383. package/registry/examples/force-update-screen/default.js +1 -1
  384. package/registry/examples/force-update-screen/default.tsx +1 -1
  385. package/registry/examples/force-update-screen/native/default.js +1 -1
  386. package/registry/examples/force-update-screen/native/default.tsx +1 -1
  387. package/registry/examples/form/native/sign-up.js +1 -1
  388. package/registry/examples/form/native/sign-up.tsx +1 -1
  389. package/registry/examples/gallery-page/made-here.js +2 -2
  390. package/registry/examples/gallery-page/made-here.tsx +3 -3
  391. package/registry/examples/goal-gauge/arcade.js +1 -1
  392. package/registry/examples/goal-gauge/arcade.tsx +1 -1
  393. package/registry/examples/landing-page/krizaka.js +5 -5
  394. package/registry/examples/landing-page/krizaka.tsx +5 -5
  395. package/registry/examples/landscape/brand.js +1 -1
  396. package/registry/examples/landscape/brand.tsx +1 -1
  397. package/registry/examples/link-card/docs-hub.js +3 -3
  398. package/registry/examples/link-card/docs-hub.tsx +3 -3
  399. package/registry/examples/link-card/hover-quiet.js +3 -3
  400. package/registry/examples/link-card/hover-quiet.tsx +3 -3
  401. package/registry/examples/link-card/stack.js +3 -3
  402. package/registry/examples/link-card/stack.tsx +3 -3
  403. package/registry/examples/list/jobs.tsx +1 -1
  404. package/registry/examples/loader/branded.js +2 -2
  405. package/registry/examples/loader/branded.tsx +3 -3
  406. package/registry/examples/loader/native/branded.js +1 -1
  407. package/registry/examples/loader/native/branded.tsx +2 -2
  408. package/registry/examples/loader/native/job-wait.tsx +1 -1
  409. package/registry/examples/longform-page/case-study.js +2 -2
  410. package/registry/examples/longform-page/case-study.tsx +3 -3
  411. package/registry/examples/longform-page/story.js +2 -2
  412. package/registry/examples/longform-page/story.tsx +2 -2
  413. package/registry/examples/maintenance-screen/default.js +1 -1
  414. package/registry/examples/maintenance-screen/default.tsx +1 -1
  415. package/registry/examples/maintenance-screen/native/default.js +1 -1
  416. package/registry/examples/maintenance-screen/native/default.tsx +1 -1
  417. package/registry/examples/marketing-layout/docs-hub.js +3 -3
  418. package/registry/examples/marketing-layout/docs-hub.tsx +3 -3
  419. package/registry/examples/marketing-layout/product-page.js +3 -3
  420. package/registry/examples/marketing-layout/product-page.tsx +3 -3
  421. package/registry/examples/mascots/flock.tsx +2 -2
  422. package/registry/examples/media-gallery/carousel-autoplay.js +23 -0
  423. package/registry/examples/media-gallery/carousel-autoplay.tsx +21 -0
  424. package/registry/examples/media-gallery/carousel-cahier.d.ts +4 -0
  425. package/registry/examples/media-gallery/carousel-cahier.js +27 -0
  426. package/registry/examples/media-gallery/carousel-cahier.tsx +26 -0
  427. package/registry/examples/media-gallery/carousel-demo.d.ts +4 -0
  428. package/registry/examples/media-gallery/carousel-demo.js +36 -0
  429. package/registry/examples/media-gallery/carousel-demo.tsx +34 -0
  430. package/registry/examples/nav-bar/family-admin.js +5 -5
  431. package/registry/examples/nav-bar/family-admin.tsx +4 -4
  432. package/registry/examples/nav-bar/family-java.js +1 -1
  433. package/registry/examples/nav-bar/family-java.tsx +1 -1
  434. package/registry/examples/nav-bar/family-product.js +4 -4
  435. package/registry/examples/nav-bar/family-product.tsx +3 -3
  436. package/registry/examples/nav-bar/site.js +2 -2
  437. package/registry/examples/nav-bar/site.tsx +2 -2
  438. package/registry/examples/pricing-page/credits.js +1 -1
  439. package/registry/examples/pricing-page/credits.tsx +2 -2
  440. package/registry/examples/product-page/sovkora.d.ts +4 -0
  441. package/registry/examples/product-page/{orazaka.js → sovkora.js} +7 -7
  442. package/registry/examples/product-page/{orazaka.tsx → sovkora.tsx} +5 -5
  443. package/registry/examples/profile-card/arcade.js +2 -2
  444. package/registry/examples/profile-card/arcade.tsx +2 -2
  445. package/registry/examples/profile-card/banner.js +2 -2
  446. package/registry/examples/profile-card/banner.tsx +2 -2
  447. package/registry/examples/profile-card/match.js +1 -1
  448. package/registry/examples/profile-card/match.tsx +1 -1
  449. package/registry/examples/profile-card/native/banner.js +1 -1
  450. package/registry/examples/profile-card/native/banner.tsx +1 -1
  451. package/registry/examples/promise-card/arcade.js +1 -1
  452. package/registry/examples/promise-card/arcade.tsx +1 -1
  453. package/registry/examples/pull-to-refresh/native/branded.js +1 -1
  454. package/registry/examples/pull-to-refresh/native/branded.tsx +1 -1
  455. package/registry/examples/rail-nav/expandable.js +3 -3
  456. package/registry/examples/rail-nav/expandable.tsx +3 -3
  457. package/registry/examples/rail-nav/shortcuts.js +6 -6
  458. package/registry/examples/rail-nav/shortcuts.tsx +6 -6
  459. package/registry/examples/rail-nav/studio.js +5 -5
  460. package/registry/examples/rail-nav/studio.tsx +5 -5
  461. package/registry/examples/scroll-stage/arcade.js +1 -1
  462. package/registry/examples/scroll-stage/arcade.tsx +1 -1
  463. package/registry/examples/shop/booking-closing-mark.js +2 -2
  464. package/registry/examples/shop/booking-closing-mark.tsx +2 -2
  465. package/registry/examples/site-footer/app.js +1 -1
  466. package/registry/examples/site-footer/app.tsx +2 -2
  467. package/registry/examples/site-footer/configured.js +1 -1
  468. package/registry/examples/site-footer/configured.tsx +1 -1
  469. package/registry/examples/site-footer/product.js +3 -3
  470. package/registry/examples/site-footer/product.tsx +4 -4
  471. package/registry/examples/sites/french.js +1 -1
  472. package/registry/examples/sites/french.tsx +1 -1
  473. package/registry/examples/specimen-tag/product.js +4 -4
  474. package/registry/examples/specimen-tag/product.tsx +4 -4
  475. package/registry/examples/specimen-tag/wire.js +3 -3
  476. package/registry/examples/specimen-tag/wire.tsx +3 -3
  477. package/registry/examples/splash-handoff/native/default.js +1 -1
  478. package/registry/examples/splash-handoff/native/default.tsx +1 -1
  479. package/registry/examples/split-view/notifications.js +1 -1
  480. package/registry/examples/split-view/notifications.tsx +1 -1
  481. package/registry/examples/stage-banner/steps.js +1 -1
  482. package/registry/examples/stage-banner/steps.tsx +1 -1
  483. package/registry/examples/status-page/building.js +1 -1
  484. package/registry/examples/status-page/building.tsx +1 -1
  485. package/registry/examples/status-page/operational.js +1 -1
  486. package/registry/examples/status-page/operational.tsx +1 -1
  487. package/registry/examples/step-showcase/desktop.js +2 -2
  488. package/registry/examples/step-showcase/desktop.tsx +2 -2
  489. package/registry/examples/step-showcase/phone.js +1 -1
  490. package/registry/examples/step-showcase/phone.tsx +1 -1
  491. package/registry/examples/stepper/native/run.tsx +1 -1
  492. package/registry/examples/stuck/card.js +1 -1
  493. package/registry/examples/stuck/card.tsx +1 -1
  494. package/registry/examples/stuck/tag.js +1 -1
  495. package/registry/examples/stuck/tag.tsx +2 -2
  496. package/registry/examples/tree-view/docs.js +4 -4
  497. package/registry/examples/tree-view/docs.tsx +4 -4
  498. package/registry/examples/update-prompt/default.js +1 -1
  499. package/registry/examples/update-prompt/default.tsx +1 -1
  500. package/registry/examples/update-prompt/native/default.js +1 -1
  501. package/registry/examples/update-prompt/native/default.tsx +1 -1
  502. package/registry/examples/video-player/signed-source.js +1 -1
  503. package/registry/examples/video-player/signed-source.tsx +1 -1
  504. package/registry/field.json +1 -1
  505. package/registry/file-upload.json +2 -2
  506. package/registry/filter-bar.json +1 -1
  507. package/registry/flock.json +1 -1
  508. package/registry/footnote.json +1 -1
  509. package/registry/force-update-screen.json +4 -4
  510. package/registry/form-flow.json +1 -1
  511. package/registry/form.json +2 -2
  512. package/registry/gallery-page.json +5 -5
  513. package/registry/genui.json +4 -4
  514. package/registry/glossary-term.json +1 -1
  515. package/registry/glossary.json +1 -1
  516. package/registry/glow-card.json +1 -1
  517. package/registry/goal-gauge.json +6 -6
  518. package/registry/grade-stamp.json +1 -1
  519. package/registry/identity-card.json +1 -1
  520. package/registry/image-cropper.json +2 -2
  521. package/registry/index.json +33 -33
  522. package/registry/kanban.json +1 -1
  523. package/registry/kbd.json +1 -1
  524. package/registry/kind-config-editor.json +1 -1
  525. package/registry/kpi-explained.json +1 -1
  526. package/registry/landing-page.json +3 -3
  527. package/registry/landscape.json +2 -2
  528. package/registry/language-switch.json +1 -1
  529. package/registry/legal-page.json +1 -1
  530. package/registry/link-card.json +5 -5
  531. package/registry/list.json +7 -7
  532. package/registry/loader.json +12 -12
  533. package/registry/longform-page.json +4 -4
  534. package/registry/maintenance-screen.json +4 -4
  535. package/registry/map.json +3 -3
  536. package/registry/margin-layout.json +1 -1
  537. package/registry/markdown.json +1 -1
  538. package/registry/marketing-layout.json +6 -6
  539. package/registry/mascot-quote.json +1 -1
  540. package/registry/mascot-state.json +1 -1
  541. package/registry/mascots.json +5 -5
  542. package/registry/match-dialog.json +1 -1
  543. package/registry/media-capture.json +2 -2
  544. package/registry/media-gallery.json +62 -10
  545. package/registry/meter.json +1 -1
  546. package/registry/money-input.json +1 -1
  547. package/registry/nav-bar.json +27 -23
  548. package/registry/next-actions.json +1 -1
  549. package/registry/notification-preferences.json +1 -1
  550. package/registry/number-ticker.json +1 -1
  551. package/registry/opening-hours.json +1 -1
  552. package/registry/page-header.json +1 -1
  553. package/registry/page-hero.json +1 -1
  554. package/registry/page-index.json +1 -1
  555. package/registry/page.json +1 -1
  556. package/registry/pagination.json +1 -1
  557. package/registry/pointer-light.json +1 -1
  558. package/registry/popover.json +1 -1
  559. package/registry/price-catalogue-editor.json +3 -3
  560. package/registry/pricing-page.json +5 -5
  561. package/registry/product-page.json +13 -13
  562. package/registry/profile-card.json +12 -12
  563. package/registry/progress.json +1 -1
  564. package/registry/promise-card.json +6 -6
  565. package/registry/promo-code-field.json +3 -3
  566. package/registry/proposal.json +4 -4
  567. package/registry/pull-to-refresh.json +2 -2
  568. package/registry/qr-code.json +1 -1
  569. package/registry/quota-meter.json +3 -3
  570. package/registry/radio-group.json +1 -1
  571. package/registry/rail-nav.json +38 -34
  572. package/registry/recipes.json +1 -1
  573. package/registry/retro-tv.json +2 -2
  574. package/registry/reviews.json +1 -1
  575. package/registry/router.json +1 -1
  576. package/registry/schema-form.json +4 -4
  577. package/registry/scroll-stage.json +6 -6
  578. package/registry/search-field.json +2 -2
  579. package/registry/section-backdrop.json +1 -1
  580. package/registry/separator.json +3 -3
  581. package/registry/service-card.json +1 -1
  582. package/registry/settings-layout.json +1 -1
  583. package/registry/shop-composer.json +8 -8
  584. package/registry/shop-gallery.json +3 -3
  585. package/registry/shop.json +12 -12
  586. package/registry/showcase.json +1 -1
  587. package/registry/signature.json +1 -1
  588. package/registry/site-cahier.json +1 -1
  589. package/registry/site-footer.json +29 -25
  590. package/registry/sites.json +3 -3
  591. package/registry/skeleton.json +1 -1
  592. package/registry/skip-link.json +1 -1
  593. package/registry/slider.json +1 -1
  594. package/registry/slot-picker.json +1 -1
  595. package/registry/slot.json +1 -1
  596. package/registry/specimen-tag.json +4 -4
  597. package/registry/speed-lines.json +1 -1
  598. package/registry/spinner.json +1 -1
  599. package/registry/splash-handoff.json +4 -4
  600. package/registry/split-view.json +2 -2
  601. package/registry/stage-banner.json +7 -7
  602. package/registry/stat.json +3 -3
  603. package/registry/state-screen.json +1 -1
  604. package/registry/status-chip.json +1 -1
  605. package/registry/status-page.json +9 -9
  606. package/registry/step-progress.json +1 -1
  607. package/registry/step-showcase.json +10 -10
  608. package/registry/stepper.json +2 -2
  609. package/registry/sticky-action.json +1 -1
  610. package/registry/stuck.json +4 -4
  611. package/registry/swipe-deck.json +2 -2
  612. package/registry/switch.json +1 -1
  613. package/registry/tabs.json +1 -1
  614. package/registry/tag-input.json +2 -2
  615. package/registry/tag-selector.json +1 -1
  616. package/registry/taped-photo.json +1 -1
  617. package/registry/terminal-replay.json +2 -2
  618. package/registry/text-style.json +1 -1
  619. package/registry/theme.json +1 -1
  620. package/registry/toast.json +1 -1
  621. package/registry/toc.json +1 -1
  622. package/registry/tooltip.json +1 -1
  623. package/registry/tree-view.json +4 -4
  624. package/registry/update-prompt.json +8 -8
  625. package/registry/upload-queue.json +3 -3
  626. package/registry/usage.json +3 -3
  627. package/registry/verified-badge.json +1 -1
  628. package/registry/versus-card.json +1 -1
  629. package/registry/vertical-video.json +1 -1
  630. package/registry/video-player.json +3 -3
  631. package/registry/video-trimmer.json +2 -2
  632. package/registry/virtual.json +2 -2
  633. package/registry/wall.json +1 -1
  634. package/registry/waveform.json +2 -2
  635. package/skills/form/SKILL.md +1 -1
  636. package/skills/map/SKILL.md +2 -2
  637. package/dist/chunk-6KZDARNX.js.map +0 -1
  638. package/dist/chunk-DRTIE44Z.js.map +0 -1
  639. package/dist/chunk-E46AEUPH.js.map +0 -1
  640. package/dist/chunk-IOTY5HYG.js.map +0 -1
  641. package/dist/chunk-LZK4IRVW.js +0 -307
  642. package/dist/chunk-LZK4IRVW.js.map +0 -1
  643. package/dist/chunk-M3T5RQYV.js.map +0 -1
  644. package/dist/chunk-RCHKIOVV.js.map +0 -1
  645. /package/dist/{chunk-DSDFXPL6.js.map → chunk-757ZTGU5.js.map} +0 -0
  646. /package/dist/{chunk-CEW3LQOZ.js.map → chunk-IEGTRCDI.js.map} +0 -0
  647. /package/dist/{chunk-KVDB4GXV.js.map → chunk-KR2W4ONJ.js.map} +0 -0
  648. /package/dist/{chunk-GOGEYAYK.js.map → chunk-PRD7JRQX.js.map} +0 -0
  649. /package/dist/{chunk-VYZFQE3P.js.map → chunk-QD6SNXF5.js.map} +0 -0
  650. /package/dist/{chunk-YQWYGQTV.js.map → chunk-UIP3WX5O.js.map} +0 -0
  651. /package/dist/{chunk-ZKKMYIDN.js.map → chunk-Y3P5B4XS.js.map} +0 -0
  652. /package/dist/{chunk-GW5EI7MI.js.map → chunk-YXETEQQJ.js.map} +0 -0
  653. /package/dist/{player-lightbox-ASFOSUSD.js.map → player-lightbox-BYQ57OXT.js.map} +0 -0
  654. /package/registry/examples/dashboard-layout/{orazaka-eric.d.ts → sovkora-eric.d.ts} +0 -0
  655. /package/registry/examples/{product-page/orazaka.d.ts → media-gallery/carousel-autoplay.d.ts} +0 -0
package/dist/retro-tv.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import {
3
3
  VideoPlayer
4
- } from "./chunk-ZKKMYIDN.js";
4
+ } from "./chunk-Y3P5B4XS.js";
5
5
  import "./chunk-ADRUEPYC.js";
6
6
  import "./chunk-HJFRHYCI.js";
7
7
  import "./chunk-NSLXEDIS.js";
8
8
  import {
9
9
  useInView,
10
10
  usePrefersReducedMotion
11
- } from "./chunk-FZBWEDQI.js";
11
+ } from "./chunk-ZSCNMFE6.js";
12
12
  import "./chunk-PGBF3UBX.js";
13
13
 
14
14
  // src/retro-tv/retro-tv.tsx
@@ -1,7 +1,19 @@
1
1
  import * as React from 'react';
2
2
 
3
3
  /** What a field is drawn as. */
4
- type SchemaFieldKind = "text" | "textarea" | "number" | "integer" | "boolean" | "select" | "date" | "money" | "list";
4
+ /** The kinds of field a schema draws, one closed set: the rules below compare to it, never to a literal. */
5
+ declare const FIELD_KIND: {
6
+ readonly text: "text";
7
+ readonly textarea: "textarea";
8
+ readonly number: "number";
9
+ readonly integer: "integer";
10
+ readonly boolean: "boolean";
11
+ readonly select: "select";
12
+ readonly date: "date";
13
+ readonly money: "money";
14
+ readonly list: "list";
15
+ };
16
+ type SchemaFieldKind = (typeof FIELD_KIND)[keyof typeof FIELD_KIND];
5
17
  /** One field of the form, derived from a property of the schema. */
6
18
  interface SchemaField {
7
19
  key: string;
@@ -21,6 +21,17 @@ import {
21
21
  } from "./chunk-NSLXEDIS.js";
22
22
 
23
23
  // src/schema-form/schema.ts
24
+ var FIELD_KIND = {
25
+ text: "text",
26
+ textarea: "textarea",
27
+ number: "number",
28
+ integer: "integer",
29
+ boolean: "boolean",
30
+ select: "select",
31
+ date: "date",
32
+ money: "money",
33
+ list: "list"
34
+ };
24
35
  var MULTILINE_OVER = 500;
25
36
  var obj = (v) => v && typeof v === "object" && !Array.isArray(v) ? v : null;
26
37
  var str = (v) => typeof v === "string" && v.trim() !== "" ? v : null;
@@ -109,7 +120,7 @@ var listItems = (text) => text.split(",").map((s) => s.trim()).filter(Boolean);
109
120
  var asNumber = (text) => Number(text.replace(",", "."));
110
121
  function checkNumber(field, text, m) {
111
122
  const n = asNumber(text);
112
- if (!Number.isFinite(n) || field.kind === "integer" && !Number.isInteger(n)) return m.notANumber;
123
+ if (!Number.isFinite(n) || field.kind === FIELD_KIND.integer && !Number.isInteger(n)) return m.notANumber;
113
124
  if (field.min !== null && n < field.min) return fill(m.belowMin, { min: field.min });
114
125
  if (field.max !== null && n > field.max) return fill(m.aboveMax, { max: field.max });
115
126
  return null;
@@ -121,13 +132,13 @@ function checkText(field, text, m) {
121
132
  return null;
122
133
  }
123
134
  function checkField(field, value, m) {
124
- if (field.kind === "boolean") return null;
125
- const empty = field.kind === "money" ? value === null || value === void 0 : textOf(value) === "";
135
+ if (field.kind === FIELD_KIND.boolean) return null;
136
+ const empty = field.kind === FIELD_KIND.money ? value === null || value === void 0 : textOf(value) === "";
126
137
  if (empty) return field.required ? m.required : null;
127
- if (field.kind === "money") return null;
138
+ if (field.kind === FIELD_KIND.money) return null;
128
139
  const text = textOf(value);
129
- if (field.kind === "number" || field.kind === "integer") return checkNumber(field, text, m);
130
- if (field.kind === "list") return field.maxItems !== null && listItems(text).length > field.maxItems ? fill(m.tooMany, { max: field.maxItems }) : null;
140
+ if (field.kind === FIELD_KIND.number || field.kind === FIELD_KIND.integer) return checkNumber(field, text, m);
141
+ if (field.kind === FIELD_KIND.list) return field.maxItems !== null && listItems(text).length > field.maxItems ? fill(m.tooMany, { max: field.maxItems }) : null;
131
142
  return checkText(field, text, m);
132
143
  }
133
144
  function checkValues(fields, values, m) {
@@ -140,9 +151,9 @@ function checkValues(fields, values, m) {
140
151
  }
141
152
  var textOf = (v) => typeof v === "string" ? v.trim() : "";
142
153
  function startOf(f, v) {
143
- if (f.kind === "boolean") return v === true;
144
- if (f.kind === "money") return typeof v === "number" ? v : null;
145
- if (f.kind === "list" && Array.isArray(v)) return v.join(", ");
154
+ if (f.kind === FIELD_KIND.boolean) return v === true;
155
+ if (f.kind === FIELD_KIND.money) return typeof v === "number" ? v : null;
156
+ if (f.kind === FIELD_KIND.list && Array.isArray(v)) return v.join(", ");
146
157
  if (typeof v === "string" || typeof v === "number" || typeof v === "boolean") return String(v);
147
158
  return "";
148
159
  }
@@ -150,15 +161,15 @@ function initialValues(fields, given = {}) {
150
161
  return Object.fromEntries(fields.map((f) => [f.key, startOf(f, given[f.key] ?? f.defaultValue)]));
151
162
  }
152
163
  function typed(f, text) {
153
- if (f.kind === "number" || f.kind === "integer") return asNumber(text);
154
- return f.kind === "list" ? listItems(text) : text;
164
+ if (f.kind === FIELD_KIND.number || f.kind === FIELD_KIND.integer) return asNumber(text);
165
+ return f.kind === FIELD_KIND.list ? listItems(text) : text;
155
166
  }
156
167
  function payloadOf(fields, values) {
157
168
  const out = {};
158
169
  for (const f of fields) {
159
170
  const v = values[f.key];
160
- if (f.kind === "boolean") out[f.key] = v === true;
161
- else if (f.kind === "money") {
171
+ if (f.kind === FIELD_KIND.boolean) out[f.key] = v === true;
172
+ else if (f.kind === FIELD_KIND.money) {
162
173
  if (typeof v === "number") out[f.key] = v;
163
174
  } else if (textOf(v) !== "") out[f.key] = typed(f, textOf(v));
164
175
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schema-form/schema.ts","../src/schema-form/schema-form.tsx"],"sourcesContent":["// Pure: no React, no clock. A JSON Schema (an object of properties) read into the fields a form draws, and the checks that\n// the schema states. Extracted from Orazaka's run form (`useInputSchema`): the same vocabulary — `required`, `enum` and\n// `oneOf` of `const`, `x-i18n` words by language, `x-advanced` folded — without the studio's own parts.\n\n/** What a field is drawn as. */\nexport type SchemaFieldKind = \"text\" | \"textarea\" | \"number\" | \"integer\" | \"boolean\" | \"select\" | \"date\" | \"money\" | \"list\";\n\n/** One field of the form, derived from a property of the schema. */\nexport interface SchemaField {\n key: string;\n kind: SchemaFieldKind;\n /** The title in the page's language (`x-i18n`), else the schema's `title`, else the key. */\n title: string;\n /** A line of help under the field. */\n description: string | null;\n /** An example of what to type. */\n placeholder: string | null;\n required: boolean;\n /** `x-advanced`: folded under « more options ». */\n advanced: boolean;\n /** A closed list: `enum` or `oneOf` of `const`, with the labels of the language. */\n options: { value: string; label: string }[] | null;\n min: number | null;\n max: number | null;\n minLength: number | null;\n maxLength: number | null;\n maxItems: number | null;\n pattern: string | null;\n /** The ISO 4217 code of a `money` field (`x-money.currency`, default CAD). */\n currency: string;\n /** The value the form starts on, when the schema states one. */\n defaultValue: unknown;\n}\n\ninterface Words {\n title?: string;\n description?: string;\n placeholder?: string;\n options?: Record<string, string | { label?: string }>;\n}\ntype Raw = Record<string, unknown>;\n\n// @fixed: the schema's own threshold between a line and a text area (Orazaka's studio form: over 500 characters)\nconst MULTILINE_OVER = 500;\n\nconst obj = (v: unknown): Raw | null => (v && typeof v === \"object\" && !Array.isArray(v) ? (v as Raw) : null);\nconst str = (v: unknown) => (typeof v === \"string\" && v.trim() !== \"\" ? v : null);\nconst num = (v: unknown) => (typeof v === \"number\" && Number.isFinite(v) ? v : null);\n\n/** The words of a language: that language (`fr-CA` → `fr`), else English, else nothing. */\nfunction wordsFor(i18n: unknown, locale: string): Words | null {\n const by = obj(i18n);\n if (!by) return null;\n return (obj(by[locale]) ?? obj(by[locale.split(\"-\")[0] ?? \"\"]) ?? obj(by.en)) as Words | null;\n}\n\nfunction optionsOf(spec: Raw, words: Words | null): SchemaField[\"options\"] {\n const label = (value: string) => {\n const w = words?.options?.[value];\n return typeof w === \"string\" ? w : (w?.label ?? null);\n };\n if (Array.isArray(spec.enum)) return spec.enum.map(String).map((value) => ({ value, label: label(value) ?? value }));\n const one = spec.oneOf;\n if (Array.isArray(one) && one.length > 0 && one.every((e) => obj(e) && \"const\" in (e as Raw))) {\n return (one as Raw[]).map((e) => ({ value: String(e.const), label: label(String(e.const)) ?? str(e.title) ?? String(e.const) }));\n }\n return null;\n}\n\nfunction kindOf(spec: Raw, options: SchemaField[\"options\"]): SchemaFieldKind | null {\n const items = obj(spec.items);\n if (options) return \"select\";\n if (spec[\"x-money\"] || spec.format === \"money\") return \"money\";\n switch (spec.type) {\n case \"boolean\":\n return \"boolean\";\n case \"integer\":\n return \"integer\";\n case \"number\":\n return \"number\";\n case \"array\":\n return items && (items.type === undefined || items.type === \"string\") ? \"list\" : null;\n case \"string\":\n case undefined:\n if (spec.format === \"date\") return \"date\";\n return (num(spec.maxLength) ?? 0) > MULTILINE_OVER ? \"textarea\" : \"text\";\n default:\n return null;\n }\n}\n\n/** The fields of a JSON Schema object, in the schema's order. A property the form cannot draw (a nested object…) is left out. */\nexport function fieldsFromSchema(schema: unknown, locale: string): SchemaField[] {\n let root = obj(schema);\n if (typeof schema === \"string\") {\n try {\n root = obj(JSON.parse(schema));\n } catch {\n root = null;\n }\n }\n const properties = obj(root?.properties);\n if (!properties) return [];\n const required = new Set(Array.isArray(root?.required) ? root.required.map(String) : []);\n const fields: SchemaField[] = [];\n for (const [key, raw] of Object.entries(properties)) {\n const spec = obj(raw);\n if (!spec) continue;\n const words = wordsFor(spec[\"x-i18n\"], locale);\n const options = optionsOf(spec, words);\n const kind = kindOf(spec, options);\n if (!kind) continue;\n fields.push({\n key,\n kind,\n title: words?.title ?? str(spec.title) ?? key,\n description: words?.description ?? str(spec.description),\n placeholder: words?.placeholder ?? null,\n required: required.has(key),\n advanced: spec[\"x-advanced\"] === true,\n options,\n min: num(spec.minimum),\n max: num(spec.maximum),\n minLength: num(spec.minLength),\n maxLength: num(spec.maxLength),\n maxItems: num(spec.maxItems),\n pattern: str(spec.pattern),\n currency: str(obj(spec[\"x-money\"])?.currency) ?? \"CAD\",\n defaultValue: spec.default ?? null,\n });\n }\n return fields;\n}\n\n/** The words of the checks, passed translated. `{min}`, `{max}` are filled. */\nexport interface SchemaFormMessages {\n required: string;\n /** « At least {min} characters. » */\n tooShort: string;\n /** « At most {max} characters. » */\n tooLong: string;\n /** « Not below {min}. » */\n belowMin: string;\n /** « Not above {max}. » */\n aboveMax: string;\n /** « Not a number. » */\n notANumber: string;\n /** « Not in the expected form. » */\n badPattern: string;\n /** « At most {max} items. » */\n tooMany: string;\n}\n\nconst fill = (template: string, vars: Record<string, number>) => template.replace(/\\{(\\w+)\\}/g, (_, k: string) => String(vars[k] ?? \"\"));\n\n/** A list typed as « a, b, c »: its items. */\nexport const listItems = (text: string) => text.split(\",\").map((s) => s.trim()).filter(Boolean);\n\nconst asNumber = (text: string) => Number(text.replace(\",\", \".\"));\n\nfunction checkNumber(field: SchemaField, text: string, m: SchemaFormMessages): string | null {\n const n = asNumber(text);\n if (!Number.isFinite(n) || (field.kind === \"integer\" && !Number.isInteger(n))) return m.notANumber;\n if (field.min !== null && n < field.min) return fill(m.belowMin, { min: field.min });\n if (field.max !== null && n > field.max) return fill(m.aboveMax, { max: field.max });\n return null;\n}\n\nfunction checkText(field: SchemaField, text: string, m: SchemaFormMessages): string | null {\n if (field.minLength !== null && text.length < field.minLength) return fill(m.tooShort, { min: field.minLength });\n if (field.maxLength !== null && text.length > field.maxLength) return fill(m.tooLong, { max: field.maxLength });\n if (field.pattern !== null && !new RegExp(field.pattern, \"u\").test(text)) return m.badPattern;\n return null;\n}\n\n/** The raw answer of a field as the form holds it (a string, a boolean, or cents), checked against the schema's rules. Returns the message, or null. */\nexport function checkField(field: SchemaField, value: unknown, m: SchemaFormMessages): string | null {\n if (field.kind === \"boolean\") return null;\n const empty = field.kind === \"money\" ? value === null || value === undefined : textOf(value) === \"\";\n if (empty) return field.required ? m.required : null;\n if (field.kind === \"money\") return null;\n const text = textOf(value);\n if (field.kind === \"number\" || field.kind === \"integer\") return checkNumber(field, text, m);\n if (field.kind === \"list\") return field.maxItems !== null && listItems(text).length > field.maxItems ? fill(m.tooMany, { max: field.maxItems }) : null;\n return checkText(field, text, m);\n}\n\n/** The messages of every field that fails; an empty object is a valid form. */\nexport function checkValues(fields: readonly SchemaField[], values: Record<string, unknown>, m: SchemaFormMessages): Record<string, string> {\n const errors: Record<string, string> = {};\n for (const field of fields) {\n const message = checkField(field, values[field.key], m);\n if (message) errors[field.key] = message;\n }\n return errors;\n}\n\nconst textOf = (v: unknown) => (typeof v === \"string\" ? v.trim() : \"\");\n\n/** The answer a field starts on, from what was given or the schema's default. */\nfunction startOf(f: SchemaField, v: unknown): unknown {\n if (f.kind === \"boolean\") return v === true;\n if (f.kind === \"money\") return typeof v === \"number\" ? v : null;\n if (f.kind === \"list\" && Array.isArray(v)) return v.join(\", \");\n if (typeof v === \"string\" || typeof v === \"number\" || typeof v === \"boolean\") return String(v);\n return \"\";\n}\n\n/** What a form holds at the start: the schema's defaults, then the given values. */\nexport function initialValues(fields: readonly SchemaField[], given: Record<string, unknown> = {}): Record<string, unknown> {\n return Object.fromEntries(fields.map((f) => [f.key, startOf(f, given[f.key] ?? f.defaultValue)]));\n}\n\n/** The typed value of a non-empty answer. */\nfunction typed(f: SchemaField, text: string): unknown {\n if (f.kind === \"number\" || f.kind === \"integer\") return asNumber(text);\n return f.kind === \"list\" ? listItems(text) : text;\n}\n\n/** The typed payload the host receives: numbers as numbers, lists as arrays, money as integer cents, empty answers left out. */\nexport function payloadOf(fields: readonly SchemaField[], values: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const f of fields) {\n const v = values[f.key];\n if (f.kind === \"boolean\") out[f.key] = v === true;\n else if (f.kind === \"money\") {\n if (typeof v === \"number\") out[f.key] = v;\n } else if (textOf(v) !== \"\") out[f.key] = typed(f, textOf(v));\n }\n return out;\n}\n","\"use client\";\n// Client (the answers, what has been touched). A form drawn from a JSON Schema: the fields come from `fieldsFromSchema`\n// (pure), are drawn on the package's own fields (`Field`, `Input`, `Select`, `Textarea`, `Switch`, `MoneyInput`), checked\n// by the schema's rules, and handed to the host as a typed payload. The host keeps what is its own — uploads, pickers —\n// through `renderField`. Words are props; the block never fetches and never reads the clock.\nimport * as React from \"react\";\n\nimport { Button } from \"../button/button\";\nimport { cn } from \"../cn\";\nimport { Field, Input, Select, Textarea } from \"../field/field\";\nimport { MoneyInput } from \"../money-input/money-input\";\nimport { Switch } from \"../switch/switch\";\nimport { checkValues, fieldsFromSchema, initialValues, payloadOf, type SchemaField, type SchemaFormMessages } from \"./schema\";\n\n/** What a custom field receives to draw itself. */\nexport interface SchemaFieldContext {\n /** An id to wire the label (`htmlFor`) and the description. */\n id: string;\n /** The raw answer: a string, a boolean, or integer cents for a money field. */\n value: unknown;\n setValue: (value: unknown) => void;\n /** The refusal to show, or `null`. */\n error: string | null;\n disabled: boolean;\n}\n\nexport interface SchemaFormWords {\n /** The submit button: « Run ». */\n submit: string;\n /** The fold of the `x-advanced` fields: « More options ». */\n advanced: string;\n}\n\nexport interface SchemaFormProps extends Omit<React.ComponentProps<\"form\">, \"onSubmit\" | \"children\"> {\n /** The JSON Schema object (or its JSON text): `properties`, `required`, `x-i18n`, `x-advanced`. */\n schema: unknown;\n /** BCP 47 language for the `x-i18n` words and the money: `\"fr-CA\"`. */\n locale: string;\n /** The words, passed translated. */\n words: SchemaFormWords;\n /** The checks' words, passed translated. */\n messages: SchemaFormMessages;\n /** Answers to start from, by field key (over the schema's defaults). */\n values?: Record<string, unknown>;\n /** Called with the typed payload once every field passes. */\n onSubmit: (payload: Record<string, unknown>) => void;\n /** The form is being submitted: the fields are blocked and the button shows progress (no second submit). */\n submitting?: boolean;\n /** Draws a field in the host's way (an upload, a picker); return `undefined` for the default. */\n renderField?: (field: SchemaField, context: SchemaFieldContext) => React.ReactNode;\n /** Beside the submit button: a cost line, a note. */\n footer?: React.ReactNode;\n}\n\nfunction FieldControl({ field, ctx, locale }: Readonly<{ field: SchemaField; ctx: SchemaFieldContext; locale: string }>) {\n const { id, value, setValue, error, disabled } = ctx;\n const describedBy = [field.description ? `${id}-help` : null, error ? `${id}-error` : null].filter(Boolean).join(\" \") || undefined;\n const common = { id, disabled, \"aria-describedby\": describedBy, \"aria-required\": field.required || undefined } as const;\n const text = typeof value === \"string\" ? value : \"\";\n switch (field.kind) {\n case \"boolean\":\n return <Switch id={id} disabled={disabled} aria-describedby={describedBy} checked={value === true} onCheckedChange={setValue} />;\n case \"select\":\n return (\n <Select {...common} invalid={!!error} value={text} onChange={(e) => setValue(e.target.value)}>\n {!field.required && <option value=\"\" />}\n {field.options?.map((o) => (\n <option key={o.value} value={o.value}>\n {o.label}\n </option>\n ))}\n </Select>\n );\n case \"textarea\":\n return <Textarea {...common} invalid={!!error} value={text} maxLength={field.maxLength ?? undefined} placeholder={field.placeholder ?? undefined} onChange={(e) => setValue(e.target.value)} />;\n case \"money\":\n return <MoneyInput {...common} invalid={!!error} value={typeof value === \"number\" ? value : null} onValueChange={setValue} currency={field.currency} locale={locale} />;\n case \"number\":\n case \"integer\":\n return <Input {...common} invalid={!!error} type=\"text\" inputMode={field.kind === \"integer\" ? \"numeric\" : \"decimal\"} value={text} placeholder={field.placeholder ?? undefined} onChange={(e) => setValue(e.target.value)} />;\n case \"date\":\n return <Input {...common} invalid={!!error} type=\"date\" value={text} onChange={(e) => setValue(e.target.value)} />;\n default:\n return <Input {...common} invalid={!!error} type=\"text\" value={text} maxLength={field.maxLength ?? undefined} placeholder={field.placeholder ?? undefined} onChange={(e) => setValue(e.target.value)} />;\n }\n}\n\n/** A form from a JSON Schema: typed fields, the schema's rules, `x-i18n` words, `x-advanced` folded. */\nexport function SchemaForm({ schema, locale, words, messages, values: given, onSubmit, submitting = false, renderField, footer, className, ...props }: Readonly<SchemaFormProps>) {\n const base = React.useId();\n const fields = React.useMemo(() => fieldsFromSchema(schema, locale), [schema, locale]);\n const [answers, setAnswers] = React.useState(() => initialValues(fields, given));\n const [shown, setShown] = React.useState<Set<string>>(() => new Set());\n const errors = React.useMemo(() => checkValues(fields, answers, messages), [fields, answers, messages]);\n const formRef = React.useRef<HTMLFormElement>(null);\n const draw = (field: SchemaField) => {\n const id = `${base}-${field.key}`;\n const error = shown.has(field.key) ? (errors[field.key] ?? null) : null;\n const ctx: SchemaFieldContext = { id, value: answers[field.key], setValue: (v) => setAnswers((a) => ({ ...a, [field.key]: v })), error, disabled: submitting };\n const custom = renderField?.(field, ctx);\n const inline = field.kind === \"boolean\";\n return (\n <Field.Root key={field.key} data-field={field.key} data-kind={field.kind} onBlur={() => setShown((s) => (s.has(field.key) ? s : new Set(s).add(field.key)))}>\n <div className={cn(inline && \"flex items-center justify-between gap-3\")}>\n <Field.Label htmlFor={id}>\n {field.title}\n {field.required && <span aria-hidden> *</span>}\n </Field.Label>\n {inline && (custom ?? <FieldControl field={field} ctx={ctx} locale={locale} />)}\n </div>\n {!inline && (custom ?? <FieldControl field={field} ctx={ctx} locale={locale} />)}\n {field.description && <Field.Hint id={`${id}-help`}>{field.description}</Field.Hint>}\n {error && <Field.Error id={`${id}-error`}>{error}</Field.Error>}\n </Field.Root>\n );\n };\n const main = fields.filter((f) => !f.advanced);\n const more = fields.filter((f) => f.advanced);\n return (\n <form\n ref={formRef}\n noValidate\n data-schema-form=\"\"\n className={cn(\"flex flex-col gap-4\", className)}\n onSubmit={(event) => {\n event.preventDefault();\n if (submitting) return;\n const failing = Object.keys(errors);\n if (failing.length > 0) {\n setShown(new Set(fields.map((f) => f.key)));\n const first = fields.find((f) => errors[f.key]);\n if (first) formRef.current?.querySelector<HTMLElement>(`[data-field=\"${first.key}\"] :is(input,select,textarea,button[role=switch])`)?.focus();\n return;\n }\n onSubmit(payloadOf(fields, answers));\n }}\n {...props}\n >\n <div className=\"flex flex-col gap-3\">{main.map(draw)}</div>\n {more.length > 0 && (\n <details className=\"rounded-lg border border-border px-3 py-2\" open={more.some((f) => shown.has(f.key) && errors[f.key]) || undefined}>\n <summary className=\"cursor-pointer select-none text-sm font-medium text-fg-secondary\">{words.advanced}</summary>\n <div className=\"mt-3 flex flex-col gap-3\">{more.map(draw)}</div>\n </details>\n )}\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div className=\"min-w-0 text-xs text-fg-secondary\">{footer}</div>\n <Button type=\"submit\" variant=\"primary\" size=\"md\" loading={submitting}>\n {words.submit}\n </Button>\n </div>\n </form>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA2CA,IAAM,iBAAiB;AAEvB,IAAM,MAAM,CAAC,MAA4B,KAAK,OAAO,MAAM,YAAY,CAAC,MAAM,QAAQ,CAAC,IAAK,IAAY;AACxG,IAAM,MAAM,CAAC,MAAgB,OAAO,MAAM,YAAY,EAAE,KAAK,MAAM,KAAK,IAAI;AAC5E,IAAM,MAAM,CAAC,MAAgB,OAAO,MAAM,YAAY,OAAO,SAAS,CAAC,IAAI,IAAI;AAG/E,SAAS,SAAS,MAAe,QAA8B;AAC7D,QAAM,KAAK,IAAI,IAAI;AACnB,MAAI,CAAC,GAAI,QAAO;AAChB,SAAQ,IAAI,GAAG,MAAM,CAAC,KAAK,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,EAAE;AAC7E;AAEA,SAAS,UAAU,MAAW,OAA6C;AACzE,QAAM,QAAQ,CAAC,UAAkB;AAC/B,UAAM,IAAI,OAAO,UAAU,KAAK;AAChC,WAAO,OAAO,MAAM,WAAW,IAAK,GAAG,SAAS;AAAA,EAClD;AACA,MAAI,MAA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sources":["../src/schema-form/schema.ts","../src/schema-form/schema-form.tsx"],"sourcesContent":["// Pure: no React, no clock. A JSON Schema (an object of properties) read into the fields a form draws, and the checks that\n// the schema states. Extracted from Sovkora's run form (`useInputSchema`): the same vocabulary — `required`, `enum` and\n// `oneOf` of `const`, `x-i18n` words by language, `x-advanced` folded — without the studio's own parts.\n\n/** What a field is drawn as. */\n/** The kinds of field a schema draws, one closed set: the rules below compare to it, never to a literal. */\nexport const FIELD_KIND = {\n text: \"text\",\n textarea: \"textarea\",\n number: \"number\",\n integer: \"integer\",\n boolean: \"boolean\",\n select: \"select\",\n date: \"date\",\n money: \"money\",\n list: \"list\",\n} as const;\nexport type SchemaFieldKind = (typeof FIELD_KIND)[keyof typeof FIELD_KIND];\n\n/** One field of the form, derived from a property of the schema. */\nexport interface SchemaField {\n key: string;\n kind: SchemaFieldKind;\n /** The title in the page's language (`x-i18n`), else the schema's `title`, else the key. */\n title: string;\n /** A line of help under the field. */\n description: string | null;\n /** An example of what to type. */\n placeholder: string | null;\n required: boolean;\n /** `x-advanced`: folded under « more options ». */\n advanced: boolean;\n /** A closed list: `enum` or `oneOf` of `const`, with the labels of the language. */\n options: { value: string; label: string }[] | null;\n min: number | null;\n max: number | null;\n minLength: number | null;\n maxLength: number | null;\n maxItems: number | null;\n pattern: string | null;\n /** The ISO 4217 code of a `money` field (`x-money.currency`, default CAD). */\n currency: string;\n /** The value the form starts on, when the schema states one. */\n defaultValue: unknown;\n}\n\ninterface Words {\n title?: string;\n description?: string;\n placeholder?: string;\n options?: Record<string, string | { label?: string }>;\n}\ntype Raw = Record<string, unknown>;\n\n// @fixed: the schema's own threshold between a line and a text area (Sovkora's studio form: over 500 characters)\nconst MULTILINE_OVER = 500;\n\nconst obj = (v: unknown): Raw | null => (v && typeof v === \"object\" && !Array.isArray(v) ? (v as Raw) : null);\nconst str = (v: unknown) => (typeof v === \"string\" && v.trim() !== \"\" ? v : null);\nconst num = (v: unknown) => (typeof v === \"number\" && Number.isFinite(v) ? v : null);\n\n/** The words of a language: that language (`fr-CA` → `fr`), else English, else nothing. */\nfunction wordsFor(i18n: unknown, locale: string): Words | null {\n const by = obj(i18n);\n if (!by) return null;\n return (obj(by[locale]) ?? obj(by[locale.split(\"-\")[0] ?? \"\"]) ?? obj(by.en)) as Words | null;\n}\n\nfunction optionsOf(spec: Raw, words: Words | null): SchemaField[\"options\"] {\n const label = (value: string) => {\n const w = words?.options?.[value];\n return typeof w === \"string\" ? w : (w?.label ?? null);\n };\n if (Array.isArray(spec.enum)) return spec.enum.map(String).map((value) => ({ value, label: label(value) ?? value }));\n const one = spec.oneOf;\n if (Array.isArray(one) && one.length > 0 && one.every((e) => obj(e) && \"const\" in (e as Raw))) {\n return (one as Raw[]).map((e) => ({ value: String(e.const), label: label(String(e.const)) ?? str(e.title) ?? String(e.const) }));\n }\n return null;\n}\n\nfunction kindOf(spec: Raw, options: SchemaField[\"options\"]): SchemaFieldKind | null {\n const items = obj(spec.items);\n if (options) return \"select\";\n if (spec[\"x-money\"] || spec.format === \"money\") return \"money\";\n switch (spec.type) {\n case \"boolean\":\n return \"boolean\";\n case \"integer\":\n return \"integer\";\n case \"number\":\n return \"number\";\n case \"array\":\n return items && (items.type === undefined || items.type === \"string\") ? \"list\" : null;\n case \"string\":\n case undefined:\n if (spec.format === \"date\") return \"date\";\n return (num(spec.maxLength) ?? 0) > MULTILINE_OVER ? \"textarea\" : \"text\";\n default:\n return null;\n }\n}\n\n/** The fields of a JSON Schema object, in the schema's order. A property the form cannot draw (a nested object…) is left out. */\nexport function fieldsFromSchema(schema: unknown, locale: string): SchemaField[] {\n let root = obj(schema);\n if (typeof schema === \"string\") {\n try {\n root = obj(JSON.parse(schema));\n } catch {\n root = null;\n }\n }\n const properties = obj(root?.properties);\n if (!properties) return [];\n const required = new Set(Array.isArray(root?.required) ? root.required.map(String) : []);\n const fields: SchemaField[] = [];\n for (const [key, raw] of Object.entries(properties)) {\n const spec = obj(raw);\n if (!spec) continue;\n const words = wordsFor(spec[\"x-i18n\"], locale);\n const options = optionsOf(spec, words);\n const kind = kindOf(spec, options);\n if (!kind) continue;\n fields.push({\n key,\n kind,\n title: words?.title ?? str(spec.title) ?? key,\n description: words?.description ?? str(spec.description),\n placeholder: words?.placeholder ?? null,\n required: required.has(key),\n advanced: spec[\"x-advanced\"] === true,\n options,\n min: num(spec.minimum),\n max: num(spec.maximum),\n minLength: num(spec.minLength),\n maxLength: num(spec.maxLength),\n maxItems: num(spec.maxItems),\n pattern: str(spec.pattern),\n currency: str(obj(spec[\"x-money\"])?.currency) ?? \"CAD\",\n defaultValue: spec.default ?? null,\n });\n }\n return fields;\n}\n\n/** The words of the checks, passed translated. `{min}`, `{max}` are filled. */\nexport interface SchemaFormMessages {\n required: string;\n /** « At least {min} characters. » */\n tooShort: string;\n /** « At most {max} characters. » */\n tooLong: string;\n /** « Not below {min}. » */\n belowMin: string;\n /** « Not above {max}. » */\n aboveMax: string;\n /** « Not a number. » */\n notANumber: string;\n /** « Not in the expected form. » */\n badPattern: string;\n /** « At most {max} items. » */\n tooMany: string;\n}\n\nconst fill = (template: string, vars: Record<string, number>) => template.replace(/\\{(\\w+)\\}/g, (_, k: string) => String(vars[k] ?? \"\"));\n\n/** A list typed as « a, b, c »: its items. */\nexport const listItems = (text: string) => text.split(\",\").map((s) => s.trim()).filter(Boolean);\n\nconst asNumber = (text: string) => Number(text.replace(\",\", \".\"));\n\nfunction checkNumber(field: SchemaField, text: string, m: SchemaFormMessages): string | null {\n const n = asNumber(text);\n if (!Number.isFinite(n) || (field.kind === FIELD_KIND.integer && !Number.isInteger(n))) return m.notANumber;\n if (field.min !== null && n < field.min) return fill(m.belowMin, { min: field.min });\n if (field.max !== null && n > field.max) return fill(m.aboveMax, { max: field.max });\n return null;\n}\n\nfunction checkText(field: SchemaField, text: string, m: SchemaFormMessages): string | null {\n if (field.minLength !== null && text.length < field.minLength) return fill(m.tooShort, { min: field.minLength });\n if (field.maxLength !== null && text.length > field.maxLength) return fill(m.tooLong, { max: field.maxLength });\n if (field.pattern !== null && !new RegExp(field.pattern, \"u\").test(text)) return m.badPattern;\n return null;\n}\n\n/** The raw answer of a field as the form holds it (a string, a boolean, or cents), checked against the schema's rules. Returns the message, or null. */\nexport function checkField(field: SchemaField, value: unknown, m: SchemaFormMessages): string | null {\n if (field.kind === FIELD_KIND.boolean) return null;\n const empty = field.kind === FIELD_KIND.money ? value === null || value === undefined : textOf(value) === \"\";\n if (empty) return field.required ? m.required : null;\n if (field.kind === FIELD_KIND.money) return null;\n const text = textOf(value);\n if (field.kind === FIELD_KIND.number || field.kind === FIELD_KIND.integer) return checkNumber(field, text, m);\n if (field.kind === FIELD_KIND.list) return field.maxItems !== null && listItems(text).length > field.maxItems ? fill(m.tooMany, { max: field.maxItems }) : null;\n return checkText(field, text, m);\n}\n\n/** The messages of every field that fails; an empty object is a valid form. */\nexport function checkValues(fields: readonly SchemaField[], values: Record<string, unknown>, m: SchemaFormMessages): Record<string, string> {\n const errors: Record<string, string> = {};\n for (const field of fields) {\n const message = checkField(field, values[field.key], m);\n if (message) errors[field.key] = message;\n }\n return errors;\n}\n\nconst textOf = (v: unknown) => (typeof v === \"string\" ? v.trim() : \"\");\n\n/** The answer a field starts on, from what was given or the schema's default. */\nfunction startOf(f: SchemaField, v: unknown): unknown {\n if (f.kind === FIELD_KIND.boolean) return v === true;\n if (f.kind === FIELD_KIND.money) return typeof v === \"number\" ? v : null;\n if (f.kind === FIELD_KIND.list && Array.isArray(v)) return v.join(\", \");\n if (typeof v === \"string\" || typeof v === \"number\" || typeof v === \"boolean\") return String(v);\n return \"\";\n}\n\n/** What a form holds at the start: the schema's defaults, then the given values. */\nexport function initialValues(fields: readonly SchemaField[], given: Record<string, unknown> = {}): Record<string, unknown> {\n return Object.fromEntries(fields.map((f) => [f.key, startOf(f, given[f.key] ?? f.defaultValue)]));\n}\n\n/** The typed value of a non-empty answer. */\nfunction typed(f: SchemaField, text: string): unknown {\n if (f.kind === FIELD_KIND.number || f.kind === FIELD_KIND.integer) return asNumber(text);\n return f.kind === FIELD_KIND.list ? listItems(text) : text;\n}\n\n/** The typed payload the host receives: numbers as numbers, lists as arrays, money as integer cents, empty answers left out. */\nexport function payloadOf(fields: readonly SchemaField[], values: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const f of fields) {\n const v = values[f.key];\n if (f.kind === FIELD_KIND.boolean) out[f.key] = v === true;\n else if (f.kind === FIELD_KIND.money) {\n if (typeof v === \"number\") out[f.key] = v;\n } else if (textOf(v) !== \"\") out[f.key] = typed(f, textOf(v));\n }\n return out;\n}\n","\"use client\";\n// Client (the answers, what has been touched). A form drawn from a JSON Schema: the fields come from `fieldsFromSchema`\n// (pure), are drawn on the package's own fields (`Field`, `Input`, `Select`, `Textarea`, `Switch`, `MoneyInput`), checked\n// by the schema's rules, and handed to the host as a typed payload. The host keeps what is its own — uploads, pickers —\n// through `renderField`. Words are props; the block never fetches and never reads the clock.\nimport * as React from \"react\";\n\nimport { Button } from \"../button/button\";\nimport { cn } from \"../cn\";\nimport { Field, Input, Select, Textarea } from \"../field/field\";\nimport { MoneyInput } from \"../money-input/money-input\";\nimport { Switch } from \"../switch/switch\";\nimport { checkValues, fieldsFromSchema, initialValues, payloadOf, type SchemaField, type SchemaFormMessages } from \"./schema\";\n\n/** What a custom field receives to draw itself. */\nexport interface SchemaFieldContext {\n /** An id to wire the label (`htmlFor`) and the description. */\n id: string;\n /** The raw answer: a string, a boolean, or integer cents for a money field. */\n value: unknown;\n setValue: (value: unknown) => void;\n /** The refusal to show, or `null`. */\n error: string | null;\n disabled: boolean;\n}\n\nexport interface SchemaFormWords {\n /** The submit button: « Run ». */\n submit: string;\n /** The fold of the `x-advanced` fields: « More options ». */\n advanced: string;\n}\n\nexport interface SchemaFormProps extends Omit<React.ComponentProps<\"form\">, \"onSubmit\" | \"children\"> {\n /** The JSON Schema object (or its JSON text): `properties`, `required`, `x-i18n`, `x-advanced`. */\n schema: unknown;\n /** BCP 47 language for the `x-i18n` words and the money: `\"fr-CA\"`. */\n locale: string;\n /** The words, passed translated. */\n words: SchemaFormWords;\n /** The checks' words, passed translated. */\n messages: SchemaFormMessages;\n /** Answers to start from, by field key (over the schema's defaults). */\n values?: Record<string, unknown>;\n /** Called with the typed payload once every field passes. */\n onSubmit: (payload: Record<string, unknown>) => void;\n /** The form is being submitted: the fields are blocked and the button shows progress (no second submit). */\n submitting?: boolean;\n /** Draws a field in the host's way (an upload, a picker); return `undefined` for the default. */\n renderField?: (field: SchemaField, context: SchemaFieldContext) => React.ReactNode;\n /** Beside the submit button: a cost line, a note. */\n footer?: React.ReactNode;\n}\n\nfunction FieldControl({ field, ctx, locale }: Readonly<{ field: SchemaField; ctx: SchemaFieldContext; locale: string }>) {\n const { id, value, setValue, error, disabled } = ctx;\n const describedBy = [field.description ? `${id}-help` : null, error ? `${id}-error` : null].filter(Boolean).join(\" \") || undefined;\n const common = { id, disabled, \"aria-describedby\": describedBy, \"aria-required\": field.required || undefined } as const;\n const text = typeof value === \"string\" ? value : \"\";\n switch (field.kind) {\n case \"boolean\":\n return <Switch id={id} disabled={disabled} aria-describedby={describedBy} checked={value === true} onCheckedChange={setValue} />;\n case \"select\":\n return (\n <Select {...common} invalid={!!error} value={text} onChange={(e) => setValue(e.target.value)}>\n {!field.required && <option value=\"\" />}\n {field.options?.map((o) => (\n <option key={o.value} value={o.value}>\n {o.label}\n </option>\n ))}\n </Select>\n );\n case \"textarea\":\n return <Textarea {...common} invalid={!!error} value={text} maxLength={field.maxLength ?? undefined} placeholder={field.placeholder ?? undefined} onChange={(e) => setValue(e.target.value)} />;\n case \"money\":\n return <MoneyInput {...common} invalid={!!error} value={typeof value === \"number\" ? value : null} onValueChange={setValue} currency={field.currency} locale={locale} />;\n case \"number\":\n case \"integer\":\n return <Input {...common} invalid={!!error} type=\"text\" inputMode={field.kind === \"integer\" ? \"numeric\" : \"decimal\"} value={text} placeholder={field.placeholder ?? undefined} onChange={(e) => setValue(e.target.value)} />;\n case \"date\":\n return <Input {...common} invalid={!!error} type=\"date\" value={text} onChange={(e) => setValue(e.target.value)} />;\n default:\n return <Input {...common} invalid={!!error} type=\"text\" value={text} maxLength={field.maxLength ?? undefined} placeholder={field.placeholder ?? undefined} onChange={(e) => setValue(e.target.value)} />;\n }\n}\n\n/** A form from a JSON Schema: typed fields, the schema's rules, `x-i18n` words, `x-advanced` folded. */\nexport function SchemaForm({ schema, locale, words, messages, values: given, onSubmit, submitting = false, renderField, footer, className, ...props }: Readonly<SchemaFormProps>) {\n const base = React.useId();\n const fields = React.useMemo(() => fieldsFromSchema(schema, locale), [schema, locale]);\n const [answers, setAnswers] = React.useState(() => initialValues(fields, given));\n const [shown, setShown] = React.useState<Set<string>>(() => new Set());\n const errors = React.useMemo(() => checkValues(fields, answers, messages), [fields, answers, messages]);\n const formRef = React.useRef<HTMLFormElement>(null);\n const draw = (field: SchemaField) => {\n const id = `${base}-${field.key}`;\n const error = shown.has(field.key) ? (errors[field.key] ?? null) : null;\n const ctx: SchemaFieldContext = { id, value: answers[field.key], setValue: (v) => setAnswers((a) => ({ ...a, [field.key]: v })), error, disabled: submitting };\n const custom = renderField?.(field, ctx);\n const inline = field.kind === \"boolean\";\n return (\n <Field.Root key={field.key} data-field={field.key} data-kind={field.kind} onBlur={() => setShown((s) => (s.has(field.key) ? s : new Set(s).add(field.key)))}>\n <div className={cn(inline && \"flex items-center justify-between gap-3\")}>\n <Field.Label htmlFor={id}>\n {field.title}\n {field.required && <span aria-hidden> *</span>}\n </Field.Label>\n {inline && (custom ?? <FieldControl field={field} ctx={ctx} locale={locale} />)}\n </div>\n {!inline && (custom ?? <FieldControl field={field} ctx={ctx} locale={locale} />)}\n {field.description && <Field.Hint id={`${id}-help`}>{field.description}</Field.Hint>}\n {error && <Field.Error id={`${id}-error`}>{error}</Field.Error>}\n </Field.Root>\n );\n };\n const main = fields.filter((f) => !f.advanced);\n const more = fields.filter((f) => f.advanced);\n return (\n <form\n ref={formRef}\n noValidate\n data-schema-form=\"\"\n className={cn(\"flex flex-col gap-4\", className)}\n onSubmit={(event) => {\n event.preventDefault();\n if (submitting) return;\n const failing = Object.keys(errors);\n if (failing.length > 0) {\n setShown(new Set(fields.map((f) => f.key)));\n const first = fields.find((f) => errors[f.key]);\n if (first) formRef.current?.querySelector<HTMLElement>(`[data-field=\"${first.key}\"] :is(input,select,textarea,button[role=switch])`)?.focus();\n return;\n }\n onSubmit(payloadOf(fields, answers));\n }}\n {...props}\n >\n <div className=\"flex flex-col gap-3\">{main.map(draw)}</div>\n {more.length > 0 && (\n <details className=\"rounded-lg border border-border px-3 py-2\" open={more.some((f) => shown.has(f.key) && errors[f.key]) || undefined}>\n <summary className=\"cursor-pointer select-none text-sm font-medium text-fg-secondary\">{words.advanced}</summary>\n <div className=\"mt-3 flex flex-col gap-3\">{more.map(draw)}</div>\n </details>\n )}\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div className=\"min-w-0 text-xs text-fg-secondary\">{footer}</div>\n <Button type=\"submit\" variant=\"primary\" size=\"md\" loading={submitting}>\n {words.submit}\n </Button>\n </div>\n </form>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAM,aAAa;AAAA,EACxB,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AACR;AAuCA,IAAM,iBAAiB;AAEvB,IAAM,MAAM,CAAC,MAA4B,KAAK,OAAO,MAAM,YAAY,CAAC,MAAM,QAAQ,CAAC,IAAK,IAAY;AACxG,IAAM,MAAM,CAAC,MAAgB,OAAO,MAAM,YAAY,EAAE,KAAK,MAAM,KAAK,IAAI;AAC5E,IAAM,MAAM,CAAC,MAAgB,OAAO,MAAM,YAAY,OAAO,SAAS,CAAC,IAAI,IAAI;AAG/E,SAAS,SAAS,MAAe,QAA8B;AAC7D,QAAM,KAAK,IAAI,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AAK,CAAC,MAAM,MAAM,IAAI,EAAE,GAAG,KAAK,OAAO,EAAE,GAAG,CAAC,KAAK,QAC1H;AAAA,8BAAC,aAAQ,WAAU,oEAAoE,gBAAM,UAAS;AAAA,UACtG,oBAAC,SAAI,WAAU,4BAA4B,eAAK,IAAI,IAAI,GAAE;AAAA,WAC5D;AAAA,QAEF,qBAAC,SAAI,WAAU,qDACb;AAAA,8BAAC,SAAI,WAAU,qCAAqC,kBAAO;AAAA,UAC3D,oBAAC,UAAO,MAAK,UAAS,SAAQ,WAAU,MAAK,MAAK,SAAS,YACxD,gBAAM,QACT;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -314,7 +314,7 @@ type SceneProps = React.HTMLAttributes<HTMLElement> & {
314
314
  * @default "section"
315
315
  */
316
316
  as?: Polymorphic | "header" | "footer" | "li";
317
- /** A brand scope for the scene (`orazaka` → `.brand-orazaka`): its accent and gradient become that brand's. */
317
+ /** A brand scope for the scene (`sovkora` → `.brand-sovkora`): its accent and gradient become that brand's. */
318
318
  brand?: string;
319
319
  };
320
320
  /**
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  brandClass,
4
4
  storyVariantClass
5
- } from "./chunk-EHTXLZSM.js";
5
+ } from "./chunk-VS3MWRBX.js";
6
6
  import {
7
7
  warnDeprecated
8
8
  } from "./chunk-BDIU5LZB.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scroll-stage/scroll-stage.tsx"],"sourcesContent":["// Client. The conductor of a told page (story.css): chapters that play their entrance once, in order, when they first\n// come into view, and whose one slow loop runs only while they are on screen. One IntersectionObserver for the stage,\n// no animation frame, nothing at all under prefers-reduced-motion.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { warnDeprecated } from \"../deprecated\";\nimport { brandClass, type StoryVariant, storyVariantClass } from \"../story-variant\";\n\nexport type { StoryVariant };\n\nconst SCENE = \"[data-kzs-scene]\";\n\ntype Polymorphic = \"div\" | \"main\" | \"article\" | \"section\";\n\nexport type ScrollStageProps = React.HTMLAttributes<HTMLElement> & {\n /**\n * The element the stage renders.\n * @default \"div\"\n */\n as?: Polymorphic;\n /**\n * The look of every storytelling component inside (each one can still set its own): `default` or `arcade`.\n * @default \"default\"\n */\n variant?: StoryVariant;\n /**\n * How much of a scene must be visible before it plays (0–1).\n * @default 0.2\n */\n threshold?: number;\n};\n\n/**\n * Plays the scenes (`Scene`, or any `[data-kzs-scene]`) it contains: each one gets `data-in` once, when it first enters\n * the viewport — its parts then arrive in order (the visual, the announcement, the words: `data-kzs-reveal`) — and\n * `data-live` while it is visible, which runs its one loop. Until the stage has switched motion on, and under\n * `prefers-reduced-motion`, everything is visible and still.\n * @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.\n */\nexport function ScrollStage({ as: Tag = \"div\", variant, threshold = 0.2, className, children, ...props }: ScrollStageProps) {\n warnDeprecated(\"scroll-stage\");\n const ref = React.useRef<HTMLElement>(null);\n React.useEffect(() => {\n const root = ref.current;\n if (!root || typeof IntersectionObserver === \"undefined\") return;\n if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n const io = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n const el = entry.target as HTMLElement;\n if (entry.isIntersecting) {\n el.setAttribute(\"data-in\", \"\");\n el.setAttribute(\"data-live\", \"\");\n } else el.removeAttribute(\"data-live\");\n }\n },\n { threshold },\n );\n const watch = (scope: ParentNode) => scope.querySelectorAll(SCENE).forEach((el) => io.observe(el));\n if (root.matches(SCENE)) io.observe(root);\n watch(root);\n const mo = new MutationObserver((records) => {\n for (const record of records)\n record.addedNodes.forEach((node) => {\n if (!(node instanceof Element)) return;\n if (node.matches(SCENE)) io.observe(node);\n watch(node);\n });\n });\n mo.observe(root, { childList: true, subtree: true });\n root.setAttribute(\"data-kzs-stage\", \"on\");\n return () => {\n io.disconnect();\n mo.disconnect();\n root.removeAttribute(\"data-kzs-stage\");\n };\n }, [threshold]);\n return React.createElement(Tag, { ref, className: cn(storyVariantClass(variant), className), ...props }, children);\n}\n\nexport type SceneProps = React.HTMLAttributes<HTMLElement> & {\n /**\n * The element the scene renders.\n * @default \"section\"\n */\n as?: Polymorphic | \"header\" | \"footer\" | \"li\";\n /** A brand scope for the scene (`orazaka` → `.brand-orazaka`): its accent and gradient become that brand's. */\n brand?: string;\n};\n\n/**\n * A chapter of a `ScrollStage`: played once when it enters the viewport, its loop running while it is visible.\n * @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.\n */\nexport function Scene({ as: Tag = \"section\", brand, className, children, ...props }: SceneProps) {\n warnDeprecated(\"scroll-stage\");\n return React.createElement(Tag, { \"data-kzs-scene\": \"\", className: cn(brandClass(brand), className) || undefined, ...props }, children);\n}\n"],"mappings":";;;;;;;;;;;;;AAGA,YAAY,WAAW;AAQvB,IAAM,QAAQ;AA6BP,SAAS,YAAY,EAAE,IAAI,MAAM,OAAO,SAAS,YAAY,KAAK,WAAW,UAAU,GAAG,MAAM,GAAqB;AAC1H,iBAAe,cAAc;AAC7B,QAAM,MAAY,aAAoB,IAAI;AAC1C,EAAM,gBAAU,MAAM;AACpB,UAAM,OAAO,IAAI;AACjB,QAAI,CAAC,QAAQ,OAAO,yBAAyB,YAAa;AAC1D,QAAI,OAAO,WAAW,kCAAkC,EAAE,QAAS;AACnE,UAAM,KAAK,IAAI;AAAA,MACb,CAAC,YAAY;AACX,mBAAW,SAAS,SAAS;AAC3B,gBAAM,KAAK,MAAM;AACjB,cAAI,MAAM,gBAAgB;AACxB,eAAG,aAAa,WAAW,EAAE;AAC7B,eAAG,aAAa,aAAa,EAAE;AAAA,UACjC,MAAO,IAAG,gBAAgB,WAAW;AAAA,QACvC;AAAA,MACF;AAAA,MACA,EAAE,UAAU;AAAA,IACd;AACA,UAAM,QAAQ,CAAC,UAAsB,MAAM,iBAAiB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,EAAE,CAAC;AACjG,QAAI,KAAK,QAAQ,KAAK,EAAG,IAAG,QAAQ,IAAI;AACxC,UAAM,IAAI;AACV,UAAM,KAAK,IAAI,iBAAiB,CAAC,YAAY;AAC3C,iBAAW,UAAU;AACnB,eAAO,WAAW,QAAQ,CAAC,SAAS;AAClC,cAAI,EAAE,gBAAgB,SAAU;AAChC,cAAI,KAAK,QAAQ,KAAK,EAAG,IAAG,QAAQ,IAAI;AACxC,gBAAM,IAAI;AAAA,QACZ,CAAC;AAAA,IACL,CAAC;AACD,OAAG,QAAQ,MAAM,EAAE,WAAW,MAAM,SAAS,KAAK,CAAC;AACnD,SAAK,aAAa,kBAAkB,IAAI;AACxC,WAAO,MAAM;AACX,SAAG,WAAW;AACd,SAAG,WAAW;AACd,WAAK,gBAAgB,gBAAgB;AAAA,IACvC;AAAA,EACF,GAAG,CAAC,SAAS,CAAC;AACd,SAAa,oBAAc,KAAK,EAAE,KAAK,WAAW,GAAG,kBAAkB,OAAO,GAAG,SAAS,GAAG,GAAG,MAAM,GAAG,QAAQ;AACnH;AAgBO,SAAS,MAAM,EAAE,IAAI,MAAM,WAAW,OAAO,WAAW,UAAU,GAAG,MAAM,GAAe;AAC/F,iBAAe,cAAc;AAC7B,SAAa,oBAAc,KAAK,EAAE,kBAAkB,IAAI,WAAW,GAAG,WAAW,KAAK,GAAG,SAAS,KAAK,QAAW,GAAG,MAAM,GAAG,QAAQ;AACxI;","names":[]}
1
+ {"version":3,"sources":["../src/scroll-stage/scroll-stage.tsx"],"sourcesContent":["// Client. The conductor of a told page (story.css): chapters that play their entrance once, in order, when they first\n// come into view, and whose one slow loop runs only while they are on screen. One IntersectionObserver for the stage,\n// no animation frame, nothing at all under prefers-reduced-motion.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { warnDeprecated } from \"../deprecated\";\nimport { brandClass, type StoryVariant, storyVariantClass } from \"../story-variant\";\n\nexport type { StoryVariant };\n\nconst SCENE = \"[data-kzs-scene]\";\n\ntype Polymorphic = \"div\" | \"main\" | \"article\" | \"section\";\n\nexport type ScrollStageProps = React.HTMLAttributes<HTMLElement> & {\n /**\n * The element the stage renders.\n * @default \"div\"\n */\n as?: Polymorphic;\n /**\n * The look of every storytelling component inside (each one can still set its own): `default` or `arcade`.\n * @default \"default\"\n */\n variant?: StoryVariant;\n /**\n * How much of a scene must be visible before it plays (0–1).\n * @default 0.2\n */\n threshold?: number;\n};\n\n/**\n * Plays the scenes (`Scene`, or any `[data-kzs-scene]`) it contains: each one gets `data-in` once, when it first enters\n * the viewport — its parts then arrive in order (the visual, the announcement, the words: `data-kzs-reveal`) — and\n * `data-live` while it is visible, which runs its one loop. Until the stage has switched motion on, and under\n * `prefers-reduced-motion`, everything is visible and still.\n * @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.\n */\nexport function ScrollStage({ as: Tag = \"div\", variant, threshold = 0.2, className, children, ...props }: ScrollStageProps) {\n warnDeprecated(\"scroll-stage\");\n const ref = React.useRef<HTMLElement>(null);\n React.useEffect(() => {\n const root = ref.current;\n if (!root || typeof IntersectionObserver === \"undefined\") return;\n if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n const io = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n const el = entry.target as HTMLElement;\n if (entry.isIntersecting) {\n el.setAttribute(\"data-in\", \"\");\n el.setAttribute(\"data-live\", \"\");\n } else el.removeAttribute(\"data-live\");\n }\n },\n { threshold },\n );\n const watch = (scope: ParentNode) => scope.querySelectorAll(SCENE).forEach((el) => io.observe(el));\n if (root.matches(SCENE)) io.observe(root);\n watch(root);\n const mo = new MutationObserver((records) => {\n for (const record of records)\n record.addedNodes.forEach((node) => {\n if (!(node instanceof Element)) return;\n if (node.matches(SCENE)) io.observe(node);\n watch(node);\n });\n });\n mo.observe(root, { childList: true, subtree: true });\n root.setAttribute(\"data-kzs-stage\", \"on\");\n return () => {\n io.disconnect();\n mo.disconnect();\n root.removeAttribute(\"data-kzs-stage\");\n };\n }, [threshold]);\n return React.createElement(Tag, { ref, className: cn(storyVariantClass(variant), className), ...props }, children);\n}\n\nexport type SceneProps = React.HTMLAttributes<HTMLElement> & {\n /**\n * The element the scene renders.\n * @default \"section\"\n */\n as?: Polymorphic | \"header\" | \"footer\" | \"li\";\n /** A brand scope for the scene (`sovkora` → `.brand-sovkora`): its accent and gradient become that brand's. */\n brand?: string;\n};\n\n/**\n * A chapter of a `ScrollStage`: played once when it enters the viewport, its loop running while it is visible.\n * @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.\n */\nexport function Scene({ as: Tag = \"section\", brand, className, children, ...props }: SceneProps) {\n warnDeprecated(\"scroll-stage\");\n return React.createElement(Tag, { \"data-kzs-scene\": \"\", className: cn(brandClass(brand), className) || undefined, ...props }, children);\n}\n"],"mappings":";;;;;;;;;;;;;AAGA,YAAY,WAAW;AAQvB,IAAM,QAAQ;AA6BP,SAAS,YAAY,EAAE,IAAI,MAAM,OAAO,SAAS,YAAY,KAAK,WAAW,UAAU,GAAG,MAAM,GAAqB;AAC1H,iBAAe,cAAc;AAC7B,QAAM,MAAY,aAAoB,IAAI;AAC1C,EAAM,gBAAU,MAAM;AACpB,UAAM,OAAO,IAAI;AACjB,QAAI,CAAC,QAAQ,OAAO,yBAAyB,YAAa;AAC1D,QAAI,OAAO,WAAW,kCAAkC,EAAE,QAAS;AACnE,UAAM,KAAK,IAAI;AAAA,MACb,CAAC,YAAY;AACX,mBAAW,SAAS,SAAS;AAC3B,gBAAM,KAAK,MAAM;AACjB,cAAI,MAAM,gBAAgB;AACxB,eAAG,aAAa,WAAW,EAAE;AAC7B,eAAG,aAAa,aAAa,EAAE;AAAA,UACjC,MAAO,IAAG,gBAAgB,WAAW;AAAA,QACvC;AAAA,MACF;AAAA,MACA,EAAE,UAAU;AAAA,IACd;AACA,UAAM,QAAQ,CAAC,UAAsB,MAAM,iBAAiB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,EAAE,CAAC;AACjG,QAAI,KAAK,QAAQ,KAAK,EAAG,IAAG,QAAQ,IAAI;AACxC,UAAM,IAAI;AACV,UAAM,KAAK,IAAI,iBAAiB,CAAC,YAAY;AAC3C,iBAAW,UAAU;AACnB,eAAO,WAAW,QAAQ,CAAC,SAAS;AAClC,cAAI,EAAE,gBAAgB,SAAU;AAChC,cAAI,KAAK,QAAQ,KAAK,EAAG,IAAG,QAAQ,IAAI;AACxC,gBAAM,IAAI;AAAA,QACZ,CAAC;AAAA,IACL,CAAC;AACD,OAAG,QAAQ,MAAM,EAAE,WAAW,MAAM,SAAS,KAAK,CAAC;AACnD,SAAK,aAAa,kBAAkB,IAAI;AACxC,WAAO,MAAM;AACX,SAAG,WAAW;AACd,SAAG,WAAW;AACd,WAAK,gBAAgB,gBAAgB;AAAA,IACvC;AAAA,EACF,GAAG,CAAC,SAAS,CAAC;AACd,SAAa,oBAAc,KAAK,EAAE,KAAK,WAAW,GAAG,kBAAkB,OAAO,GAAG,SAAS,GAAG,GAAG,MAAM,GAAG,QAAQ;AACnH;AAgBO,SAAS,MAAM,EAAE,IAAI,MAAM,WAAW,OAAO,WAAW,UAAU,GAAG,MAAM,GAAe;AAC/F,iBAAe,cAAc;AAC7B,SAAa,oBAAc,KAAK,EAAE,kBAAkB,IAAI,WAAW,GAAG,WAAW,KAAK,GAAG,SAAS,KAAK,QAAW,GAAG,MAAM,GAAG,QAAQ;AACxI;","names":[]}
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  SearchField,
4
4
  searchField
5
- } from "./chunk-DSDFXPL6.js";
5
+ } from "./chunk-757ZTGU5.js";
6
6
  import "./chunk-ZIXB33X7.js";
7
- import "./chunk-FZBWEDQI.js";
7
+ import "./chunk-ZSCNMFE6.js";
8
8
  import "./chunk-PGBF3UBX.js";
9
9
  export {
10
10
  SearchField,
@@ -6,7 +6,7 @@ import {
6
6
  } from "../chunk-5D7NMUF6.js";
7
7
  import {
8
8
  ShopSection
9
- } from "../chunk-M3T5RQYV.js";
9
+ } from "../chunk-SB5WSVPI.js";
10
10
  import {
11
11
  Page,
12
12
  cn
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-ZYHWJ7U5.js";
4
4
  import {
5
5
  ShopSection
6
- } from "../chunk-M3T5RQYV.js";
6
+ } from "../chunk-SB5WSVPI.js";
7
7
  import {
8
8
  cn
9
9
  } from "../chunk-B47WSPMP.js";
package/dist/shop/faq.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ShopSection
3
- } from "../chunk-M3T5RQYV.js";
3
+ } from "../chunk-SB5WSVPI.js";
4
4
  import "../chunk-B47WSPMP.js";
5
5
 
6
6
  // src/shop/faq/faq.tsx
@@ -6,7 +6,7 @@ import {
6
6
  } from "../chunk-ZYHWJ7U5.js";
7
7
  import {
8
8
  ShopSection
9
- } from "../chunk-M3T5RQYV.js";
9
+ } from "../chunk-SB5WSVPI.js";
10
10
  import {
11
11
  cn
12
12
  } from "../chunk-B47WSPMP.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shop/look/apply-look.ts","../../src/shop/look/mascots.tsx"],"sourcesContent":["// Pure. A look (`look-*` of @krizaka/tokens, akinaza#478) is applied to a shop page by rewriting the variants of the sections the\n// page already has — never their order, settings, blocks, text or photos. The closing call and the sticky bar are different jobs\n// from the strip of next times, so a look leaves them as they are.\nimport { shopPresets } from \"@krizaka/tokens/shop-presets\";\n\nimport { SECTION_DEFINITIONS } from \"../catalogue\";\nimport type { Section, ShopPage } from \"../schema\";\n\n/** What `applyLook` reads of a look: its id and version, and one variant per section type. */\nexport type ShopLookLike = { id: string; version: number; variants: Readonly<Record<string, string>> };\n\n/** The six looks, in the order of the addendum (Cahier first). */\nexport const SHOP_LOOKS = [\"look-cahier\", \"look-krizaka\", \"look-editorial\", \"look-boutique\", \"look-affiche\", \"look-nuit\"]\n .map((id) => shopPresets.find((p) => p.id === id))\n .filter((p): p is (typeof shopPresets)[number] => p !== undefined);\n\n/** A look by id, or undefined for a trade preset or an unknown id. */\nexport const shopLookOf = (id: string) => SHOP_LOOKS.find((p) => p.id === id);\n\n/** Booking variants a look rewrites: the strip of next times and the panel. `closing` and `sticky` keep their own job. */\nconst REWRITTEN_BOOKING = new Set([\"strip\", \"panel\"]);\n\nconst variantsOf = (type: string) => SECTION_DEFINITIONS.find((d) => d.type === type)?.variants as readonly string[] | undefined;\n\nfunction restyle(section: Section, look: ShopLookLike): Section {\n const variant = look.variants[section.type];\n if (!variant || variant === section.variant || !variantsOf(section.type)?.includes(variant)) return section;\n if (section.type === \"booking\" && !REWRITTEN_BOOKING.has(section.variant)) return section;\n return { ...section, variant } as Section;\n}\n\n/**\n * The page wearing a look: its preset reference, the look's own density and accent, and the variants of its sections. Everything\n * else is the owner's and stays: `applyLook(applyLook(p, a), b)` has the content of `p`.\n */\nexport function applyLook(page: ShopPage, look: ShopLookLike): ShopPage {\n const sections = page.sections.map((s) => restyle(s, look));\n const same = page.preset.id === look.id && page.preset.version === look.version && page.density === undefined && page.accent === undefined && sections.every((s, i) => s === page.sections[i]);\n if (same) return page;\n return { ...page, preset: { id: look.id, version: look.version }, density: undefined, accent: undefined, sections };\n}\n","// Server-safe. The Krizaka look's birds (akinaza#478): at most one per section, each one doing its job, never on the first\n// screen nor on the pictures. The host asks `mascotFor` and hands the result to the section's `mascot` slot.\nimport { Mascot, type MascotBird } from \"@krizaka/ui/mascots\";\nimport * as React from \"react\";\n\nimport type { Section } from \"../schema\";\n\n/** The section (and booking variant) that carries a bird, and which: the beaver builds the shop, the owl reads, the falcon watches, the crane listens, the flamingo answers, the pigeon delivers. */\nexport const MASCOT_SLOTS = {\n \"booking:strip\": \"beaver\",\n reviews: \"owl\",\n policies: \"falcon\",\n story: \"crane\",\n faq: \"flamingo\",\n \"booking:closing\": \"pigeon\",\n} as const satisfies Record<string, MascotBird>;\n\n/** The bird of a section under a look, or none: only a look with `mascots: \"on\"`; never the hero, the gallery, the wall or the TV. */\nexport function mascotFor(section: Pick<Section, \"type\" | \"variant\">, look: { mascots?: string } | undefined): MascotBird | undefined {\n if (look?.mascots !== \"on\") return undefined;\n const slots = MASCOT_SLOTS as Record<string, MascotBird>;\n return slots[`${section.type}:${section.variant}`] ?? (section.type === \"booking\" ? undefined : slots[section.type]);\n}\n\n/** The bird, small, in the brand's accent: decorative (`aria-hidden`), the words stay beside it. */\nexport function ShopMascot({ bird, size = 56 }: { bird: MascotBird; size?: number }) {\n return <Mascot bird={bird} tone=\"brand\" size={size} life aria-hidden />;\n}\n"],"mappings":";;;;;;AAGA,SAAS,mBAAmB;AASrB,IAAM,aAAa,CAAC,eAAe,gBAAgB,kBAAkB,iBAAiB,gBAAgB,WAAW,EACrH,IAAI,CAAC,OAAO,YAAY,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EAChD,OAAO,CAAC,MAAyC,MAAM,MAAS;AAG5D,IAAM,aAAa,CAAC,OAAe,WAAW,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE;AAG5E,IAAM,oBAAoB,oBAAI,IAAI,CAAC,SAAS,OAAO,CAAC;AAEpD,IAAM,aAAa,CAAC,SAAiB,oBAAoB,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI,GAAG;AAEvF,SAAS,QAAQ,SAAkB,MAA6B;AAC9D,QAAM,UAAU,KAAK,SAAS,QAAQ,IAAI;AAC1C,MAAI,CAAC,WAAW,YAAY,QAAQ,WAAW,CAAC,WAAW,QAAQ,IAAI,GAAG,SAAS,OAAO,EAAG,QAAO;AACpG,MAAI,QAAQ,SAAS,aAAa,CAAC,kBAAkB,IAAI,QAAQ,OAAO,EAAG,QAAO;AAClF,SAAO,EAAE,GAAG,SAAS,QAAQ;AAC/B;AAMO,SAAS,UAAU,MAAgB,MAA8B;AACtE,QAAM,WAAW,KAAK,SAAS,IAAI,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC;AAC1D,QAAM,OAAO,KAAK,OAAO,OAAO,KAAK,MAAM,KAAK,OAAO,YAAY,KAAK,WAAW,KAAK,YAAY,UAAa,KAAK,WAAW,UAAa,SAAS,MAAM,CAAC,GAAG,MAAM,MAAM,KAAK,SAAS,CAAC,CAAC;AAC7L,MAAI,KAAM,QAAO;AACjB,SAAO,EAAE,GAAG,MAAM,QAAQ,EAAE,IAAI,KAAK,IAAI,SAAS,KAAK,QAAQ,GAAG,SAAS,QAAW,QAAQ,QAAW,SAAS;AACpH;;;ACtCA,SAAS,cAA+B;AAwB/B;AAlBF,IAAM,eAAe;AAAA,EAC1B,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;AAAA,EACL,mBAAmB;AACrB;AAGO,SAAS,UAAU,SAA4C,MAAgE;AACpI,MAAI,MAAM,YAAY,KAAM,QAAO;AACnC,QAAM,QAAQ;AACd,SAAO,MAAM,GAAG,QAAQ,IAAI,IAAI,QAAQ,OAAO,EAAE,MAAM,QAAQ,SAAS,YAAY,SAAY,MAAM,QAAQ,IAAI;AACpH;AAGO,SAAS,WAAW,EAAE,MAAM,OAAO,GAAG,GAAwC;AACnF,SAAO,oBAAC,UAAO,MAAY,MAAK,SAAQ,MAAY,MAAI,MAAC,eAAW,MAAC;AACvE;","names":[]}
1
+ {"version":3,"sources":["../../src/shop/look/apply-look.ts","../../src/shop/look/mascots.tsx"],"sourcesContent":["// Pure. A look (`look-*` of @krizaka/tokens, folioviv#478) is applied to a shop page by rewriting the variants of the sections the\n// page already has — never their order, settings, blocks, text or photos. The closing call and the sticky bar are different jobs\n// from the strip of next times, so a look leaves them as they are.\nimport { shopPresets } from \"@krizaka/tokens/shop-presets\";\n\nimport { SECTION_DEFINITIONS } from \"../catalogue\";\nimport type { Section, ShopPage } from \"../schema\";\n\n/** What `applyLook` reads of a look: its id and version, and one variant per section type. */\nexport type ShopLookLike = { id: string; version: number; variants: Readonly<Record<string, string>> };\n\n/** The six looks, in the order of the addendum (Cahier first). */\nexport const SHOP_LOOKS = [\"look-cahier\", \"look-krizaka\", \"look-editorial\", \"look-boutique\", \"look-affiche\", \"look-nuit\"]\n .map((id) => shopPresets.find((p) => p.id === id))\n .filter((p): p is (typeof shopPresets)[number] => p !== undefined);\n\n/** A look by id, or undefined for a trade preset or an unknown id. */\nexport const shopLookOf = (id: string) => SHOP_LOOKS.find((p) => p.id === id);\n\n/** Booking variants a look rewrites: the strip of next times and the panel. `closing` and `sticky` keep their own job. */\nconst REWRITTEN_BOOKING = new Set([\"strip\", \"panel\"]);\n\nconst variantsOf = (type: string) => SECTION_DEFINITIONS.find((d) => d.type === type)?.variants as readonly string[] | undefined;\n\nfunction restyle(section: Section, look: ShopLookLike): Section {\n const variant = look.variants[section.type];\n if (!variant || variant === section.variant || !variantsOf(section.type)?.includes(variant)) return section;\n if (section.type === \"booking\" && !REWRITTEN_BOOKING.has(section.variant)) return section;\n return { ...section, variant } as Section;\n}\n\n/**\n * The page wearing a look: its preset reference, the look's own density and accent, and the variants of its sections. Everything\n * else is the owner's and stays: `applyLook(applyLook(p, a), b)` has the content of `p`.\n */\nexport function applyLook(page: ShopPage, look: ShopLookLike): ShopPage {\n const sections = page.sections.map((s) => restyle(s, look));\n const same = page.preset.id === look.id && page.preset.version === look.version && page.density === undefined && page.accent === undefined && sections.every((s, i) => s === page.sections[i]);\n if (same) return page;\n return { ...page, preset: { id: look.id, version: look.version }, density: undefined, accent: undefined, sections };\n}\n","// Server-safe. The Krizaka look's birds (folioviv#478): at most one per section, each one doing its job, never on the first\n// screen nor on the pictures. The host asks `mascotFor` and hands the result to the section's `mascot` slot.\nimport { Mascot, type MascotBird } from \"@krizaka/ui/mascots\";\nimport * as React from \"react\";\n\nimport type { Section } from \"../schema\";\n\n/** The section (and booking variant) that carries a bird, and which: the beaver builds the shop, the owl reads, the falcon watches, the crane listens, the flamingo answers, the pigeon delivers. */\nexport const MASCOT_SLOTS = {\n \"booking:strip\": \"beaver\",\n reviews: \"owl\",\n policies: \"falcon\",\n story: \"crane\",\n faq: \"flamingo\",\n \"booking:closing\": \"pigeon\",\n} as const satisfies Record<string, MascotBird>;\n\n/** The bird of a section under a look, or none: only a look with `mascots: \"on\"`; never the hero, the gallery, the wall or the TV. */\nexport function mascotFor(section: Pick<Section, \"type\" | \"variant\">, look: { mascots?: string } | undefined): MascotBird | undefined {\n if (look?.mascots !== \"on\") return undefined;\n const slots = MASCOT_SLOTS as Record<string, MascotBird>;\n return slots[`${section.type}:${section.variant}`] ?? (section.type === \"booking\" ? undefined : slots[section.type]);\n}\n\n/** The bird, small, in the brand's accent: decorative (`aria-hidden`), the words stay beside it. */\nexport function ShopMascot({ bird, size = 56 }: { bird: MascotBird; size?: number }) {\n return <Mascot bird={bird} tone=\"brand\" size={size} life aria-hidden />;\n}\n"],"mappings":";;;;;;AAGA,SAAS,mBAAmB;AASrB,IAAM,aAAa,CAAC,eAAe,gBAAgB,kBAAkB,iBAAiB,gBAAgB,WAAW,EACrH,IAAI,CAAC,OAAO,YAAY,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EAChD,OAAO,CAAC,MAAyC,MAAM,MAAS;AAG5D,IAAM,aAAa,CAAC,OAAe,WAAW,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE;AAG5E,IAAM,oBAAoB,oBAAI,IAAI,CAAC,SAAS,OAAO,CAAC;AAEpD,IAAM,aAAa,CAAC,SAAiB,oBAAoB,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI,GAAG;AAEvF,SAAS,QAAQ,SAAkB,MAA6B;AAC9D,QAAM,UAAU,KAAK,SAAS,QAAQ,IAAI;AAC1C,MAAI,CAAC,WAAW,YAAY,QAAQ,WAAW,CAAC,WAAW,QAAQ,IAAI,GAAG,SAAS,OAAO,EAAG,QAAO;AACpG,MAAI,QAAQ,SAAS,aAAa,CAAC,kBAAkB,IAAI,QAAQ,OAAO,EAAG,QAAO;AAClF,SAAO,EAAE,GAAG,SAAS,QAAQ;AAC/B;AAMO,SAAS,UAAU,MAAgB,MAA8B;AACtE,QAAM,WAAW,KAAK,SAAS,IAAI,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC;AAC1D,QAAM,OAAO,KAAK,OAAO,OAAO,KAAK,MAAM,KAAK,OAAO,YAAY,KAAK,WAAW,KAAK,YAAY,UAAa,KAAK,WAAW,UAAa,SAAS,MAAM,CAAC,GAAG,MAAM,MAAM,KAAK,SAAS,CAAC,CAAC;AAC7L,MAAI,KAAM,QAAO;AACjB,SAAO,EAAE,GAAG,MAAM,QAAQ,EAAE,IAAI,KAAK,IAAI,SAAS,KAAK,QAAQ,GAAG,SAAS,QAAW,QAAQ,QAAW,SAAS;AACpH;;;ACtCA,SAAS,cAA+B;AAwB/B;AAlBF,IAAM,eAAe;AAAA,EAC1B,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;AAAA,EACL,mBAAmB;AACrB;AAGO,SAAS,UAAU,SAA4C,MAAgE;AACpI,MAAI,MAAM,YAAY,KAAM,QAAO;AACnC,QAAM,QAAQ;AACd,SAAO,MAAM,GAAG,QAAQ,IAAI,IAAI,QAAQ,OAAO,EAAE,MAAM,QAAQ,SAAS,YAAY,SAAY,MAAM,QAAQ,IAAI;AACpH;AAGO,SAAS,WAAW,EAAE,MAAM,OAAO,GAAG,GAAwC;AACnF,SAAO,oBAAC,UAAO,MAAY,MAAK,SAAQ,MAAY,MAAI,MAAC,eAAW,MAAC;AACvE;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ShopSection
3
- } from "../chunk-M3T5RQYV.js";
3
+ } from "../chunk-SB5WSVPI.js";
4
4
  import "../chunk-B47WSPMP.js";
5
5
 
6
6
  // src/shop/policies/policies.tsx
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ShopSection
3
- } from "../chunk-M3T5RQYV.js";
3
+ } from "../chunk-SB5WSVPI.js";
4
4
  import "../chunk-B47WSPMP.js";
5
5
 
6
6
  // src/shop/reviews/reviews.tsx
@@ -9,7 +9,7 @@ import {
9
9
  } from "../chunk-ZYHWJ7U5.js";
10
10
  import {
11
11
  ShopSection
12
- } from "../chunk-M3T5RQYV.js";
12
+ } from "../chunk-SB5WSVPI.js";
13
13
  import {
14
14
  cn
15
15
  } from "../chunk-B47WSPMP.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ShopSection
3
- } from "../chunk-M3T5RQYV.js";
3
+ } from "../chunk-SB5WSVPI.js";
4
4
  import "../chunk-B47WSPMP.js";
5
5
 
6
6
  // src/shop/social/social.tsx
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ShopSection
3
- } from "../chunk-M3T5RQYV.js";
3
+ } from "../chunk-SB5WSVPI.js";
4
4
  import "../chunk-B47WSPMP.js";
5
5
 
6
6
  // src/shop/story/story.tsx
package/dist/shop/team.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ShopSection
3
- } from "../chunk-M3T5RQYV.js";
3
+ } from "../chunk-SB5WSVPI.js";
4
4
  import "../chunk-B47WSPMP.js";
5
5
 
6
6
  // src/shop/team/team.tsx
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-ZYHWJ7U5.js";
4
4
  import {
5
5
  ShopSection
6
- } from "../chunk-M3T5RQYV.js";
6
+ } from "../chunk-SB5WSVPI.js";
7
7
  import "../chunk-B47WSPMP.js";
8
8
 
9
9
  // src/shop/video/video.tsx
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ShopSection
3
- } from "../chunk-M3T5RQYV.js";
3
+ } from "../chunk-SB5WSVPI.js";
4
4
  import "../chunk-B47WSPMP.js";
5
5
 
6
6
  // src/shop/visit/visit.tsx
@@ -372,7 +372,7 @@ type ShopComposerMessages = {
372
372
  lookApplied: string;
373
373
  /** The accent within the chosen look. */
374
374
  accentChoice: string;
375
- /** The names of the accents a look lists (`krizaka`, `akinaza:accent-2`…); an unknown one reads as its id. */
375
+ /** The names of the accents a look lists (`krizaka`, `folioviv:accent-2`…); an unknown one reads as its id. */
376
376
  accentNames: Readonly<Record<string, string>>;
377
377
  preset: string;
378
378
  density: string;
@@ -394,7 +394,7 @@ var shopPageSchema = z4.object({
394
394
  preset: presetRef,
395
395
  /** Overrides the preset's density. */
396
396
  density: z4.optional(z4.enum(["compact", "airy"])),
397
- /** One of the accents the look lists as tested (`krizaka`, `akinaza:accent-2`…): the owner's choice within the look. */
397
+ /** One of the accents the look lists as tested (`krizaka`, `folioviv:accent-2`…): the owner's choice within the look. */
398
398
  accent: z4.optional(z4.string().check(z4.regex(/^[a-z]+(:accent-2)?$/, "an accent of the look"))),
399
399
  sections: z4.array(sectionUnion).check(z4.minLength(1), z4.maxLength(SHOP_LIMITS.sections))
400
400
  }).check(
@@ -566,7 +566,7 @@ var defaultShopComposerMessages = {
566
566
  lookChoice: "Look of the page",
567
567
  lookApplied: "Look: {name}",
568
568
  accentChoice: "Accent",
569
- accentNames: { krizaka: "Krizaka blue", akinaza: "Akinaza green", "akinaza:accent-2": "Copper", yomizaka: "Indigo", orazaka: "Orange" },
569
+ accentNames: { krizaka: "Krizaka blue", folioviv: "Folioviv green", "folioviv:accent-2": "Copper", verikora: "Indigo", sovkora: "Orange" },
570
570
  preset: "Style",
571
571
  density: "Spacing",
572
572
  densityCompact: "Compact",