foldkit-mixins-ui 0.21.0 → 0.23.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 (775) hide show
  1. package/README.md +8 -5
  2. package/dist/accordion.d.ts +66 -0
  3. package/dist/accordion.d.ts.map +1 -0
  4. package/dist/accordion.js +87 -0
  5. package/dist/accordion.js.map +1 -0
  6. package/dist/alert.d.ts +68 -0
  7. package/dist/alert.d.ts.map +1 -0
  8. package/dist/alert.js +59 -0
  9. package/dist/alert.js.map +1 -0
  10. package/dist/anchor.d.ts +86 -0
  11. package/dist/anchor.d.ts.map +1 -0
  12. package/dist/anchor.js +180 -0
  13. package/dist/anchor.js.map +1 -0
  14. package/dist/angleSlider.d.ts +119 -0
  15. package/dist/angleSlider.d.ts.map +1 -0
  16. package/dist/angleSlider.js +229 -0
  17. package/dist/angleSlider.js.map +1 -0
  18. package/dist/appShell.d.ts +58 -0
  19. package/dist/appShell.d.ts.map +1 -0
  20. package/dist/appShell.js +53 -0
  21. package/dist/appShell.js.map +1 -0
  22. package/dist/aspectRatio.d.ts +23 -0
  23. package/dist/aspectRatio.d.ts.map +1 -0
  24. package/dist/aspectRatio.js +17 -0
  25. package/dist/aspectRatio.js.map +1 -0
  26. package/dist/avatar.d.ts +98 -0
  27. package/dist/avatar.d.ts.map +1 -0
  28. package/dist/avatar.js +110 -0
  29. package/dist/avatar.js.map +1 -0
  30. package/dist/badge.d.ts +27 -0
  31. package/dist/badge.d.ts.map +1 -0
  32. package/dist/badge.js +18 -0
  33. package/dist/badge.js.map +1 -0
  34. package/dist/breadcrumb.d.ts +101 -0
  35. package/dist/breadcrumb.d.ts.map +1 -0
  36. package/dist/breadcrumb.js +104 -0
  37. package/dist/breadcrumb.js.map +1 -0
  38. package/dist/button.d.ts +50 -0
  39. package/dist/button.d.ts.map +1 -0
  40. package/dist/button.js +39 -0
  41. package/dist/button.js.map +1 -0
  42. package/dist/buttonGroup.d.ts +44 -0
  43. package/dist/buttonGroup.d.ts.map +1 -0
  44. package/dist/buttonGroup.js +33 -0
  45. package/dist/buttonGroup.js.map +1 -0
  46. package/dist/calendar.d.ts +352 -0
  47. package/dist/calendar.d.ts.map +1 -0
  48. package/dist/calendar.js +755 -0
  49. package/dist/calendar.js.map +1 -0
  50. package/dist/card.d.ts +125 -0
  51. package/dist/card.d.ts.map +1 -0
  52. package/dist/card.js +144 -0
  53. package/dist/card.js.map +1 -0
  54. package/dist/carousel.d.ts +153 -0
  55. package/dist/carousel.d.ts.map +1 -0
  56. package/dist/carousel.js +343 -0
  57. package/dist/carousel.js.map +1 -0
  58. package/dist/cascadeSelect.d.ts +207 -0
  59. package/dist/cascadeSelect.d.ts.map +1 -0
  60. package/dist/cascadeSelect.js +490 -0
  61. package/dist/cascadeSelect.js.map +1 -0
  62. package/dist/chart/scale.d.ts +40 -0
  63. package/dist/chart/scale.d.ts.map +1 -0
  64. package/dist/chart/scale.js +106 -0
  65. package/dist/chart/scale.js.map +1 -0
  66. package/dist/chart.d.ts +165 -0
  67. package/dist/chart.d.ts.map +1 -0
  68. package/dist/chart.js +365 -0
  69. package/dist/chart.js.map +1 -0
  70. package/dist/chatMessage.d.ts +124 -0
  71. package/dist/chatMessage.d.ts.map +1 -0
  72. package/dist/chatMessage.js +118 -0
  73. package/dist/chatMessage.js.map +1 -0
  74. package/dist/checkbox.d.ts +22 -0
  75. package/dist/checkbox.d.ts.map +1 -0
  76. package/dist/checkbox.js +36 -0
  77. package/dist/checkbox.js.map +1 -0
  78. package/dist/checkboxGroup.d.ts +70 -0
  79. package/dist/checkboxGroup.d.ts.map +1 -0
  80. package/dist/checkboxGroup.js +110 -0
  81. package/dist/checkboxGroup.js.map +1 -0
  82. package/dist/choices.d.ts +7 -0
  83. package/dist/choices.d.ts.map +1 -0
  84. package/dist/choices.js +10 -0
  85. package/dist/choices.js.map +1 -0
  86. package/dist/codeBlock.d.ts +79 -0
  87. package/dist/codeBlock.d.ts.map +1 -0
  88. package/dist/codeBlock.js +75 -0
  89. package/dist/codeBlock.js.map +1 -0
  90. package/dist/colorPicker.d.ts +239 -0
  91. package/dist/colorPicker.d.ts.map +1 -0
  92. package/dist/colorPicker.js +724 -0
  93. package/dist/colorPicker.js.map +1 -0
  94. package/dist/combobox.d.ts +162 -0
  95. package/dist/combobox.d.ts.map +1 -0
  96. package/dist/combobox.js +244 -0
  97. package/dist/combobox.js.map +1 -0
  98. package/dist/comboboxShared.d.ts +96 -0
  99. package/dist/comboboxShared.d.ts.map +1 -0
  100. package/dist/comboboxShared.js +356 -0
  101. package/dist/comboboxShared.js.map +1 -0
  102. package/dist/comboboxView.d.ts +39 -0
  103. package/dist/comboboxView.d.ts.map +1 -0
  104. package/dist/comboboxView.js +51 -0
  105. package/dist/comboboxView.js.map +1 -0
  106. package/dist/command.d.ts +145 -0
  107. package/dist/command.d.ts.map +1 -0
  108. package/dist/command.js +220 -0
  109. package/dist/command.js.map +1 -0
  110. package/dist/datePicker.d.ts +54 -0
  111. package/dist/datePicker.d.ts.map +1 -0
  112. package/dist/datePicker.js +88 -0
  113. package/dist/datePicker.js.map +1 -0
  114. package/dist/datePickerUtils.d.ts +23 -0
  115. package/dist/datePickerUtils.d.ts.map +1 -0
  116. package/dist/datePickerUtils.js +71 -0
  117. package/dist/datePickerUtils.js.map +1 -0
  118. package/dist/datePickerView.d.ts +368 -0
  119. package/dist/datePickerView.d.ts.map +1 -0
  120. package/dist/datePickerView.js +128 -0
  121. package/dist/datePickerView.js.map +1 -0
  122. package/dist/dialog.d.ts +90 -0
  123. package/dist/dialog.d.ts.map +1 -0
  124. package/dist/dialog.js +112 -0
  125. package/dist/dialog.js.map +1 -0
  126. package/dist/direction.d.ts +26 -0
  127. package/dist/direction.d.ts.map +1 -0
  128. package/dist/direction.js +63 -0
  129. package/dist/direction.js.map +1 -0
  130. package/dist/disclosure.d.ts +15 -0
  131. package/dist/disclosure.d.ts.map +1 -0
  132. package/dist/disclosure.js +23 -0
  133. package/dist/disclosure.js.map +1 -0
  134. package/dist/drawer.d.ts +118 -0
  135. package/dist/drawer.d.ts.map +1 -0
  136. package/dist/drawer.js +208 -0
  137. package/dist/drawer.js.map +1 -0
  138. package/dist/empty.d.ts +35 -0
  139. package/dist/empty.d.ts.map +1 -0
  140. package/dist/empty.js +30 -0
  141. package/dist/empty.js.map +1 -0
  142. package/dist/field.d.ts +12 -0
  143. package/dist/field.d.ts.map +1 -0
  144. package/dist/field.js +18 -0
  145. package/dist/field.js.map +1 -0
  146. package/dist/fieldset.d.ts +16 -0
  147. package/dist/fieldset.d.ts.map +1 -0
  148. package/dist/fieldset.js +18 -0
  149. package/dist/fieldset.js.map +1 -0
  150. package/dist/figure.d.ts +24 -0
  151. package/dist/figure.d.ts.map +1 -0
  152. package/dist/figure.js +25 -0
  153. package/dist/figure.js.map +1 -0
  154. package/dist/fileDrop.d.ts +22 -0
  155. package/dist/fileDrop.d.ts.map +1 -0
  156. package/dist/fileDrop.js +25 -0
  157. package/dist/fileDrop.js.map +1 -0
  158. package/dist/floatingPanel.d.ts +226 -0
  159. package/dist/floatingPanel.d.ts.map +1 -0
  160. package/dist/floatingPanel.js +435 -0
  161. package/dist/floatingPanel.js.map +1 -0
  162. package/dist/hoverIntent.d.ts +48 -0
  163. package/dist/hoverIntent.d.ts.map +1 -0
  164. package/dist/hoverIntent.js +84 -0
  165. package/dist/hoverIntent.js.map +1 -0
  166. package/dist/icon.d.ts +31 -0
  167. package/dist/icon.d.ts.map +1 -0
  168. package/dist/icon.js +22 -0
  169. package/dist/icon.js.map +1 -0
  170. package/dist/icons.d.ts +17 -0
  171. package/dist/icons.d.ts.map +1 -0
  172. package/dist/icons.js +32 -0
  173. package/dist/icons.js.map +1 -0
  174. package/dist/image.d.ts +85 -0
  175. package/dist/image.d.ts.map +1 -0
  176. package/dist/image.js +201 -0
  177. package/dist/image.js.map +1 -0
  178. package/dist/imageAttributes.d.ts +5 -0
  179. package/dist/imageAttributes.d.ts.map +1 -0
  180. package/dist/imageAttributes.js +22 -0
  181. package/dist/imageAttributes.js.map +1 -0
  182. package/dist/imageCropper.d.ts +284 -0
  183. package/dist/imageCropper.d.ts.map +1 -0
  184. package/dist/imageCropper.js +922 -0
  185. package/dist/imageCropper.js.map +1 -0
  186. package/dist/index.d.ts +187 -0
  187. package/dist/index.js +181 -0
  188. package/dist/input.d.ts +64 -0
  189. package/dist/input.d.ts.map +1 -0
  190. package/dist/input.js +76 -0
  191. package/dist/input.js.map +1 -0
  192. package/dist/inputCopy.d.ts +89 -0
  193. package/dist/inputCopy.d.ts.map +1 -0
  194. package/dist/inputCopy.js +120 -0
  195. package/dist/inputCopy.js.map +1 -0
  196. package/dist/item.d.ts +78 -0
  197. package/dist/item.d.ts.map +1 -0
  198. package/dist/item.js +75 -0
  199. package/dist/item.js.map +1 -0
  200. package/dist/kbd.d.ts +42 -0
  201. package/dist/kbd.d.ts.map +1 -0
  202. package/dist/kbd.js +28 -0
  203. package/dist/kbd.js.map +1 -0
  204. package/dist/label.d.ts +26 -0
  205. package/dist/label.d.ts.map +1 -0
  206. package/dist/label.js +18 -0
  207. package/dist/label.js.map +1 -0
  208. package/dist/listbox.d.ts +144 -0
  209. package/dist/listbox.d.ts.map +1 -0
  210. package/dist/listbox.js +220 -0
  211. package/dist/listbox.js.map +1 -0
  212. package/dist/listboxShared.d.ts +74 -0
  213. package/dist/listboxShared.d.ts.map +1 -0
  214. package/dist/listboxShared.js +298 -0
  215. package/dist/listboxShared.js.map +1 -0
  216. package/dist/listboxView.d.ts +33 -0
  217. package/dist/listboxView.d.ts.map +1 -0
  218. package/dist/listboxView.js +49 -0
  219. package/dist/listboxView.js.map +1 -0
  220. package/dist/marquee.d.ts +104 -0
  221. package/dist/marquee.d.ts.map +1 -0
  222. package/dist/marquee.js +126 -0
  223. package/dist/marquee.js.map +1 -0
  224. package/dist/menu.d.ts +556 -0
  225. package/dist/menu.d.ts.map +1 -0
  226. package/dist/menu.js +891 -0
  227. package/dist/menu.js.map +1 -0
  228. package/dist/menuUtils.d.ts +20 -0
  229. package/dist/menuUtils.d.ts.map +1 -0
  230. package/dist/menuUtils.js +56 -0
  231. package/dist/menuUtils.js.map +1 -0
  232. package/dist/menuView.d.ts +70 -0
  233. package/dist/menuView.d.ts.map +1 -0
  234. package/dist/menuView.js +281 -0
  235. package/dist/menuView.js.map +1 -0
  236. package/dist/menubar.d.ts +201 -0
  237. package/dist/menubar.d.ts.map +1 -0
  238. package/dist/menubar.js +263 -0
  239. package/dist/menubar.js.map +1 -0
  240. package/dist/messageScroller.d.ts +122 -0
  241. package/dist/messageScroller.d.ts.map +1 -0
  242. package/dist/messageScroller.js +252 -0
  243. package/dist/messageScroller.js.map +1 -0
  244. package/dist/meter.d.ts +44 -0
  245. package/dist/meter.d.ts.map +1 -0
  246. package/dist/meter.js +50 -0
  247. package/dist/meter.js.map +1 -0
  248. package/dist/nav.d.ts +178 -0
  249. package/dist/nav.d.ts.map +1 -0
  250. package/dist/nav.js +363 -0
  251. package/dist/nav.js.map +1 -0
  252. package/dist/numberField.d.ts +51 -0
  253. package/dist/numberField.d.ts.map +1 -0
  254. package/dist/numberField.js +97 -0
  255. package/dist/numberField.js.map +1 -0
  256. package/dist/otpField.d.ts +47 -0
  257. package/dist/otpField.d.ts.map +1 -0
  258. package/dist/otpField.js +54 -0
  259. package/dist/otpField.js.map +1 -0
  260. package/dist/pagination.d.ts +91 -0
  261. package/dist/pagination.d.ts.map +1 -0
  262. package/dist/pagination.js +94 -0
  263. package/dist/pagination.js.map +1 -0
  264. package/dist/passwordInput.d.ts +85 -0
  265. package/dist/passwordInput.d.ts.map +1 -0
  266. package/dist/passwordInput.js +105 -0
  267. package/dist/passwordInput.js.map +1 -0
  268. package/dist/patterns.d.ts +875 -0
  269. package/dist/patterns.d.ts.map +1 -0
  270. package/dist/patterns.js +1047 -0
  271. package/dist/patterns.js.map +1 -0
  272. package/dist/picker.d.ts +234 -0
  273. package/dist/picker.d.ts.map +1 -0
  274. package/dist/picker.js +210 -0
  275. package/dist/picker.js.map +1 -0
  276. package/dist/popover.d.ts +39 -0
  277. package/dist/popover.d.ts.map +1 -0
  278. package/dist/popover.js +62 -0
  279. package/dist/popover.js.map +1 -0
  280. package/dist/popupScroll.d.ts +15 -0
  281. package/dist/popupScroll.d.ts.map +1 -0
  282. package/dist/popupScroll.js +12 -0
  283. package/dist/popupScroll.js.map +1 -0
  284. package/dist/popupView.d.ts +64 -0
  285. package/dist/popupView.d.ts.map +1 -0
  286. package/dist/popupView.js +43 -0
  287. package/dist/popupView.js.map +1 -0
  288. package/dist/progress.d.ts +65 -0
  289. package/dist/progress.d.ts.map +1 -0
  290. package/dist/progress.js +87 -0
  291. package/dist/progress.js.map +1 -0
  292. package/dist/qrCode.d.ts +95 -0
  293. package/dist/qrCode.d.ts.map +1 -0
  294. package/dist/qrCode.js +182 -0
  295. package/dist/qrCode.js.map +1 -0
  296. package/dist/questionnaire.d.ts +289 -0
  297. package/dist/questionnaire.d.ts.map +1 -0
  298. package/dist/questionnaire.js +512 -0
  299. package/dist/questionnaire.js.map +1 -0
  300. package/dist/radioGroup.d.ts +57 -0
  301. package/dist/radioGroup.d.ts.map +1 -0
  302. package/dist/radioGroup.js +77 -0
  303. package/dist/radioGroup.js.map +1 -0
  304. package/dist/rating.d.ts +78 -0
  305. package/dist/rating.d.ts.map +1 -0
  306. package/dist/rating.js +117 -0
  307. package/dist/rating.js.map +1 -0
  308. package/dist/recipes/accordion.d.ts +61 -0
  309. package/dist/recipes/accordion.d.ts.map +1 -0
  310. package/dist/recipes/accordion.js +206 -0
  311. package/dist/recipes/accordion.js.map +1 -0
  312. package/dist/recipes/alert.d.ts +34 -0
  313. package/dist/recipes/alert.d.ts.map +1 -0
  314. package/dist/recipes/alert.js +151 -0
  315. package/dist/recipes/alert.js.map +1 -0
  316. package/dist/recipes/angleSlider.d.ts +52 -0
  317. package/dist/recipes/angleSlider.d.ts.map +1 -0
  318. package/dist/recipes/angleSlider.js +162 -0
  319. package/dist/recipes/angleSlider.js.map +1 -0
  320. package/dist/recipes/appShell.d.ts +21 -0
  321. package/dist/recipes/appShell.d.ts.map +1 -0
  322. package/dist/recipes/appShell.js +132 -0
  323. package/dist/recipes/appShell.js.map +1 -0
  324. package/dist/recipes/aspectRatio.d.ts +16 -0
  325. package/dist/recipes/aspectRatio.d.ts.map +1 -0
  326. package/dist/recipes/aspectRatio.js +24 -0
  327. package/dist/recipes/aspectRatio.js.map +1 -0
  328. package/dist/recipes/avatar.d.ts +66 -0
  329. package/dist/recipes/avatar.d.ts.map +1 -0
  330. package/dist/recipes/avatar.js +138 -0
  331. package/dist/recipes/avatar.js.map +1 -0
  332. package/dist/recipes/badge.d.ts +21 -0
  333. package/dist/recipes/badge.d.ts.map +1 -0
  334. package/dist/recipes/badge.js +73 -0
  335. package/dist/recipes/badge.js.map +1 -0
  336. package/dist/recipes/breadcrumb.d.ts +24 -0
  337. package/dist/recipes/breadcrumb.d.ts.map +1 -0
  338. package/dist/recipes/breadcrumb.js +101 -0
  339. package/dist/recipes/breadcrumb.js.map +1 -0
  340. package/dist/recipes/button.d.ts +60 -0
  341. package/dist/recipes/button.d.ts.map +1 -0
  342. package/dist/recipes/button.js +193 -0
  343. package/dist/recipes/button.js.map +1 -0
  344. package/dist/recipes/buttonGroup.d.ts +23 -0
  345. package/dist/recipes/buttonGroup.d.ts.map +1 -0
  346. package/dist/recipes/buttonGroup.js +81 -0
  347. package/dist/recipes/buttonGroup.js.map +1 -0
  348. package/dist/recipes/calendar.d.ts +57 -0
  349. package/dist/recipes/calendar.d.ts.map +1 -0
  350. package/dist/recipes/calendar.js +265 -0
  351. package/dist/recipes/calendar.js.map +1 -0
  352. package/dist/recipes/card.d.ts +116 -0
  353. package/dist/recipes/card.d.ts.map +1 -0
  354. package/dist/recipes/card.js +368 -0
  355. package/dist/recipes/card.js.map +1 -0
  356. package/dist/recipes/carousel.d.ts +21 -0
  357. package/dist/recipes/carousel.d.ts.map +1 -0
  358. package/dist/recipes/carousel.js +187 -0
  359. package/dist/recipes/carousel.js.map +1 -0
  360. package/dist/recipes/cascadeSelect.d.ts +49 -0
  361. package/dist/recipes/cascadeSelect.d.ts.map +1 -0
  362. package/dist/recipes/cascadeSelect.js +171 -0
  363. package/dist/recipes/cascadeSelect.js.map +1 -0
  364. package/dist/recipes/chart.d.ts +66 -0
  365. package/dist/recipes/chart.d.ts.map +1 -0
  366. package/dist/recipes/chart.js +258 -0
  367. package/dist/recipes/chart.js.map +1 -0
  368. package/dist/recipes/chatMessage.d.ts +45 -0
  369. package/dist/recipes/chatMessage.d.ts.map +1 -0
  370. package/dist/recipes/chatMessage.js +189 -0
  371. package/dist/recipes/chatMessage.js.map +1 -0
  372. package/dist/recipes/checkboxGroup.d.ts +29 -0
  373. package/dist/recipes/checkboxGroup.d.ts.map +1 -0
  374. package/dist/recipes/checkboxGroup.js +114 -0
  375. package/dist/recipes/checkboxGroup.js.map +1 -0
  376. package/dist/recipes/codeBlock.d.ts +11 -0
  377. package/dist/recipes/codeBlock.d.ts.map +1 -0
  378. package/dist/recipes/codeBlock.js +91 -0
  379. package/dist/recipes/codeBlock.js.map +1 -0
  380. package/dist/recipes/colorPicker.d.ts +36 -0
  381. package/dist/recipes/colorPicker.d.ts.map +1 -0
  382. package/dist/recipes/colorPicker.js +192 -0
  383. package/dist/recipes/colorPicker.js.map +1 -0
  384. package/dist/recipes/combobox.d.ts +61 -0
  385. package/dist/recipes/combobox.d.ts.map +1 -0
  386. package/dist/recipes/combobox.js +129 -0
  387. package/dist/recipes/combobox.js.map +1 -0
  388. package/dist/recipes/command.d.ts +33 -0
  389. package/dist/recipes/command.d.ts.map +1 -0
  390. package/dist/recipes/command.js +201 -0
  391. package/dist/recipes/command.js.map +1 -0
  392. package/dist/recipes/datePicker.d.ts +17 -0
  393. package/dist/recipes/datePicker.d.ts.map +1 -0
  394. package/dist/recipes/datePicker.js +54 -0
  395. package/dist/recipes/datePicker.js.map +1 -0
  396. package/dist/recipes/design.d.ts +721 -0
  397. package/dist/recipes/design.d.ts.map +1 -0
  398. package/dist/recipes/design.js +348 -0
  399. package/dist/recipes/design.js.map +1 -0
  400. package/dist/recipes/dialog.d.ts +34 -0
  401. package/dist/recipes/dialog.d.ts.map +1 -0
  402. package/dist/recipes/dialog.js +130 -0
  403. package/dist/recipes/dialog.js.map +1 -0
  404. package/dist/recipes/drawer.d.ts +26 -0
  405. package/dist/recipes/drawer.d.ts.map +1 -0
  406. package/dist/recipes/drawer.js +135 -0
  407. package/dist/recipes/drawer.js.map +1 -0
  408. package/dist/recipes/empty.d.ts +40 -0
  409. package/dist/recipes/empty.d.ts.map +1 -0
  410. package/dist/recipes/empty.js +94 -0
  411. package/dist/recipes/empty.js.map +1 -0
  412. package/dist/recipes/field.d.ts +84 -0
  413. package/dist/recipes/field.d.ts.map +1 -0
  414. package/dist/recipes/field.js +190 -0
  415. package/dist/recipes/field.js.map +1 -0
  416. package/dist/recipes/figure.d.ts +12 -0
  417. package/dist/recipes/figure.d.ts.map +1 -0
  418. package/dist/recipes/figure.js +33 -0
  419. package/dist/recipes/figure.js.map +1 -0
  420. package/dist/recipes/fileDrop.d.ts +5 -0
  421. package/dist/recipes/fileDrop.d.ts.map +1 -0
  422. package/dist/recipes/fileDrop.js +35 -0
  423. package/dist/recipes/fileDrop.js.map +1 -0
  424. package/dist/recipes/floatingPanel.d.ts +24 -0
  425. package/dist/recipes/floatingPanel.d.ts.map +1 -0
  426. package/dist/recipes/floatingPanel.js +214 -0
  427. package/dist/recipes/floatingPanel.js.map +1 -0
  428. package/dist/recipes/hoverCard.d.ts +13 -0
  429. package/dist/recipes/hoverCard.d.ts.map +1 -0
  430. package/dist/recipes/hoverCard.js +60 -0
  431. package/dist/recipes/hoverCard.js.map +1 -0
  432. package/dist/recipes/icon.d.ts +16 -0
  433. package/dist/recipes/icon.d.ts.map +1 -0
  434. package/dist/recipes/icon.js +36 -0
  435. package/dist/recipes/icon.js.map +1 -0
  436. package/dist/recipes/image.d.ts +51 -0
  437. package/dist/recipes/image.d.ts.map +1 -0
  438. package/dist/recipes/image.js +72 -0
  439. package/dist/recipes/image.js.map +1 -0
  440. package/dist/recipes/imageCropper.d.ts +43 -0
  441. package/dist/recipes/imageCropper.d.ts.map +1 -0
  442. package/dist/recipes/imageCropper.js +220 -0
  443. package/dist/recipes/imageCropper.js.map +1 -0
  444. package/dist/recipes/index.d.ts +82 -0
  445. package/dist/recipes/index.js +82 -0
  446. package/dist/recipes/inputCopy.d.ts +9 -0
  447. package/dist/recipes/inputCopy.d.ts.map +1 -0
  448. package/dist/recipes/inputCopy.js +76 -0
  449. package/dist/recipes/inputCopy.js.map +1 -0
  450. package/dist/recipes/item.d.ts +52 -0
  451. package/dist/recipes/item.d.ts.map +1 -0
  452. package/dist/recipes/item.js +139 -0
  453. package/dist/recipes/item.js.map +1 -0
  454. package/dist/recipes/kbd.d.ts +6 -0
  455. package/dist/recipes/kbd.d.ts.map +1 -0
  456. package/dist/recipes/kbd.js +42 -0
  457. package/dist/recipes/kbd.js.map +1 -0
  458. package/dist/recipes/label.d.ts +4 -0
  459. package/dist/recipes/label.d.ts.map +1 -0
  460. package/dist/recipes/label.js +19 -0
  461. package/dist/recipes/label.js.map +1 -0
  462. package/dist/recipes/listbox.d.ts +92 -0
  463. package/dist/recipes/listbox.d.ts.map +1 -0
  464. package/dist/recipes/listbox.js +165 -0
  465. package/dist/recipes/listbox.js.map +1 -0
  466. package/dist/recipes/marquee.d.ts +26 -0
  467. package/dist/recipes/marquee.d.ts.map +1 -0
  468. package/dist/recipes/marquee.js +107 -0
  469. package/dist/recipes/marquee.js.map +1 -0
  470. package/dist/recipes/menu.d.ts +32 -0
  471. package/dist/recipes/menu.d.ts.map +1 -0
  472. package/dist/recipes/menu.js +110 -0
  473. package/dist/recipes/menu.js.map +1 -0
  474. package/dist/recipes/menubar.d.ts +36 -0
  475. package/dist/recipes/menubar.d.ts.map +1 -0
  476. package/dist/recipes/menubar.js +40 -0
  477. package/dist/recipes/menubar.js.map +1 -0
  478. package/dist/recipes/messageScroller.d.ts +7 -0
  479. package/dist/recipes/messageScroller.d.ts.map +1 -0
  480. package/dist/recipes/messageScroller.js +82 -0
  481. package/dist/recipes/messageScroller.js.map +1 -0
  482. package/dist/recipes/meter.d.ts +7 -0
  483. package/dist/recipes/meter.d.ts.map +1 -0
  484. package/dist/recipes/meter.js +38 -0
  485. package/dist/recipes/meter.js.map +1 -0
  486. package/dist/recipes/nav.d.ts +29 -0
  487. package/dist/recipes/nav.d.ts.map +1 -0
  488. package/dist/recipes/nav.js +173 -0
  489. package/dist/recipes/nav.js.map +1 -0
  490. package/dist/recipes/numberField.d.ts +10 -0
  491. package/dist/recipes/numberField.d.ts.map +1 -0
  492. package/dist/recipes/numberField.js +80 -0
  493. package/dist/recipes/numberField.js.map +1 -0
  494. package/dist/recipes/otpField.d.ts +8 -0
  495. package/dist/recipes/otpField.d.ts.map +1 -0
  496. package/dist/recipes/otpField.js +81 -0
  497. package/dist/recipes/otpField.js.map +1 -0
  498. package/dist/recipes/pagination.d.ts +28 -0
  499. package/dist/recipes/pagination.d.ts.map +1 -0
  500. package/dist/recipes/pagination.js +104 -0
  501. package/dist/recipes/pagination.js.map +1 -0
  502. package/dist/recipes/passwordInput.d.ts +26 -0
  503. package/dist/recipes/passwordInput.d.ts.map +1 -0
  504. package/dist/recipes/passwordInput.js +87 -0
  505. package/dist/recipes/passwordInput.js.map +1 -0
  506. package/dist/recipes/picker.d.ts +43 -0
  507. package/dist/recipes/picker.d.ts.map +1 -0
  508. package/dist/recipes/picker.js +64 -0
  509. package/dist/recipes/picker.js.map +1 -0
  510. package/dist/recipes/popover.d.ts +46 -0
  511. package/dist/recipes/popover.d.ts.map +1 -0
  512. package/dist/recipes/popover.js +124 -0
  513. package/dist/recipes/popover.js.map +1 -0
  514. package/dist/recipes/popup.d.ts +48 -0
  515. package/dist/recipes/popup.d.ts.map +1 -0
  516. package/dist/recipes/popup.js +147 -0
  517. package/dist/recipes/popup.js.map +1 -0
  518. package/dist/recipes/progress.d.ts +69 -0
  519. package/dist/recipes/progress.d.ts.map +1 -0
  520. package/dist/recipes/progress.js +197 -0
  521. package/dist/recipes/progress.js.map +1 -0
  522. package/dist/recipes/qrCode.d.ts +27 -0
  523. package/dist/recipes/qrCode.d.ts.map +1 -0
  524. package/dist/recipes/qrCode.js +69 -0
  525. package/dist/recipes/qrCode.js.map +1 -0
  526. package/dist/recipes/questionnaire.d.ts +30 -0
  527. package/dist/recipes/questionnaire.d.ts.map +1 -0
  528. package/dist/recipes/questionnaire.js +105 -0
  529. package/dist/recipes/questionnaire.js.map +1 -0
  530. package/dist/recipes/radio.d.ts +38 -0
  531. package/dist/recipes/radio.d.ts.map +1 -0
  532. package/dist/recipes/radio.js +109 -0
  533. package/dist/recipes/radio.js.map +1 -0
  534. package/dist/recipes/rating.d.ts +39 -0
  535. package/dist/recipes/rating.d.ts.map +1 -0
  536. package/dist/recipes/rating.js +98 -0
  537. package/dist/recipes/rating.js.map +1 -0
  538. package/dist/recipes/resizable.d.ts +15 -0
  539. package/dist/recipes/resizable.d.ts.map +1 -0
  540. package/dist/recipes/resizable.js +91 -0
  541. package/dist/recipes/resizable.js.map +1 -0
  542. package/dist/recipes/scrollArea.d.ts +21 -0
  543. package/dist/recipes/scrollArea.d.ts.map +1 -0
  544. package/dist/recipes/scrollArea.js +60 -0
  545. package/dist/recipes/scrollArea.js.map +1 -0
  546. package/dist/recipes/scrollBars.d.ts +13 -0
  547. package/dist/recipes/scrollBars.d.ts.map +1 -0
  548. package/dist/recipes/scrollBars.js +90 -0
  549. package/dist/recipes/scrollBars.js.map +1 -0
  550. package/dist/recipes/segmented.d.ts +46 -0
  551. package/dist/recipes/segmented.d.ts.map +1 -0
  552. package/dist/recipes/segmented.js +153 -0
  553. package/dist/recipes/segmented.js.map +1 -0
  554. package/dist/recipes/select.d.ts +26 -0
  555. package/dist/recipes/select.d.ts.map +1 -0
  556. package/dist/recipes/select.js +74 -0
  557. package/dist/recipes/select.js.map +1 -0
  558. package/dist/recipes/separator.d.ts +51 -0
  559. package/dist/recipes/separator.d.ts.map +1 -0
  560. package/dist/recipes/separator.js +100 -0
  561. package/dist/recipes/separator.js.map +1 -0
  562. package/dist/recipes/sheet.d.ts +48 -0
  563. package/dist/recipes/sheet.d.ts.map +1 -0
  564. package/dist/recipes/sheet.js +227 -0
  565. package/dist/recipes/sheet.js.map +1 -0
  566. package/dist/recipes/sidebar.d.ts +38 -0
  567. package/dist/recipes/sidebar.d.ts.map +1 -0
  568. package/dist/recipes/sidebar.js +332 -0
  569. package/dist/recipes/sidebar.js.map +1 -0
  570. package/dist/recipes/signaturePad.d.ts +38 -0
  571. package/dist/recipes/signaturePad.d.ts.map +1 -0
  572. package/dist/recipes/signaturePad.js +138 -0
  573. package/dist/recipes/signaturePad.js.map +1 -0
  574. package/dist/recipes/skeleton.d.ts +23 -0
  575. package/dist/recipes/skeleton.d.ts.map +1 -0
  576. package/dist/recipes/skeleton.js +92 -0
  577. package/dist/recipes/skeleton.js.map +1 -0
  578. package/dist/recipes/slider.d.ts +67 -0
  579. package/dist/recipes/slider.d.ts.map +1 -0
  580. package/dist/recipes/slider.js +289 -0
  581. package/dist/recipes/slider.js.map +1 -0
  582. package/dist/recipes/spinner.d.ts +53 -0
  583. package/dist/recipes/spinner.d.ts.map +1 -0
  584. package/dist/recipes/spinner.js +140 -0
  585. package/dist/recipes/spinner.js.map +1 -0
  586. package/dist/recipes/steps.d.ts +59 -0
  587. package/dist/recipes/steps.d.ts.map +1 -0
  588. package/dist/recipes/steps.js +283 -0
  589. package/dist/recipes/steps.js.map +1 -0
  590. package/dist/recipes/table.d.ts +54 -0
  591. package/dist/recipes/table.d.ts.map +1 -0
  592. package/dist/recipes/table.js +191 -0
  593. package/dist/recipes/table.js.map +1 -0
  594. package/dist/recipes/tabs.d.ts +42 -0
  595. package/dist/recipes/tabs.d.ts.map +1 -0
  596. package/dist/recipes/tabs.js +188 -0
  597. package/dist/recipes/tabs.js.map +1 -0
  598. package/dist/recipes/tagsInput.d.ts +16 -0
  599. package/dist/recipes/tagsInput.d.ts.map +1 -0
  600. package/dist/recipes/tagsInput.js +125 -0
  601. package/dist/recipes/tagsInput.js.map +1 -0
  602. package/dist/recipes/thinkingIndicator.d.ts +44 -0
  603. package/dist/recipes/thinkingIndicator.d.ts.map +1 -0
  604. package/dist/recipes/thinkingIndicator.js +152 -0
  605. package/dist/recipes/thinkingIndicator.js.map +1 -0
  606. package/dist/recipes/thinkingSteps.d.ts +30 -0
  607. package/dist/recipes/thinkingSteps.d.ts.map +1 -0
  608. package/dist/recipes/thinkingSteps.js +158 -0
  609. package/dist/recipes/thinkingSteps.js.map +1 -0
  610. package/dist/recipes/timer.d.ts +43 -0
  611. package/dist/recipes/timer.d.ts.map +1 -0
  612. package/dist/recipes/timer.js +108 -0
  613. package/dist/recipes/timer.js.map +1 -0
  614. package/dist/recipes/toast.d.ts +22 -0
  615. package/dist/recipes/toast.d.ts.map +1 -0
  616. package/dist/recipes/toast.js +239 -0
  617. package/dist/recipes/toast.js.map +1 -0
  618. package/dist/recipes/toggle.d.ts +53 -0
  619. package/dist/recipes/toggle.d.ts.map +1 -0
  620. package/dist/recipes/toggle.js +143 -0
  621. package/dist/recipes/toggle.js.map +1 -0
  622. package/dist/recipes/tooltip.d.ts +14 -0
  623. package/dist/recipes/tooltip.d.ts.map +1 -0
  624. package/dist/recipes/tooltip.js +50 -0
  625. package/dist/recipes/tooltip.js.map +1 -0
  626. package/dist/recipes/tour.d.ts +15 -0
  627. package/dist/recipes/tour.d.ts.map +1 -0
  628. package/dist/recipes/tour.js +109 -0
  629. package/dist/recipes/tour.js.map +1 -0
  630. package/dist/recipes/treeView.d.ts +19 -0
  631. package/dist/recipes/treeView.d.ts.map +1 -0
  632. package/dist/recipes/treeView.js +150 -0
  633. package/dist/recipes/treeView.js.map +1 -0
  634. package/dist/recipes/typography.d.ts +52 -0
  635. package/dist/recipes/typography.d.ts.map +1 -0
  636. package/dist/recipes/typography.js +88 -0
  637. package/dist/recipes/typography.js.map +1 -0
  638. package/dist/recipes/virtualList.d.ts +7 -0
  639. package/dist/recipes/virtualList.d.ts.map +1 -0
  640. package/dist/recipes/virtualList.js +39 -0
  641. package/dist/recipes/virtualList.js.map +1 -0
  642. package/dist/recipes/windowList.d.ts +6 -0
  643. package/dist/recipes/windowList.d.ts.map +1 -0
  644. package/dist/recipes/windowList.js +14 -0
  645. package/dist/recipes/windowList.js.map +1 -0
  646. package/dist/resizable.d.ts +89 -0
  647. package/dist/resizable.d.ts.map +1 -0
  648. package/dist/resizable.js +153 -0
  649. package/dist/resizable.js.map +1 -0
  650. package/dist/resolve.d.ts +15 -0
  651. package/dist/resolve.d.ts.map +1 -0
  652. package/dist/resolve.js +19 -0
  653. package/dist/resolve.js.map +1 -0
  654. package/dist/scrollArea.d.ts +38 -0
  655. package/dist/scrollArea.d.ts.map +1 -0
  656. package/dist/scrollArea.js +42 -0
  657. package/dist/scrollArea.js.map +1 -0
  658. package/dist/segmented.d.ts +75 -0
  659. package/dist/segmented.d.ts.map +1 -0
  660. package/dist/segmented.js +120 -0
  661. package/dist/segmented.js.map +1 -0
  662. package/dist/select.d.ts +21 -0
  663. package/dist/select.d.ts.map +1 -0
  664. package/dist/select.js +29 -0
  665. package/dist/select.js.map +1 -0
  666. package/dist/separator.d.ts +36 -0
  667. package/dist/separator.d.ts.map +1 -0
  668. package/dist/separator.js +37 -0
  669. package/dist/separator.js.map +1 -0
  670. package/dist/sheet.d.ts +190 -0
  671. package/dist/sheet.d.ts.map +1 -0
  672. package/dist/sheet.js +292 -0
  673. package/dist/sheet.js.map +1 -0
  674. package/dist/sidebar.d.ts +337 -0
  675. package/dist/sidebar.d.ts.map +1 -0
  676. package/dist/sidebar.js +480 -0
  677. package/dist/sidebar.js.map +1 -0
  678. package/dist/signaturePad.d.ts +272 -0
  679. package/dist/signaturePad.d.ts.map +1 -0
  680. package/dist/signaturePad.js +522 -0
  681. package/dist/signaturePad.js.map +1 -0
  682. package/dist/skeleton.d.ts +43 -0
  683. package/dist/skeleton.d.ts.map +1 -0
  684. package/dist/skeleton.js +61 -0
  685. package/dist/skeleton.js.map +1 -0
  686. package/dist/slider.d.ts +116 -0
  687. package/dist/slider.d.ts.map +1 -0
  688. package/dist/slider.js +219 -0
  689. package/dist/slider.js.map +1 -0
  690. package/dist/spinner.d.ts +34 -0
  691. package/dist/spinner.d.ts.map +1 -0
  692. package/dist/spinner.js +30 -0
  693. package/dist/spinner.js.map +1 -0
  694. package/dist/steps.d.ts +60 -0
  695. package/dist/steps.d.ts.map +1 -0
  696. package/dist/steps.js +67 -0
  697. package/dist/steps.js.map +1 -0
  698. package/dist/switch.d.ts +18 -0
  699. package/dist/switch.d.ts.map +1 -0
  700. package/dist/switch.js +32 -0
  701. package/dist/switch.js.map +1 -0
  702. package/dist/table.d.ts +127 -0
  703. package/dist/table.d.ts.map +1 -0
  704. package/dist/table.js +165 -0
  705. package/dist/table.js.map +1 -0
  706. package/dist/tabs.d.ts +106 -0
  707. package/dist/tabs.d.ts.map +1 -0
  708. package/dist/tabs.js +156 -0
  709. package/dist/tabs.js.map +1 -0
  710. package/dist/tagsInput.d.ts +129 -0
  711. package/dist/tagsInput.d.ts.map +1 -0
  712. package/dist/tagsInput.js +225 -0
  713. package/dist/tagsInput.js.map +1 -0
  714. package/dist/textarea.d.ts +101 -0
  715. package/dist/textarea.d.ts.map +1 -0
  716. package/dist/textarea.js +131 -0
  717. package/dist/textarea.js.map +1 -0
  718. package/dist/thinkingIndicator.d.ts +39 -0
  719. package/dist/thinkingIndicator.d.ts.map +1 -0
  720. package/dist/thinkingIndicator.js +40 -0
  721. package/dist/thinkingIndicator.js.map +1 -0
  722. package/dist/thinkingSteps.d.ts +92 -0
  723. package/dist/thinkingSteps.d.ts.map +1 -0
  724. package/dist/thinkingSteps.js +137 -0
  725. package/dist/thinkingSteps.js.map +1 -0
  726. package/dist/timer.d.ts +154 -0
  727. package/dist/timer.d.ts.map +1 -0
  728. package/dist/timer.js +305 -0
  729. package/dist/timer.js.map +1 -0
  730. package/dist/toast.d.ts +301 -0
  731. package/dist/toast.d.ts.map +1 -0
  732. package/dist/toast.js +763 -0
  733. package/dist/toast.js.map +1 -0
  734. package/dist/toastUtils.d.ts +5 -0
  735. package/dist/toastUtils.d.ts.map +1 -0
  736. package/dist/toastUtils.js +32 -0
  737. package/dist/toastUtils.js.map +1 -0
  738. package/dist/toastView.d.ts +1431 -0
  739. package/dist/toastView.d.ts.map +1 -0
  740. package/dist/toastView.js +169 -0
  741. package/dist/toastView.js.map +1 -0
  742. package/dist/tooltip.d.ts +41 -0
  743. package/dist/tooltip.d.ts.map +1 -0
  744. package/dist/tooltip.js +62 -0
  745. package/dist/tooltip.js.map +1 -0
  746. package/dist/touch.d.ts +13 -0
  747. package/dist/touch.d.ts.map +1 -0
  748. package/dist/touch.js +23 -0
  749. package/dist/touch.js.map +1 -0
  750. package/dist/tour.d.ts +186 -0
  751. package/dist/tour.d.ts.map +1 -0
  752. package/dist/tour.js +344 -0
  753. package/dist/tour.js.map +1 -0
  754. package/dist/treeView.d.ts +138 -0
  755. package/dist/treeView.d.ts.map +1 -0
  756. package/dist/treeView.js +328 -0
  757. package/dist/treeView.js.map +1 -0
  758. package/dist/typography.d.ts +34 -0
  759. package/dist/typography.d.ts.map +1 -0
  760. package/dist/typography.js +29 -0
  761. package/dist/typography.js.map +1 -0
  762. package/dist/virtualList.d.ts +48 -0
  763. package/dist/virtualList.d.ts.map +1 -0
  764. package/dist/virtualList.js +65 -0
  765. package/dist/virtualList.js.map +1 -0
  766. package/dist/windowList.d.ts +155 -0
  767. package/dist/windowList.d.ts.map +1 -0
  768. package/dist/windowList.js +277 -0
  769. package/dist/windowList.js.map +1 -0
  770. package/package.json +17 -17
  771. package/dist/index.d.mts +0 -14433
  772. package/dist/index.d.mts.map +0 -1
  773. package/dist/index.mjs +0 -28874
  774. package/dist/index.mjs.map +0 -1
  775. package/dist/rolldown-runtime-D8jQpDG7.mjs +0 -12
package/README.md CHANGED
@@ -31,7 +31,7 @@ Three kinds of thing live here:
31
31
  - **Stateless views** draw a vocabulary from what the application passes and
32
32
  keep nothing: Card, Badge, Item, Avatar, Command, Slider, PasswordInput.
33
33
  - **Components with a small Model of their own**: Menu, Menubar, Toast,
34
- Sheet, Drawer, TagsInput, TreeView, Carousel, Resizable, ColorPicker, InputCopy,
34
+ Sheet, Picker, WindowList, Drawer, TagsInput, TreeView, Carousel, Resizable, ColorPicker, InputCopy,
35
35
  MessageScroller, Questionnaire, AngleSlider, Timer, Marquee, ImageCropper,
36
36
  SignaturePad, Chart, CascadeSelect, FloatingPanel and Tour.
37
37
  The Model holds interaction state only (what is open, a drag, a countdown,
@@ -473,7 +473,7 @@ adapter.
473
473
 
474
474
  These views take no `@foldkit/ui` bundle. Call `X.view(options, h)`. Most own no
475
475
  Model and no Message; the components among them that keep a small Model
476
- (Menu, Menubar, Toast, Sheet, Drawer, TagsInput, TreeView, Carousel, Resizable,
476
+ (Menu, Menubar, Toast, Sheet, Picker, WindowList, Drawer, TagsInput, TreeView, Carousel, Resizable,
477
477
  ColorPicker, InputCopy, MessageScroller, Questionnaire, AngleSlider, Timer,
478
478
  Marquee, ImageCropper, SignaturePad, Chart, CascadeSelect, FloatingPanel,
479
479
  Tour) say so, with its `init` and `update`.
@@ -521,7 +521,7 @@ glyph with it, so the recipe's size is the drawing's.
521
521
  | `Calendar` | One date system, inline: `Calendar.Selection` is `Single`, `Range` or `Multiple`, owned by the application (`Calendar.empty(mode)`, fold each `SelectedDate` through `Calendar.picked`, `Calendar.isComplete` says when a picker may close). Spread `Calendar.inputs(selection, mixins, { h })` into upstream `Calendar.view`'s inputs: its `toView` (`Calendar.toView(selection, mixins, { h })`) marks each chosen day `aria-selected`, a range's ends `data-selected` with `data-range-start`/`data-range-end` and every day between `data-in-range`, and its `maybeSelectedDate` (`Calendar.selectedDate(selection)`, a Single selection's day) agrees with it. The grid of a Range or Multiple selection is `aria-multiselectable`. A selection in a popover is the DatePicker's. Options, the fourth argument of `toView`, `inputs` and `resolve` (`CalendarOptions`): `weekNumbers`, `caption: 'label'` or `dropdowns: { model, onShow }` (month and year selects; answer `onShow` with `Calendar.show`), `paging` with `Calendar.alongside(model, other, offset)` for two months side by side, `preview: { date, onPreview }` for a range under the pointer, and `detail: date => Option<string>` for a line under a day's number (a price, "2 events") that describes its button; `ResolvedDayCell.detail` holds it. `ResolvedDays`' paging buttons are `Option`s and its heading is a `caption` (`Grid`, `Label`, `Dropdowns`). Presets: `Calendar.lastDays`, `nextDays`, `monthOf`, `day`, drawn by `Calendar.presetsView`. `Calendar.localeOf('de-DE')` reads upstream's `locale` from Intl. | `size` (the Calendar's); `outside`: `shown` (default), `hidden`; `detail`: `text` (a taller rounded day holding the line), `dot` (the line as a dot, its words left to a screen reader), unset by default. Slots `CalendarSlots`. |
522
522
  | `Card` | `{ title?, description?, content?, image?, media?, action?, footer?, press?, label?, selected?, disabled?, dismiss? }`. `press` is `{ onClick }` or `{ href, external? }`: one button or link stretched over the card, named by `label` or the title (a pressable card with neither throws); `action`, `footer` and the dismiss button stay pressable above it. `selected` is `aria-pressed` on the button, `aria-current` on the link. `dismiss: { onDismiss, label?, always? }` is revealed on hover and focus unless `always`, and always on a touch screen. The root carries `data-selected`, `data-disabled`, `data-pressable`, `data-dismissible` (the header then keeps clear of the button). | `orientation`: `stacked` (default), `inline` (image or media leading, footer trailing). An `image` bleeds to the card's edges (16:9 when stacked); `media` puts a bare icon (`svg`, `img`) in a tile and lets anything else, an Avatar say, lead at its own size. `surface`: `outlined` (default), `elevated`, `filled`, `plain`. `padding`: `compact`, `comfortable` (default), `roomy`, `flush`. `elevation`: `0` to `3`, a step of the surface ladder (lighter in a dark scheme; a contact and an ambient shadow in a light one). `lift`: `none` (default) or `hover`, a lift under the pointer that `travel` stills (not in a `Card.group` with a highlight, which is the hover there). `Card.overlay` is the stretched press control, shared with Item. Slots `root`, `image`, `media`, `header`, `title`, `description`, `action`, `content`, `footer`, `overlay`, `dismiss`. |
523
523
  | `Card.group` | `{ cards: (CardView & { key })[], columns?, fluidHover?, label?, cardStyle? }`. A keyed list of cards in up to `columns` (default 1), which wraps to fewer where a column would be narrower than the recipe's `minColumn`; the root carries `--fk-card-columns` and `data-card-fluid`. With `fluidHover` (default) one highlight follows the pointer to the nearest card through `FluidHover` from `foldkit-primitives/dom`, reading both directions when there is more than one column, and a press in a gap presses the highlighted card. `cardStyle` styles every card that names no style of its own. | `Recipes.CardGroup`: `layout`: `divided` (default, hairlines between cards, wherever the row wraps), `separated` (apart, for cards with a surface). `minColumn`: `none`, `sm`, `md` (default), `lg`, the narrowest a column may be (10, 14, 18rem); `none` keeps every column at any width. `border`: `none` (default), `outlined`. The highlight is a film over the card the pointer is on, and is that card's hover: a card in a group with one draws no hover of its own, whatever its `surface`. Divided cards are usually `surface: 'plain'`. Slots `root`, `list`, `item`, `highlight`. |
524
- | `Carousel` | The APG carousel: `Carousel.init({ id, slide?, autoplay?, delay? })`, folded with `Carousel.update({ count, perView?, loop? })`, drawn with `Carousel.view({ label, model, slides, onMessage, loop?, perView?, picker?, thumbnails?, slideLabel?, previousLabel?, nextLabel?, pickerLabel?, rotationLabels?, style? }, h)`. A group with `aria-roledescription="carousel"`, each slide a group named "2 of 5"; previous and next (`aria-disabled` at the ends unless `loop`), a dot per place the track can rest (or `thumbnails` in their place), and a polite status naming the slide shown. The track is a CSS scroll-snap scroller, so swipes move it natively, and `ScrollSettle` reports where a swipe rests, so the dots follow the finger. Every press, swipe and timer reaches `update`, which returns the `Carousel.ShowSlide` Command that scrolls the track: do not keep the slide yourself. With `autoplay` it moves on every `delay` (4s), the current dot filling as it waits; it pauses under the pointer, stops when focus arrives by the keys, quiets its status while it rotates, and draws the APG's rotation button first. | `peek`: `none` (default) or `edge`. Slots `root`, `track`, `slide`, `controls`, `rotation`, `previous`, `next`, `picker`, `dot`, `thumbnail`, `status`. |
524
+ | `Carousel` | The APG carousel: `Carousel.init({ id, index?, autoplay?, delay? })`, folded with `Carousel.update({ count, perView?, loop? })`, drawn with `Carousel.view({ label, model, slides, onMessage, loop?, perView?, picker?, thumbnails?, slideLabel?, previousLabel?, nextLabel?, pickerLabel?, rotationLabels?, style? }, h)`. A group with `aria-roledescription="carousel"`, each slide a group named "2 of 5"; previous and next (`aria-disabled` at the ends unless `loop`), a dot per place the track can rest (or `thumbnails` in their place), and a polite status naming the slide shown. The track is a CSS scroll-snap scroller, so swipes move it natively, and `ScrollSettle` reports where a swipe rests, so the dots follow the finger. Every press, swipe and timer reaches `update`, which returns the `Carousel.ShowSlide` Command that scrolls the track: do not keep the slide yourself. With `autoplay` it moves on every `delay` (4s), the current dot filling as it waits; it pauses under the pointer, stops when focus arrives by the keys, quiets its status while it rotates, and draws the APG's rotation button first. | `peek`: `none` (default) or `edge`. Slots `root`, `track`, `slide`, `controls`, `rotation`, `previous`, `next`, `picker`, `dot`, `thumbnail`, `status`. |
525
525
  | `CascadeSelect` | After Zag's: one value chosen as a path of ids through nested options. `CascadeSelect.init({ id })` holds the chosen path and the one the keys are on while open, folded with `CascadeSelect.update(config)` (`config` is `{ nodes, parents?, closeOnSelect?, loop? }`, the same object the view takes): `CascadeSelect.view({ model, config, onMessage, label, placeholder?, levels?, layout?, expandOn?, clearable?, separator?, name?, disabled?, invalid?, direction?, style? }, h)`. The trigger is a combobox opening a top-layer APG tree, a column per level or one level at a time (`layout: 'drill'`; the columns also drill in on their own when they would not fit the window, measured as the popup opens); the arrows move within and between levels (swapped right to left), Home, End and a letter jump, Enter and Space choose, and only an option without children is chosen unless `parents` allows any. | `size`, `trigger` (`outline`, `filled`, `ghost`), `width` (`trigger`, `auto`). Slots `root`, `trigger`, `valueText`, `chevron`, `clear`, `input`, `layer`, `backdrop`, `panel`, `column`, `heading`, `back`, `item`, `itemText`, `branch`. |
526
526
  | `Chart` | After shadcn's Chart: `Chart.view({ id, label, kind: 'bar' \| 'line' \| 'area', categories, series: [{ name, values, color? }], model, onMessage, description?, format?, legend?, table?, categoryLabel?, style? }, h)`, or `kind: 'donut'` with `slices: [{ name, value, color? }]` and `totalLabel?`. The value axis's ticks are round and reach both ends, zero included; the plot is drawn in percentages, so it fills its container's width with nothing measured and renders the same on a server. `Chart.Model` (`Chart.init()`, folded with `Chart.update`) holds the lit point: the pointer lights a category's band and its tooltip, and the plot is a tab stop whose arrows, Home and End step through the points while a polite status says each. The drawing is hidden from assistive technology, which reads a data table, visually hidden unless `table: 'shown'`. Series take `chart-1` to `chart-5` in order, or the `color` they name; a sixth series throws. | `height` (`sm`, `md`, `lg`), `grid` (`lines`, `zero`), `indicator` (`dot`, `line`). Slots `root`, `title`, `description`, `legend`, `legendItem`, `swatch`, `body`, `yAxis`, `xAxis`, `yTick`, `xTick`, `plot`, `canvas`, `paths`, `grid`, `cursor`, `bar`, `line`, `area`, `dot`, `slice`, `band`, `center`, `centerValue`, `centerLabel`, `tooltip` and its parts, `status`, `table` and its parts. |
527
527
  | `ChatMessage` | One message of a chat: `ChatMessage.view({ from, content, author?, avatar?, time?, status?, onRetry?, actions?, pinActions?, streaming?, style? }, h)`, `from` being `user`, `assistant` or `system`. The user's sits at the end in a bubble, an answer as text at the start. `status` is `sending`, `sent` or `failed`, which draws a retry; `actions` are named buttons (`{ key, label, onClick, icon?, pressed?, disabled? }`) shown on hover and focus unless pinned. A streamed answer is the same message drawn again with more `content` and `streaming: true` (`aria-busy`); its body wraps with `text-wrap: wrap`, so no earlier word moves line. `ChatMessage.group({ items, continues?, style?, messageStyle? }, h)` draws a run, a sender's following messages continued. Markdown is the application's to render (`foldkit-richtext-markdown`'s `parse`, `foldkit-richtext-dom/view`'s `renderDocument`). | `layout` (`chat`, `thread`), `bubble` (`muted`, `accent`), `content` (`text`, `markdown`). `Recipes.ChatMessageGroup` for the group. Slots `root`, `avatar`, `main`, `header`, `author`, `time`, `bubble`, `body`, `footer`, `status`, `retry`, `actions`, `action`. |
@@ -557,6 +557,7 @@ glyph with it, so the recipe's size is the drawing's.
557
557
  | `Separator` | `{ orientation?, label?, decorative? }`, horizontal by default. A `label` sits between two drawn rules and is read as text; `decorative` is `role="none"`. The rule and a label's frame carry `data-orientation`, which the recipe reads, so one style draws both orientations. A vertical rule stretches across a flex or grid row, short of it by the inset, and elsewhere (running text) stands as tall as the letters. | `line`: `solid`, `dashed`, `dotted`; `thickness`: `thin`, `thick`; `spacing`: `none`, `sm`, `md`, `lg`; `inset`: `none`, `sm`, `md`. The line is a border in `outline.default`, which a dark page shows. Slots `rule`, `root`, `label`. |
558
558
  | `Drawer` | A panel docked to the bottom of the screen that peeks or opens beside the page, not over it: no focus trap, backdrop or scroll lock, so the page under it stays live (a modal one is the `Sheet`). `Drawer.init({ id, open?, swipe? })` (down by default), folded with `Drawer.update`, opened with `Drawer.open` and `Drawer.close`, drawn with `Drawer.view({ model, onMessage, labels: { open, closed }, style?, mixins?, draw }, h)`, `draw` laying out `panel`, `handle`, `body` (the body may sit below what else peeks with the handle) and, optionally, `grip`, more to drag it by (a row of tabs: vertical swipes drag it, sideways ones still scroll). A drag follows the finger and lets go open or down by its speed, then by how far it came. `swipe: { from?, flickSpeed?, closeShare? }` says how it is swiped: a finger drags it from anywhere on the panel (`from: 'panel'`, the default), yielding to content that can still scroll its way, so a long one scrolls back to its top and then goes, and a field or `data-no-swipe` starts no drag; a mouse drags it by the handle, and `from: 'handle'` keeps every pointer there. A release faster than `flickSpeed` (0.4px/ms) is a flick, and a slow one goes once dragged `closeShare` (a quarter) of the panel. A click or Enter on the handle toggles it, and the click a browser sends after a drag does not. The panel's inline style is the drag's: set `--fk-drawer-peek` (default 5rem) and `--fk-drawer-height` (default 70dvh) on an ancestor or in a style. | `Recipes.Drawer`: `dock`: `always` (default), `below-lg` or `below-xl`, above which the panel is the column it sits in, with no handle. The handle's bar bends into a chevron going down, with the finger while dragged. Slots `panel`, `handle`, `body`, `grip`. The handle is a 44px target drawn tight to its bar, and the peek stays above the home indicator. |
559
559
  | `Sheet` | A Dialog a finger drags, vaul's Drawer: `Sheet.init({ id, side?, points?, opensAt?, dismissible?, isAnimated?, swipe? })`, folded with `Sheet.update` and opened with `Sheet.open` and `Sheet.close` (each also reporting the Dialog's `Opened` or `Closed`), drawn with `Sheet.view({ model, onMessage, mixins, hasDescription?, covered?, scalesPage?, draw }, h)`, `draw` laying out `DialogSlots`' bundles with `h.div(sheet.handle)` in the panel. The panel stands on `side`'s edge (`data-side`); a drag follows the pointer and settles at the nearest of `points` (the share of the panel shown, ascending; a top or bottom sheet with a point below 1 takes its `size`'s full height, so a short one still shows its start, and below its highest point its content holds still, so a swipe up raises it), or, flicked or dragged far enough past the first, closes it, unless `dismissible: false`. `swipe: { from?, flickSpeed?, closeShare? }` says how it is swiped: a finger drags it from anywhere on the panel (`from: 'panel'`, the default), yielding to content that can still scroll its way, so a long one scrolls back to its top and then goes, and a field or `data-no-swipe` starts no drag; a mouse drags it by the handle, and `from: 'handle'` keeps every pointer there. A release faster than `flickSpeed` (0.4px/ms) is a flick, and a slow one goes once dragged `closeShare` (a quarter) of the panel. The Dialog keeps focus, Escape and scroll lock. `scalesPage` with `Recipes.sheetPage` on the page beside the sheet, never around it, steps the page back while it is open. | `Recipes.Sheet`: `size`: `sm`, `md` (default), `lg`, `full`; `handle`: `bar` (default) or `none`. Slots are `DialogSlots`. |
560
+ | `Picker` | A select that is a dropdown on a desktop and a bottom sheet on a phone, with one Model and one set of Messages whatever the width: `Picker.init({ id, sheet? })` (upstream's Listbox Model and a `Sheet`'s), folded with `Picker.update`, which returns `Picker.OutMessage.Chose({ value })` for a choice made either way, drawn with `Picker.view({ model, onMessage, label, options, value, placeholder, anchor?, style?, mixins?, listbox?, sheet? }, h)`. The application keeps the value (`Option`), as with the Listbox; `options` are `{ value, label, description?, icon? }`, `Value` inferred from them. Both halves are drawn and the recipe shows one, so nothing reads the width: the Listbox (its panel kept in place) at or above the breakpoint, and below it an opener whose Sheet lists the options as a listbox, the chosen one (or the first) focused, the arrows, Home and End moving focus, Enter, Space or a tap choosing and closing it. Opening the Sheet closes a Listbox left open. `listbox` takes `Recipes.Listbox`, which also draws the options' and the trigger's content (`Listbox.parts`), and `sheet` takes `Recipes.Sheet`. | `Recipes.Picker`: `sheetBelow`: `sm`, `md` (default) or `lg`, the theme's breakpoint below which the Sheet's half shows; `trigger`: `outline` (default), `filled`, `ghost`, the opener's look, as the Listbox's; `size`: `sm`, `md`, `lg`. Slots `root`, `dropdown`, `opener`, `list`, `option`. |
560
561
  | `Sidebar` | shadcn's sidebar with Fluid's collapse, keeping a Model: `Sidebar.init({ id, rows, open?, collapsed?, side?, width? })` (a Tooltip per row id, and the phone's Sheet), folded with `Sidebar.update`, drawn with `Sidebar.view({ model, onMessage, label, groups, header?, footer?, direction?, collapse?, style?, mixins?, tooltip?, sheet? }, h)`. `groups` are `{ id, title?, collapsible?, action?, rows }`, a row a `SidebarLink` (`{ id, label, href, current?, icon?, badge?, action? }`) or a `SidebarBranch` of nested links (`items`). An `action` (`SidebarAction`: `{ label, icon, message }`) is a button at a titled group's heading or beside a link, where it takes the badge's place under the pointer (both show on a touch screen). Groups and branches open like an accordion's, several at once; the current page is `aria-current` and `Sidebar.fluid` glides a marker to it. `collapse: 'offcanvas'` (default) takes the whole column off the page; `'icons'` leaves a rail of icons named in Tooltips (`tooltip`, a Tooltip style). With `sheet` (a Sheet style), an opener shows it in a Sheet on a phone. Shut groups and a collapsed column stay drawn and `inert`. `Sidebar.init({ width: { size?, min?, max? } })` makes the column resizable, its width in the Model: a `resize` handle on its edge drags it, the arrows step it, Enter or a double-click collapses it, and dragged below half `min` it collapses, coming back at the width the drag began at. | `variant`: `sidebar` (flush with the page's edge, the default), `floating` (a card lifted off it), `inset` (no edge, on the surface it stands on, for a page drawn as a card beside it); on a phone with a Sheet the column is its opener alone. Slots `root`, `header`, `footer`, `opener`, `title`, `toggle`, `nav`, `section`, `heading`, `trigger`, `chevron`, `links`, `item`, `branch`, `link`, `icon`, `mark`, `detail`, `label`, `badge`, `action`, `tip`, `indicator`, `highlight`, `resize`. |
561
562
  | `SignaturePad` | After Zag's: strokes drawn by one pointer over a dashed line and "Sign here", undo, clear, and a typed name instead. `SignaturePad.init({ id, pen? })` holds the strokes (points with pressure, in the pad's coordinates), folded with `SignaturePad.update`. Drawn with `SignaturePad.view({ model, onMessage, label, fallback?, labels?, disabled?, style? }, h)`. `pathOf(stroke, pen)` and `toSvg(model, { color?, font? })` are pure; `RequestedPng({ scale, background })` returns `ExportPng`, answered by `ExportedPng({ url, width, height })` or `FailedExport`. | `surface` (`plain`, `muted`, `dashed`), `size`. Slots `root`, `label`, `control`, `segments`, `stroke`, `guide`, `placeholder`, `typedName`, `controls`, `undo`, `clear`, `fallback`, `fallbackLabel`, `input`. |
562
563
  | `Skeleton` | `{ label? }`, `role="status"`, a bar a film of the text. `Skeleton.lines({ lines, label? })`, `avatarRow`, `card` and `tableRow({ columns })` draw the shapes content takes, in a `group`. | `shape`: `bar` (default), `circle`; `animation`: `pulse` (default), `shimmer`, `none`. Slots `bar`, `group`. |
@@ -573,6 +574,7 @@ glyph with it, so the recipe's size is the drawing's.
573
574
  | `TreeView` | The APG's and Zag's tree view, a small Model of its own: `TreeView.init({ id, open?, checked? })`, folded with `TreeView.update(nodes, { checkable? })` (curried over the tree, flattened once), drawn with `TreeView.view({ label, model, nodes, onMessage, direction?, style?, mixins? }, h)` over nodes `{ id, label, children?, disabled?, icon?, openIcon? }`. `checkable` (on the view and `update`) gives each row a box: the Model's `checked` holds the leaves, a branch reads checked, mixed or not from them (`TreeView.checksOf`), and Space checks the current row in `update`. One tab stop; Up/Down move through the rows showing, stepping over shut and disabled ones; Right opens or steps in, Left shuts or steps out (swapped under `direction: 'rtl'`, drawn as the root's `dir`); Home/End; a character moves to the next showing row that starts with it; Enter, Space or a click chooses a row and opens or shuts a branch. Keys reach `update`, which decides from its own Model and sends a focus Command. Each item carries `--fk-tree-level`; a shut group stays drawn and `inert`. | `guides`: `none` (default) or `lines`, a guide down each open branch; `data-state` on a branch `item` and its `group`. Slots `root`, `item`, `row`, `chevron`, `checkbox`, `icon`, `label`, `group`. |
574
575
  | `Typography` | `{ level, text }`. The level chooses the element (`h1`–`h4`, `lead`, `body`, `small`, `muted`, `quote`, `code`, and the interface roles `display`, `title`, `subtitle`, `caption`, `micro` as paragraphs). | `level`, same set; a role is its size and leading on the size ladder. Defaults to `body`. Slot `text`. |
575
576
  | `VirtualList` | `@foldkit/ui`'s virtual list: `VirtualList.view({ model, items, itemToKey, itemToView, onMessage, overscan?, itemToRowHeightPx? \| dynamicRowHeights?, style?, mixins? }, h)` draws only the rows in view. Its Model is upstream's (`@foldkit/ui/virtualList`'s `init`), kept by the application and folded with that module's `update`. A row's mixins may style it, not handle its events, since it is drawn inside the list's submodel. A bar is drawn beside the list, and `VirtualList.overlayBars` lays it over the list's edge: `root` runs `ScrollBars` for upstream's list, which holds a Mount of its own. | No axis. Slots `root` (the box it scrolls within: 18rem tall by default and as wide as its container, offering 20rem where the container takes its width from it, so the rows drawn as it scrolls never resize it), `row`, `bar`, `thumb`. |
577
+ | `WindowList` | A virtual list that scrolls with the window: `WindowList.init({ id, estimatedHeight, unmeasured?, overscan?, viewportHeight?, from? })`, folded with `WindowList.update`, drawn with `WindowList.view({ model, items, itemToKey, itemToView, onMessage, label?, style?, mixins? }, h)`. It draws the rows in view of the document's viewport between spacers as tall as the rest, so the page keeps its own scrolling: the browser restores its offset, a `sticky` header above the list sticks, and Space and End move it. Its one Mount on `root`, `WindowList.Track`, reads where the viewport lies over the list on every scroll, resize and resize of the page (`WindowViewport`), so content above it, or growing above it, counts, and measures each drawn row's border box (`MeasureRows`; space rows with padding: a row is `flow-root`). The rows already drawn when it starts are read at once, so no row leaves before its height is known. A row not yet measured counts `estimatedHeight`, or with `unmeasured: 'mean'` the mean of the rows measured above 0: for rows whose height the window's width decides, which `init` cannot know. A Scene test of a page drawing the list resolves it with `Scene.Mount.resolveAll(WindowList.resolveTrack(onMessage, WindowList.Message.Placed({ top, height })))`, the reading going through the view's own `onMessage`. `WindowList.windowOf(model, keys)` is which rows are drawn, for loading what is in view, and `WindowList.keep(model, keys)` drops the heights of rows that left; a row still drawn is measured again only when it resizes, so keep the keys of the rows drawn. A server's page opens the list at a row with `from` (a page's `?from=`): the window starts at that row, with no overscan above it, and the rows above take no room until `Track` places the list, which gives them their room and scrolls the window by what that moved the first row drawn, so a reader sees the same rows before and after the runtime takes the page over. The first `Placed` sets `from` back to 0, and the list follows the window. For a page without scripts, `WindowList.pageOf(model, keys)` is `{ start, end, previous, next }`: the rows drawn and, as `Option`s, the rows the pages either side open at (`previous` the first whose window reaches this one's start), for links that set `?from=`. Use `VirtualList` for a list in a box of its own. | `Recipes.WindowList`: no look, only the spacers hidden where no script runs (`@media (scripting: none)`), so the rows a server drew lie in the page's flow; `.extend` it with the list's look. Slots `root` (`role="list"`), `spacer` (`data-edge` `start` or `end`, hidden from assistive technology), `row` (`role="listitem"`). |
576
578
 
577
579
  ## Recipes
578
580
 
@@ -984,8 +986,9 @@ const TileStyle = Style.forSlots(TileSlots)(
984
986
  ```
985
987
 
986
988
  The icons the components draw themselves (a search field's magnifier, a
987
- toast's mark, a locked cell's padlock) are the theme's `icon` tokens, Lucide's
988
- by default. An application's own pack replaces them as its own tokens:
989
+ toast's mark, a locked cell's padlock) are the theme's `icon` tokens:
990
+ Heroicons' outline set (MIT), restroked to 2px, by default. An application's
991
+ own pack replaces them as its own tokens:
989
992
  `AppStyle.make({ theme, tokens: Icons.tokens(pack, { width?, corners? }) })`,
990
993
  where `pack` holds an `IconData` for each name the components draw
991
994
  (`ChromeIcon` from `foldkit-mixins/theme`; one missing is a type error), and
@@ -0,0 +1,66 @@
1
+ import { Attr, Capability, Event, NamedStyle, Slot, Slots } from "foldkit-mixins";
2
+ import { MixinList } from "./resolve.js";
3
+ import { Html, HtmlBuilder } from "foldkit/html";
4
+ /**
5
+ * An accordion: sections whose headings each show and hide their panel, as
6
+ * the APG accordion pattern has it. Each trigger is a button in a heading,
7
+ * with `aria-expanded` and `aria-controls`; each panel is a region named by
8
+ * its trigger. Which sections are open is the application's, in its Model:
9
+ * the view draws `open` and sends `onToggle`, and `toggled` is the
10
+ * transition `update` applies. A shut panel stays drawn and is `inert`, out
11
+ * of the accessibility tree and the tab order, so its close can animate and
12
+ * `aria-controls` always names a node.
13
+ */
14
+ export declare const AccordionSlots: Slots.Contract<{
15
+ readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
16
+ readonly item: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
17
+ readonly heading: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
18
+ readonly trigger: Slot.UnnamedSlot<Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>, readonly [Event.EventToken<"click">], readonly [Attr.AttrToken<"aria-expanded">, Attr.AttrToken<"disabled">], readonly Slot.RequirementName[], boolean>;
19
+ readonly label: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
20
+ readonly chevron: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
21
+ /** The view's own `icon`, drawn in place of the chevron. */
22
+ readonly icon: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
23
+ readonly panel: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly [Attr.AttrToken<"role">], readonly Slot.RequirementName[], boolean>;
24
+ /** The panel's one grid row, with no padding of its own, so it can shrink to nothing. */
25
+ readonly body: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
26
+ readonly content: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
27
+ }>;
28
+ export interface AccordionItem {
29
+ /** Unique within the accordion, and part of its elements' ids. */
30
+ readonly id: string;
31
+ readonly title: string;
32
+ readonly content: Html | string;
33
+ readonly disabled?: boolean | undefined;
34
+ }
35
+ export interface AccordionView<Message> {
36
+ readonly items: ReadonlyArray<AccordionItem>;
37
+ /** The ids of the open sections, as the application keeps them. */
38
+ readonly open: ReadonlyArray<string>;
39
+ /** The Message a press on a section sends; its type comes from `h`. */
40
+ readonly onToggle: (id: string) => NoInfer<Message>;
41
+ /** Prefixes every id the accordion draws, unique on the page. */
42
+ readonly id: string;
43
+ /**
44
+ * Drawn in each row in place of the recipe's chevron or plus, carrying the
45
+ * section's `data-state`; the recipe leaves it still.
46
+ */
47
+ readonly icon?: Html | undefined;
48
+ /** The level of the headings that hold the triggers, for the page's outline. Default 3. */
49
+ readonly headingLevel?: 2 | 3 | 4 | 5 | 6 | undefined;
50
+ /** A style of `AccordionSlots`, for the accordion's look. */
51
+ readonly style?: NamedStyle<typeof AccordionSlots> | undefined;
52
+ /** Mixins beside the style. */
53
+ readonly mixins?: MixinList<Message> | undefined;
54
+ }
55
+ /**
56
+ * The open sections after `id` is pressed. With `multiple`, any number stay
57
+ * open; otherwise opening one shuts the others. A pressed open section shuts
58
+ * unless it is the only one open and `collapsible` is false (shadcn's and
59
+ * Zag's default for a single accordion is collapsible, and so is this).
60
+ */
61
+ export declare const toggled: (open: ReadonlyArray<string>, id: string, options?: {
62
+ readonly multiple?: boolean;
63
+ readonly collapsible?: boolean;
64
+ }) => ReadonlyArray<string>;
65
+ export declare const view: <Message>(options: AccordionView<Message>, h: HtmlBuilder<Message>) => Html;
66
+ //# sourceMappingURL=accordion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion.d.ts","names":[],"sources":["../src/accordion.ts"],"mappings":";;;;;;;;;;;;;qBAea,gBAAc,MAAA;;;;;;;;;;;;;;iBAmBV;;WAEN;WACA;WACA,SAAS;WACT;;iBAGM,cAAc;WACpB,OAAO,cAAc;;WAErB,MAAM;;WAEN,WAAW,eAAe,QAAQ;;WAElC;;;;;WAKA,OAAO;;WAEP;;WAEA,QAAQ,kBAAkB;;WAE1B,SAAS,UAAU;;;;;;;;qBASjB,UAAO,MACZ,uBAAqB,YACjB;WACU;WAA6B;MAChD;qBAOU,OAAQ,SAAO,SAAW,cAAc,UAAQ,GAAK,YAAY,aAAW"}
@@ -0,0 +1,87 @@
1
+ import { Attr, Capability, Event, Slot, SlotView, Slots } from "foldkit-mixins";
2
+ import { flipped } from "./choices.js";
3
+ // src/accordion.ts
4
+ /**
5
+ * An accordion: sections whose headings each show and hide their panel, as
6
+ * the APG accordion pattern has it. Each trigger is a button in a heading,
7
+ * with `aria-expanded` and `aria-controls`; each panel is a region named by
8
+ * its trigger. Which sections are open is the application's, in its Model:
9
+ * the view draws `open` and sends `onToggle`, and `toggled` is the
10
+ * transition `update` applies. A shut panel stays drawn and is `inert`, out
11
+ * of the accessibility tree and the tab order, so its close can animate and
12
+ * `aria-controls` always names a node.
13
+ */
14
+ const AccordionSlots = Slots.define({
15
+ root: Slot.make({ capability: Capability.Container }),
16
+ item: Slot.make({ capability: Capability.Container }),
17
+ heading: Slot.make({ capability: Capability.Container }),
18
+ trigger: Slot.make({
19
+ capability: Capability.Interactive,
20
+ events: [Event.Click],
21
+ attributes: [Attr.AriaExpanded, Attr.Disabled]
22
+ }),
23
+ label: Slot.make({ capability: Capability.Container }),
24
+ chevron: Slot.make({ capability: Capability.Container }),
25
+ /** The view's own `icon`, drawn in place of the chevron. */
26
+ icon: Slot.make({ capability: Capability.Container }),
27
+ panel: Slot.make({
28
+ capability: Capability.Container,
29
+ attributes: [Attr.Role]
30
+ }),
31
+ /** The panel's one grid row, with no padding of its own, so it can shrink to nothing. */
32
+ body: Slot.make({ capability: Capability.Container }),
33
+ content: Slot.make({ capability: Capability.Container })
34
+ });
35
+ /**
36
+ * The open sections after `id` is pressed. With `multiple`, any number stay
37
+ * open; otherwise opening one shuts the others. A pressed open section shuts
38
+ * unless it is the only one open and `collapsible` is false (shadcn's and
39
+ * Zag's default for a single accordion is collapsible, and so is this).
40
+ */
41
+ const toggled = (open, id, options = {}) => {
42
+ const isOpen = open.includes(id);
43
+ if (options.multiple === true) return flipped(open, id);
44
+ if (!isOpen) return [id];
45
+ return options.collapsible === false ? open : [];
46
+ };
47
+ const view = (options, h) => {
48
+ const builders = SlotView.buildersFor(AccordionSlots, [...options.style === void 0 ? [] : [options.style.mixin], ...options.mixins ?? []], {
49
+ input: void 0,
50
+ h
51
+ });
52
+ const open = new Set(options.open);
53
+ const heading = (children) => {
54
+ const attrs = builders.heading.attrs();
55
+ switch (options.headingLevel ?? 3) {
56
+ case 2: return h.h2(attrs, children);
57
+ case 4: return h.h4(attrs, children);
58
+ case 5: return h.h5(attrs, children);
59
+ case 6: return h.h6(attrs, children);
60
+ default: return h.h3(attrs, children);
61
+ }
62
+ };
63
+ return h.div(builders.root.attrs(), options.items.map((item) => {
64
+ const shown = open.has(item.id);
65
+ const state = h.DataAttribute("state", shown ? "open" : "closed");
66
+ const triggerId = `${options.id}-${item.id}-trigger`;
67
+ const panelId = `${options.id}-${item.id}-panel`;
68
+ const disabled = item.disabled === true;
69
+ return h.keyed("div")(item.id, builders.item.attrs([state]), [heading([h.button(builders.trigger.attrs([
70
+ h.Type("button"),
71
+ h.Id(triggerId),
72
+ h.AriaExpanded(shown),
73
+ h.AriaControls(panelId),
74
+ state,
75
+ ...disabled ? [h.Disabled(true)] : [h.OnClick(options.onToggle(item.id))]
76
+ ]), [h.span(builders.label.attrs([h.DataAttribute("label", item.title)]), [item.title]), options.icon === void 0 ? h.span(builders.chevron.attrs([h.AriaHidden(true)]), []) : h.span(builders.icon.attrs([h.AriaHidden(true), state]), [options.icon])])]), h.div(builders.panel.attrs([
77
+ h.Id(panelId),
78
+ h.Role("region"),
79
+ h.AriaLabelledBy(triggerId),
80
+ state,
81
+ ...shown ? [] : [h.Attribute("inert", "")]
82
+ ]), [h.div(builders.body.attrs(), [h.div(builders.content.attrs(), [item.content])])])]);
83
+ }));
84
+ };
85
+ export { AccordionSlots, toggled, view };
86
+
87
+ //# sourceMappingURL=accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion.js","names":[],"sources":["../src/accordion.ts"],"sourcesContent":["import { Attr, Capability, Event, Slot, Slots, SlotView, type NamedStyle } from 'foldkit-mixins'\nimport type { Html, HtmlBuilder } from 'foldkit/html'\nimport { flipped } from './choices.js'\nimport type { MixinList } from './resolve.js'\n\n/**\n * An accordion: sections whose headings each show and hide their panel, as\n * the APG accordion pattern has it. Each trigger is a button in a heading,\n * with `aria-expanded` and `aria-controls`; each panel is a region named by\n * its trigger. Which sections are open is the application's, in its Model:\n * the view draws `open` and sends `onToggle`, and `toggled` is the\n * transition `update` applies. A shut panel stays drawn and is `inert`, out\n * of the accessibility tree and the tab order, so its close can animate and\n * `aria-controls` always names a node.\n */\nexport const AccordionSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n item: Slot.make({ capability: Capability.Container }),\n heading: Slot.make({ capability: Capability.Container }),\n trigger: Slot.make({\n capability: Capability.Interactive,\n events: [Event.Click],\n attributes: [Attr.AriaExpanded, Attr.Disabled],\n }),\n label: Slot.make({ capability: Capability.Container }),\n chevron: Slot.make({ capability: Capability.Container }),\n /** The view's own `icon`, drawn in place of the chevron. */\n icon: Slot.make({ capability: Capability.Container }),\n panel: Slot.make({ capability: Capability.Container, attributes: [Attr.Role] }),\n /** The panel's one grid row, with no padding of its own, so it can shrink to nothing. */\n body: Slot.make({ capability: Capability.Container }),\n content: Slot.make({ capability: Capability.Container }),\n})\n\nexport interface AccordionItem {\n /** Unique within the accordion, and part of its elements' ids. */\n readonly id: string\n readonly title: string\n readonly content: Html | string\n readonly disabled?: boolean | undefined\n}\n\nexport interface AccordionView<Message> {\n readonly items: ReadonlyArray<AccordionItem>\n /** The ids of the open sections, as the application keeps them. */\n readonly open: ReadonlyArray<string>\n /** The Message a press on a section sends; its type comes from `h`. */\n readonly onToggle: (id: string) => NoInfer<Message>\n /** Prefixes every id the accordion draws, unique on the page. */\n readonly id: string\n /**\n * Drawn in each row in place of the recipe's chevron or plus, carrying the\n * section's `data-state`; the recipe leaves it still.\n */\n readonly icon?: Html | undefined\n /** The level of the headings that hold the triggers, for the page's outline. Default 3. */\n readonly headingLevel?: 2 | 3 | 4 | 5 | 6 | undefined\n /** A style of `AccordionSlots`, for the accordion's look. */\n readonly style?: NamedStyle<typeof AccordionSlots> | undefined\n /** Mixins beside the style. */\n readonly mixins?: MixinList<Message> | undefined\n}\n\n/**\n * The open sections after `id` is pressed. With `multiple`, any number stay\n * open; otherwise opening one shuts the others. A pressed open section shuts\n * unless it is the only one open and `collapsible` is false (shadcn's and\n * Zag's default for a single accordion is collapsible, and so is this).\n */\nexport const toggled = (\n open: ReadonlyArray<string>,\n id: string,\n options: { readonly multiple?: boolean; readonly collapsible?: boolean } = {},\n): ReadonlyArray<string> => {\n const isOpen = open.includes(id)\n if (options.multiple === true) return flipped(open, id)\n if (!isOpen) return [id]\n return options.collapsible === false ? open : []\n}\n\nexport const view = <Message>(options: AccordionView<Message>, h: HtmlBuilder<Message>): Html => {\n const builders = SlotView.buildersFor(\n AccordionSlots,\n [...(options.style === undefined ? [] : [options.style.mixin]), ...(options.mixins ?? [])],\n { input: undefined, h },\n )\n const open = new Set(options.open)\n const heading = (children: ReadonlyArray<Html>) => {\n const attrs = builders.heading.attrs()\n switch (options.headingLevel ?? 3) {\n case 2:\n return h.h2(attrs, children)\n case 4:\n return h.h4(attrs, children)\n case 5:\n return h.h5(attrs, children)\n case 6:\n return h.h6(attrs, children)\n default:\n return h.h3(attrs, children)\n }\n }\n return h.div(\n builders.root.attrs(),\n options.items.map(item => {\n const shown = open.has(item.id)\n const state = h.DataAttribute('state', shown ? 'open' : 'closed')\n const triggerId = `${options.id}-${item.id}-trigger`\n const panelId = `${options.id}-${item.id}-panel`\n const disabled = item.disabled === true\n return h.keyed('div')(item.id, builders.item.attrs([state]), [\n heading([\n h.button(\n builders.trigger.attrs([\n h.Type('button'),\n h.Id(triggerId),\n h.AriaExpanded(shown),\n h.AriaControls(panelId),\n state,\n ...(disabled ? [h.Disabled(true)] : [h.OnClick(options.onToggle(item.id))]),\n ]),\n [\n // Its text in `data-label` too, so turning semibold when open moves nothing.\n h.span(builders.label.attrs([h.DataAttribute('label', item.title)]), [item.title]),\n options.icon === undefined\n ? h.span(builders.chevron.attrs([h.AriaHidden(true)]), [])\n : h.span(builders.icon.attrs([h.AriaHidden(true), state]), [options.icon]),\n ],\n ),\n ]),\n h.div(\n builders.panel.attrs([\n h.Id(panelId),\n h.Role('region'),\n h.AriaLabelledBy(triggerId),\n state,\n ...(shown ? [] : [h.Attribute('inert', '')]),\n ]),\n [h.div(builders.body.attrs(), [h.div(builders.content.attrs(), [item.content])])],\n ),\n ])\n }),\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAa,iBAAiB,MAAM,OAAO;CACzC,MAAM,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACpD,MAAM,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACpD,SAAS,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACvD,SAAS,KAAK,KAAK;EACjB,YAAY,WAAW;EACvB,QAAQ,CAAC,MAAM,KAAK;EACpB,YAAY,CAAC,KAAK,cAAc,KAAK,QAAQ;CAC/C,CAAC;CACD,OAAO,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACrD,SAAS,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;;CAEvD,MAAM,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACpD,OAAO,KAAK,KAAK;EAAE,YAAY,WAAW;EAAW,YAAY,CAAC,KAAK,IAAI;CAAE,CAAC;;CAE9E,MAAM,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACpD,SAAS,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;AACzD,CAAC;;;;;;;AAqCD,MAAa,WACX,MACA,IACA,UAA2E,CAAC,MAClD;CAC1B,MAAM,SAAS,KAAK,SAAS,EAAE;CAC/B,IAAI,QAAQ,aAAa,MAAM,OAAO,QAAQ,MAAM,EAAE;CACtD,IAAI,CAAC,QAAQ,OAAO,CAAC,EAAE;CACvB,OAAO,QAAQ,gBAAgB,QAAQ,OAAO,CAAC;AACjD;AAEA,MAAa,QAAiB,SAAiC,MAAkC;CAC/F,MAAM,WAAW,SAAS,YACxB,gBACA,CAAC,GAAI,QAAQ,UAAU,KAAA,IAAY,CAAC,IAAI,CAAC,QAAQ,MAAM,KAAK,GAAI,GAAI,QAAQ,UAAU,CAAC,CAAE,GACzF;EAAE,OAAO,KAAA;EAAW;CAAE,CACxB;CACA,MAAM,OAAO,IAAI,IAAI,QAAQ,IAAI;CACjC,MAAM,WAAW,aAAkC;EACjD,MAAM,QAAQ,SAAS,QAAQ,MAAM;EACrC,QAAQ,QAAQ,gBAAgB,GAAhC;GACE,KAAK,GACH,OAAO,EAAE,GAAG,OAAO,QAAQ;GAC7B,KAAK,GACH,OAAO,EAAE,GAAG,OAAO,QAAQ;GAC7B,KAAK,GACH,OAAO,EAAE,GAAG,OAAO,QAAQ;GAC7B,KAAK,GACH,OAAO,EAAE,GAAG,OAAO,QAAQ;GAC7B,SACE,OAAO,EAAE,GAAG,OAAO,QAAQ;EAC/B;CACF;CACA,OAAO,EAAE,IACP,SAAS,KAAK,MAAM,GACpB,QAAQ,MAAM,KAAI,SAAQ;EACxB,MAAM,QAAQ,KAAK,IAAI,KAAK,EAAE;EAC9B,MAAM,QAAQ,EAAE,cAAc,SAAS,QAAQ,SAAS,QAAQ;EAChE,MAAM,YAAY,GAAG,QAAQ,GAAG,GAAG,KAAK,GAAG;EAC3C,MAAM,UAAU,GAAG,QAAQ,GAAG,GAAG,KAAK,GAAG;EACzC,MAAM,WAAW,KAAK,aAAa;EACnC,OAAO,EAAE,MAAM,KAAK,CAAC,CAAC,KAAK,IAAI,SAAS,KAAK,MAAM,CAAC,KAAK,CAAC,GAAG,CAC3D,QAAQ,CACN,EAAE,OACA,SAAS,QAAQ,MAAM;GACrB,EAAE,KAAK,QAAQ;GACf,EAAE,GAAG,SAAS;GACd,EAAE,aAAa,KAAK;GACpB,EAAE,aAAa,OAAO;GACtB;GACA,GAAI,WAAW,CAAC,EAAE,SAAS,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,QAAQ,SAAS,KAAK,EAAE,CAAC,CAAC;EAC3E,CAAC,GACD,CAEE,EAAE,KAAK,SAAS,MAAM,MAAM,CAAC,EAAE,cAAc,SAAS,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GACjF,QAAQ,SAAS,KAAA,IACb,EAAE,KAAK,SAAS,QAAQ,MAAM,CAAC,EAAE,WAAW,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IACvD,EAAE,KAAK,SAAS,KAAK,MAAM,CAAC,EAAE,WAAW,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,CAC7E,CACF,CACF,CAAC,GACD,EAAE,IACA,SAAS,MAAM,MAAM;GACnB,EAAE,GAAG,OAAO;GACZ,EAAE,KAAK,QAAQ;GACf,EAAE,eAAe,SAAS;GAC1B;GACA,GAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,SAAS,EAAE,CAAC;EAC5C,CAAC,GACD,CAAC,EAAE,IAAI,SAAS,KAAK,MAAM,GAAG,CAAC,EAAE,IAAI,SAAS,QAAQ,MAAM,GAAG,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAClF,CACF,CAAC;CACH,CAAC,CACH;AACF"}
@@ -0,0 +1,68 @@
1
+ import { Attr, Capability, Event, NamedStyle, Slot, Slots } from "foldkit-mixins";
2
+ import { MixinList } from "./resolve.js";
3
+ import { Html, HtmlBuilder } from "foldkit/html";
4
+ /**
5
+ * An alert publishes its regions as slots; it owns no state. Shown or
6
+ * dismissed is the application's: `onDismiss` asks, and the next view leaves
7
+ * the alert out. The root carries `data-layout` and `data-dismissible` for a
8
+ * style to read.
9
+ */
10
+ export declare const AlertSlots: Slots.Contract<{
11
+ readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly [Attr.AttrToken<"role">, Attr.AttrToken<"aria-label">], readonly Slot.RequirementName[], boolean>;
12
+ readonly icon: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
13
+ readonly title: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
14
+ readonly description: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
15
+ readonly actions: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
16
+ readonly action: Slot.UnnamedSlot<Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
17
+ readonly dismiss: Slot.UnnamedSlot<Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>, readonly [Event.EventToken<"click">], readonly [Attr.AttrToken<"aria-label">], readonly Slot.RequirementName[], boolean>;
18
+ }>;
19
+ /** A feedback family the alert can take. */
20
+ export type AlertTone = 'info' | 'success' | 'warning' | 'error';
21
+ /** An action: a link to follow, or a button that sends a Message. */
22
+ export type AlertAction<Message> = {
23
+ readonly label: string;
24
+ readonly href: string;
25
+ } | {
26
+ readonly label: string;
27
+ readonly onClick: Message;
28
+ };
29
+ interface AlertContent<Message> {
30
+ readonly title: string;
31
+ readonly description?: string | undefined;
32
+ /** Hidden from screen readers: the title says what the icon shows. */
33
+ readonly icon?: Html | undefined;
34
+ readonly actions?: ReadonlyArray<AlertAction<NoInfer<Message>>> | undefined;
35
+ /** Draws a dismiss button that sends this. */
36
+ readonly onDismiss?: NoInfer<Message> | undefined;
37
+ /** The dismiss button's name; default `Dismiss <title>` inline, `Dismiss <label>` as a banner. */
38
+ readonly dismissLabel?: string | undefined;
39
+ /** A style of `AlertSlots`, for the alert's look. */
40
+ readonly style?: NamedStyle<typeof AlertSlots> | undefined;
41
+ /** Mixins beside the style. */
42
+ readonly mixins?: MixinList<Message> | undefined;
43
+ }
44
+ /**
45
+ * A notice inside the content, of something that just happened: a live
46
+ * region. `assertive` interrupts (`role="alert"`); anything else reports
47
+ * (`role="status"`). Screen readers speak what changes in a live region, not
48
+ * what it held when the page loaded, so draw it when the thing happens.
49
+ */
50
+ export interface InlineAlert<Message> extends AlertContent<Message> {
51
+ readonly layout: 'inline';
52
+ readonly assertive?: boolean | undefined;
53
+ }
54
+ /**
55
+ * A full-width strip across a page or a section, there when it loads: a
56
+ * region landmark (a `section` named by `label`), not a live region, which
57
+ * would say nothing on load. The landmark lets a screen reader find it, and
58
+ * its dismiss button, from anywhere.
59
+ */
60
+ export interface BannerAlert<Message> extends AlertContent<Message> {
61
+ readonly layout: 'banner';
62
+ /** The region's name, such as "Announcement" or "Maintenance notice". */
63
+ readonly label: string;
64
+ }
65
+ export type AlertView<Message = never> = InlineAlert<Message> | BannerAlert<Message>;
66
+ export declare const view: <Message = never>(options: AlertView<Message>, h: HtmlBuilder<Message>) => Html;
67
+ export {};
68
+ //# sourceMappingURL=alert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert.d.ts","names":[],"sources":["../src/alert.ts"],"mappings":";;;;;;;;;qBAWa,YAAU,MAAA;;;;;;;;;;YAeX;;YAGA,YAAY;WACT;WAAwB;;WACxB;WAAwB,SAAS;;UAEtC,aAAa;WACZ;WACA;;WAEA,OAAO;WACP,UAAU,cAAc,YAAY,QAAQ;;WAE5C,YAAY,QAAQ;;WAEpB;;WAEA,QAAQ,kBAAkB;;WAE1B,SAAS,UAAU;;;;;;;;iBASb,YAAY,iBAAiB,aAAa;WAChD;WACA;;;;;;;;iBASM,YAAY,iBAAiB,aAAa;WAChD;;WAEA;;YAGC,UAAU,mBAAmB,YAAY,WAAW,YAAY;qBAE/D,OAAQ,iBAAe,SACzB,UAAU,UAAQ,GACxB,YAAY,aACd"}
package/dist/alert.js ADDED
@@ -0,0 +1,59 @@
1
+ import { Attr, Capability, Event, Slot, SlotView, Slots } from "foldkit-mixins";
2
+ import { Match } from "effect";
3
+ // src/alert.ts
4
+ /**
5
+ * An alert publishes its regions as slots; it owns no state. Shown or
6
+ * dismissed is the application's: `onDismiss` asks, and the next view leaves
7
+ * the alert out. The root carries `data-layout` and `data-dismissible` for a
8
+ * style to read.
9
+ */
10
+ const AlertSlots = Slots.define({
11
+ root: Slot.make({
12
+ capability: Capability.Container,
13
+ attributes: [Attr.Role, Attr.AriaLabel]
14
+ }),
15
+ icon: Slot.make({ capability: Capability.Container }),
16
+ title: Slot.make({ capability: Capability.Container }),
17
+ description: Slot.make({ capability: Capability.Container }),
18
+ actions: Slot.make({ capability: Capability.Container }),
19
+ action: Slot.make({ capability: Capability.Interactive }),
20
+ dismiss: Slot.make({
21
+ capability: Capability.Interactive,
22
+ events: [Event.Click],
23
+ attributes: [Attr.AriaLabel]
24
+ })
25
+ });
26
+ const view = (options, h) => {
27
+ const builders = SlotView.buildersFor(AlertSlots, [...options.style === void 0 ? [] : [options.style.mixin], ...options.mixins ?? []], {
28
+ input: void 0,
29
+ h
30
+ });
31
+ const onDismiss = options.onDismiss;
32
+ const marks = [h.DataAttribute("layout", options.layout), h.DataAttribute("dismissible", String(onDismiss !== void 0))];
33
+ const region = Match.value(options).pipe(Match.discriminatorsExhaustive("layout")({
34
+ inline: ({ title, assertive }) => ({
35
+ name: title,
36
+ draw: (children) => h.div(builders.root.attrs([h.Role(assertive === true ? "alert" : "status"), ...marks]), children)
37
+ }),
38
+ banner: ({ label }) => ({
39
+ name: label,
40
+ draw: (children) => h.section(builders.root.attrs([h.AriaLabel(label), ...marks]), children)
41
+ })
42
+ }));
43
+ const drawAction = (action) => "href" in action ? h.a(builders.action.attrs([h.Href(action.href)]), [action.label]) : h.button(builders.action.attrs([h.Type("button"), h.OnClick(action.onClick)]), [action.label]);
44
+ const actions = options.actions ?? [];
45
+ return region.draw([
46
+ ...options.icon === void 0 ? [] : [h.span(builders.icon.attrs([h.AriaHidden(true)]), [options.icon])],
47
+ h.p(builders.title.attrs(), [options.title]),
48
+ ...options.description === void 0 ? [] : [h.p(builders.description.attrs(), [options.description])],
49
+ ...actions.length === 0 ? [] : [h.div(builders.actions.attrs(), actions.map(drawAction))],
50
+ ...onDismiss === void 0 ? [] : [h.button(builders.dismiss.attrs([
51
+ h.Type("button"),
52
+ h.AriaLabel(options.dismissLabel ?? `Dismiss ${region.name}`),
53
+ h.OnClick(onDismiss)
54
+ ]), ["✕"])]
55
+ ]);
56
+ };
57
+ export { AlertSlots, view };
58
+
59
+ //# sourceMappingURL=alert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert.js","names":[],"sources":["../src/alert.ts"],"sourcesContent":["import { Match } from 'effect'\nimport { Attr, Capability, Event, Slot, Slots, SlotView, type NamedStyle } from 'foldkit-mixins'\nimport type { Html, HtmlBuilder } from 'foldkit/html'\nimport type { MixinList } from './resolve.js'\n\n/**\n * An alert publishes its regions as slots; it owns no state. Shown or\n * dismissed is the application's: `onDismiss` asks, and the next view leaves\n * the alert out. The root carries `data-layout` and `data-dismissible` for a\n * style to read.\n */\nexport const AlertSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container, attributes: [Attr.Role, Attr.AriaLabel] }),\n icon: Slot.make({ capability: Capability.Container }),\n title: Slot.make({ capability: Capability.Container }),\n description: Slot.make({ capability: Capability.Container }),\n actions: Slot.make({ capability: Capability.Container }),\n action: Slot.make({ capability: Capability.Interactive }),\n dismiss: Slot.make({\n capability: Capability.Interactive,\n events: [Event.Click],\n attributes: [Attr.AriaLabel],\n }),\n})\n\n/** A feedback family the alert can take. */\nexport type AlertTone = 'info' | 'success' | 'warning' | 'error'\n\n/** An action: a link to follow, or a button that sends a Message. */\nexport type AlertAction<Message> =\n | { readonly label: string; readonly href: string }\n | { readonly label: string; readonly onClick: Message }\n\ninterface AlertContent<Message> {\n readonly title: string\n readonly description?: string | undefined\n /** Hidden from screen readers: the title says what the icon shows. */\n readonly icon?: Html | undefined\n readonly actions?: ReadonlyArray<AlertAction<NoInfer<Message>>> | undefined\n /** Draws a dismiss button that sends this. */\n readonly onDismiss?: NoInfer<Message> | undefined\n /** The dismiss button's name; default `Dismiss <title>` inline, `Dismiss <label>` as a banner. */\n readonly dismissLabel?: string | undefined\n /** A style of `AlertSlots`, for the alert's look. */\n readonly style?: NamedStyle<typeof AlertSlots> | undefined\n /** Mixins beside the style. */\n readonly mixins?: MixinList<Message> | undefined\n}\n\n/**\n * A notice inside the content, of something that just happened: a live\n * region. `assertive` interrupts (`role=\"alert\"`); anything else reports\n * (`role=\"status\"`). Screen readers speak what changes in a live region, not\n * what it held when the page loaded, so draw it when the thing happens.\n */\nexport interface InlineAlert<Message> extends AlertContent<Message> {\n readonly layout: 'inline'\n readonly assertive?: boolean | undefined\n}\n\n/**\n * A full-width strip across a page or a section, there when it loads: a\n * region landmark (a `section` named by `label`), not a live region, which\n * would say nothing on load. The landmark lets a screen reader find it, and\n * its dismiss button, from anywhere.\n */\nexport interface BannerAlert<Message> extends AlertContent<Message> {\n readonly layout: 'banner'\n /** The region's name, such as \"Announcement\" or \"Maintenance notice\". */\n readonly label: string\n}\n\nexport type AlertView<Message = never> = InlineAlert<Message> | BannerAlert<Message>\n\nexport const view = <Message = never>(\n options: AlertView<Message>,\n h: HtmlBuilder<Message>,\n): Html => {\n const builders = SlotView.buildersFor(\n AlertSlots,\n [...(options.style === undefined ? [] : [options.style.mixin]), ...(options.mixins ?? [])],\n { input: undefined, h },\n )\n const onDismiss = options.onDismiss\n const marks = [\n h.DataAttribute('layout', options.layout),\n // Whether the root holds a dismiss button, for a recipe that keeps room for it.\n h.DataAttribute('dismissible', String(onDismiss !== undefined)),\n ]\n const region = Match.value(options).pipe(\n Match.discriminatorsExhaustive('layout')({\n inline: ({ title, assertive }) => ({\n name: title,\n draw: (children: ReadonlyArray<Html>) =>\n h.div(\n builders.root.attrs([h.Role(assertive === true ? 'alert' : 'status'), ...marks]),\n children,\n ),\n }),\n banner: ({ label }) => ({\n name: label,\n draw: (children: ReadonlyArray<Html>) =>\n h.section(builders.root.attrs([h.AriaLabel(label), ...marks]), children),\n }),\n }),\n )\n const drawAction = (action: AlertAction<Message>): Html =>\n 'href' in action\n ? h.a(builders.action.attrs([h.Href(action.href)]), [action.label])\n : h.button(builders.action.attrs([h.Type('button'), h.OnClick(action.onClick)]), [\n action.label,\n ])\n const actions = options.actions ?? []\n return region.draw([\n ...(options.icon === undefined\n ? []\n : [h.span(builders.icon.attrs([h.AriaHidden(true)]), [options.icon])]),\n h.p(builders.title.attrs(), [options.title]),\n ...(options.description === undefined\n ? []\n : [h.p(builders.description.attrs(), [options.description])]),\n ...(actions.length === 0 ? [] : [h.div(builders.actions.attrs(), actions.map(drawAction))]),\n ...(onDismiss === undefined\n ? []\n : [\n h.button(\n builders.dismiss.attrs([\n h.Type('button'),\n h.AriaLabel(options.dismissLabel ?? `Dismiss ${region.name}`),\n h.OnClick(onDismiss),\n ]),\n // Named by its label, so the glyph is never read.\n ['✕'],\n ),\n ]),\n ])\n}\n"],"mappings":";;;;;;;;;AAWA,MAAa,aAAa,MAAM,OAAO;CACrC,MAAM,KAAK,KAAK;EAAE,YAAY,WAAW;EAAW,YAAY,CAAC,KAAK,MAAM,KAAK,SAAS;CAAE,CAAC;CAC7F,MAAM,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACpD,OAAO,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACrD,aAAa,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CAC3D,SAAS,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACvD,QAAQ,KAAK,KAAK,EAAE,YAAY,WAAW,YAAY,CAAC;CACxD,SAAS,KAAK,KAAK;EACjB,YAAY,WAAW;EACvB,QAAQ,CAAC,MAAM,KAAK;EACpB,YAAY,CAAC,KAAK,SAAS;CAC7B,CAAC;AACH,CAAC;AAmDD,MAAa,QACX,SACA,MACS;CACT,MAAM,WAAW,SAAS,YACxB,YACA,CAAC,GAAI,QAAQ,UAAU,KAAA,IAAY,CAAC,IAAI,CAAC,QAAQ,MAAM,KAAK,GAAI,GAAI,QAAQ,UAAU,CAAC,CAAE,GACzF;EAAE,OAAO,KAAA;EAAW;CAAE,CACxB;CACA,MAAM,YAAY,QAAQ;CAC1B,MAAM,QAAQ,CACZ,EAAE,cAAc,UAAU,QAAQ,MAAM,GAExC,EAAE,cAAc,eAAe,OAAO,cAAc,KAAA,CAAS,CAAC,CAChE;CACA,MAAM,SAAS,MAAM,MAAM,OAAO,CAAC,CAAC,KAClC,MAAM,yBAAyB,QAAQ,CAAC,CAAC;EACvC,SAAS,EAAE,OAAO,iBAAiB;GACjC,MAAM;GACN,OAAO,aACL,EAAE,IACA,SAAS,KAAK,MAAM,CAAC,EAAE,KAAK,cAAc,OAAO,UAAU,QAAQ,GAAG,GAAG,KAAK,CAAC,GAC/E,QACF;EACJ;EACA,SAAS,EAAE,aAAa;GACtB,MAAM;GACN,OAAO,aACL,EAAE,QAAQ,SAAS,KAAK,MAAM,CAAC,EAAE,UAAU,KAAK,GAAG,GAAG,KAAK,CAAC,GAAG,QAAQ;EAC3E;CACF,CAAC,CACH;CACA,MAAM,cAAc,WAClB,UAAU,SACN,EAAE,EAAE,SAAS,OAAO,MAAM,CAAC,EAAE,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,IAChE,EAAE,OAAO,SAAS,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ,GAAG,EAAE,QAAQ,OAAO,OAAO,CAAC,CAAC,GAAG,CAC7E,OAAO,KACT,CAAC;CACP,MAAM,UAAU,QAAQ,WAAW,CAAC;CACpC,OAAO,OAAO,KAAK;EACjB,GAAI,QAAQ,SAAS,KAAA,IACjB,CAAC,IACD,CAAC,EAAE,KAAK,SAAS,KAAK,MAAM,CAAC,EAAE,WAAW,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC;EACtE,EAAE,EAAE,SAAS,MAAM,MAAM,GAAG,CAAC,QAAQ,KAAK,CAAC;EAC3C,GAAI,QAAQ,gBAAgB,KAAA,IACxB,CAAC,IACD,CAAC,EAAE,EAAE,SAAS,YAAY,MAAM,GAAG,CAAC,QAAQ,WAAW,CAAC,CAAC;EAC7D,GAAI,QAAQ,WAAW,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,SAAS,QAAQ,MAAM,GAAG,QAAQ,IAAI,UAAU,CAAC,CAAC;EACzF,GAAI,cAAc,KAAA,IACd,CAAC,IACD,CACE,EAAE,OACA,SAAS,QAAQ,MAAM;GACrB,EAAE,KAAK,QAAQ;GACf,EAAE,UAAU,QAAQ,gBAAgB,WAAW,OAAO,MAAM;GAC5D,EAAE,QAAQ,SAAS;EACrB,CAAC,GAED,CAAC,GAAG,CACN,CACF;CACN,CAAC;AACH"}
@@ -0,0 +1,86 @@
1
+ import { Behavior } from "foldkit-mixins";
2
+ import { Schema } from "effect";
3
+ import * as Mount from "foldkit/mount";
4
+ import { Attribute, HtmlBuilder } from "foldkit/html";
5
+ export declare const Anchor: Mount.MountDefinitionWithArgs<"Anchor", {
6
+ /** The id of the element the floating one is placed against. */
7
+ buttonId: Schema.String;
8
+ anchor: Schema.Struct<{
9
+ readonly placement: Schema.optional<Schema.Literals<readonly ["top", "right", "bottom", "left", "top-start", "top-end", "right-start", "right-end", "bottom-start", "bottom-end", "left-start", "left-end"]>>;
10
+ readonly gap: Schema.optional<Schema.Number>;
11
+ readonly offset: Schema.optional<Schema.Number>;
12
+ readonly padding: Schema.optional<Schema.Union<readonly [Schema.Number, Schema.Struct<{
13
+ readonly top: Schema.optionalKey<Schema.Number>;
14
+ readonly right: Schema.optionalKey<Schema.Number>;
15
+ readonly bottom: Schema.optionalKey<Schema.Number>;
16
+ readonly left: Schema.optionalKey<Schema.Number>;
17
+ }>]>>;
18
+ readonly portal: Schema.optional<Schema.Boolean>;
19
+ readonly isPlacementLocked: Schema.optional<Schema.Boolean>;
20
+ }>;
21
+ interceptTab: Schema.optional<Schema.Boolean>;
22
+ focusAfterPosition: Schema.optional<Schema.Boolean>;
23
+ focusSelector: Schema.optional<Schema.String>;
24
+ arrowId: Schema.optional<Schema.String>;
25
+ arrowPadding: Schema.optional<Schema.Number>;
26
+ }, never>;
27
+ export type AnchorArgs = Parameters<typeof Anchor>[0];
28
+ /**
29
+ * Draw an upstream-anchored, in-place panel in the browser's top layer: show
30
+ * it as a manual popover, run the wrapped Mount's own acquire (which
31
+ * positions it), and hide it once that Mount releases. Use it only when the
32
+ * anchor keeps the panel in place (`portal: false`): upstream portal
33
+ * relocation moves the element after the Mount acquires, and moving a shown
34
+ * popover hides it again. The panel carries `popover="manual"` in its view.
35
+ * Where the popover API or the attribute is missing the wrapper is a no-op
36
+ * and the anchor positions in place.
37
+ *
38
+ * The view sets `inset: auto` on the panel, since the anchor writes only
39
+ * `left` and `top` over the browser's `inset: 0`. The browser's popover
40
+ * border, padding and `Canvas` fill stay on an unstyled panel: any author
41
+ * rule replaces them, as every recipe's panel does, where an inline reset
42
+ * would beat the recipes.
43
+ */
44
+ export declare const topLayer: <Message, E>(action: Mount.MountAction<Message, E>) => Mount.MountAction<Message, E>;
45
+ /** Shows its element in the top layer while it is drawn: the `layer` bundle's Mount. */
46
+ export declare const TopLayer: Mount.MountDefinitionNoArgs<"TopLayer", never>;
47
+ /**
48
+ * A box in the top layer, the viewport's width and no height, for a panel
49
+ * whose anchor Mount is `@foldkit/ui`'s: an element holds one Mount, so the
50
+ * panel cannot also carry the one that shows it. Drawn around the panel, the
51
+ * layer takes the panel out of every stacking context and ancestor
52
+ * `overflow`, and the anchor places the panel inside it as on the page: the
53
+ * layer is fixed at the viewport's corner, so its coordinates are the
54
+ * viewport's, and as wide, so the panel's widths and `100%` read as they
55
+ * would. With no height it covers nothing a press could land on. Its look
56
+ * is inline: the browser's popover border, padding and fill must not show
57
+ * around a panel, whatever a theme does.
58
+ */
59
+ export declare const layer: <Message>(h: HtmlBuilder<Message>) => ReadonlyArray<Attribute<Message>>;
60
+ /**
61
+ * The `layer` box without its Mount, for a box whose own Mount shows it
62
+ * (`topLayer` around one that sends Messages, which a Scene can resolve
63
+ * where `TopLayer` sends none). `style` joins the box's inline style, since
64
+ * a second `h.Style` on the element would replace it.
65
+ */
66
+ export declare const layerBox: <Message>(h: HtmlBuilder<Message>, style?: Readonly<Record<string, string>>) => ReadonlyArray<Attribute<Message>>;
67
+ /**
68
+ * Places an arrow drawn as a panel's child against the middle of the
69
+ * element whose id is given, for a panel whose anchor computes no arrow
70
+ * (`@foldkit/ui`'s Tooltip). It writes `--arrow-x` (above or below) or
71
+ * `--arrow-y` (beside) on the arrow, the properties upstream's anchor writes
72
+ * on a panel, and the other `initial`, so one rule styles both. It follows
73
+ * the panel: the anchor writes the panel's `style` and `data-placement` on
74
+ * every move, its first showing included, and each write places the arrow.
75
+ */
76
+ export declare const PlaceArrow: Mount.MountDefinitionWithArgs<"PlaceArrow", {
77
+ buttonId: Schema.String;
78
+ }, never>;
79
+ export interface BehaviorOptions<Input, Slots> {
80
+ /** The slot to position. */
81
+ readonly floating: keyof Slots & string;
82
+ readonly config: (input: Input) => AnchorArgs;
83
+ }
84
+ /** Mounts the anchor on the floating slot with the config the input gives. */
85
+ export declare const behavior: <Slots>(slots: Slots) => <Input, ParentMessage>(options: BehaviorOptions<Input, Slots>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
86
+ //# sourceMappingURL=anchor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anchor.d.ts","names":[],"sources":["../src/anchor.ts"],"mappings":";;;;qBAqCa,QAAM,MAAA;;;;;;;;;;;;;;;;;;;;;;YAgCP,aAAa,kBAAkB;;;;;;;;;;;;;;;;;qBA0D9B,WAAY,SAAS,GAAC,QACzB,MAAM,YAAY,SAAS,OAClC,MAAM,YAAY,SAAS;;qBAOjB,UAAQ,MAAA;;;;;;;;;;;;;qBAiBR,QAAS,SAAO,GAAK,YAAY,aAAW,cAAc,UAAU;;;;;;;qBAWpE,WAAY,SAAO,GAC3B,YAAY,UAAQ,QAChB,SAAS,4BACf,cAAc,UAAU;;;;;;;;;;qBA0Bd,YAAU,MAAA;;;iBA+CN,gBAAgB,OAAO;;WAE7B,gBAAgB;WAChB,SAAS,OAAO,UAAU;;;qBAIxB,WACV,OAAK,OAAS,WACd,OAAO,eAAa,SACV,gBAAgB,OAAO,WAC/B,SAAS,cAAc,OAAO,OAAO"}