@gjermundgaraba/pixel-paper 0.0.0-stage → 0.1.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 (387) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/dist/_virtual/_rolldown/runtime.js +13 -0
  4. package/dist/announcer/announcer.d.ts +35 -0
  5. package/dist/announcer/announcer.js +121 -0
  6. package/dist/announcer/index.d.ts +5 -0
  7. package/dist/announcer/index.js +11 -0
  8. package/dist/attributes/attributes.d.ts +4 -0
  9. package/dist/banner/banner.d.ts +20 -0
  10. package/dist/banner/banner.js +18 -0
  11. package/dist/banner/index.d.ts +5 -0
  12. package/dist/banner/index.js +6 -0
  13. package/dist/bench/bench.d.ts +16 -0
  14. package/dist/bench/bench.js +12 -0
  15. package/dist/bench/index.d.ts +5 -0
  16. package/dist/bench/index.js +6 -0
  17. package/dist/board/board.d.ts +1151 -0
  18. package/dist/board/board.js +449 -0
  19. package/dist/board/index.d.ts +6 -0
  20. package/dist/board/index.js +21 -0
  21. package/dist/button/button.d.ts +54 -0
  22. package/dist/button/button.js +50 -0
  23. package/dist/button/index.d.ts +5 -0
  24. package/dist/button/index.js +9 -0
  25. package/dist/card/card.d.ts +66 -0
  26. package/dist/card/card.js +70 -0
  27. package/dist/card/index.d.ts +5 -0
  28. package/dist/card/index.js +10 -0
  29. package/dist/chip/chip.d.ts +27 -0
  30. package/dist/chip/chip.js +34 -0
  31. package/dist/chip/index.d.ts +5 -0
  32. package/dist/chip/index.js +9 -0
  33. package/dist/choice/choice.d.ts +16 -0
  34. package/dist/choice/choice.js +17 -0
  35. package/dist/choice/index.d.ts +5 -0
  36. package/dist/choice/index.js +6 -0
  37. package/dist/code-editor/code-editor.d.ts +15 -0
  38. package/dist/code-editor/code-editor.js +22 -0
  39. package/dist/code-editor/index.d.ts +5 -0
  40. package/dist/code-editor/index.js +6 -0
  41. package/dist/code-surface/code-surface.d.ts +12 -0
  42. package/dist/code-surface/code-surface.js +12 -0
  43. package/dist/code-surface/index.d.ts +5 -0
  44. package/dist/code-surface/index.js +6 -0
  45. package/dist/command-palette/command-palette.d.ts +579 -0
  46. package/dist/command-palette/command-palette.js +600 -0
  47. package/dist/command-palette/index.d.ts +9 -0
  48. package/dist/command-palette/index.js +32 -0
  49. package/dist/command-palette/keys.d.ts +13 -0
  50. package/dist/command-palette/keys.js +71 -0
  51. package/dist/command-palette/match.d.ts +43 -0
  52. package/dist/command-palette/match.js +45 -0
  53. package/dist/command-palette/message.d.ts +94 -0
  54. package/dist/command-palette/message.js +46 -0
  55. package/dist/confirm-dialog/confirm-dialog.d.ts +287 -0
  56. package/dist/confirm-dialog/confirm-dialog.js +115 -0
  57. package/dist/confirm-dialog/index.d.ts +5 -0
  58. package/dist/confirm-dialog/index.js +17 -0
  59. package/dist/copy-button/copy-button.d.ts +99 -0
  60. package/dist/copy-button/copy-button.js +96 -0
  61. package/dist/copy-button/index.d.ts +5 -0
  62. package/dist/copy-button/index.js +13 -0
  63. package/dist/crumbs/crumbs.d.ts +15 -0
  64. package/dist/crumbs/crumbs.js +11 -0
  65. package/dist/crumbs/index.d.ts +5 -0
  66. package/dist/crumbs/index.js +6 -0
  67. package/dist/deck/deck.d.ts +9 -0
  68. package/dist/deck/deck.js +9 -0
  69. package/dist/deck/index.d.ts +5 -0
  70. package/dist/deck/index.js +6 -0
  71. package/dist/dialog/dialog.d.ts +278 -0
  72. package/dist/dialog/dialog.js +145 -0
  73. package/dist/dialog/fold.d.ts +58 -0
  74. package/dist/dialog/fold.js +63 -0
  75. package/dist/dialog/index.d.ts +6 -0
  76. package/dist/dialog/index.js +21 -0
  77. package/dist/disclosure/disclosure.d.ts +24 -0
  78. package/dist/disclosure/disclosure.js +25 -0
  79. package/dist/disclosure/index.d.ts +5 -0
  80. package/dist/disclosure/index.js +6 -0
  81. package/dist/dom/html-element.js +8 -0
  82. package/dist/drag/drag.d.ts +15 -0
  83. package/dist/drag/drag.js +123 -0
  84. package/dist/drop-zone/drop-zone.d.ts +119 -0
  85. package/dist/drop-zone/drop-zone.js +64 -0
  86. package/dist/drop-zone/index.d.ts +5 -0
  87. package/dist/drop-zone/index.js +14 -0
  88. package/dist/empty-state/empty-state.d.ts +18 -0
  89. package/dist/empty-state/empty-state.js +16 -0
  90. package/dist/empty-state/index.d.ts +5 -0
  91. package/dist/empty-state/index.js +6 -0
  92. package/dist/error-summary/error-summary.d.ts +34 -0
  93. package/dist/error-summary/error-summary.js +33 -0
  94. package/dist/error-summary/index.d.ts +5 -0
  95. package/dist/error-summary/index.js +6 -0
  96. package/dist/field/field.d.ts +35 -0
  97. package/dist/field/field.js +34 -0
  98. package/dist/field/index.d.ts +5 -0
  99. package/dist/field/index.js +6 -0
  100. package/dist/field-grid/field-grid.d.ts +8 -0
  101. package/dist/field-grid/field-grid.js +8 -0
  102. package/dist/field-grid/index.d.ts +5 -0
  103. package/dist/field-grid/index.js +6 -0
  104. package/dist/fields/fields.js +9 -0
  105. package/dist/fieldset/fieldset.d.ts +13 -0
  106. package/dist/fieldset/fieldset.js +13 -0
  107. package/dist/fieldset/index.d.ts +5 -0
  108. package/dist/fieldset/index.js +6 -0
  109. package/dist/filter-chip/filter-chip.d.ts +21 -0
  110. package/dist/filter-chip/filter-chip.js +28 -0
  111. package/dist/filter-chip/index.d.ts +5 -0
  112. package/dist/filter-chip/index.js +6 -0
  113. package/dist/filter-strip/filter-strip.d.ts +12 -0
  114. package/dist/filter-strip/filter-strip.js +13 -0
  115. package/dist/filter-strip/index.d.ts +5 -0
  116. package/dist/filter-strip/index.js +6 -0
  117. package/dist/flash-word/flash-word.d.ts +31 -0
  118. package/dist/flash-word/flash-word.js +31 -0
  119. package/dist/flash-word/index.d.ts +5 -0
  120. package/dist/flash-word/index.js +9 -0
  121. package/dist/focus/focus.d.ts +15 -0
  122. package/dist/focus/focus.js +17 -0
  123. package/dist/focus/index.d.ts +5 -0
  124. package/dist/focus/index.js +9 -0
  125. package/dist/format/format.js +52 -0
  126. package/dist/format/index.d.ts +5 -0
  127. package/dist/format/index.js +6 -0
  128. package/dist/glyph/glyph.d.ts +9 -0
  129. package/dist/glyph/glyph.js +25 -0
  130. package/dist/glyph/glyphs.d.ts +381 -0
  131. package/dist/glyph/glyphs.js +2603 -0
  132. package/dist/glyph/index.d.ts +5 -0
  133. package/dist/glyph/index.js +6 -0
  134. package/dist/group/group.d.ts +8 -0
  135. package/dist/group/group.js +9 -0
  136. package/dist/group/index.d.ts +5 -0
  137. package/dist/group/index.js +6 -0
  138. package/dist/history/history.d.ts +34 -0
  139. package/dist/history/history.js +15 -0
  140. package/dist/history/index.d.ts +5 -0
  141. package/dist/history/index.js +6 -0
  142. package/dist/icon-button/icon-button.d.ts +23 -0
  143. package/dist/icon-button/icon-button.js +23 -0
  144. package/dist/icon-button/index.d.ts +5 -0
  145. package/dist/icon-button/index.js +6 -0
  146. package/dist/identity/identity.d.ts +15 -0
  147. package/dist/identity/identity.js +15 -0
  148. package/dist/identity/index.d.ts +5 -0
  149. package/dist/identity/index.js +6 -0
  150. package/dist/index.d.ts +85 -0
  151. package/dist/index.js +85 -0
  152. package/dist/inline-input/index.d.ts +5 -0
  153. package/dist/inline-input/index.js +20 -0
  154. package/dist/inline-input/inline-input.d.ts +196 -0
  155. package/dist/inline-input/inline-input.js +212 -0
  156. package/dist/key-help/index.d.ts +5 -0
  157. package/dist/key-help/index.js +18 -0
  158. package/dist/key-help/key-help.d.ts +255 -0
  159. package/dist/key-help/key-help.js +137 -0
  160. package/dist/key-hint/index.d.ts +6 -0
  161. package/dist/key-hint/index.js +12 -0
  162. package/dist/key-hint/key-hint.d.ts +13 -0
  163. package/dist/key-hint/key-hint.js +7 -0
  164. package/dist/key-hint/key-label.d.ts +18 -0
  165. package/dist/key-hint/key-label.js +77 -0
  166. package/dist/keymap/keymap.d.ts +11 -0
  167. package/dist/keymap/keymap.js +9 -0
  168. package/dist/keys/keys.js +4 -0
  169. package/dist/line-diff/diff.d.ts +2 -0
  170. package/dist/line-diff/diff.js +73 -0
  171. package/dist/line-diff/index.d.ts +6 -0
  172. package/dist/line-diff/index.js +10 -0
  173. package/dist/line-diff/line-diff.d.ts +21 -0
  174. package/dist/line-diff/line-diff.js +75 -0
  175. package/dist/line-diff/patch.d.ts +15 -0
  176. package/dist/line-diff/patch.js +120 -0
  177. package/dist/link-button/index.d.ts +5 -0
  178. package/dist/link-button/index.js +6 -0
  179. package/dist/link-button/link-button.d.ts +11 -0
  180. package/dist/link-button/link-button.js +10 -0
  181. package/dist/link-state/index.d.ts +5 -0
  182. package/dist/link-state/index.js +6 -0
  183. package/dist/link-state/link-state.d.ts +15 -0
  184. package/dist/link-state/link-state.js +17 -0
  185. package/dist/live-region/index.d.ts +5 -0
  186. package/dist/live-region/index.js +9 -0
  187. package/dist/live-region/live-region.d.ts +39 -0
  188. package/dist/live-region/live-region.js +33 -0
  189. package/dist/loading/index.d.ts +5 -0
  190. package/dist/loading/index.js +6 -0
  191. package/dist/loading/loading.d.ts +19 -0
  192. package/dist/loading/loading.js +16 -0
  193. package/dist/locale/locale.d.ts +3 -0
  194. package/dist/locale/locale.js +5 -0
  195. package/dist/mark/index.d.ts +5 -0
  196. package/dist/mark/index.js +6 -0
  197. package/dist/mark/mark.d.ts +15 -0
  198. package/dist/mark/mark.js +30 -0
  199. package/dist/menu/index.d.ts +7 -0
  200. package/dist/menu/index.js +25 -0
  201. package/dist/menu/item.d.ts +236 -0
  202. package/dist/menu/item.js +19 -0
  203. package/dist/menu/menu.d.ts +206 -0
  204. package/dist/menu/menu.js +208 -0
  205. package/dist/menu/slip.js +163 -0
  206. package/dist/meter/index.d.ts +5 -0
  207. package/dist/meter/index.js +6 -0
  208. package/dist/meter/meter.d.ts +38 -0
  209. package/dist/meter/meter.js +69 -0
  210. package/dist/monogram/monogram.js +33 -0
  211. package/dist/nav-strip/index.d.ts +5 -0
  212. package/dist/nav-strip/index.js +6 -0
  213. package/dist/nav-strip/nav-strip.d.ts +19 -0
  214. package/dist/nav-strip/nav-strip.js +21 -0
  215. package/dist/notice/index.d.ts +5 -0
  216. package/dist/notice/index.js +6 -0
  217. package/dist/notice/notice.d.ts +23 -0
  218. package/dist/notice/notice.js +35 -0
  219. package/dist/outcome/index.d.ts +5 -0
  220. package/dist/outcome/index.js +6 -0
  221. package/dist/outcome/outcome.d.ts +19 -0
  222. package/dist/outcome/outcome.js +14 -0
  223. package/dist/page-head/index.d.ts +5 -0
  224. package/dist/page-head/index.js +6 -0
  225. package/dist/page-head/page-head.d.ts +13 -0
  226. package/dist/page-head/page-head.js +10 -0
  227. package/dist/panel/index.d.ts +5 -0
  228. package/dist/panel/index.js +6 -0
  229. package/dist/panel/panel.d.ts +35 -0
  230. package/dist/panel/panel.js +25 -0
  231. package/dist/password-field/index.d.ts +5 -0
  232. package/dist/password-field/index.js +6 -0
  233. package/dist/password-field/password-field.d.ts +33 -0
  234. package/dist/password-field/password-field.js +39 -0
  235. package/dist/places/index.d.ts +5 -0
  236. package/dist/places/index.js +6 -0
  237. package/dist/places/places.d.ts +32 -0
  238. package/dist/places/places.js +22 -0
  239. package/dist/props-list/index.d.ts +5 -0
  240. package/dist/props-list/index.js +6 -0
  241. package/dist/props-list/props-list.d.ts +18 -0
  242. package/dist/props-list/props-list.js +12 -0
  243. package/dist/prose/index.d.ts +5 -0
  244. package/dist/prose/index.js +6 -0
  245. package/dist/prose/prose.d.ts +14 -0
  246. package/dist/prose/prose.js +6 -0
  247. package/dist/query-chip/index.d.ts +5 -0
  248. package/dist/query-chip/index.js +6 -0
  249. package/dist/query-chip/query-chip.d.ts +18 -0
  250. package/dist/query-chip/query-chip.js +17 -0
  251. package/dist/radio-choices/index.d.ts +5 -0
  252. package/dist/radio-choices/index.js +12 -0
  253. package/dist/radio-choices/radio-choices.d.ts +105 -0
  254. package/dist/radio-choices/radio-choices.js +56 -0
  255. package/dist/rail/index.d.ts +5 -0
  256. package/dist/rail/index.js +22 -0
  257. package/dist/rail/rail.d.ts +403 -0
  258. package/dist/rail/rail.js +355 -0
  259. package/dist/reel/index.d.ts +6 -0
  260. package/dist/reel/index.js +26 -0
  261. package/dist/reel/layout.d.ts +58 -0
  262. package/dist/reel/layout.js +378 -0
  263. package/dist/reel/reel.d.ts +1070 -0
  264. package/dist/reel/reel.js +1019 -0
  265. package/dist/remote/index.d.ts +5 -0
  266. package/dist/remote/index.js +6 -0
  267. package/dist/remote/remote.d.ts +28 -0
  268. package/dist/remote/remote.js +41 -0
  269. package/dist/rows/index.d.ts +5 -0
  270. package/dist/rows/index.js +12 -0
  271. package/dist/rows/rows.d.ts +116 -0
  272. package/dist/rows/rows.js +67 -0
  273. package/dist/scheme/index.d.ts +6 -0
  274. package/dist/scheme/index.js +10 -0
  275. package/dist/scheme/scheme-switch.d.ts +98 -0
  276. package/dist/scheme/scheme-switch.js +118 -0
  277. package/dist/scheme/scheme.d.ts +5 -0
  278. package/dist/scheme/scheme.js +16 -0
  279. package/dist/scheme/script.d.ts +8 -0
  280. package/dist/scheme/script.js +10 -0
  281. package/dist/secret/index.d.ts +5 -0
  282. package/dist/secret/index.js +6 -0
  283. package/dist/secret/secret.d.ts +13 -0
  284. package/dist/secret/secret.js +9 -0
  285. package/dist/segmented/index.d.ts +5 -0
  286. package/dist/segmented/index.js +6 -0
  287. package/dist/segmented/segmented.d.ts +17 -0
  288. package/dist/segmented/segmented.js +17 -0
  289. package/dist/select-field/index.d.ts +5 -0
  290. package/dist/select-field/index.js +6 -0
  291. package/dist/select-field/select-field.d.ts +38 -0
  292. package/dist/select-field/select-field.js +29 -0
  293. package/dist/sheet/index.d.ts +5 -0
  294. package/dist/sheet/index.js +6 -0
  295. package/dist/sheet/sheet.d.ts +16 -0
  296. package/dist/sheet/sheet.js +15 -0
  297. package/dist/skip-link/index.d.ts +5 -0
  298. package/dist/skip-link/index.js +9 -0
  299. package/dist/skip-link/skip-link.d.ts +23 -0
  300. package/dist/skip-link/skip-link.js +36 -0
  301. package/dist/slot/slot.js +8 -0
  302. package/dist/sortable/index.d.ts +5 -0
  303. package/dist/sortable/index.js +16 -0
  304. package/dist/sortable/sortable.d.ts +1125 -0
  305. package/dist/sortable/sortable.js +431 -0
  306. package/dist/stack/index.d.ts +5 -0
  307. package/dist/stack/index.js +6 -0
  308. package/dist/stack/stack.d.ts +15 -0
  309. package/dist/stack/stack.js +12 -0
  310. package/dist/stage/index.d.ts +5 -0
  311. package/dist/stage/index.js +6 -0
  312. package/dist/stage/stage.d.ts +14 -0
  313. package/dist/stage/stage.js +11 -0
  314. package/dist/stat/index.d.ts +5 -0
  315. package/dist/stat/index.js +6 -0
  316. package/dist/stat/stat.d.ts +18 -0
  317. package/dist/stat/stat.js +13 -0
  318. package/dist/status-bar/index.d.ts +6 -0
  319. package/dist/status-bar/index.js +11 -0
  320. package/dist/status-bar/status-bar.d.ts +28 -0
  321. package/dist/status-bar/status-bar.js +19 -0
  322. package/dist/subscription/prefix-keys.js +12 -0
  323. package/dist/table/index.d.ts +5 -0
  324. package/dist/table/index.js +6 -0
  325. package/dist/table/table.d.ts +26 -0
  326. package/dist/table/table.js +18 -0
  327. package/dist/tabs/index.d.ts +5 -0
  328. package/dist/tabs/index.js +14 -0
  329. package/dist/tabs/tabs.d.ts +125 -0
  330. package/dist/tabs/tabs.js +57 -0
  331. package/dist/tag/index.d.ts +5 -0
  332. package/dist/tag/index.js +6 -0
  333. package/dist/tag/tag.d.ts +16 -0
  334. package/dist/tag/tag.js +25 -0
  335. package/dist/text-button/index.d.ts +5 -0
  336. package/dist/text-button/index.js +6 -0
  337. package/dist/text-button/text-button.d.ts +8 -0
  338. package/dist/text-button/text-button.js +12 -0
  339. package/dist/textarea-field/index.d.ts +5 -0
  340. package/dist/textarea-field/index.js +6 -0
  341. package/dist/textarea-field/textarea-field.d.ts +28 -0
  342. package/dist/textarea-field/textarea-field.js +30 -0
  343. package/dist/time/index.d.ts +5 -0
  344. package/dist/time/index.js +9 -0
  345. package/dist/time/time.d.ts +38 -0
  346. package/dist/time/time.js +63 -0
  347. package/dist/tips/index.d.ts +5 -0
  348. package/dist/tips/index.js +14 -0
  349. package/dist/tips/tips.d.ts +339 -0
  350. package/dist/tips/tips.js +308 -0
  351. package/dist/toast/index.d.ts +5 -0
  352. package/dist/toast/index.js +17 -0
  353. package/dist/toast/stack.d.ts +7 -0
  354. package/dist/toast/stack.js +23 -0
  355. package/dist/toast/toast.d.ts +559 -0
  356. package/dist/toast/toast.js +269 -0
  357. package/dist/toc/index.d.ts +5 -0
  358. package/dist/toc/index.js +9 -0
  359. package/dist/toc/toc.d.ts +42 -0
  360. package/dist/toc/toc.js +35 -0
  361. package/dist/top-bar/bar-height.d.ts +26 -0
  362. package/dist/top-bar/bar-height.js +43 -0
  363. package/dist/top-bar/index.d.ts +6 -0
  364. package/dist/top-bar/index.js +12 -0
  365. package/dist/top-bar/top-bar.d.ts +19 -0
  366. package/dist/top-bar/top-bar.js +18 -0
  367. package/dist/wall/index.d.ts +5 -0
  368. package/dist/wall/index.js +9 -0
  369. package/dist/wall/wall.d.ts +16 -0
  370. package/dist/wall/wall.js +15 -0
  371. package/dist/window/index.d.ts +5 -0
  372. package/dist/window/index.js +6 -0
  373. package/dist/window/window.d.ts +28 -0
  374. package/dist/window/window.js +29 -0
  375. package/dist/wordmark/index.d.ts +5 -0
  376. package/dist/wordmark/index.js +6 -0
  377. package/dist/wordmark/wordmark.d.ts +10 -0
  378. package/dist/wordmark/wordmark.js +10 -0
  379. package/dist/wrap/index.d.ts +5 -0
  380. package/dist/wrap/index.js +6 -0
  381. package/dist/wrap/wrap.d.ts +12 -0
  382. package/dist/wrap/wrap.js +9 -0
  383. package/fonts/DepartureMono-Regular.woff2 +0 -0
  384. package/fonts/LICENSE.txt +2 -0
  385. package/package.json +57 -3
  386. package/src/pixel-paper.css +4611 -0
  387. package/src/tokens.css +151 -0
@@ -0,0 +1,19 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { keyLabel } from "../key-hint/key-label.js";
3
+ import { slotView } from "../slot/slot.js";
4
+ import { measureAttributes } from "../top-bar/bar-height.js";
5
+ import { Array, Predicate } from "effect";
6
+ // src/status-bar/status-bar.ts
7
+ const bindingKey = (keys) => __foldkitBrandViewResult((Predicate.isString(keys) ? keys : Array.join(keys, " ")), "@gjermundgaraba/pixel-paper/status-bar/status-bar.js#bindingKey");
8
+ const keyNoteView = (platform, h) => __foldkitBrandViewResult((({ keys, does }) => __foldkitBrandViewResult((h.keyed("span")(bindingKey(keys), [], [h.kbd([h.Class("key-hint")], [keyLabel(keys, platform)]), ` ${does}`])), "@gjermundgaraba/pixel-paper/status-bar/status-bar.js#anonymous")), "@gjermundgaraba/pixel-paper/status-bar/status-bar.js#keyNoteView");
9
+ /** The quiet line along the bottom of an interface: what state it is in, and the keys to
10
+ * know. One per page, after the rail and the deck and outside `main`, where it is the page's
11
+ * footer (`<footer>`, the contentinfo landmark). Its keys are content, so each `kbd` is read. */
12
+ const view = (config, h) => {
13
+ const { body, keys = [], platform, toParentMessage } = config;
14
+ return __foldkitBrandViewResult((h.footer([...measureAttributes(toParentMessage, {
15
+ selector: ".statusbar",
16
+ property: "--statusbar-h"
17
+ }, h), h.Class("statusbar")], [h.div([h.Class("statusbar-state")], body), ...slotView("p", "statusbar-keys", Array.map(keys, keyNoteView(platform, h)), h)])), "@gjermundgaraba/pixel-paper/status-bar/status-bar.js#view");
18
+ };
19
+ export { view };
@@ -0,0 +1,12 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { Array, String } from "effect";
3
+ // src/subscription/prefix-keys.ts
4
+ /**
5
+ * Re-keys a Subscriptions record behind `prefix`, so a component's record can be given once per
6
+ * instance. Foldkit's `Subscription.aggregate` throws on a key two records share, and
7
+ * `Subscription.lift` keeps a child's keys, so a component that may appear twice on a page
8
+ * takes the prefix from its parent (`Board.subscriptions("queueBoard")`). The entries
9
+ * themselves are unchanged.
10
+ */
11
+ const prefixKeys = (prefix, entries) => __foldkitBrandViewResult((Object.fromEntries(Array.map(Object.entries(entries), ([key, entry]) => __foldkitBrandViewResult(([`${prefix}${String.capitalize(key)}`, entry]), "@gjermundgaraba/pixel-paper/subscription/prefix-keys.js#anonymous")))), "@gjermundgaraba/pixel-paper/subscription/prefix-keys.js#prefixKeys");
12
+ export { prefixKeys };
@@ -0,0 +1,5 @@
1
+ import { ViewConfig, view } from "./table.js";
2
+ declare namespace index_d_exports {
3
+ export { ViewConfig, view };
4
+ }
5
+ export { type ViewConfig, index_d_exports, view };
@@ -0,0 +1,6 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
3
+ import { view } from "./table.js";
4
+ // src/table/index.ts
5
+ var table_exports = /* @__PURE__ */ __exportAll({ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/table/index.js#view") });
6
+ export { table_exports, view };
@@ -0,0 +1,26 @@
1
+ import { Html, HtmlBuilder } from "foldkit/html";
2
+ /** One column of a table. */
3
+ export type Column<Row> = Readonly<{
4
+ /** Unique among the columns. */
5
+ key: string;
6
+ /** The column's head, in pixel caps; on a phone, each cell's label. */
7
+ header: string;
8
+ /** The cell for a row. A function because it receives the row. */
9
+ cell: (row: Row) => ReadonlyArray<Html | string>;
10
+ }>;
11
+ /** Configuration for rendering a table with `view`. */
12
+ export type ViewConfig<Row> = Readonly<{
13
+ /** Names the table's scrolling region for screen readers. */
14
+ label: string;
15
+ columns: ReadonlyArray<Column<Row>>;
16
+ rows: readonly Row[];
17
+ /** The row's stable id. */
18
+ rowKey: (row: Row) => string;
19
+ /** The row's buttons, in a last column pinned right while the table scrolls under it. Its
20
+ * head is named "Actions" for screen readers. A function because it receives the row. */
21
+ actions?: (row: Row) => ReadonlyArray<Html | string>;
22
+ }>;
23
+ /** A ruled table: head-tinted pixel-caps heads, 1px rules, and a tint under the row the
24
+ * pointer is on. Every head is a column header (`scope="col"`); on a phone each row becomes a
25
+ * block of lines, each labelled with its head. It scrolls sideways inside its wrapper. */
26
+ export declare const view: <Row, Message>(config: ViewConfig<Row>, h: HtmlBuilder<Message>) => Html;
@@ -0,0 +1,18 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { Array } from "effect";
3
+ // src/table/table.ts
4
+ /** A ruled table: head-tinted pixel-caps heads, 1px rules, and a tint under the row the
5
+ * pointer is on. Every head is a column header (`scope="col"`); on a phone each row becomes a
6
+ * block of lines, each labelled with its head. It scrolls sideways inside its wrapper. */
7
+ const view = (config, h) => {
8
+ const { label, columns, rows, rowKey, actions } = config;
9
+ const headView = h.thead([], [h.tr([], [...Array.map(columns, (column) => __foldkitBrandViewResult((h.keyed("th")(column.key, [h.Scope("col")], [column.header])), "@gjermundgaraba/pixel-paper/table/table.js#anonymous")), ...actions === void 0 ? [] : [h.th([h.Scope("col")], [h.span([h.Class("sr-only")], ["Actions"])])]])]);
10
+ const rowView = (row) => __foldkitBrandViewResult((h.keyed("tr")(rowKey(row), [], [...Array.map(columns, (column) => __foldkitBrandViewResult((h.keyed("td")(column.key, [h.DataAttribute("label", column.header)], column.cell(row))), "@gjermundgaraba/pixel-paper/table/table.js#anonymous~2")), ...actions === void 0 ? [] : [h.td([h.Class("acts")], actions(row))]])), "@gjermundgaraba/pixel-paper/table/table.js#rowView");
11
+ return __foldkitBrandViewResult((h.div([
12
+ h.Role("region"),
13
+ h.AriaLabel(label),
14
+ h.Tabindex(0),
15
+ h.Class("table-wrap")
16
+ ], [h.table([h.Class("table")], [headView, h.tbody([], Array.map(rows, rowView))])])), "@gjermundgaraba/pixel-paper/table/table.js#view");
17
+ };
18
+ export { view };
@@ -0,0 +1,5 @@
1
+ import { InitConfig, Message, Model, OutMessage, ViewInputs, id, init, update, view } from "./tabs.js";
2
+ declare namespace index_d_exports {
3
+ export { InitConfig, Message, Model, OutMessage, ViewInputs, id, init, update, view };
4
+ }
5
+ export { type InitConfig, Message, Model, OutMessage, type ViewInputs, id, index_d_exports, init, update, view };
@@ -0,0 +1,14 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
3
+ import { Message, Model, OutMessage, id, init, update, view } from "./tabs.js";
4
+ // src/tabs/index.ts
5
+ var tabs_exports = /* @__PURE__ */ __exportAll({
6
+ Message: () => __foldkitBrandViewResult((Message), "@gjermundgaraba/pixel-paper/tabs/index.js#Message"),
7
+ Model: () => __foldkitBrandViewResult((Model), "@gjermundgaraba/pixel-paper/tabs/index.js#Model"),
8
+ OutMessage: () => __foldkitBrandViewResult((OutMessage), "@gjermundgaraba/pixel-paper/tabs/index.js#OutMessage"),
9
+ id: () => __foldkitBrandViewResult((id), "@gjermundgaraba/pixel-paper/tabs/index.js#id"),
10
+ init: () => __foldkitBrandViewResult((init), "@gjermundgaraba/pixel-paper/tabs/index.js#init"),
11
+ update: () => __foldkitBrandViewResult((update), "@gjermundgaraba/pixel-paper/tabs/index.js#update"),
12
+ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/tabs/index.js#view")
13
+ });
14
+ export { Message, Model, OutMessage, id, init, tabs_exports, update, view };
@@ -0,0 +1,125 @@
1
+ import { Option, Schema } from "effect";
2
+ import { Html } from "foldkit/html";
3
+ import * as Update from "foldkit/update";
4
+ /** Schema for a tab strip: the `@foldkit/ui` Tabs it is built on, which keeps where the
5
+ * keyboard is. Which tab is selected is the parent's: pass it in as `selectedValue`. */
6
+ export declare const Model: Schema.Struct<{
7
+ readonly tabs: Schema.Struct<{
8
+ readonly id: Schema.String;
9
+ readonly maybeFocusedIndex: Schema.Option<Schema.Number>;
10
+ readonly activationMode: Schema.Literals<readonly ["Automatic", "Manual"]>;
11
+ }>;
12
+ }>;
13
+ export type Model = typeof Model.Type;
14
+ /** Union of all Messages a tab strip can produce. */
15
+ export declare const Message: import("foldkit/message").MessageUnion<{
16
+ readonly GotTabsMessage: {
17
+ message: import("foldkit/message").MessageUnion<{
18
+ readonly SelectedTab: {
19
+ index: Schema.Number;
20
+ value: Schema.String;
21
+ };
22
+ readonly FocusedTab: {
23
+ index: Schema.Number;
24
+ };
25
+ readonly CompletedFocusTab: {};
26
+ }>;
27
+ };
28
+ }>;
29
+ export type Message = typeof Message.Type;
30
+ /** Union of OutMessages a tab strip reports: a tab was chosen by a press, an arrow, Home or
31
+ * End. Store `value` and pass it back in as `selectedValue`. */
32
+ export declare const OutMessage: import("foldkit/message").MessageUnion<{
33
+ readonly Selected: {
34
+ value: Schema.String;
35
+ };
36
+ }>;
37
+ export type OutMessage = typeof OutMessage.Type;
38
+ /** Configuration for creating a tab strip with `init`. The `id` must be unique in the
39
+ * document; each tab's and panel's id derives from it. */
40
+ export type InitConfig = Readonly<{
41
+ id: string;
42
+ }>;
43
+ /** Creates a tab strip. Arrows select as they move. */
44
+ export declare const init: (config: InitConfig) => Model;
45
+ /** The tab strip's id, unique in the document. */
46
+ export declare const id: (model: Model) => string;
47
+ /** Processes a tab strip Message and returns the next Model, Commands and OutMessage. */
48
+ export declare const update: (model: Model, message: Message) => Readonly<{
49
+ model: {
50
+ readonly tabs: {
51
+ readonly id: string;
52
+ readonly maybeFocusedIndex: Option.Option<number>;
53
+ readonly activationMode: "Automatic" | "Manual";
54
+ };
55
+ };
56
+ commands?: Update.Commands<{
57
+ readonly _tag: "GotTabsMessage";
58
+ readonly message: {
59
+ readonly _tag: "CompletedFocusTab";
60
+ } | {
61
+ readonly _tag: "FocusedTab";
62
+ readonly index: number;
63
+ } | {
64
+ readonly _tag: "SelectedTab";
65
+ readonly index: number;
66
+ readonly value: string;
67
+ };
68
+ }, never>;
69
+ outMessage?: {
70
+ readonly _tag: "Selected";
71
+ readonly value: string;
72
+ };
73
+ }>;
74
+ /** One tab: its value and its words. */
75
+ export type Tab = Readonly<{
76
+ value: string;
77
+ label: string;
78
+ }>;
79
+ /** Per-render inputs passed to `view` through `h.submodel`'s `viewInputs`. */
80
+ export type ViewInputs = Readonly<{
81
+ /** Names the tab list for screen readers. */
82
+ label: string;
83
+ tabs: readonly Tab[];
84
+ /** The selected tab's value, from the parent's Model. */
85
+ selectedValue: string;
86
+ /** The selected tab's panel. A function because a Submodel's viewInputs may hold functions
87
+ * only at the top level, and Foldkit runs this one in the parent's boundary, so the
88
+ * handlers in what it returns dispatch the parent's Messages. */
89
+ toPanelView: () => readonly Html[];
90
+ }>;
91
+ /**
92
+ * The nav strip at tab size over the selected tab's panel, built on `@foldkit/ui`'s Tabs:
93
+ * `div.nav.tabs[role="tablist"]` of `button[role="tab"][aria-selected]`, then the
94
+ * `div[role="tabpanel"]` named by its tab. Arrows move and select (they wrap), Home and End
95
+ * go to the ends, and only the selected tab is in the keyboard's Tab order.
96
+ */
97
+ export declare const view: import("foldkit/submodel").View<{
98
+ readonly tabs: {
99
+ readonly id: string;
100
+ readonly maybeFocusedIndex: Option.Option<number>;
101
+ readonly activationMode: "Automatic" | "Manual";
102
+ };
103
+ }, {
104
+ readonly _tag: "GotTabsMessage";
105
+ readonly message: {
106
+ readonly _tag: "CompletedFocusTab";
107
+ } | {
108
+ readonly _tag: "FocusedTab";
109
+ readonly index: number;
110
+ } | {
111
+ readonly _tag: "SelectedTab";
112
+ readonly index: number;
113
+ readonly value: string;
114
+ };
115
+ }, Readonly<{
116
+ /** Names the tab list for screen readers. */
117
+ label: string;
118
+ tabs: readonly Tab[];
119
+ /** The selected tab's value, from the parent's Model. */
120
+ selectedValue: string;
121
+ /** The selected tab's panel. A function because a Submodel's viewInputs may hold functions
122
+ * only at the top level, and Foldkit runs this one in the parent's boundary, so the
123
+ * handlers in what it returns dispatch the parent's Messages. */
124
+ toPanelView: () => readonly Html[];
125
+ }>>;
@@ -0,0 +1,57 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { Array, Option, Schema } from "effect";
3
+ import { defineMessageUnion } from "foldkit/message";
4
+ import { Tabs } from "@foldkit/ui";
5
+ import { modifyFields } from "foldkit/struct";
6
+ import { defineView } from "foldkit/submodel";
7
+ import * as Update from "foldkit/update";
8
+ // src/tabs/tabs.ts
9
+ /** Schema for a tab strip: the `@foldkit/ui` Tabs it is built on, which keeps where the
10
+ * keyboard is. Which tab is selected is the parent's: pass it in as `selectedValue`. */
11
+ const Model = Schema.Struct({ tabs: Tabs.Model });
12
+ /** Union of all Messages a tab strip can produce. */
13
+ const Message = defineMessageUnion({ GotTabsMessage: { message: Tabs.Message } });
14
+ /** Union of OutMessages a tab strip reports: a tab was chosen by a press, an arrow, Home or
15
+ * End. Store `value` and pass it back in as `selectedValue`. */
16
+ const OutMessage = defineMessageUnion({ Selected: { value: Schema.String } });
17
+ /** Creates a tab strip. Arrows select as they move. */
18
+ const init = (config) => (__foldkitBrandViewResult(({ tabs: Tabs.init({
19
+ id: config.id,
20
+ activationMode: "Automatic"
21
+ }) }), "@gjermundgaraba/pixel-paper/tabs/tabs.js#init"));
22
+ /** The tab strip's id, unique in the document. */
23
+ const id = (model) => __foldkitBrandViewResult((model.tabs.id), "@gjermundgaraba/pixel-paper/tabs/tabs.js#id");
24
+ const StringTabs = Tabs.create();
25
+ const foldTabs = Update.foldChild({
26
+ update: StringTabs.update,
27
+ read: (model) => __foldkitBrandViewResult((Option.some(model.tabs)), "@gjermundgaraba/pixel-paper/tabs/tabs.js#read"),
28
+ write: (model, nextTabs) => __foldkitBrandViewResult((modifyFields(model, { tabs: () => __foldkitBrandViewResult((nextTabs), "@gjermundgaraba/pixel-paper/tabs/tabs.js#tabs") })), "@gjermundgaraba/pixel-paper/tabs/tabs.js#write"),
29
+ toParentMessage: (message) => __foldkitBrandViewResult((Message.GotTabsMessage({ message })), "@gjermundgaraba/pixel-paper/tabs/tabs.js#toParentMessage"),
30
+ toParentOutMessage: Tabs.OutMessage.match({ Selected: ({ value }) => __foldkitBrandViewResult((OutMessage.Selected({ value })), "@gjermundgaraba/pixel-paper/tabs/tabs.js#Selected") })
31
+ });
32
+ /** Processes a tab strip Message and returns the next Model, Commands and OutMessage. */
33
+ const update = (model, message) => __foldkitBrandViewResult((Message.match(message, { GotTabsMessage: ({ message: tabsMessage }) => __foldkitBrandViewResult((foldTabs(model, tabsMessage)), "@gjermundgaraba/pixel-paper/tabs/tabs.js#GotTabsMessage") })), "@gjermundgaraba/pixel-paper/tabs/tabs.js#update");
34
+ /**
35
+ * The nav strip at tab size over the selected tab's panel, built on `@foldkit/ui`'s Tabs:
36
+ * `div.nav.tabs[role="tablist"]` of `button[role="tab"][aria-selected]`, then the
37
+ * `div[role="tabpanel"]` named by its tab. Arrows move and select (they wrap), Home and End
38
+ * go to the ends, and only the selected tab is in the keyboard's Tab order.
39
+ */
40
+ const view = defineView((model, viewInputs, h) => {
41
+ const { label, tabs, selectedValue, toPanelView } = viewInputs;
42
+ const toTabView = (tab, info) => __foldkitBrandViewResult((h.keyed("button")(tab.value, info.tab, [tab.label])), "@gjermundgaraba/pixel-paper/tabs/tabs.js#toTabView");
43
+ const toView = (render) => __foldkitBrandViewResult((h.div([h.Class("tabbed")], [h.div([...render.tablist, h.Class("nav tabs")], Array.zipWith(tabs, render.tabs, toTabView)), ...Option.toArray(Option.map(Array.findFirst(render.tabs, (info) => __foldkitBrandViewResult((info.isActive), "@gjermundgaraba/pixel-paper/tabs/tabs.js#anonymous~2")), (info) => __foldkitBrandViewResult((h.div([...info.panel, h.Class("tab-panel")], toPanelView())), "@gjermundgaraba/pixel-paper/tabs/tabs.js#anonymous~3")))])), "@gjermundgaraba/pixel-paper/tabs/tabs.js#toView");
44
+ return __foldkitBrandViewResult((h.submodel({
45
+ slotId: id(model),
46
+ model: model.tabs,
47
+ view: StringTabs.view,
48
+ viewInputs: {
49
+ tabs: Array.map(tabs, (tab) => __foldkitBrandViewResult((tab.value), "@gjermundgaraba/pixel-paper/tabs/tabs.js#anonymous~4")),
50
+ selectedValue,
51
+ ariaLabel: label,
52
+ toView
53
+ },
54
+ toParentMessage: (message) => __foldkitBrandViewResult((Message.GotTabsMessage({ message })), "@gjermundgaraba/pixel-paper/tabs/tabs.js#toParentMessage~2")
55
+ })), "@gjermundgaraba/pixel-paper/tabs/tabs.js#anonymous");
56
+ });
57
+ export { Message, Model, OutMessage, id, init, update, view };
@@ -0,0 +1,5 @@
1
+ import { ViewConfig, view } from "./tag.js";
2
+ declare namespace index_d_exports {
3
+ export { ViewConfig, view };
4
+ }
5
+ export { type ViewConfig, index_d_exports, view };
@@ -0,0 +1,6 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
3
+ import { view } from "./tag.js";
4
+ // src/tag/index.ts
5
+ var tag_exports = /* @__PURE__ */ __exportAll({ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/tag/index.js#view") });
6
+ export { tag_exports, view };
@@ -0,0 +1,16 @@
1
+ import { Html, HtmlBuilder } from "foldkit/html";
2
+ /** Configuration for rendering a tag with `view`. */
3
+ export type ViewConfig<Message> = Readonly<{
4
+ /** The tag as printed: a count, a group name, a scope. */
5
+ label: string;
6
+ /** The tag written out, when it is abbreviated or clipped ("3 in Operations" for "3"): its
7
+ * name for screen readers and its tip for everyone else. */
8
+ full?: string;
9
+ /** Makes the tag a button. */
10
+ onClick?: Message;
11
+ /** The tag's stable id among its siblings, for tags mapped from a list that changes. */
12
+ key?: string;
13
+ }>;
14
+ /** A small muted label on a 1px rule. With `full`, screen readers hear the full words and
15
+ * the eye gets them as a tip; with `onClick`, a button built on `@foldkit/ui`'s Button. */
16
+ export declare const view: <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Message>) => Html;
@@ -0,0 +1,25 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { Button } from "@foldkit/ui";
3
+ // src/tag/tag.ts
4
+ /** A small muted label on a 1px rule. With `full`, screen readers hear the full words and
5
+ * the eye gets them as a tip; with `onClick`, a button built on `@foldkit/ui`'s Button. */
6
+ const view = (config, h) => {
7
+ const { label, full, onClick, key } = config;
8
+ const fullAttributes = full === void 0 ? [] : [h.DataAttribute("tip", full)];
9
+ const keyAttributes = key === void 0 ? [] : [h.Key(key)];
10
+ return __foldkitBrandViewResult((onClick === void 0 ? h.span([
11
+ ...keyAttributes,
12
+ ...fullAttributes,
13
+ h.Class("tag")
14
+ ], full === void 0 ? [label] : [h.span([h.AriaHidden(true)], [label]), h.span([h.Class("sr-only")], [full])]) : Button.view({
15
+ onClick,
16
+ toView: (groups) => __foldkitBrandViewResult((h.button([
17
+ ...groups.button,
18
+ ...keyAttributes,
19
+ ...fullAttributes,
20
+ ...full === void 0 ? [] : [h.AriaLabel(full)],
21
+ h.Class("tag")
22
+ ], [h.span([], [label])])), "@gjermundgaraba/pixel-paper/tag/tag.js#toView")
23
+ }, h)), "@gjermundgaraba/pixel-paper/tag/tag.js#view");
24
+ };
25
+ export { view };
@@ -0,0 +1,5 @@
1
+ import { ViewConfig, view } from "./text-button.js";
2
+ declare namespace index_d_exports {
3
+ export { ViewConfig, view };
4
+ }
5
+ export { type ViewConfig, index_d_exports, view };
@@ -0,0 +1,6 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
3
+ import { view } from "./text-button.js";
4
+ // src/text-button/index.ts
5
+ var text_button_exports = /* @__PURE__ */ __exportAll({ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/text-button/index.js#view") });
6
+ export { text_button_exports, view };
@@ -0,0 +1,8 @@
1
+ import { Html, HtmlBuilder } from "foldkit/html";
2
+ /** Configuration for rendering a text button with `view`. */
3
+ export type ViewConfig<Message> = Readonly<{
4
+ label: string;
5
+ onClick?: Message;
6
+ }>;
7
+ /** A button that reads as a word in the top bar: pixel caps, a dotted rule on hover. */
8
+ export declare const view: <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Message>) => Html;
@@ -0,0 +1,12 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { Button } from "@foldkit/ui";
3
+ // src/text-button/text-button.ts
4
+ /** A button that reads as a word in the top bar: pixel caps, a dotted rule on hover. */
5
+ const view = (config, h) => {
6
+ const { label, onClick } = config;
7
+ return __foldkitBrandViewResult((Button.view({
8
+ ...onClick !== void 0 && { onClick },
9
+ toView: (groups) => __foldkitBrandViewResult((h.button([...groups.button, h.Class("textbtn")], [label])), "@gjermundgaraba/pixel-paper/text-button/text-button.js#toView")
10
+ }, h)), "@gjermundgaraba/pixel-paper/text-button/text-button.js#view");
11
+ };
12
+ export { view };
@@ -0,0 +1,5 @@
1
+ import { ViewConfig, view } from "./textarea-field.js";
2
+ declare namespace index_d_exports {
3
+ export { ViewConfig, view };
4
+ }
5
+ export { type ViewConfig, index_d_exports, view };
@@ -0,0 +1,6 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
3
+ import { view } from "./textarea-field.js";
4
+ // src/textarea-field/index.ts
5
+ var textarea_field_exports = /* @__PURE__ */ __exportAll({ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/textarea-field/index.js#view") });
6
+ export { textarea_field_exports, view };
@@ -0,0 +1,28 @@
1
+ import { ChildAttribute, Html, HtmlBuilder, TextareaAttribute } from "foldkit/html";
2
+ /** Configuration for rendering a textarea field with `view`. */
3
+ export type ViewConfig<Message> = Readonly<{
4
+ id: string;
5
+ label: string;
6
+ value: string;
7
+ onInput: (value: string) => Message;
8
+ /** A sans sentence under the control. */
9
+ help?: string;
10
+ /** Why the value was refused: a red sentence under the control, which the control is
11
+ * described by, with red on its rule and its label (`aria-invalid`). Say it again in an
12
+ * ErrorSummary above the form. */
13
+ error?: string | undefined;
14
+ /** The form is not sent without it: screen readers hear "required" (`aria-required`). */
15
+ isRequired?: boolean;
16
+ /** Code and identifiers: the system monospace. */
17
+ isMono?: boolean;
18
+ /** The lines it opens at; it grows with its text from there. */
19
+ rows?: number;
20
+ /** Further attributes for the `<textarea>`, such as a placeholder or spelling off; never a
21
+ * class, and never its text, which is `value`. */
22
+ textareaAttributes?: ReadonlyArray<TextareaAttribute<Message> | ChildAttribute>;
23
+ }>;
24
+ /** A labelled textarea with its help line, built on `@foldkit/ui`'s `Textarea`: the label
25
+ * names the textarea, the help line describes it (`aria-describedby`), an `error` sets
26
+ * `aria-invalid` and describes it before the help, and `isRequired` sets `aria-required`.
27
+ * Boxless like a Field, on a dotted baseline, with an ink corner grip. */
28
+ export declare const view: <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Message>) => Html;
@@ -0,0 +1,30 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { controlAttributes, errorView, helpView } from "../field/field.js";
3
+ import { Textarea } from "@foldkit/ui";
4
+ // src/textarea-field/textarea-field.ts
5
+ /** A labelled textarea with its help line, built on `@foldkit/ui`'s `Textarea`: the label
6
+ * names the textarea, the help line describes it (`aria-describedby`), an `error` sets
7
+ * `aria-invalid` and describes it before the help, and `isRequired` sets `aria-required`.
8
+ * Boxless like a Field, on a dotted baseline, with an ink corner grip. */
9
+ const view = (config, h) => {
10
+ const { id, label, value, onInput, help, error, isRequired = false, isMono = false, rows, textareaAttributes = [] } = config;
11
+ return __foldkitBrandViewResult((Textarea.view({
12
+ id,
13
+ value,
14
+ onInput,
15
+ isInvalid: error !== void 0,
16
+ hasDescription: help !== void 0,
17
+ ...rows !== void 0 && { rows },
18
+ toView: (groups) => __foldkitBrandViewResult((h.div([h.Class(`field${isMono ? " mono" : ""}`)], [
19
+ h.label(groups.label, [label]),
20
+ h.textarea([
21
+ ...textareaAttributes,
22
+ ...groups.textarea,
23
+ ...controlAttributes(id, error, help, isRequired, h)
24
+ ]),
25
+ ...errorView(id, error, h),
26
+ ...helpView(help, groups.description, h)
27
+ ])), "@gjermundgaraba/pixel-paper/textarea-field/textarea-field.js#toView")
28
+ }, h)), "@gjermundgaraba/pixel-paper/textarea-field/textarea-field.js#view");
29
+ };
30
+ export { view };
@@ -0,0 +1,5 @@
1
+ import { ClockConfig, ViewConfig, clockEntry, view } from "./time.js";
2
+ declare namespace index_d_exports {
3
+ export { ClockConfig, ViewConfig, clockEntry, view };
4
+ }
5
+ export { type ClockConfig, type ViewConfig, clockEntry, index_d_exports, view };
@@ -0,0 +1,9 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
3
+ import { clockEntry, view } from "./time.js";
4
+ // src/time/index.ts
5
+ var time_exports = /* @__PURE__ */ __exportAll({
6
+ clockEntry: () => __foldkitBrandViewResult((clockEntry), "@gjermundgaraba/pixel-paper/time/index.js#clockEntry"),
7
+ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/time/index.js#view")
8
+ });
9
+ export { clockEntry, time_exports, view };
@@ -0,0 +1,38 @@
1
+ import { Duration, Option, Schema } from "effect";
2
+ import { Html, HtmlBuilder } from "foldkit/html";
3
+ import { EntryWithoutKeepAlive } from "foldkit/subscription";
4
+ /** How a moment is said. `Age`: `"19d"`, the age register. `Ago`: `"4m ago"`. `Until`:
5
+ * `"in 1h 41m"`. `Date`: `"12 Mar 2026"`. `DateTime`: `"12 Mar 2026, 14:05"`, in the reader's
6
+ * zone. */
7
+ export declare const TimeFormat: Schema.Literals<readonly ["Age", "Ago", "Until", "Date", "DateTime"]>;
8
+ export type TimeFormat = typeof TimeFormat.Type;
9
+ /** Configuration for rendering a moment with `view`. */
10
+ export type ViewConfig = Readonly<{
11
+ /** The moment, in epoch milliseconds. */
12
+ at: number;
13
+ format?: TimeFormat;
14
+ /** The current time from the caller's Model, kept by `clockEntry`. `None` until the clock
15
+ * first ticks, as during a server render: the moment then prints in UTC, so the server and
16
+ * the browser write the same text. */
17
+ maybeNow: Option.Option<number>;
18
+ /** `Until`: printed once the moment has gone (`"reset due"`, `"expired"`). */
19
+ passed?: string;
20
+ /** `Age` and `Ago`: older than this prints red, as a stale age. */
21
+ staleAfter?: Duration.Duration;
22
+ }>;
23
+ /** A moment, said relative to the caller's `maybeNow` or as a date, in a `<time>` whose
24
+ * `datetime` is the moment in ISO form. Stale ages print red. */
25
+ export declare const view: <Message>(config: ViewConfig, h: HtmlBuilder<Message>) => Html;
26
+ /** Configuration for the `clockEntry` Subscription helper. */
27
+ export type ClockConfig<Model, Message> = Readonly<{
28
+ /** Whether anything on the page reads the clock; it stops while this is false. */
29
+ isActive: (model: Model) => boolean;
30
+ toMessage: (now: number) => Message;
31
+ }>;
32
+ /** A Subscription entry that emits the current time in epoch milliseconds at once and then
33
+ * once a second while `isActive`. Keep the value in the Model and hand it to `view` as
34
+ * `maybeNow`, so every Time on the page reads one clock. Pass it into `Subscription.make` as
35
+ * an entry value. */
36
+ export declare const clockEntry: <Model, Message>(config: ClockConfig<Model, Message>) => EntryWithoutKeepAlive<Model, Message, Readonly<{
37
+ isActive: boolean;
38
+ }>, never>;
@@ -0,0 +1,63 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { formatDate, formatDateTime, formatRemaining, formatSpan } from "../format/format.js";
3
+ import { Clock, Duration, Match, Option, Schedule, Schema, Stream } from "effect";
4
+ Schema.Literals([
5
+ "Age",
6
+ "Ago",
7
+ "Until",
8
+ "Date",
9
+ "DateTime"
10
+ ]);
11
+ const JUST_NOW = Duration.toMillis(Duration.seconds(10));
12
+ const UTC = Option.some("UTC");
13
+ const utcLook = (at, format) => (__foldkitBrandViewResult(({
14
+ maybeClass: Option.none(),
15
+ text: format === "Date" ? formatDate(new Date(at), UTC) : `${formatDateTime(new Date(at), UTC)} UTC`
16
+ }), "@gjermundgaraba/pixel-paper/time/time.js#utcLook"));
17
+ const untilLook = (left, passed) => (__foldkitBrandViewResult(({
18
+ maybeClass: Option.some("due"),
19
+ text: left <= 0 ? passed : `in ${formatRemaining(left)}`
20
+ }), "@gjermundgaraba/pixel-paper/time/time.js#untilLook"));
21
+ const ageLook = (age, format, maybeStaleAfter) => {
22
+ const isStale = Option.exists(maybeStaleAfter, (staleAfter) => __foldkitBrandViewResult((age > Duration.toMillis(staleAfter)), "@gjermundgaraba/pixel-paper/time/time.js#anonymous"));
23
+ const maybeClass = Option.some(isStale ? "age stale" : "age");
24
+ if (age < JUST_NOW) return __foldkitBrandViewResult(({
25
+ maybeClass,
26
+ text: format === "Ago" ? "just now" : "now"
27
+ }), "@gjermundgaraba/pixel-paper/time/time.js#ageLook");
28
+ return __foldkitBrandViewResult(({
29
+ maybeClass,
30
+ text: format === "Ago" ? `${formatSpan(age)} ago` : formatSpan(age)
31
+ }), "@gjermundgaraba/pixel-paper/time/time.js#ageLook");
32
+ };
33
+ const localLook = (config, format, now) => {
34
+ const maybeStaleAfter = Option.fromNullishOr(config.staleAfter);
35
+ return __foldkitBrandViewResult((Match.value(format).pipe(Match.withReturnType(), Match.when("Date", () => (__foldkitBrandViewResult(({
36
+ maybeClass: Option.none(),
37
+ text: formatDate(new Date(config.at))
38
+ }), "@gjermundgaraba/pixel-paper/time/time.js#anonymous~2"))), Match.when("DateTime", () => (__foldkitBrandViewResult(({
39
+ maybeClass: Option.none(),
40
+ text: formatDateTime(new Date(config.at))
41
+ }), "@gjermundgaraba/pixel-paper/time/time.js#anonymous~3"))), Match.when("Until", () => __foldkitBrandViewResult((untilLook(config.at - now, config.passed ?? "now")), "@gjermundgaraba/pixel-paper/time/time.js#anonymous~4")), Match.when("Age", () => __foldkitBrandViewResult((ageLook(now - config.at, "Age", maybeStaleAfter)), "@gjermundgaraba/pixel-paper/time/time.js#anonymous~5")), Match.when("Ago", () => __foldkitBrandViewResult((ageLook(now - config.at, "Ago", maybeStaleAfter)), "@gjermundgaraba/pixel-paper/time/time.js#anonymous~6")), Match.exhaustive)), "@gjermundgaraba/pixel-paper/time/time.js#localLook");
42
+ };
43
+ /** A moment, said relative to the caller's `maybeNow` or as a date, in a `<time>` whose
44
+ * `datetime` is the moment in ISO form. Stale ages print red. */
45
+ const view = (config, h) => {
46
+ const format = config.format ?? "Age";
47
+ const { maybeClass, text } = Option.match(config.maybeNow, {
48
+ onNone: () => __foldkitBrandViewResult((utcLook(config.at, format)), "@gjermundgaraba/pixel-paper/time/time.js#onNone"),
49
+ onSome: (now) => __foldkitBrandViewResult((localLook(config, format, now)), "@gjermundgaraba/pixel-paper/time/time.js#onSome")
50
+ });
51
+ return __foldkitBrandViewResult((h.time([h.Datetime(new Date(config.at).toISOString()), ...Option.isSome(maybeClass) ? [h.Class(maybeClass.value)] : []], [text])), "@gjermundgaraba/pixel-paper/time/time.js#view");
52
+ };
53
+ const TICK = Duration.seconds(1);
54
+ /** A Subscription entry that emits the current time in epoch milliseconds at once and then
55
+ * once a second while `isActive`. Keep the value in the Model and hand it to `view` as
56
+ * `maybeNow`, so every Time on the page reads one clock. Pass it into `Subscription.make` as
57
+ * an entry value. */
58
+ const clockEntry = (config) => (__foldkitBrandViewResult(({
59
+ dependenciesSchema: Schema.Struct({ isActive: Schema.Boolean }),
60
+ modelToDependencies: (model) => (__foldkitBrandViewResult(({ isActive: config.isActive(model) }), "@gjermundgaraba/pixel-paper/time/time.js#modelToDependencies")),
61
+ dependenciesToStream: ({ isActive }) => __foldkitBrandViewResult((isActive ? Stream.fromEffectSchedule(Clock.currentTimeMillis, Schedule.spaced(TICK)).pipe(Stream.map(config.toMessage)) : Stream.empty), "@gjermundgaraba/pixel-paper/time/time.js#dependenciesToStream")
62
+ }), "@gjermundgaraba/pixel-paper/time/time.js#clockEntry"));
63
+ export { clockEntry, view };
@@ -0,0 +1,5 @@
1
+ import { InitConfig, Message, Model, id, init, subscriptions, update, view } from "./tips.js";
2
+ declare namespace index_d_exports {
3
+ export { InitConfig, Message, Model, id, init, subscriptions, update, view };
4
+ }
5
+ export { type InitConfig, Message, Model, id, index_d_exports, init, subscriptions, update, view };
@@ -0,0 +1,14 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
3
+ import { Message, Model, id, init, subscriptions, update, view } from "./tips.js";
4
+ // src/tips/index.ts
5
+ var tips_exports = /* @__PURE__ */ __exportAll({
6
+ Message: () => __foldkitBrandViewResult((Message), "@gjermundgaraba/pixel-paper/tips/index.js#Message"),
7
+ Model: () => __foldkitBrandViewResult((Model), "@gjermundgaraba/pixel-paper/tips/index.js#Model"),
8
+ id: () => __foldkitBrandViewResult((id), "@gjermundgaraba/pixel-paper/tips/index.js#id"),
9
+ init: () => __foldkitBrandViewResult((init), "@gjermundgaraba/pixel-paper/tips/index.js#init"),
10
+ subscriptions: () => __foldkitBrandViewResult((subscriptions), "@gjermundgaraba/pixel-paper/tips/index.js#subscriptions"),
11
+ update: () => __foldkitBrandViewResult((update), "@gjermundgaraba/pixel-paper/tips/index.js#update"),
12
+ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/tips/index.js#view")
13
+ });
14
+ export { Message, Model, id, init, subscriptions, tips_exports, update, view };