@krizaka/ui 3.55.0 → 3.59.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 (576) hide show
  1. package/dist/{RotatingWord-D9s7FXFD.d.ts → RotatingWord-COSabR2c.d.ts} +2 -1
  2. package/dist/account-menu.d.ts +2 -1
  3. package/dist/account-settings.d.ts +153 -61
  4. package/dist/account-settings.js +240 -97
  5. package/dist/account-settings.js.map +1 -1
  6. package/dist/achievement.d.ts +2 -1
  7. package/dist/action-bar.d.ts +3 -2
  8. package/dist/activity-feed.d.ts +2 -1
  9. package/dist/agenda.d.ts +2 -1
  10. package/dist/alert.d.ts +2 -1
  11. package/dist/anatomy-plate.d.ts +2 -1
  12. package/dist/app-header/search.d.ts +8 -7
  13. package/dist/app-header.d.ts +2 -1
  14. package/dist/app-shell.d.ts +26 -25
  15. package/dist/argument-card.d.ts +3 -2
  16. package/dist/audio-player.d.ts +2 -1
  17. package/dist/auth-layout.d.ts +11 -10
  18. package/dist/avatar/defaults.d.ts +2 -1
  19. package/dist/avatar.d.ts +2 -1
  20. package/dist/badge.d.ts +2 -1
  21. package/dist/bird-plate.d.ts +4 -2
  22. package/dist/blocks.css +77 -4
  23. package/dist/button.d.ts +2 -1
  24. package/dist/captcha.d.ts +2 -1
  25. package/dist/captcha.js +1 -0
  26. package/dist/captcha.js.map +1 -1
  27. package/dist/card-grid.d.ts +2 -1
  28. package/dist/card.d.ts +2 -1
  29. package/dist/catalogue-page.d.ts +82 -2
  30. package/dist/catalogue-page.js +156 -13
  31. package/dist/catalogue-page.js.map +1 -1
  32. package/dist/changelog-page.d.ts +2 -1
  33. package/dist/chapter.d.ts +2 -1
  34. package/dist/chat.d.ts +14 -13
  35. package/dist/checkbox.d.ts +2 -1
  36. package/dist/chip-link.d.ts +2 -1
  37. package/dist/chip-row.d.ts +8 -7
  38. package/dist/chip.d.ts +55 -1
  39. package/dist/chip.js +10 -1
  40. package/dist/choice-grid.d.ts +3 -2
  41. package/dist/chunk-27AWSJTK.js +46 -0
  42. package/dist/chunk-27AWSJTK.js.map +1 -0
  43. package/dist/{chunk-AEP3K4YD.js → chunk-4GQH27IT.js} +2 -2
  44. package/dist/{chunk-QWKCNSPF.js → chunk-5LANVCK7.js} +125 -73
  45. package/dist/chunk-5LANVCK7.js.map +1 -0
  46. package/dist/{chunk-KDXRYUD3.js → chunk-5QEXOGO2.js} +3 -1
  47. package/dist/{chunk-KDXRYUD3.js.map → chunk-5QEXOGO2.js.map} +1 -1
  48. package/dist/chunk-7J2L4HOD.js +340 -0
  49. package/dist/chunk-7J2L4HOD.js.map +1 -0
  50. package/dist/{chunk-7U5TXA5Q.js → chunk-BQ4EOR2O.js} +74 -2
  51. package/dist/chunk-BQ4EOR2O.js.map +1 -0
  52. package/dist/chunk-F6JTHPHE.js +399 -0
  53. package/dist/chunk-F6JTHPHE.js.map +1 -0
  54. package/dist/chunk-OGWB76BR.js +90 -0
  55. package/dist/chunk-OGWB76BR.js.map +1 -0
  56. package/dist/{chunk-VIPSZXO4.js → chunk-UYGUSYIC.js} +72 -2
  57. package/dist/chunk-UYGUSYIC.js.map +1 -0
  58. package/dist/chunk-WOZP3JLW.js +51 -0
  59. package/dist/chunk-WOZP3JLW.js.map +1 -0
  60. package/dist/chunk-XVXFMVG3.js +27 -0
  61. package/dist/chunk-XVXFMVG3.js.map +1 -0
  62. package/dist/code-block.d.ts +2 -1
  63. package/dist/combobox.d.ts +20 -19
  64. package/dist/combobox.js +3 -2
  65. package/dist/command.d.ts +21 -20
  66. package/dist/comparison-table.d.ts +2 -1
  67. package/dist/component-page.d.ts +2 -1
  68. package/dist/confirm-button.d.ts +2 -1
  69. package/dist/contact-page.d.ts +2 -1
  70. package/dist/continue-prompt.d.ts +2 -1
  71. package/dist/countdown.d.ts +2 -1
  72. package/dist/cover-hero.d.ts +20 -19
  73. package/dist/cover-hero.js +25 -42
  74. package/dist/cover-hero.js.map +1 -1
  75. package/dist/cta-panel.d.ts +2 -1
  76. package/dist/dashboard-layout.d.ts +50 -2
  77. package/dist/dashboard-layout.js +66 -11
  78. package/dist/dashboard-layout.js.map +1 -1
  79. package/dist/data-table.d.ts +45 -2
  80. package/dist/data-table.js +7 -3
  81. package/dist/date-picker.d.ts +29 -28
  82. package/dist/decision-list.d.ts +2 -1
  83. package/dist/description-list.d.ts +2 -1
  84. package/dist/detail-layout.d.ts +153 -20
  85. package/dist/detail-layout.js +73 -4
  86. package/dist/detail-layout.js.map +1 -1
  87. package/dist/{dialog-D42QwYb_.d.ts → dialog-DpUwec2g.d.ts} +2 -1
  88. package/dist/dialog.d.ts +3 -2
  89. package/dist/docs-article-page.d.ts +2 -1
  90. package/dist/docs-hub-page.d.ts +2 -1
  91. package/dist/docs-layout.d.ts +2 -1
  92. package/dist/docs-nav.d.ts +3 -10
  93. package/dist/document-viewer.d.ts +5 -4
  94. package/dist/doodle.d.ts +17 -6
  95. package/dist/doodle.js +40 -9
  96. package/dist/doodle.js.map +1 -1
  97. package/dist/drop-overlay.d.ts +2 -1
  98. package/dist/dropdown-menu.d.ts +2 -1
  99. package/dist/dropdown-menu.js +13 -74
  100. package/dist/dropdown-menu.js.map +1 -1
  101. package/dist/elephant.d.ts +2 -1
  102. package/dist/empty-state.d.ts +2 -1
  103. package/dist/engine-flow.d.ts +2 -1
  104. package/dist/error-page.d.ts +2 -1
  105. package/dist/file-upload.d.ts +14 -13
  106. package/dist/filter-bar.d.ts +84 -11
  107. package/dist/filter-bar.js +6 -2
  108. package/dist/flock.d.ts +3 -2
  109. package/dist/footnote.d.ts +2 -1
  110. package/dist/force-update-screen.d.ts +8 -7
  111. package/dist/form/server.d.ts +2 -1
  112. package/dist/form.d.ts +2 -1
  113. package/dist/gallery-page.d.ts +2 -1
  114. package/dist/genui.d.ts +2 -1
  115. package/dist/genui.js +3 -3
  116. package/dist/{geometry-DX-W-Yyf.d.ts → geometry-DZ4Q3hDQ.d.ts} +2 -1
  117. package/dist/glossary-term.d.ts +2 -1
  118. package/dist/glossary.d.ts +2 -1
  119. package/dist/glow-card.d.ts +2 -1
  120. package/dist/goal-gauge.d.ts +2 -1
  121. package/dist/grade-stamp.d.ts +23 -0
  122. package/dist/grade-stamp.js +42 -0
  123. package/dist/grade-stamp.js.map +1 -0
  124. package/dist/how-it-works-page.d.ts +2 -1
  125. package/dist/image-cropper.d.ts +5 -4
  126. package/dist/index.d.ts +3 -2
  127. package/dist/index.js +4 -4
  128. package/dist/iso.d.ts +2 -1
  129. package/dist/kanban.d.ts +2 -1
  130. package/dist/kbd.d.ts +2 -1
  131. package/dist/kind-config-editor.d.ts +152 -0
  132. package/dist/kind-config-editor.js +574 -0
  133. package/dist/kind-config-editor.js.map +1 -0
  134. package/dist/kpi-explained.d.ts +2 -1
  135. package/dist/landing-page.d.ts +2 -1
  136. package/dist/landscape.d.ts +2 -1
  137. package/dist/language-switch/server.d.ts +2 -1
  138. package/dist/language-switch.d.ts +11 -10
  139. package/dist/legal-page.d.ts +2 -1
  140. package/dist/link-card.d.ts +2 -1
  141. package/dist/list.d.ts +2 -1
  142. package/dist/loader.d.ts +2 -1
  143. package/dist/longform-page.d.ts +2 -1
  144. package/dist/maintenance-screen.d.ts +5 -4
  145. package/dist/map.d.ts +8 -7
  146. package/dist/map.js +24 -0
  147. package/dist/map.js.map +1 -1
  148. package/dist/markdown.d.ts +2 -1
  149. package/dist/marketing-layout.d.ts +5 -4
  150. package/dist/marquee.d.ts +2 -1
  151. package/dist/mascot-quote.d.ts +2 -1
  152. package/dist/mascot-state.d.ts +3 -2
  153. package/dist/mascots.d.ts +4 -3
  154. package/dist/match-dialog.d.ts +2 -1
  155. package/dist/media-capture.d.ts +5 -4
  156. package/dist/media-gallery.d.ts +2 -1
  157. package/dist/media-grid.d.ts +3 -10
  158. package/dist/meta-row.d.ts +2 -1
  159. package/dist/meter.d.ts +2 -1
  160. package/dist/motion.d.ts +3 -2
  161. package/dist/native/form.d.ts +2 -1
  162. package/dist/native/list.d.ts +2 -1
  163. package/dist/native/map.d.ts +2 -1
  164. package/dist/native/map.js +24 -0
  165. package/dist/native/map.js.map +1 -1
  166. package/dist/native/markdown.d.ts +2 -1
  167. package/dist/native/media-capture.d.ts +2 -1
  168. package/dist/native/media-picker.d.ts +2 -1
  169. package/dist/native/vertical-video.d.ts +2 -1
  170. package/dist/native/video-player.d.ts +2 -1
  171. package/dist/native.d.ts +230 -1
  172. package/dist/native.js +1465 -965
  173. package/dist/native.js.map +1 -1
  174. package/dist/nav-bar/me.d.ts +2 -1
  175. package/dist/nav-bar.d.ts +2 -1
  176. package/dist/next-actions.d.ts +2 -1
  177. package/dist/notification-preferences.d.ts +23 -22
  178. package/dist/notification-preferences.js +4 -3
  179. package/dist/notification-preferences.js.map +1 -1
  180. package/dist/number-ticker.d.ts +2 -1
  181. package/dist/opening-hours.d.ts +2 -1
  182. package/dist/page-header.d.ts +2 -1
  183. package/dist/page-hero.d.ts +2 -1
  184. package/dist/page-index.d.ts +2 -1
  185. package/dist/page.d.ts +2 -1
  186. package/dist/pagination.d.ts +2 -1
  187. package/dist/photo-grid.d.ts +2 -1
  188. package/dist/pointer-light.d.ts +2 -1
  189. package/dist/popover.d.ts +2 -1
  190. package/dist/pricing-page.d.ts +2 -1
  191. package/dist/product-page.d.ts +2 -1
  192. package/dist/profile-card.d.ts +2 -1
  193. package/dist/progress.d.ts +2 -1
  194. package/dist/promise-card.d.ts +2 -1
  195. package/dist/quota-meter.d.ts +2 -1
  196. package/dist/radio-group.d.ts +2 -1
  197. package/dist/radio-group.js +3 -3
  198. package/dist/rail-nav.d.ts +17 -16
  199. package/dist/rail-nav.js +22 -56
  200. package/dist/rail-nav.js.map +1 -1
  201. package/dist/recipes.d.ts +2 -1
  202. package/dist/retro-tv.d.ts +2 -1
  203. package/dist/router.d.ts +2 -1
  204. package/dist/scroll-stage.d.ts +2 -1
  205. package/dist/search-field.d.ts +2 -1
  206. package/dist/section-backdrop.d.ts +2 -1
  207. package/dist/separator.d.ts +2 -1
  208. package/dist/service-card.d.ts +9 -8
  209. package/dist/settings-layout.d.ts +2 -1
  210. package/dist/settings-layout.js +10 -324
  211. package/dist/settings-layout.js.map +1 -1
  212. package/dist/showcase.d.ts +2 -1
  213. package/dist/signature.d.ts +2 -1
  214. package/dist/site-cahier.d.ts +187 -0
  215. package/dist/site-cahier.js +844 -0
  216. package/dist/site-cahier.js.map +1 -0
  217. package/dist/site-footer.d.ts +2 -1
  218. package/dist/sites.d.ts +2 -1
  219. package/dist/skeleton.d.ts +2 -1
  220. package/dist/skip-link.d.ts +2 -1
  221. package/dist/slider.d.ts +2 -1
  222. package/dist/slot-picker.d.ts +86 -13
  223. package/dist/slot-picker.js +98 -16
  224. package/dist/slot-picker.js.map +1 -1
  225. package/dist/specimen-tag.d.ts +2 -1
  226. package/dist/speed-lines.d.ts +19 -0
  227. package/dist/speed-lines.js +45 -0
  228. package/dist/speed-lines.js.map +1 -0
  229. package/dist/spinner.d.ts +2 -1
  230. package/dist/split-view.d.ts +2 -1
  231. package/dist/stage-banner.d.ts +2 -1
  232. package/dist/stat.d.ts +2 -1
  233. package/dist/status-chip.d.ts +44 -0
  234. package/dist/status-chip.js +137 -0
  235. package/dist/status-chip.js.map +1 -0
  236. package/dist/status-page.d.ts +2 -1
  237. package/dist/step-progress.d.ts +2 -1
  238. package/dist/step-showcase.d.ts +2 -1
  239. package/dist/stepper.d.ts +2 -1
  240. package/dist/sticky-action.d.ts +28 -5
  241. package/dist/sticky-action.js +10 -4
  242. package/dist/sticky-action.js.map +1 -1
  243. package/dist/stuck.d.ts +2 -1
  244. package/dist/swipe-deck.d.ts +2 -1
  245. package/dist/switch.d.ts +2 -1
  246. package/dist/tabs.d.ts +2 -1
  247. package/dist/tag-input.d.ts +2 -1
  248. package/dist/tag-input.js +3 -2
  249. package/dist/tag-input.js.map +1 -1
  250. package/dist/tag-selector.d.ts +30 -4
  251. package/dist/tag-selector.js +90 -8
  252. package/dist/tag-selector.js.map +1 -1
  253. package/dist/taped-photo.d.ts +2 -1
  254. package/dist/taped-photo.js +3 -20
  255. package/dist/taped-photo.js.map +1 -1
  256. package/dist/terminal-replay.d.ts +2 -1
  257. package/dist/terminal-replay.js +1 -1
  258. package/dist/text-style/server.d.ts +2 -1
  259. package/dist/text-style.d.ts +2 -1
  260. package/dist/theme.d.ts +21 -1
  261. package/dist/theme.js +37 -1
  262. package/dist/theme.js.map +1 -1
  263. package/dist/toast.d.ts +2 -1
  264. package/dist/toc.d.ts +2 -1
  265. package/dist/tooltip.d.ts +2 -1
  266. package/dist/tree-view.d.ts +2 -1
  267. package/dist/update-prompt.d.ts +11 -10
  268. package/dist/upload-queue.d.ts +2 -1
  269. package/dist/verified-badge.d.ts +2 -1
  270. package/dist/versus-card.d.ts +40 -0
  271. package/dist/versus-card.js +40 -0
  272. package/dist/versus-card.js.map +1 -0
  273. package/dist/vertical-video.d.ts +2 -1
  274. package/dist/video-player.d.ts +20 -19
  275. package/dist/video-trimmer.d.ts +2 -1
  276. package/dist/virtual.d.ts +8 -7
  277. package/dist/waveform.d.ts +2 -1
  278. package/package.json +124 -39
  279. package/registry/account-menu.json +1 -1
  280. package/registry/account-settings.json +257 -5
  281. package/registry/achievement.json +1 -1
  282. package/registry/action-bar.json +1 -1
  283. package/registry/activity-feed.json +1 -1
  284. package/registry/agenda.json +1 -1
  285. package/registry/alert.json +1 -1
  286. package/registry/anatomy-plate.json +1 -1
  287. package/registry/app-header.json +1 -1
  288. package/registry/app-shell.json +1 -1
  289. package/registry/argument-card.json +1 -1
  290. package/registry/audio-player.json +1 -1
  291. package/registry/auth-layout.json +1 -1
  292. package/registry/avatar.json +1 -1
  293. package/registry/badge.json +1 -1
  294. package/registry/bird-plate.json +1 -1
  295. package/registry/button.json +1 -1
  296. package/registry/captcha.json +1 -1
  297. package/registry/card-grid.json +1 -1
  298. package/registry/card.json +1 -1
  299. package/registry/catalogue-page.json +116 -6
  300. package/registry/changelog-page.json +1 -1
  301. package/registry/chapter.json +1 -1
  302. package/registry/chat.json +1 -1
  303. package/registry/checkbox.json +1 -1
  304. package/registry/chip-link.json +1 -1
  305. package/registry/chip-row.json +1 -1
  306. package/registry/chip.json +386 -11
  307. package/registry/choice-grid.json +1 -1
  308. package/registry/code-block.json +1 -1
  309. package/registry/combobox.json +1 -1
  310. package/registry/command.json +1 -1
  311. package/registry/comparison-table.json +1 -1
  312. package/registry/component-page.json +1 -1
  313. package/registry/confirm-button.json +1 -1
  314. package/registry/contact-page.json +1 -1
  315. package/registry/continue-prompt.json +1 -1
  316. package/registry/countdown.json +1 -1
  317. package/registry/cover-hero.json +1 -1
  318. package/registry/cta-panel.json +1 -1
  319. package/registry/dashboard-layout.json +91 -5
  320. package/registry/data-table.json +156 -5
  321. package/registry/date-picker.json +1 -1
  322. package/registry/decision-list.json +1 -1
  323. package/registry/description-list.json +1 -1
  324. package/registry/detail-layout.json +199 -5
  325. package/registry/dialog.json +1 -1
  326. package/registry/docs-article-page.json +1 -1
  327. package/registry/docs-hub-page.json +1 -1
  328. package/registry/docs-layout.json +1 -1
  329. package/registry/docs-nav.json +1 -1
  330. package/registry/document-viewer.json +1 -1
  331. package/registry/doodle.json +115 -22
  332. package/registry/drop-overlay.json +1 -1
  333. package/registry/dropdown-menu.json +1 -1
  334. package/registry/elephant.json +2 -2
  335. package/registry/empty-state.json +1 -1
  336. package/registry/engine-flow.json +1 -1
  337. package/registry/error-page.json +1 -1
  338. package/registry/examples/account-settings/appearance.d.ts +4 -0
  339. package/registry/examples/account-settings/appearance.js +40 -0
  340. package/registry/examples/account-settings/appearance.tsx +30 -0
  341. package/registry/examples/catalogue-page/clients.d.ts +4 -0
  342. package/registry/examples/catalogue-page/clients.js +49 -0
  343. package/registry/examples/catalogue-page/clients.tsx +61 -0
  344. package/registry/examples/chip/marker-picker.d.ts +4 -0
  345. package/registry/examples/chip/marker-picker.js +17 -0
  346. package/registry/examples/chip/marker-picker.tsx +17 -0
  347. package/registry/examples/chip/native/marker-picker.d.ts +4 -0
  348. package/registry/examples/chip/native/marker-picker.dark.png +0 -0
  349. package/registry/examples/chip/native/marker-picker.js +18 -0
  350. package/registry/examples/chip/native/marker-picker.light.png +0 -0
  351. package/registry/examples/chip/native/marker-picker.tsx +16 -0
  352. package/registry/examples/chip/native/tags.d.ts +4 -0
  353. package/registry/examples/chip/native/tags.dark.png +0 -0
  354. package/registry/examples/chip/native/tags.js +22 -0
  355. package/registry/examples/chip/native/tags.light.png +0 -0
  356. package/registry/examples/chip/native/tags.tsx +20 -0
  357. package/registry/examples/chip/tags.d.ts +4 -0
  358. package/registry/examples/chip/tags.js +26 -0
  359. package/registry/examples/chip/tags.tsx +23 -0
  360. package/registry/examples/dashboard-layout/today.d.ts +4 -0
  361. package/registry/examples/dashboard-layout/today.js +54 -0
  362. package/registry/examples/dashboard-layout/today.tsx +63 -0
  363. package/registry/examples/data-table/bulk.d.ts +4 -0
  364. package/registry/examples/data-table/bulk.js +45 -0
  365. package/registry/examples/data-table/bulk.tsx +34 -0
  366. package/registry/examples/detail-layout/client.d.ts +4 -0
  367. package/registry/examples/detail-layout/client.js +40 -0
  368. package/registry/examples/detail-layout/client.tsx +39 -0
  369. package/registry/examples/detail-layout/new-invoice.d.ts +4 -0
  370. package/registry/examples/detail-layout/new-invoice.js +44 -0
  371. package/registry/examples/detail-layout/new-invoice.tsx +34 -0
  372. package/registry/examples/doodle/bird-sketch.d.ts +4 -0
  373. package/registry/examples/doodle/bird-sketch.js +11 -0
  374. package/registry/examples/doodle/bird-sketch.tsx +12 -0
  375. package/registry/examples/doodle/margin-marks.d.ts +4 -0
  376. package/registry/examples/doodle/margin-marks.js +27 -0
  377. package/registry/examples/doodle/margin-marks.tsx +19 -0
  378. package/registry/examples/filter-bar/views.d.ts +4 -0
  379. package/registry/examples/filter-bar/views.js +39 -0
  380. package/registry/examples/filter-bar/views.tsx +30 -0
  381. package/registry/examples/grade-stamp/coverage.d.ts +4 -0
  382. package/registry/examples/grade-stamp/coverage.js +12 -0
  383. package/registry/examples/grade-stamp/coverage.tsx +8 -0
  384. package/registry/examples/grade-stamp/lighthouse.d.ts +4 -0
  385. package/registry/examples/grade-stamp/lighthouse.js +12 -0
  386. package/registry/examples/grade-stamp/lighthouse.tsx +14 -0
  387. package/registry/examples/kind-config-editor/derived.d.ts +4 -0
  388. package/registry/examples/kind-config-editor/derived.js +26 -0
  389. package/registry/examples/kind-config-editor/derived.tsx +16 -0
  390. package/registry/examples/kind-config-editor/native/status-set.d.ts +4 -0
  391. package/registry/examples/kind-config-editor/native/status-set.dark.png +0 -0
  392. package/registry/examples/kind-config-editor/native/status-set.js +22 -0
  393. package/registry/examples/kind-config-editor/native/status-set.light.png +0 -0
  394. package/registry/examples/kind-config-editor/native/status-set.tsx +19 -0
  395. package/registry/examples/kind-config-editor/native/tag-set.d.ts +4 -0
  396. package/registry/examples/kind-config-editor/native/tag-set.dark.png +0 -0
  397. package/registry/examples/kind-config-editor/native/tag-set.js +20 -0
  398. package/registry/examples/kind-config-editor/native/tag-set.light.png +0 -0
  399. package/registry/examples/kind-config-editor/native/tag-set.tsx +18 -0
  400. package/registry/examples/kind-config-editor/status-set.d.ts +4 -0
  401. package/registry/examples/kind-config-editor/status-set.js +29 -0
  402. package/registry/examples/kind-config-editor/status-set.tsx +25 -0
  403. package/registry/examples/kind-config-editor/tag-set.d.ts +4 -0
  404. package/registry/examples/kind-config-editor/tag-set.js +20 -0
  405. package/registry/examples/kind-config-editor/tag-set.tsx +18 -0
  406. package/registry/examples/site-cahier/java-releases.d.ts +4 -0
  407. package/registry/examples/site-cahier/java-releases.js +33 -0
  408. package/registry/examples/site-cahier/java-releases.tsx +32 -0
  409. package/registry/examples/site-cahier/motion-lab.d.ts +4 -0
  410. package/registry/examples/site-cahier/motion-lab.js +32 -0
  411. package/registry/examples/site-cahier/motion-lab.tsx +29 -0
  412. package/registry/examples/site-cahier/ts-changelog.d.ts +4 -0
  413. package/registry/examples/site-cahier/ts-changelog.js +24 -0
  414. package/registry/examples/site-cahier/ts-changelog.tsx +20 -0
  415. package/registry/examples/site-cahier/ts-doc.d.ts +4 -0
  416. package/registry/examples/site-cahier/ts-doc.js +38 -0
  417. package/registry/examples/site-cahier/ts-doc.tsx +27 -0
  418. package/registry/examples/site-cahier/ui-home.d.ts +4 -0
  419. package/registry/examples/site-cahier/ui-home.js +46 -0
  420. package/registry/examples/site-cahier/ui-home.tsx +40 -0
  421. package/registry/examples/slot-picker/weeks.d.ts +4 -0
  422. package/registry/examples/slot-picker/weeks.js +45 -0
  423. package/registry/examples/slot-picker/weeks.tsx +28 -0
  424. package/registry/examples/speed-lines/hero.d.ts +4 -0
  425. package/registry/examples/speed-lines/hero.js +11 -0
  426. package/registry/examples/speed-lines/hero.tsx +12 -0
  427. package/registry/examples/speed-lines/streaks.d.ts +4 -0
  428. package/registry/examples/speed-lines/streaks.js +11 -0
  429. package/registry/examples/speed-lines/streaks.tsx +12 -0
  430. package/registry/examples/status-chip/default.d.ts +4 -0
  431. package/registry/examples/status-chip/default.js +35 -0
  432. package/registry/examples/status-chip/default.tsx +32 -0
  433. package/registry/examples/status-chip/native/default.d.ts +4 -0
  434. package/registry/examples/status-chip/native/default.dark.png +0 -0
  435. package/registry/examples/status-chip/native/default.js +26 -0
  436. package/registry/examples/status-chip/native/default.light.png +0 -0
  437. package/registry/examples/status-chip/native/default.tsx +20 -0
  438. package/registry/examples/tag-selector/creatable.d.ts +4 -0
  439. package/registry/examples/tag-selector/creatable.js +41 -0
  440. package/registry/examples/tag-selector/creatable.tsx +29 -0
  441. package/registry/examples/tag-selector/native/tags.d.ts +4 -0
  442. package/registry/examples/tag-selector/native/tags.dark.png +0 -0
  443. package/registry/examples/tag-selector/native/tags.js +19 -0
  444. package/registry/examples/tag-selector/native/tags.light.png +0 -0
  445. package/registry/examples/tag-selector/native/tags.tsx +19 -0
  446. package/registry/examples/versus-card/alternatives.d.ts +4 -0
  447. package/registry/examples/versus-card/alternatives.js +20 -0
  448. package/registry/examples/versus-card/alternatives.tsx +14 -0
  449. package/registry/examples/versus-card/releases.d.ts +4 -0
  450. package/registry/examples/versus-card/releases.js +35 -0
  451. package/registry/examples/versus-card/releases.tsx +29 -0
  452. package/registry/field.json +1 -1
  453. package/registry/file-upload.json +1 -1
  454. package/registry/filter-bar.json +208 -8
  455. package/registry/flock.json +1 -1
  456. package/registry/footnote.json +1 -1
  457. package/registry/force-update-screen.json +1 -1
  458. package/registry/form.json +1 -1
  459. package/registry/gallery-page.json +1 -1
  460. package/registry/genui.json +1 -1
  461. package/registry/glossary-term.json +1 -1
  462. package/registry/glossary.json +1 -1
  463. package/registry/glow-card.json +1 -1
  464. package/registry/goal-gauge.json +1 -1
  465. package/registry/grade-stamp.json +227 -0
  466. package/registry/how-it-works-page.json +1 -1
  467. package/registry/image-cropper.json +1 -1
  468. package/registry/index.json +323 -30
  469. package/registry/iso.json +1 -1
  470. package/registry/kanban.json +1 -1
  471. package/registry/kbd.json +1 -1
  472. package/registry/kind-config-editor.json +565 -0
  473. package/registry/kpi-explained.json +1 -1
  474. package/registry/landing-page.json +1 -1
  475. package/registry/landscape.json +1 -1
  476. package/registry/language-switch.json +1 -1
  477. package/registry/legal-page.json +1 -1
  478. package/registry/link-card.json +1 -1
  479. package/registry/list.json +1 -1
  480. package/registry/loader.json +1 -1
  481. package/registry/longform-page.json +1 -1
  482. package/registry/maintenance-screen.json +1 -1
  483. package/registry/map.json +2 -2
  484. package/registry/markdown.json +1 -1
  485. package/registry/marketing-layout.json +1 -1
  486. package/registry/marquee.json +1 -1
  487. package/registry/mascot-quote.json +1 -1
  488. package/registry/mascot-state.json +1 -1
  489. package/registry/mascots.json +1 -1
  490. package/registry/match-dialog.json +1 -1
  491. package/registry/media-capture.json +1 -1
  492. package/registry/media-gallery.json +1 -1
  493. package/registry/media-grid.json +1 -1
  494. package/registry/meta-row.json +1 -1
  495. package/registry/meter.json +1 -1
  496. package/registry/nav-bar.json +2 -2
  497. package/registry/next-actions.json +1 -1
  498. package/registry/notification-preferences.json +1 -1
  499. package/registry/number-ticker.json +1 -1
  500. package/registry/opening-hours.json +1 -1
  501. package/registry/page-header.json +1 -1
  502. package/registry/page-hero.json +1 -1
  503. package/registry/page-index.json +1 -1
  504. package/registry/page.json +1 -1
  505. package/registry/pagination.json +1 -1
  506. package/registry/photo-grid.json +1 -1
  507. package/registry/pointer-light.json +1 -1
  508. package/registry/popover.json +1 -1
  509. package/registry/pricing-page.json +1 -1
  510. package/registry/product-page.json +1 -1
  511. package/registry/profile-card.json +1 -1
  512. package/registry/progress.json +1 -1
  513. package/registry/promise-card.json +1 -1
  514. package/registry/quota-meter.json +1 -1
  515. package/registry/radio-group.json +1 -1
  516. package/registry/rail-nav.json +2 -2
  517. package/registry/recipes.json +1 -1
  518. package/registry/retro-tv.json +1 -1
  519. package/registry/router.json +1 -1
  520. package/registry/scroll-stage.json +1 -1
  521. package/registry/search-field.json +1 -1
  522. package/registry/section-backdrop.json +1 -1
  523. package/registry/separator.json +1 -1
  524. package/registry/service-card.json +1 -1
  525. package/registry/settings-layout.json +1 -1
  526. package/registry/showcase.json +1 -1
  527. package/registry/signature.json +1 -1
  528. package/registry/site-cahier.json +548 -0
  529. package/registry/site-footer.json +2 -2
  530. package/registry/sites.json +1 -1
  531. package/registry/skeleton.json +1 -1
  532. package/registry/skip-link.json +1 -1
  533. package/registry/slider.json +1 -1
  534. package/registry/slot-picker.json +156 -10
  535. package/registry/slot.json +1 -1
  536. package/registry/specimen-tag.json +1 -1
  537. package/registry/speed-lines.json +174 -0
  538. package/registry/spinner.json +1 -1
  539. package/registry/split-view.json +1 -1
  540. package/registry/stage-banner.json +1 -1
  541. package/registry/stat.json +1 -1
  542. package/registry/status-chip.json +350 -0
  543. package/registry/status-page.json +1 -1
  544. package/registry/step-progress.json +1 -1
  545. package/registry/step-showcase.json +1 -1
  546. package/registry/stepper.json +1 -1
  547. package/registry/sticky-action.json +38 -8
  548. package/registry/stuck.json +1 -1
  549. package/registry/swipe-deck.json +1 -1
  550. package/registry/switch.json +1 -1
  551. package/registry/tabs.json +1 -1
  552. package/registry/tag-input.json +1 -1
  553. package/registry/tag-selector.json +189 -12
  554. package/registry/taped-photo.json +1 -1
  555. package/registry/terminal-replay.json +1 -1
  556. package/registry/text-style.json +1 -1
  557. package/registry/theme.json +3 -3
  558. package/registry/toast.json +1 -1
  559. package/registry/toc.json +1 -1
  560. package/registry/tooltip.json +1 -1
  561. package/registry/tree-view.json +1 -1
  562. package/registry/update-prompt.json +1 -1
  563. package/registry/upload-queue.json +1 -1
  564. package/registry/verified-badge.json +1 -1
  565. package/registry/versus-card.json +194 -0
  566. package/registry/vertical-video.json +1 -1
  567. package/registry/video-player.json +1 -1
  568. package/registry/video-trimmer.json +1 -1
  569. package/registry/virtual.json +2 -2
  570. package/registry/waveform.json +1 -1
  571. package/dist/chunk-7U5TXA5Q.js.map +0 -1
  572. package/dist/chunk-OIMXKRXF.js +0 -179
  573. package/dist/chunk-OIMXKRXF.js.map +0 -1
  574. package/dist/chunk-QWKCNSPF.js.map +0 -1
  575. package/dist/chunk-VIPSZXO4.js.map +0 -1
  576. /package/dist/{chunk-AEP3K4YD.js.map → chunk-4GQH27IT.js.map} +0 -0
@@ -6,7 +6,7 @@ import {
6
6
  // src/slot-picker/slot-picker.tsx
7
7
  import * as React from "react";
8
8
  import { tv } from "tailwind-variants";
9
- import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
10
  var slotPicker = tv({
11
11
  slots: {
12
12
  root: "flex min-w-0 flex-col gap-3",
@@ -15,28 +15,110 @@ var slotPicker = tv({
15
15
  dayName: "text-xs font-bold",
16
16
  daySub: "text-[11px] tabular-nums text-fg-muted",
17
17
  times: "m-0 flex list-none flex-wrap gap-2 p-0",
18
- time: "inline-flex min-h-11 min-w-[4.75rem] items-center justify-center gap-1.5 rounded-sm border border-border-default bg-surface-1 px-4 text-sm font-semibold tabular-nums text-fg no-underline transition-colors hover:border-accent/60 hover:bg-accent-soft focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-pressed:border-accent aria-pressed:bg-accent aria-pressed:text-on-accent disabled:cursor-not-allowed disabled:opacity-50",
18
+ time: "inline-flex min-h-11 min-w-[4.75rem] items-center justify-center gap-1.5 rounded-sm border border-border-default bg-surface-1 px-4 text-sm font-semibold tabular-nums text-fg no-underline transition-colors hover:border-accent/60 hover:bg-accent-soft focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-pressed:border-accent aria-pressed:bg-accent aria-pressed:text-on-accent disabled:cursor-not-allowed disabled:border-dashed disabled:bg-transparent disabled:text-fg-muted disabled:line-through disabled:hover:border-border-default disabled:hover:bg-transparent",
19
19
  note: "text-[11px] font-medium text-fg-secondary group-aria-pressed:text-on-accent",
20
+ weekBar: "flex flex-wrap items-center justify-between gap-2",
21
+ weekLabel: "m-0 min-w-0 text-sm font-semibold tabular-nums text-fg",
22
+ weekNav: "flex items-center gap-1.5",
23
+ weekBtn: "inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center rounded-sm border border-border-default bg-surface-1 px-3 text-sm font-semibold text-fg no-underline transition-colors hover:border-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-disabled:cursor-not-allowed aria-disabled:opacity-50",
24
+ groups: "m-0 flex list-none flex-col gap-3 p-0",
25
+ groupLabel: "m-0 mb-1.5 text-xs font-bold text-fg-secondary",
26
+ footer: "m-0 text-xs text-fg-secondary",
20
27
  empty: "m-0 rounded-xl border border-dashed border-border-default px-4 py-6 text-center text-sm text-fg-secondary"
21
28
  }
22
29
  });
23
30
  var s = slotPicker();
24
- function SlotPicker({ days, label, emptyLabel, value, onValueChange, defaultDay, linkAs, className, ...props }) {
31
+ var addDays = (iso, days) => {
32
+ const d = /* @__PURE__ */ new Date(`${iso}T00:00:00Z`);
33
+ d.setUTCDate(d.getUTCDate() + days);
34
+ return d.toISOString().slice(0, 10);
35
+ };
36
+ var focusables = (root) => [...root?.querySelectorAll("button:not(:disabled), a[href]") ?? []];
37
+ function moveFocus(e, keys) {
38
+ const dir = keys.prev.includes(e.key) ? -1 : keys.next.includes(e.key) ? 1 : 0;
39
+ if (!dir) return;
40
+ const items = focusables(e.currentTarget);
41
+ const at = items.indexOf(document.activeElement);
42
+ if (at < 0) return;
43
+ e.preventDefault();
44
+ items[(at + dir + items.length) % items.length]?.focus();
45
+ }
46
+ function SlotPicker({
47
+ days,
48
+ label,
49
+ emptyLabel,
50
+ value,
51
+ onValueChange,
52
+ defaultDay,
53
+ linkAs,
54
+ week,
55
+ onWeekChange,
56
+ minWeek,
57
+ maxWeek,
58
+ todayWeek,
59
+ weekLabel,
60
+ weekButtons,
61
+ weekHref,
62
+ footer,
63
+ className,
64
+ ...props
65
+ }) {
25
66
  const [dayId, setDayId] = React.useState(defaultDay ?? days[0]?.id);
67
+ const rootRef = React.useRef(null);
68
+ const refocusDays = React.useRef(false);
26
69
  const active = days.find((d) => d.id === dayId) ?? days[0];
27
- if (!active) return /* @__PURE__ */ jsx("p", { className: s.empty({ className }), children: emptyLabel });
28
- return /* @__PURE__ */ jsxs("div", { className: s.root({ className }), ...props, children: [
29
- /* @__PURE__ */ jsx("div", { className: s.days(), role: "group", "aria-label": label, children: days.map((day) => /* @__PURE__ */ jsxs("button", { type: "button", "aria-pressed": day.id === active.id, onClick: () => setDayId(day.id), className: s.day(), children: [
30
- /* @__PURE__ */ jsx("span", { className: s.dayName(), children: day.label }),
31
- day.sub && /* @__PURE__ */ jsx("span", { className: s.daySub(), children: day.sub })
32
- ] }, day.id)) }),
33
- /* @__PURE__ */ jsx("ul", { className: s.times(), "aria-label": `${active.label}${active.sub ? ` ${active.sub}` : ""}`, children: active.slots.map((slot) => /* @__PURE__ */ jsx("li", { children: slot.href ? /* @__PURE__ */ jsxs(BlockLink, { href: slot.href, linkAs, className: s.time(), children: [
34
- slot.label,
35
- slot.note && /* @__PURE__ */ jsx("span", { className: s.note(), children: slot.note })
36
- ] }) : /* @__PURE__ */ jsxs("button", { type: "button", "aria-pressed": value === slot.id, disabled: slot.disabled, onClick: () => onValueChange?.(slot.id), className: s.time({ className: "group" }), children: [
37
- slot.label,
38
- slot.note && /* @__PURE__ */ jsx("span", { className: s.note(), children: slot.note })
39
- ] }) }, slot.id)) })
70
+ React.useEffect(() => {
71
+ if (!refocusDays.current) return;
72
+ refocusDays.current = false;
73
+ rootRef.current?.querySelector("[data-day][aria-pressed=true]")?.focus();
74
+ }, [week]);
75
+ const weeks = week !== void 0;
76
+ const prev = weeks ? addDays(week, -7) : void 0;
77
+ const next = weeks ? addDays(week, 7) : void 0;
78
+ const current = todayWeek ?? minWeek;
79
+ const prevOff = !!prev && !!minWeek && prev < minWeek;
80
+ const nextOff = !!next && !!maxWeek && next > maxWeek;
81
+ const todayOff = !current || current === week;
82
+ const go = (to, off) => {
83
+ if (to && !off) onWeekChange?.(to);
84
+ };
85
+ const weekButton = (kind, to, off, text, shown) => weekHref && to && !off ? /* @__PURE__ */ jsx(BlockLink, { href: weekHref(to), linkAs, "aria-label": text, className: s.weekBtn(), children: shown }, kind) : /* @__PURE__ */ jsx("button", { type: "button", "aria-label": text, "aria-disabled": off || void 0, onClick: () => go(to, off), className: s.weekBtn(), children: shown }, kind);
86
+ const onKeyDown = (e) => {
87
+ if (!weeks || e.key !== "PageUp" && e.key !== "PageDown") return;
88
+ const to = e.key === "PageUp" ? prev : next;
89
+ if (!to || (e.key === "PageUp" ? prevOff : nextOff)) return;
90
+ e.preventDefault();
91
+ refocusDays.current = true;
92
+ onWeekChange?.(to);
93
+ };
94
+ const timeList = (slots, name) => /* @__PURE__ */ jsx("ul", { className: s.times(), "aria-label": name, onKeyDown: (e) => moveFocus(e, { prev: ["ArrowLeft", "ArrowUp"], next: ["ArrowRight", "ArrowDown"] }), children: slots.map((slot) => /* @__PURE__ */ jsx("li", { children: slot.href && !slot.disabled ? /* @__PURE__ */ jsxs(BlockLink, { href: slot.href, linkAs, className: s.time(), children: [
95
+ slot.label,
96
+ slot.note && /* @__PURE__ */ jsx("span", { className: s.note(), children: slot.note })
97
+ ] }) : /* @__PURE__ */ jsxs("button", { type: "button", "aria-pressed": value === slot.id, disabled: slot.disabled, onClick: () => onValueChange?.(slot.id), className: s.time({ className: "group" }), children: [
98
+ slot.label,
99
+ slot.note && /* @__PURE__ */ jsx("span", { className: s.note(), children: slot.note })
100
+ ] }) }, slot.id)) });
101
+ const dayName = active ? `${active.label}${active.sub ? ` ${active.sub}` : ""}` : "";
102
+ return /* @__PURE__ */ jsxs("div", { ref: rootRef, className: s.root({ className }), onKeyDown, ...props, children: [
103
+ weeks && weekButtons && /* @__PURE__ */ jsxs("div", { className: s.weekBar(), children: [
104
+ weekLabel && /* @__PURE__ */ jsx("p", { className: s.weekLabel(), role: "status", "aria-live": "polite", children: weekLabel }),
105
+ /* @__PURE__ */ jsxs("div", { className: s.weekNav(), children: [
106
+ weekButton("previous", prev, prevOff, weekButtons.previous, /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2190" })),
107
+ weekButton("today", current, todayOff, weekButtons.today, weekButtons.today),
108
+ weekButton("next", next, nextOff, weekButtons.next, /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2192" }))
109
+ ] })
110
+ ] }),
111
+ !active ? /* @__PURE__ */ jsx("p", { className: s.empty(), children: emptyLabel }) : /* @__PURE__ */ jsxs(Fragment, { children: [
112
+ /* @__PURE__ */ jsx("div", { className: s.days(), role: "group", "aria-label": label, onKeyDown: (e) => moveFocus(e, { prev: ["ArrowLeft"], next: ["ArrowRight"] }), children: days.map((day) => /* @__PURE__ */ jsxs("button", { type: "button", "data-day": "", "aria-pressed": day.id === active.id, onClick: () => setDayId(day.id), className: s.day(), children: [
113
+ /* @__PURE__ */ jsx("span", { className: s.dayName(), children: day.label }),
114
+ day.sub && /* @__PURE__ */ jsx("span", { className: s.daySub(), children: day.sub })
115
+ ] }, day.id)) }),
116
+ active.groups ? /* @__PURE__ */ jsx("ul", { className: s.groups(), "aria-label": dayName, children: active.groups.map((group) => /* @__PURE__ */ jsxs("li", { children: [
117
+ /* @__PURE__ */ jsx("p", { className: s.groupLabel(), children: group.label }),
118
+ timeList(group.slots, `${dayName} \xB7 ${group.label}`)
119
+ ] }, group.id)) }) : timeList(active.slots ?? [], dayName)
120
+ ] }),
121
+ footer && /* @__PURE__ */ jsx("p", { className: s.footer(), children: footer })
40
122
  ] });
41
123
  }
42
124
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/slot-picker/slot-picker.tsx"],"sourcesContent":["// Client (the chosen day). The next free times of a service as tappable chips: a strip of days, then the day's times.\n// A time is a link (`href`: the booking page with the time chosen) or a toggle the reader presses (`value`,\n// `onValueChange`). The app computes the slots (its availability is the truth) and formats the labels.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\n\nexport const slotPicker = tv({\n slots: {\n root: \"flex min-w-0 flex-col gap-3\",\n days: \"flex gap-2 overflow-x-auto p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n day:\n \"flex min-h-12 min-w-[4.5rem] shrink-0 cursor-pointer flex-col items-center justify-center rounded-xl border border-border-default bg-surface-1 px-3 py-1.5 text-center leading-tight text-fg-secondary \" +\n \"transition-colors hover:border-border-strong hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"aria-pressed:border-accent aria-pressed:bg-accent-soft aria-pressed:text-fg\",\n dayName: \"text-xs font-bold\",\n daySub: \"text-[11px] tabular-nums text-fg-muted\",\n times: \"m-0 flex list-none flex-wrap gap-2 p-0\",\n time:\n \"inline-flex min-h-11 min-w-[4.75rem] items-center justify-center gap-1.5 rounded-sm border border-border-default bg-surface-1 px-4 text-sm font-semibold tabular-nums text-fg no-underline \" +\n \"transition-colors hover:border-accent/60 hover:bg-accent-soft focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"aria-pressed:border-accent aria-pressed:bg-accent aria-pressed:text-on-accent disabled:cursor-not-allowed disabled:opacity-50\",\n note: \"text-[11px] font-medium text-fg-secondary group-aria-pressed:text-on-accent\",\n empty: \"m-0 rounded-xl border border-dashed border-border-default px-4 py-6 text-center text-sm text-fg-secondary\",\n },\n});\nconst s = slotPicker();\n\nexport type PickerSlot = {\n /** A stable id (the slot's start as an ISO string). */\n id: string;\n /** The time in words, formatted by the app (`9 h 30`). */\n label: string;\n /** What to know about it (`2 places left`), shown beside the time and read with it. */\n note?: string;\n /** Not offered any more: shown, disabled. */\n disabled?: boolean;\n /** Makes the time a link to this address (the booking page with the slot chosen). */\n href?: string;\n};\n\nexport type PickerDay = {\n /** A stable id (`2026-10-19`). */\n id: string;\n /** The day's name, translated (`Today`, `Mon`). */\n label: string;\n /** Under it (`19 Oct`). */\n sub?: string;\n /** Its free times, in order. */\n slots: readonly PickerSlot[];\n};\n\nexport type SlotPickerProps = Omit<React.ComponentProps<\"div\">, \"onChange\" | \"defaultValue\"> & {\n /** The days that have free times, in order. */\n days: readonly PickerDay[];\n /** The name of the group (`Available times`), passed translated. */\n label: string;\n /** Said when no day has a free time. */\n emptyLabel: string;\n /** The chosen slot's id (controlled). */\n value?: string | null;\n /** Called with the chosen slot's id. */\n onValueChange?: (id: string) => void;\n /** The first day shown. Default: the first of `days`. */\n defaultDay?: string;\n /** The app's link component for the times that have an `href`. */\n linkAs?: LinkComponent;\n};\n\n/** Tappable free times by day: the day strip, then the day's chips — links or toggles. */\nexport function SlotPicker({ days, label, emptyLabel, value, onValueChange, defaultDay, linkAs, className, ...props }: SlotPickerProps) {\n const [dayId, setDayId] = React.useState(defaultDay ?? days[0]?.id);\n const active = days.find((d) => d.id === dayId) ?? days[0];\n if (!active) return <p className={s.empty({ className })}>{emptyLabel}</p>;\n return (\n <div className={s.root({ className })} {...props}>\n <div className={s.days()} role=\"group\" aria-label={label}>\n {days.map((day) => (\n <button key={day.id} type=\"button\" aria-pressed={day.id === active.id} onClick={() => setDayId(day.id)} className={s.day()}>\n <span className={s.dayName()}>{day.label}</span>\n {day.sub && <span className={s.daySub()}>{day.sub}</span>}\n </button>\n ))}\n </div>\n <ul className={s.times()} aria-label={`${active.label}${active.sub ? ` ${active.sub}` : \"\"}`}>\n {active.slots.map((slot) => (\n <li key={slot.id}>\n {slot.href ? (\n <BlockLink href={slot.href} linkAs={linkAs} className={s.time()}>\n {slot.label}\n {slot.note && <span className={s.note()}>{slot.note}</span>}\n </BlockLink>\n ) : (\n <button type=\"button\" aria-pressed={value === slot.id} disabled={slot.disabled} onClick={() => onValueChange?.(slot.id)} className={s.time({ className: \"group\" })}>\n {slot.label}\n {slot.note && <span className={s.note()}>{slot.note}</span>}\n </button>\n )}\n </li>\n ))}\n </ul>\n </div>\n );\n}\n"],"mappings":";;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AAsEG,cAKZ,YALY;AAlEf,IAAM,aAAa,GAAG;AAAA,EAC3B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,KACE;AAAA,IAGF,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MACE;AAAA,IAGF,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AACF,CAAC;AACD,IAAM,IAAI,WAAW;AA4Cd,SAAS,WAAW,EAAE,MAAM,OAAO,YAAY,OAAO,eAAe,YAAY,QAAQ,WAAW,GAAG,MAAM,GAAoB;AACtI,QAAM,CAAC,OAAO,QAAQ,IAAU,eAAS,cAAc,KAAK,CAAC,GAAG,EAAE;AAClE,QAAM,SAAS,KAAK,KAAK,CAAC,MAAM,EAAE,OAAO,KAAK,KAAK,KAAK,CAAC;AACzD,MAAI,CAAC,OAAQ,QAAO,oBAAC,OAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,GAAI,sBAAW;AACtE,SACE,qBAAC,SAAI,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OACzC;AAAA,wBAAC,SAAI,WAAW,EAAE,KAAK,GAAG,MAAK,SAAQ,cAAY,OAChD,eAAK,IAAI,CAAC,QACT,qBAAC,YAAoB,MAAK,UAAS,gBAAc,IAAI,OAAO,OAAO,IAAI,SAAS,MAAM,SAAS,IAAI,EAAE,GAAG,WAAW,EAAE,IAAI,GACvH;AAAA,0BAAC,UAAK,WAAW,EAAE,QAAQ,GAAI,cAAI,OAAM;AAAA,MACxC,IAAI,OAAO,oBAAC,UAAK,WAAW,EAAE,OAAO,GAAI,cAAI,KAAI;AAAA,SAFvC,IAAI,EAGjB,CACD,GACH;AAAA,IACA,oBAAC,QAAG,WAAW,EAAE,MAAM,GAAG,cAAY,GAAG,OAAO,KAAK,GAAG,OAAO,MAAM,IAAI,OAAO,GAAG,KAAK,EAAE,IACvF,iBAAO,MAAM,IAAI,CAAC,SACjB,oBAAC,QACE,eAAK,OACJ,qBAAC,aAAU,MAAM,KAAK,MAAM,QAAgB,WAAW,EAAE,KAAK,GAC3D;AAAA,WAAK;AAAA,MACL,KAAK,QAAQ,oBAAC,UAAK,WAAW,EAAE,KAAK,GAAI,eAAK,MAAK;AAAA,OACtD,IAEA,qBAAC,YAAO,MAAK,UAAS,gBAAc,UAAU,KAAK,IAAI,UAAU,KAAK,UAAU,SAAS,MAAM,gBAAgB,KAAK,EAAE,GAAG,WAAW,EAAE,KAAK,EAAE,WAAW,QAAQ,CAAC,GAC9J;AAAA,WAAK;AAAA,MACL,KAAK,QAAQ,oBAAC,UAAK,WAAW,EAAE,KAAK,GAAI,eAAK,MAAK;AAAA,OACtD,KAVK,KAAK,EAYd,CACD,GACH;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/slot-picker/slot-picker.tsx"],"sourcesContent":["// Client (the chosen day). The next free times of a service as tappable chips: a strip of days, then the day's times.\n// A time is a link (`href`: the booking page with the time chosen) or a toggle the reader presses (`value`,\n// `onValueChange`). The app computes the slots (its availability is the truth) and formats the labels. With `week` the\n// picker moves through the weeks (← Today →): the host loads the days of the week it is asked for, the picker never computes.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\n\nexport const slotPicker = tv({\n slots: {\n root: \"flex min-w-0 flex-col gap-3\",\n days: \"flex gap-2 overflow-x-auto p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n day:\n \"flex min-h-12 min-w-[4.5rem] shrink-0 cursor-pointer flex-col items-center justify-center rounded-xl border border-border-default bg-surface-1 px-3 py-1.5 text-center leading-tight text-fg-secondary \" +\n \"transition-colors hover:border-border-strong hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"aria-pressed:border-accent aria-pressed:bg-accent-soft aria-pressed:text-fg\",\n dayName: \"text-xs font-bold\",\n daySub: \"text-[11px] tabular-nums text-fg-muted\",\n times: \"m-0 flex list-none flex-wrap gap-2 p-0\",\n time:\n \"inline-flex min-h-11 min-w-[4.75rem] items-center justify-center gap-1.5 rounded-sm border border-border-default bg-surface-1 px-4 text-sm font-semibold tabular-nums text-fg no-underline \" +\n \"transition-colors hover:border-accent/60 hover:bg-accent-soft focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"aria-pressed:border-accent aria-pressed:bg-accent aria-pressed:text-on-accent disabled:cursor-not-allowed disabled:border-dashed disabled:bg-transparent disabled:text-fg-muted disabled:line-through disabled:hover:border-border-default disabled:hover:bg-transparent\",\n note: \"text-[11px] font-medium text-fg-secondary group-aria-pressed:text-on-accent\",\n weekBar: \"flex flex-wrap items-center justify-between gap-2\",\n weekLabel: \"m-0 min-w-0 text-sm font-semibold tabular-nums text-fg\",\n weekNav: \"flex items-center gap-1.5\",\n weekBtn:\n \"inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center rounded-sm border border-border-default bg-surface-1 px-3 text-sm font-semibold text-fg no-underline \" +\n \"transition-colors hover:border-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-disabled:cursor-not-allowed aria-disabled:opacity-50\",\n groups: \"m-0 flex list-none flex-col gap-3 p-0\",\n groupLabel: \"m-0 mb-1.5 text-xs font-bold text-fg-secondary\",\n footer: \"m-0 text-xs text-fg-secondary\",\n empty: \"m-0 rounded-xl border border-dashed border-border-default px-4 py-6 text-center text-sm text-fg-secondary\",\n },\n});\nconst s = slotPicker();\n\nexport type PickerSlot = {\n /** A stable id (the slot's start as an ISO string). */\n id: string;\n /** The time in words, formatted by the app (`9 h 30`). */\n label: string;\n /** What to know about it (`2 places left`), shown beside the time and read with it. */\n note?: string;\n /** Not offered any more (full): shown struck out and disabled, its `note` (`Full`) read with the time — never colour alone. */\n disabled?: boolean;\n /** Makes the time a link to this address (the booking page with the slot chosen). */\n href?: string;\n};\n\n/** A part of a day (`Morning`, `Afternoon`): the label comes from the host's messages. */\nexport type PickerGroup = {\n id: string;\n label: string;\n slots: readonly PickerSlot[];\n};\n\nexport type PickerDay = {\n /** A stable id (`2026-10-19`). */\n id: string;\n /** The day's name, translated (`Today`, `Mon`). */\n label: string;\n /** Under it (`19 Oct`). */\n sub?: string;\n /** Its times, in order — flat… */\n slots?: readonly PickerSlot[];\n /** …or in parts of the day (`Morning`, `Afternoon`), each under its own label. Wins over `slots`. */\n groups?: readonly PickerGroup[];\n};\n\nexport type SlotPickerProps = Omit<React.ComponentProps<\"div\">, \"onChange\" | \"defaultValue\"> & {\n /** The days that have free times, in order. */\n days: readonly PickerDay[];\n /** The name of the group (`Available times`), passed translated. */\n label: string;\n /** Said when no day has a free time. */\n emptyLabel: string;\n /** The chosen slot's id (controlled). */\n value?: string | null;\n /** Called with the chosen slot's id. */\n onValueChange?: (id: string) => void;\n /** The first day shown. Default: the first of `days`. */\n defaultDay?: string;\n /** The app's link component for the times that have an `href`, and for the week buttons when `weekHref` is set. */\n linkAs?: LinkComponent;\n /** The week shown, the ISO date of its first day (`2026-10-19`; controlled). Setting it turns on ← Today →. */\n week?: string;\n /** Called with the ISO date of the week asked for (± 7 days, or `todayWeek`). The host loads that week's days. */\n onWeekChange?: (week: string) => void;\n /** The earliest week the host offers (ISO date): ← is disabled there. */\n minWeek?: string;\n /** The latest week the host offers (ISO date): → is disabled there. */\n maxWeek?: string;\n /** The current week, where « Today » goes back to. Default: `minWeek`. */\n todayWeek?: string;\n /** The week in words, formatted by the host with `@krizaka/intl` (`19 – 25 Oct`); announced politely at every change. */\n weekLabel?: string;\n /** Names of the three week buttons, translated: `{ previous: \"Previous week\", today: \"Today\", next: \"Next week\" }`. */\n weekButtons?: { previous: string; today: string; next: string };\n /** Makes the week buttons links (the address holds the state: `?week=`), given the week they go to. */\n weekHref?: (week: string) => string;\n /** The context line under the times: time zone and duration (`Montréal (UTC−4) · 45 min`), formatted by the host. */\n footer?: React.ReactNode;\n};\n\n/** The ISO date `days` days after `iso` (UTC, so a time zone never moves it). */\nconst addDays = (iso: string, days: number) => {\n const d = new Date(`${iso}T00:00:00Z`);\n d.setUTCDate(d.getUTCDate() + days);\n return d.toISOString().slice(0, 10);\n};\n\nconst focusables = (root: Element | null) => [...(root?.querySelectorAll<HTMLElement>(\"button:not(:disabled), a[href]\") ?? [])];\n/** Arrows move focus inside one list of controls (`dir` -1/+1 on the arrows that follow the reading order). */\nfunction moveFocus(e: React.KeyboardEvent<HTMLElement>, keys: { prev: string[]; next: string[] }) {\n const dir = keys.prev.includes(e.key) ? -1 : keys.next.includes(e.key) ? 1 : 0;\n if (!dir) return;\n const items = focusables(e.currentTarget);\n const at = items.indexOf(document.activeElement as HTMLElement);\n if (at < 0) return;\n e.preventDefault();\n items[(at + dir + items.length) % items.length]?.focus();\n}\n\n/** Tappable free times by day: the day strip, then the day's chips (in parts of the day if asked) — links or toggles — and, with `week`, ← Today →. */\nexport function SlotPicker({\n days,\n label,\n emptyLabel,\n value,\n onValueChange,\n defaultDay,\n linkAs,\n week,\n onWeekChange,\n minWeek,\n maxWeek,\n todayWeek,\n weekLabel,\n weekButtons,\n weekHref,\n footer,\n className,\n ...props\n}: SlotPickerProps) {\n const [dayId, setDayId] = React.useState(defaultDay ?? days[0]?.id);\n const rootRef = React.useRef<HTMLDivElement>(null);\n const refocusDays = React.useRef(false);\n const active = days.find((d) => d.id === dayId) ?? days[0];\n // After a week change from the keyboard (Page Up / Down inside the times), focus goes to the day strip, which stays.\n React.useEffect(() => {\n if (!refocusDays.current) return;\n refocusDays.current = false;\n rootRef.current?.querySelector<HTMLElement>(\"[data-day][aria-pressed=true]\")?.focus();\n }, [week]);\n\n const weeks = week !== undefined;\n const prev = weeks ? addDays(week, -7) : undefined;\n const next = weeks ? addDays(week, 7) : undefined;\n const current = todayWeek ?? minWeek;\n const prevOff = !!prev && !!minWeek && prev < minWeek;\n const nextOff = !!next && !!maxWeek && next > maxWeek;\n const todayOff = !current || current === week;\n const go = (to: string | undefined, off: boolean) => {\n if (to && !off) onWeekChange?.(to);\n };\n\n const weekButton = (kind: \"previous\" | \"today\" | \"next\", to: string | undefined, off: boolean, text: string, shown: React.ReactNode) =>\n weekHref && to && !off ? (\n <BlockLink key={kind} href={weekHref(to)} linkAs={linkAs} aria-label={text} className={s.weekBtn()}>\n {shown}\n </BlockLink>\n ) : (\n <button key={kind} type=\"button\" aria-label={text} aria-disabled={off || undefined} onClick={() => go(to, off)} className={s.weekBtn()}>\n {shown}\n </button>\n );\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (!weeks || (e.key !== \"PageUp\" && e.key !== \"PageDown\")) return;\n const to = e.key === \"PageUp\" ? prev : next;\n if (!to || (e.key === \"PageUp\" ? prevOff : nextOff)) return;\n e.preventDefault();\n refocusDays.current = true;\n onWeekChange?.(to);\n };\n\n const timeList = (slots: readonly PickerSlot[], name: string) => (\n <ul className={s.times()} aria-label={name} onKeyDown={(e) => moveFocus(e, { prev: [\"ArrowLeft\", \"ArrowUp\"], next: [\"ArrowRight\", \"ArrowDown\"] })}>\n {slots.map((slot) => (\n <li key={slot.id}>\n {slot.href && !slot.disabled ? (\n <BlockLink href={slot.href} linkAs={linkAs} className={s.time()}>\n {slot.label}\n {slot.note && <span className={s.note()}>{slot.note}</span>}\n </BlockLink>\n ) : (\n <button type=\"button\" aria-pressed={value === slot.id} disabled={slot.disabled} onClick={() => onValueChange?.(slot.id)} className={s.time({ className: \"group\" })}>\n {slot.label}\n {slot.note && <span className={s.note()}>{slot.note}</span>}\n </button>\n )}\n </li>\n ))}\n </ul>\n );\n\n const dayName = active ? `${active.label}${active.sub ? ` ${active.sub}` : \"\"}` : \"\";\n return (\n <div ref={rootRef} className={s.root({ className })} onKeyDown={onKeyDown} {...props}>\n {weeks && weekButtons && (\n <div className={s.weekBar()}>\n {weekLabel && (\n <p className={s.weekLabel()} role=\"status\" aria-live=\"polite\">\n {weekLabel}\n </p>\n )}\n <div className={s.weekNav()}>\n {weekButton(\"previous\", prev, prevOff, weekButtons.previous, <span aria-hidden=\"true\">←</span>)}\n {weekButton(\"today\", current, todayOff, weekButtons.today, weekButtons.today)}\n {weekButton(\"next\", next, nextOff, weekButtons.next, <span aria-hidden=\"true\">→</span>)}\n </div>\n </div>\n )}\n {!active ? (\n <p className={s.empty()}>{emptyLabel}</p>\n ) : (\n <>\n <div className={s.days()} role=\"group\" aria-label={label} onKeyDown={(e) => moveFocus(e, { prev: [\"ArrowLeft\"], next: [\"ArrowRight\"] })}>\n {days.map((day) => (\n <button key={day.id} type=\"button\" data-day=\"\" aria-pressed={day.id === active.id} onClick={() => setDayId(day.id)} className={s.day()}>\n <span className={s.dayName()}>{day.label}</span>\n {day.sub && <span className={s.daySub()}>{day.sub}</span>}\n </button>\n ))}\n </div>\n {active.groups ? (\n <ul className={s.groups()} aria-label={dayName}>\n {active.groups.map((group) => (\n <li key={group.id}>\n <p className={s.groupLabel()}>{group.label}</p>\n {timeList(group.slots, `${dayName} · ${group.label}`)}\n </li>\n ))}\n </ul>\n ) : (\n timeList(active.slots ?? [], dayName)\n )}\n </>\n )}\n {footer && <p className={s.footer()}>{footer}</p>}\n </div>\n );\n}\n"],"mappings":";;;;;;AAIA,YAAY,WAAW;AACvB,SAAS,UAAU;AAsKb,SA0DE,UA1DF,KAuBM,YAvBN;AAl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imenTagProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
49
49
  */
50
50
  declare function SpecimenTag({ code, title, titleAs: Title, mark, status, fields, children, footer, mount, className, ...props }: SpecimenTagProps): React.JSX.Element;
51
51
 
52
- export { type SpecimenField, SpecimenTag, type SpecimenTagProps, Stamp, type StampProps, type StampTone };
52
+ export { SpecimenTag, Stamp };
53
+ export type { SpecimenField, SpecimenTagProps, StampProps, StampTone };
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+
3
+ type SpeedLinesProps = React.HTMLAttributes<HTMLDivElement> & {
4
+ /** `radial` bursts from the centre; `horizontal` streaks across. @default "radial" */
5
+ kind?: "radial" | "horizontal";
6
+ /** How many lines (4 to 120). @default 36 */
7
+ count?: number;
8
+ /** For `radial`: the share of the height left clear around the centre, 0 to 80. @default 34 */
9
+ clear?: number;
10
+ /** A slow pulse of the lines; off under reduced motion. @default false */
11
+ animated?: boolean;
12
+ /** The element the lines sit behind. */
13
+ children?: React.ReactNode;
14
+ };
15
+ /** Manga action lines behind a hero element: a burst or streaks in SVG, still under reduced motion. */
16
+ declare function SpeedLines({ kind, count, clear, animated, className, children, ...props }: SpeedLinesProps): React.JSX.Element;
17
+
18
+ export { SpeedLines };
19
+ export type { SpeedLinesProps };
@@ -0,0 +1,45 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-W675RFOA.js";
4
+
5
+ // src/speed-lines/speed-lines.tsx
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ var unit = (i, salt) => {
8
+ let h = Math.imul(i + 1, 2654435761) ^ Math.imul(salt + 7, 40503);
9
+ h = Math.imul(h ^ h >>> 15, 2246822519);
10
+ h = Math.imul(h ^ h >>> 13, 3266489917);
11
+ return ((h ^ h >>> 16) >>> 0) % 1e3 / 1e3;
12
+ };
13
+ var r2 = (n) => Math.round(n * 100) / 100;
14
+ function radial(count, clear) {
15
+ const cx = 100;
16
+ const cy = 50;
17
+ const inner = clear / 100 * 50;
18
+ return Array.from({ length: count }, (_, i) => {
19
+ const a = (i + (unit(i, 1) - 0.5) * 0.6) / count * Math.PI * 2;
20
+ const w = 0.012 + unit(i, 2) * 0.05;
21
+ const r0 = inner * (0.8 + unit(i, 3) * 0.5);
22
+ const r1 = 150;
23
+ const p = (r, da) => `${r2(cx + r * Math.cos(a + da))},${r2(cy + r * Math.sin(a + da))}`;
24
+ return { key: i, points: `${p(r0, 0)} ${p(r1, -w)} ${p(r1, w)}`, opacity: r2(0.35 + unit(i, 4) * 0.5) };
25
+ });
26
+ }
27
+ function horizontal(count) {
28
+ return Array.from({ length: count }, (_, i) => {
29
+ const y = (i + unit(i, 5) * 0.8) / count * 100;
30
+ const x = unit(i, 6) * 120;
31
+ return { key: i, x: r2(x), y: r2(y), width: r2(40 + unit(i, 7) * 100), height: r2(0.25 + unit(i, 8) * 0.9), opacity: r2(0.3 + unit(i, 9) * 0.5) };
32
+ });
33
+ }
34
+ function SpeedLines({ kind = "radial", count = 36, clear = 34, animated = false, className, children, ...props }) {
35
+ const n = Math.min(120, Math.max(4, Math.round(count)));
36
+ const gap = Math.min(80, Math.max(0, clear));
37
+ return /* @__PURE__ */ jsxs("div", { className: cn("kz-speed", className), "data-kind": kind, "data-speed-animated": animated ? "" : void 0, ...props, children: [
38
+ /* @__PURE__ */ jsx("svg", { className: "kz-speed-lines", viewBox: "0 0 200 100", preserveAspectRatio: "xMidYMid slice", "aria-hidden": "true", focusable: "false", children: kind === "radial" ? radial(n, gap).map((l) => /* @__PURE__ */ jsx("polygon", { points: l.points, fill: "currentColor", opacity: l.opacity }, l.key)) : horizontal(n).map((l) => /* @__PURE__ */ jsx("rect", { x: l.x, y: l.y, width: l.width, height: l.height, fill: "currentColor", opacity: l.opacity }, l.key)) }),
39
+ /* @__PURE__ */ jsx("div", { className: "kz-speed-content", children })
40
+ ] });
41
+ }
42
+ export {
43
+ SpeedLines
44
+ };
45
+ //# sourceMappingURL=speed-lines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/speed-lines/speed-lines.tsx"],"sourcesContent":["// Server-safe. The manga action lines of the Krizaka style (blocks.css): thin wedges that burst from behind a hero element\n// (`radial`) or streak across it (`horizontal`), in SVG. Deterministic (an integer hash of the index, never Math.random), static\n// by default, and still under `prefers-reduced-motion`: `animated` only pulses them, and the stylesheet stops that.\n// Decoration: the lines are hidden from assistive technology, the content in front is the real thing.\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type SpeedLinesProps = React.HTMLAttributes<HTMLDivElement> & {\n /** `radial` bursts from the centre; `horizontal` streaks across. @default \"radial\" */\n kind?: \"radial\" | \"horizontal\";\n /** How many lines (4 to 120). @default 36 */\n count?: number;\n /** For `radial`: the share of the height left clear around the centre, 0 to 80. @default 34 */\n clear?: number;\n /** A slow pulse of the lines; off under reduced motion. @default false */\n animated?: boolean;\n /** The element the lines sit behind. */\n children?: React.ReactNode;\n};\n\n/** A stable 0–1 value of `i` and a `salt`: integer arithmetic only, so the server and the client draw the same lines. */\nconst unit = (i: number, salt: number) => {\n let h = Math.imul(i + 1, 2654435761) ^ Math.imul(salt + 7, 40503);\n h = Math.imul(h ^ (h >>> 15), 2246822519);\n h = Math.imul(h ^ (h >>> 13), 3266489917);\n return ((h ^ (h >>> 16)) >>> 0) % 1000 / 1000;\n};\nconst r2 = (n: number) => Math.round(n * 100) / 100;\n\nfunction radial(count: number, clear: number) {\n const cx = 100;\n const cy = 50;\n const inner = (clear / 100) * 50;\n return Array.from({ length: count }, (_, i) => {\n const a = ((i + (unit(i, 1) - 0.5) * 0.6) / count) * Math.PI * 2;\n const w = 0.012 + unit(i, 2) * 0.05;\n const r0 = inner * (0.8 + unit(i, 3) * 0.5);\n const r1 = 150;\n const p = (r: number, da: number) => `${r2(cx + r * Math.cos(a + da))},${r2(cy + r * Math.sin(a + da))}`;\n return { key: i, points: `${p(r0, 0)} ${p(r1, -w)} ${p(r1, w)}`, opacity: r2(0.35 + unit(i, 4) * 0.5) };\n });\n}\n\nfunction horizontal(count: number) {\n return Array.from({ length: count }, (_, i) => {\n const y = ((i + unit(i, 5) * 0.8) / count) * 100;\n const x = unit(i, 6) * 120;\n return { key: i, x: r2(x), y: r2(y), width: r2(40 + unit(i, 7) * 100), height: r2(0.25 + unit(i, 8) * 0.9), opacity: r2(0.3 + unit(i, 9) * 0.5) };\n });\n}\n\n/** Manga action lines behind a hero element: a burst or streaks in SVG, still under reduced motion. */\nexport function SpeedLines({ kind = \"radial\", count = 36, clear = 34, animated = false, className, children, ...props }: SpeedLinesProps) {\n const n = Math.min(120, Math.max(4, Math.round(count)));\n const gap = Math.min(80, Math.max(0, clear));\n return (\n <div className={cn(\"kz-speed\", className)} data-kind={kind} data-speed-animated={animated ? \"\" : undefined} {...props}>\n <svg className=\"kz-speed-lines\" viewBox=\"0 0 200 100\" preserveAspectRatio=\"xMidYMid slice\" aria-hidden=\"true\" focusable=\"false\">\n {kind === \"radial\"\n ? radial(n, gap).map((l) => <polygon key={l.key} points={l.points} fill=\"currentColor\" opacity={l.opacity} />)\n : horizontal(n).map((l) => <rect key={l.key} x={l.x} y={l.y} width={l.width} height={l.height} fill=\"currentColor\" opacity={l.opacity} />)}\n </svg>\n <div className=\"kz-speed-content\">{children}</div>\n </div>\n );\n}\n"],"mappings":";;;;;AAyDI,SAGkC,KAHlC;AAnCJ,IAAM,OAAO,CAAC,GAAW,SAAiB;AACxC,MAAI,IAAI,KAAK,KAAK,IAAI,GAAG,UAAU,IAAI,KAAK,KAAK,OAAO,GAAG,KAAK;AAChE,MAAI,KAAK,KAAK,IAAK,MAAM,IAAK,UAAU;AACxC,MAAI,KAAK,KAAK,IAAK,MAAM,IAAK,UAAU;AACxC,WAAS,IAAK,MAAM,QAAS,KAAK,MAAO;AAC3C;AACA,IAAM,KAAK,CAAC,MAAc,KAAK,MAAM,IAAI,GAAG,IAAI;AAEhD,SAAS,OAAO,OAAe,OAAe;AAC5C,QAAM,KAAK;AACX,QAAM,KAAK;AACX,QAAM,QAAS,QAAQ,MAAO;AAC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IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,CAAC,CAAC;AACtD,QAAM,MAAM,KAAK,IAAI,IAAI,KAAK,IAAI,GAAG,KAAK,CAAC;AAC3C,SACE,qBAAC,SAAI,WAAW,GAAG,YAAY,SAAS,GAAG,aAAW,MAAM,uBAAqB,WAAW,KAAK,QAAY,GAAG,OAC9G;AAAA,wBAAC,SAAI,WAAU,kBAAiB,SAAQ,eAAc,qBAAoB,kBAAiB,eAAY,QAAO,WAAU,SACrH,mBAAS,WACN,OAAO,GAAG,GAAG,EAAE,IAAI,CAAC,MAAM,oBAAC,aAAoB,QAAQ,EAAE,QAAQ,MAAK,gBAAe,SAAS,EAAE,WAAxD,EAAE,GAA+D,CAAE,IAC3G,WAAW,CAAC,EAAE,IAAI,CAAC,MAAM,oBAAC,UAAiB,GAAG,EAAE,GAAG,GAAG,EAAE,GAAG,OAAO,EAAE,OAAO,QAAQ,EAAE,QAAQ,MAAK,gBAAe,SAAS,EAAE,WAAxF,EAAE,GAA+F,CAAE,GAC7I;AAAA,IACA,oBAAC,SAAI,WAAU,oBAAoB,UAAS;AAAA,KAC9C;AAEJ;","names":[]}
package/dist/spinner.d.ts CHANGED
@@ -49,4 +49,5 @@ type SpinnerProps = Omit<React.ComponentProps<"svg">, "children"> & VariantProps
49
49
  */
50
50
  declare function Spinner({ label, size, value, className, ...props }: SpinnerProps): React.JSX.Element;
51
51
 
52
- export { LoaderGlyph, type LoaderGlyphProps, type LoaderGlyphState, Spinner, type SpinnerProps, spinnerVariants };
52
+ export { LoaderGlyph, Spinner, spinnerVariants };
53
+ export type { LoaderGlyphProps, LoaderGlyphState, SpinnerProps };
@@ -103,4 +103,5 @@ type SplitViewProps = React.ComponentProps<"div"> & {
103
103
  /** A list and its open item: two panes on a desktop, one at a time on a phone. */
104
104
  declare function SplitView({ listTitle, listActions, list, detailHead, detail, empty, showDetail, back, listLabel, className, ...props }: SplitViewProps): React.JSX.Element;
105
105
 
106
- export { SplitView, type SplitViewProps, splitView };
106
+ export { SplitView, splitView };
107
+ export type { SplitViewProps };
@@ -31,4 +31,5 @@ type StageBannerProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
31
31
  /** Announces a chapter: a stage and its name on one line, or (`size="lg"`) a stage, a title and a line, centred. */
32
32
  declare function StageBanner({ stage, name, title, subtitle, size, titleAs: Title, variant, brand, className, ...props }: StageBannerProps): React.JSX.Element;
33
33
 
34
- export { StageBanner, type StageBannerProps };
34
+ export { StageBanner };
35
+ export type { StageBannerProps };
package/dist/stat.d.ts CHANGED
@@ -103,4 +103,5 @@ type StatGridProps = React.ComponentProps<"div"> & {
103
103
  /** A row of key figures that wraps with the width: a dashboard's head. The stats are its children. */
104
104
  declare function StatGrid({ divided, minWidth, className, style, ...props }: StatGridProps): React.JSX.Element;
105
105
 
106
- export { Stat, StatGrid, type StatGridProps, type StatProps, type StatTrend, stat, statGrid };
106
+ export { Stat, StatGrid, stat, statGrid };
107
+ export type { StatGridProps, StatProps, StatTrend };
@@ -0,0 +1,44 @@
1
+ import { StatusSet, StatusTransition } from '@krizaka/organize/contract';
2
+ export { StatusSet, StatusTone, StatusTransition } from '@krizaka/organize/contract';
3
+ import * as React from 'react';
4
+
5
+ type StatusMove = {
6
+ /** The transition the person chose. */
7
+ transition: StatusTransition;
8
+ /** The key of the reason picked from the transition's list, or null when it has none. */
9
+ reason: string | null;
10
+ };
11
+ type StatusChipLabels = {
12
+ /** The menu's accessible name: `(state) => "Change the status, now " + state`. */
13
+ menu: (state: string) => string;
14
+ /** The item that waits for a second press: `(target) => "Confirm: " + target`. */
15
+ confirm: (target: string) => string;
16
+ /** The submenu that asks for a reason: `(target) => target + " — pick a reason"`. */
17
+ reason: (target: string) => string;
18
+ };
19
+ type StatusChipProps = {
20
+ /** The kind's status set (`KindConfig.status`). */
21
+ set: StatusSet;
22
+ /** The key of the entity's state. */
23
+ state: string;
24
+ /** The role of the person: the moves are the ones this role may make. */
25
+ role: string;
26
+ /** The language the labels are read in. */
27
+ locale: "fr" | "en";
28
+ /** Called when a move is chosen (confirmed, with its reason when it asks for one). Without it the chip is read-only. */
29
+ onMove?: (move: StatusMove) => void;
30
+ /** The words of the menu, passed translated. */
31
+ labels?: Partial<StatusChipLabels>;
32
+ /**
33
+ * sm · md.
34
+ * @default "sm"
35
+ */
36
+ size?: "sm" | "md";
37
+ /** Classes merged on the badge. */
38
+ className?: string;
39
+ };
40
+ /** The state of a status set as a badge; a menu of the allowed moves when the set, the role and `onMove` allow it. */
41
+ declare function StatusChip({ set, state, role, locale, onMove, labels: given, size, className }: StatusChipProps): React.JSX.Element;
42
+
43
+ export { StatusChip };
44
+ export type { StatusChipLabels, StatusChipProps, StatusMove };
@@ -0,0 +1,137 @@
1
+ "use client";
2
+ import {
3
+ ChevronGlyph
4
+ } from "./chunk-5QEXOGO2.js";
5
+ import {
6
+ DropdownMenu
7
+ } from "./chunk-OGWB76BR.js";
8
+ import {
9
+ defineRecipe
10
+ } from "./chunk-D3T54RSL.js";
11
+ import "./chunk-J3NC6ER4.js";
12
+ import {
13
+ cn
14
+ } from "./chunk-NSLXEDIS.js";
15
+
16
+ // src/status-chip/status-chip.tsx
17
+ import { movesFrom, stateOf } from "@krizaka/organize/contract";
18
+ import { DropdownMenu as MenuPrimitive } from "radix-ui";
19
+ import * as React from "react";
20
+
21
+ // src/badge/badge.tsx
22
+ import { tv } from "tailwind-variants";
23
+
24
+ // src/badge/recipe.ts
25
+ var badgeRecipe = defineRecipe({
26
+ base: "inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm font-semibold ",
27
+ variants: {
28
+ tone: {
29
+ neutral: "bg-surface-3 text-fg-secondary",
30
+ accent: "bg-accent-soft text-fg ring-1 ring-inset ring-accent/40 [&>[data-dot]]:bg-accent",
31
+ success: "bg-success/15 text-fg ring-1 ring-inset ring-success/40 [&>[data-dot]]:bg-success",
32
+ warning: "bg-warning/15 text-fg ring-1 ring-inset ring-warning/40 [&>[data-dot]]:bg-warning",
33
+ danger: "bg-danger/15 text-fg ring-1 ring-inset ring-danger/40 [&>[data-dot]]:bg-danger",
34
+ /** On a media: veil and text invariant, identical in both themes. */
35
+ scrim: "bg-scrim text-fg-on-media backdrop-blur-md"
36
+ },
37
+ size: { sm: "px-2 py-0.5 text-[10px]", md: "px-2.5 py-1 text-[11px]" },
38
+ pulse: { true: "[&>[data-dot]]:motion-safe:animate-pulse" }
39
+ },
40
+ defaultVariants: { tone: "neutral", size: "sm" }
41
+ });
42
+
43
+ // src/badge/badge.tsx
44
+ import { jsx, jsxs } from "react/jsx-runtime";
45
+ var badgeVariants = tv(badgeRecipe);
46
+
47
+ // src/status-chip/status-chip.tsx
48
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
49
+ var defaultLabels = {
50
+ menu: (state) => `Change the status, now ${state}`,
51
+ confirm: (target) => `Confirm: ${target}`,
52
+ reason: (target) => `${target} \u2014 pick a reason`
53
+ };
54
+ function StatusChip({ set, state, role, locale, onMove, labels: given, size = "sm", className }) {
55
+ const labels = { ...defaultLabels, ...given };
56
+ const current = stateOf(set, state);
57
+ const text = current ? current.label[locale] : state;
58
+ const tone = current?.tone ?? "neutral";
59
+ const moves = onMove && set.mode === "editable" ? movesFrom(set, state, role) : [];
60
+ const [armed, setArmed] = React.useState(null);
61
+ const [open, setOpen] = React.useState(false);
62
+ const label = (key) => stateOf(set, key)?.label[locale] ?? key;
63
+ if (moves.length === 0) {
64
+ return /* @__PURE__ */ jsxs2("span", { "data-status": state, "data-tone": tone, className: badgeVariants({ tone, size, className }), children: [
65
+ /* @__PURE__ */ jsx2("span", { "data-dot": "", "aria-hidden": true, className: "h-1.5 w-1.5 rounded-full bg-current" }),
66
+ text
67
+ ] });
68
+ }
69
+ const choose = (move, reason) => {
70
+ setArmed(null);
71
+ setOpen(false);
72
+ onMove?.({ transition: move, reason });
73
+ };
74
+ return /* @__PURE__ */ jsxs2(
75
+ MenuPrimitive.Root,
76
+ {
77
+ open,
78
+ onOpenChange: (next) => {
79
+ setOpen(next);
80
+ if (!next) setArmed(null);
81
+ },
82
+ modal: false,
83
+ children: [
84
+ /* @__PURE__ */ jsxs2(
85
+ MenuPrimitive.Trigger,
86
+ {
87
+ "aria-label": labels.menu(text),
88
+ "data-status": state,
89
+ "data-tone": tone,
90
+ className: cn(
91
+ badgeVariants({ tone, size }),
92
+ "cursor-pointer transition-colors hover:brightness-110 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
93
+ className
94
+ ),
95
+ children: [
96
+ /* @__PURE__ */ jsx2("span", { "data-dot": "", "aria-hidden": true, className: "h-1.5 w-1.5 rounded-full bg-current" }),
97
+ text,
98
+ /* @__PURE__ */ jsx2(ChevronGlyph, { className: "-mr-0.5 h-3.5 w-3.5" })
99
+ ]
100
+ }
101
+ ),
102
+ /* @__PURE__ */ jsx2(DropdownMenu.Content, { align: "start", "aria-label": labels.menu(text), children: moves.map((move) => {
103
+ const target = label(move.to);
104
+ const reasons = move.reasons ?? [];
105
+ if (reasons.length > 0) {
106
+ return /* @__PURE__ */ jsxs2(DropdownMenu.Sub, { children: [
107
+ /* @__PURE__ */ jsx2(DropdownMenu.SubTrigger, { "aria-label": labels.reason(target), children: target }),
108
+ /* @__PURE__ */ jsx2(DropdownMenu.SubContent, { children: reasons.map((reason) => /* @__PURE__ */ jsx2(DropdownMenu.Item, { onSelect: () => choose(move, reason.key), children: reason.label[locale] }, reason.key)) })
109
+ ] }, move.to);
110
+ }
111
+ const waiting = move.confirm && armed === move.to;
112
+ return /* @__PURE__ */ jsx2(
113
+ DropdownMenu.Item,
114
+ {
115
+ "data-armed": waiting ? "" : void 0,
116
+ className: waiting ? "font-semibold text-fg-accent" : void 0,
117
+ onSelect: (event) => {
118
+ if (move.confirm && !waiting) {
119
+ event.preventDefault();
120
+ setArmed(move.to);
121
+ return;
122
+ }
123
+ choose(move, null);
124
+ },
125
+ children: /* @__PURE__ */ jsx2("span", { "aria-live": "polite", children: waiting ? labels.confirm(target) : target })
126
+ },
127
+ move.to
128
+ );
129
+ }) })
130
+ ]
131
+ }
132
+ );
133
+ }
134
+ export {
135
+ StatusChip
136
+ };
137
+ //# sourceMappingURL=status-chip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/status-chip/status-chip.tsx","../src/badge/badge.tsx","../src/badge/recipe.ts"],"sourcesContent":["// Client (a Radix menu). A state of a status set (krizaka-ts#89, `@krizaka/organize`): the set says the states (label in\n// both languages, tone, final) and the transitions (who may move, whether a second press confirms, which reasons may be\n// picked). Read-only when the set is derived (an invoice's « paid » comes from the ledger), when no move is allowed to\n// the role, or when nobody listens (`onMove`); otherwise a menu of the moves the role may make, in the set's order. A\n// reason is picked from a list, never typed. The tone is a tint and a dot: the label always says the state.\nimport { movesFrom, stateOf,type StatusSet, type StatusTone, type StatusTransition } from \"@krizaka/organize/contract\";\nimport { DropdownMenu as MenuPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { badgeVariants } from \"../badge\";\nimport { cn } from \"../cn\";\nimport { DropdownMenu } from \"../dropdown-menu\";\nimport { ChevronGlyph } from \"../glyphs\";\n\nexport type { StatusSet, StatusTone, StatusTransition };\n\nexport type StatusMove = {\n /** The transition the person chose. */\n transition: StatusTransition;\n /** The key of the reason picked from the transition's list, or null when it has none. */\n reason: string | null;\n};\n\nexport type StatusChipLabels = {\n /** The menu's accessible name: `(state) => \"Change the status, now \" + state`. */\n menu: (state: string) => string;\n /** The item that waits for a second press: `(target) => \"Confirm: \" + target`. */\n confirm: (target: string) => string;\n /** The submenu that asks for a reason: `(target) => target + \" — pick a reason\"`. */\n reason: (target: string) => string;\n};\n\nconst defaultLabels: StatusChipLabels = {\n menu: (state) => `Change the status, now ${state}`,\n confirm: (target) => `Confirm: ${target}`,\n reason: (target) => `${target} — pick a reason`,\n};\n\nexport type StatusChipProps = {\n /** The kind's status set (`KindConfig.status`). */\n set: StatusSet;\n /** The key of the entity's state. */\n state: string;\n /** The role of the person: the moves are the ones this role may make. */\n role: string;\n /** The language the labels are read in. */\n locale: \"fr\" | \"en\";\n /** Called when a move is chosen (confirmed, with its reason when it asks for one). Without it the chip is read-only. */\n onMove?: (move: StatusMove) => void;\n /** The words of the menu, passed translated. */\n labels?: Partial<StatusChipLabels>;\n /**\n * sm · md.\n * @default \"sm\"\n */\n size?: \"sm\" | \"md\";\n /** Classes merged on the badge. */\n className?: string;\n};\n\n/** The state of a status set as a badge; a menu of the allowed moves when the set, the role and `onMove` allow it. */\nexport function StatusChip({ set, state, role, locale, onMove, labels: given, size = \"sm\", className }: StatusChipProps) {\n const labels = { ...defaultLabels, ...given };\n const current = stateOf(set, state);\n const text = current ? current.label[locale] : state;\n const tone = current?.tone ?? \"neutral\";\n const moves = onMove && set.mode === \"editable\" ? movesFrom(set, state, role) : [];\n const [armed, setArmed] = React.useState<string | null>(null);\n const [open, setOpen] = React.useState(false);\n const label = (key: string) => stateOf(set, key)?.label[locale] ?? key;\n\n if (moves.length === 0) {\n return (\n <span data-status={state} data-tone={tone} className={badgeVariants({ tone, size, className })}>\n <span data-dot=\"\" aria-hidden className=\"h-1.5 w-1.5 rounded-full bg-current\" />\n {text}\n </span>\n );\n }\n\n const choose = (move: StatusTransition, reason: string | null) => {\n setArmed(null);\n setOpen(false);\n onMove?.({ transition: move, reason });\n };\n\n return (\n <MenuPrimitive.Root\n open={open}\n onOpenChange={(next) => {\n setOpen(next);\n if (!next) setArmed(null);\n }}\n modal={false}\n >\n <MenuPrimitive.Trigger\n aria-label={labels.menu(text)}\n data-status={state}\n data-tone={tone}\n className={cn(\n badgeVariants({ tone, size }),\n \"cursor-pointer transition-colors hover:brightness-110 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n className,\n )}\n >\n <span data-dot=\"\" aria-hidden className=\"h-1.5 w-1.5 rounded-full bg-current\" />\n {text}\n <ChevronGlyph className=\"-mr-0.5 h-3.5 w-3.5\" />\n </MenuPrimitive.Trigger>\n <DropdownMenu.Content align=\"start\" aria-label={labels.menu(text)}>\n {moves.map((move) => {\n const target = label(move.to);\n const reasons = move.reasons ?? [];\n if (reasons.length > 0) {\n return (\n <DropdownMenu.Sub key={move.to}>\n <DropdownMenu.SubTrigger aria-label={labels.reason(target)}>{target}</DropdownMenu.SubTrigger>\n <DropdownMenu.SubContent>\n {reasons.map((reason) => (\n <DropdownMenu.Item key={reason.key} onSelect={() => choose(move, reason.key)}>\n {reason.label[locale]}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.SubContent>\n </DropdownMenu.Sub>\n );\n }\n const waiting = move.confirm && armed === move.to;\n return (\n <DropdownMenu.Item\n key={move.to}\n data-armed={waiting ? \"\" : undefined}\n className={waiting ? \"font-semibold text-fg-accent\" : undefined}\n onSelect={(event) => {\n if (move.confirm && !waiting) {\n // The first press asks, the second one moves: the menu stays open and says so.\n event.preventDefault();\n setArmed(move.to);\n return;\n }\n choose(move, null);\n }}\n >\n <span aria-live=\"polite\">{waiting ? labels.confirm(target) : target}</span>\n </DropdownMenu.Item>\n );\n })}\n </DropdownMenu.Content>\n </MenuPrimitive.Root>\n );\n}\n","// Server-safe: no hook, no context.\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { badgeRecipe } from \"./recipe\";\n\n// Status tones are soft (a tint, a coloured dot, a text role): the invariant status tokens are too light to carry\n// small text on a light surface, or to sit under white text (WCAG AA).\nexport const badgeVariants = tv(badgeRecipe);\n\nexport type BadgeVariants = VariantProps<typeof badgeVariants>;\n\nexport type BadgeProps = React.ComponentProps<\"span\"> &\n BadgeVariants & {\n /**\n * neutral · accent · success · warning · danger (soft tints, the text stays a text role) · scrim (on a media).\n * @default \"neutral\"\n */\n tone?: BadgeVariants[\"tone\"];\n /**\n * sm · md.\n * @default \"sm\"\n */\n size?: BadgeVariants[\"size\"];\n /** Makes the `dot` pulse (stopped under reduced motion). */\n pulse?: BadgeVariants[\"pulse\"];\n /** A small dot before the text, in the tone's colour (pulsing with `pulse`). */\n dot?: boolean;\n };\n\nexport function Badge({ tone, size, pulse, dot, className, children, ...props }: BadgeProps) {\n return (\n <span data-tone={tone ?? \"neutral\"} className={badgeVariants({ tone, size, pulse, className })} {...props}>\n {dot && <span data-dot=\"\" aria-hidden className=\"h-1.5 w-1.5 rounded-full bg-current\" />}\n {children}\n </span>\n );\n}\n","// The badge's tones and sizes, written once as classes of the Krizaka tokens: the web wears them with `tv(badgeRecipe)`,\n// React Native reads the same classes into styles (native/badge.tsx). Status tones are soft (a tint, a coloured dot, a\n// text role): the invariant status tokens are too light to carry small text on a light surface, or to sit under white\n// text (WCAG AA).\nimport { defineRecipe } from \"../recipes/define\";\n\nexport const badgeRecipe = defineRecipe({\n base: \"inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm font-semibold \",\n variants: {\n tone: {\n neutral: \"bg-surface-3 text-fg-secondary\",\n accent: \"bg-accent-soft text-fg ring-1 ring-inset ring-accent/40 [&>[data-dot]]:bg-accent\",\n success: \"bg-success/15 text-fg ring-1 ring-inset ring-success/40 [&>[data-dot]]:bg-success\",\n warning: \"bg-warning/15 text-fg ring-1 ring-inset ring-warning/40 [&>[data-dot]]:bg-warning\",\n danger: \"bg-danger/15 text-fg ring-1 ring-inset ring-danger/40 [&>[data-dot]]:bg-danger\",\n /** On a media: veil and text invariant, identical in both themes. */\n scrim: \"bg-scrim text-fg-on-media backdrop-blur-md\",\n },\n size: { sm: \"px-2 py-0.5 text-[10px]\", md: \"px-2.5 py-1 text-[11px]\" },\n pulse: { true: \"[&>[data-dot]]:motion-safe:animate-pulse\" },\n },\n defaultVariants: { tone: \"neutral\", size: \"sm\" },\n});\n"],"mappings":";;;;;;;;;;;;;;;;AAKA,SAAS,WAAW,eAAsE;AAC1F,SAAS,gBAAgB,qBAAqB;AAC9C,YAAY,WAAW;;;ACLvB,SAAS,UAA6B;;;ACI/B,IAAM,cAAc,aAAa;AAAA,EACtC,MAAM;AAAA,EACN,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,SAAS;AAAA,MACT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,OAAO,GAE/B,CACD,GACH;AAAA,iBARqB,KAAK,EAS5B;AAAA,UAEJ;AACA,gBAAM,UAAU,KAAK,WAAW,UAAU,KAAK;AAC/C,iBACE,gBAAAA;AAAA,YAAC,aAAa;AAAA,YAAb;AAAA,cAEC,cAAY,UAAU,KAAK;AAAA,cAC3B,WAAW,UAAU,iCAAiC;AAAA,cACtD,UAAU,CAAC,UAAU;AACnB,oBAAI,KAAK,WAAW,CAAC,SAAS;AAE5B,wBAAM,eAAe;AACrB,2BAAS,KAAK,EAAE;AAChB;AAAA,gBACF;AACA,uBAAO,MAAM,IAAI;AAAA,cACnB;AAAA,cAEA,0BAAAA,KAAC,UAAK,aAAU,UAAU,oBAAU,OAAO,QAAQ,MAAM,IAAI,QAAO;AAAA;AAAA,YAb/D,KAAK;AAAA,UAcZ;AAAA,QAEJ,CAAC,GACH;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["jsx","jsxs"]}
@@ -42,4 +42,5 @@ type StatusPageProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
42
42
  */
43
43
  declare function StatusPage({ back, eyebrow, title, lead, aside, state, stateLabel, checked, services, servicesLabel, linkAs, children, ...props }: StatusPageProps): React.JSX.Element;
44
44
 
45
- export { type ServiceState, StatusPage, type StatusPageProps };
45
+ export { StatusPage };
46
+ export type { ServiceState, StatusPageProps };
@@ -17,4 +17,5 @@ type StepProgressProps = {
17
17
  /** The head of a sign-up or a profile to fill: back, segments that fill, the position in words. */
18
18
  declare function StepProgress({ step, total, label, back, trailing, className }: StepProgressProps): React.JSX.Element;
19
19
 
20
- export { StepProgress, type StepProgressProps };
20
+ export { StepProgress };
21
+ export type { StepProgressProps };
@@ -59,4 +59,5 @@ interface StepShowcaseProps extends Omit<React.ComponentProps<"section">, "child
59
59
  /** One device frame, its steps beside it, playing each recording then the next — a product's guided tour. */
60
60
  declare function StepShowcase({ label, steps, device, deviceTitle, autoplay, labels, defaultIndex, onIndexChange, className, ...props }: StepShowcaseProps): React.JSX.Element;
61
61
 
62
- export { DeviceFrame, type DeviceFrameProps, type DeviceKind, type ShowcaseStep, StepShowcase, type StepShowcaseLabels, type StepShowcaseProps, stepShowcaseLabels };
62
+ export { DeviceFrame, StepShowcase, stepShowcaseLabels };
63
+ export type { DeviceFrameProps, DeviceKind, ShowcaseStep, StepShowcaseLabels, StepShowcaseProps };
package/dist/stepper.d.ts CHANGED
@@ -109,4 +109,5 @@ type StepperProps = Omit<React.ComponentProps<"ol">, "children"> & {
109
109
  /** An ordered list of steps: `aria-current="step"` on the current one, each state said in words. */
110
110
  declare function Stepper({ steps, current, labels, orientation, className, ...props }: StepperProps): React.JSX.Element;
111
111
 
112
- export { type Step, type StepStatus, Stepper, type StepperProps, stepper };
112
+ export { Stepper, stepper };
113
+ export type { Step, StepStatus, StepperProps };
@@ -1,12 +1,35 @@
1
1
  import * as tailwind_variants from 'tailwind-variants';
2
2
  import * as React from 'react';
3
3
 
4
- declare const stickyAction: tailwind_variants.TVReturnType<{} | {} | {}, undefined, "sticky bottom-0 z-30 border-t border-border-subtle bg-surface-1 px-4 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3 md:hidden", {} | {}, undefined, tailwind_variants.TVReturnTypeLike<unknown, undefined>>;
4
+ declare const stickyAction: tailwind_variants.TVReturnType<{
5
+ mode: {
6
+ phone: "md:hidden";
7
+ task: "";
8
+ };
9
+ }, undefined, "sticky bottom-0 z-30 border-t border-border-subtle bg-surface-1 px-4 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3", {
10
+ mode: {
11
+ phone: "md:hidden";
12
+ task: "";
13
+ };
14
+ }, undefined, tailwind_variants.TVReturnTypeLike<{
15
+ mode: {
16
+ phone: "md:hidden";
17
+ task: "";
18
+ };
19
+ }, undefined>>;
5
20
  type StickyActionProps = React.ComponentProps<"div"> & {
6
- /** The action: one `ButtonLink` (full width is added). */
21
+ /**
22
+ * `phone`: the bar of a phone only. `task`: on every width, for a form the person is finishing.
23
+ * @default "phone"
24
+ */
25
+ mode?: "phone" | "task";
26
+ /** `task` only: what the action commits (`Total 1 250,00 $`), at the left of the action; stacked above it on a phone. */
27
+ summary?: React.ReactNode;
28
+ /** The action: one `ButtonLink` (full width is added on a phone). */
7
29
  children: React.ReactNode;
8
30
  };
9
- /** The one action of a page, held at the bottom edge of a phone. */
10
- declare function StickyAction({ className, children, ...props }: StickyActionProps): React.JSX.Element;
31
+ /** The one action of a page, held at the bottom edge of a phone — or, in `task` mode, of the form on every width. */
32
+ declare function StickyAction({ mode, summary, className, children, ...props }: StickyActionProps): React.JSX.Element;
11
33
 
12
- export { StickyAction, type StickyActionProps, stickyAction };
34
+ export { StickyAction, stickyAction };
35
+ export type { StickyActionProps };