@prestack/thread-ui 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) hide show
  1. package/CHANGELOG.md +348 -0
  2. package/dist/attach.d.ts +1 -0
  3. package/dist/attach.js +1 -0
  4. package/dist/ui/animations/anm_appear.d.ts +16 -0
  5. package/dist/ui/animations/anm_appear.js +10 -0
  6. package/dist/ui/animations/anm_blur_in.d.ts +22 -0
  7. package/dist/ui/animations/anm_blur_in.js +16 -0
  8. package/dist/ui/animations/anm_blur_out.d.ts +22 -0
  9. package/dist/ui/animations/anm_blur_out.js +16 -0
  10. package/dist/ui/animations/anm_dismiss.d.ts +22 -0
  11. package/dist/ui/animations/anm_dismiss.js +16 -0
  12. package/dist/ui/animations/anm_drop.d.ts +22 -0
  13. package/dist/ui/animations/anm_drop.js +16 -0
  14. package/dist/ui/animations/anm_fall.d.ts +22 -0
  15. package/dist/ui/animations/anm_fall.js +16 -0
  16. package/dist/ui/animations/anm_flash.d.ts +19 -0
  17. package/dist/ui/animations/anm_flash.js +16 -0
  18. package/dist/ui/animations/anm_glow.d.ts +16 -0
  19. package/dist/ui/animations/anm_glow.js +14 -0
  20. package/dist/ui/animations/anm_lift.d.ts +16 -0
  21. package/dist/ui/animations/anm_lift.js +14 -0
  22. package/dist/ui/animations/anm_nudge.d.ts +16 -0
  23. package/dist/ui/animations/anm_nudge.js +14 -0
  24. package/dist/ui/animations/anm_pop_in.d.ts +29 -0
  25. package/dist/ui/animations/anm_pop_in.js +20 -0
  26. package/dist/ui/animations/anm_pop_out.d.ts +29 -0
  27. package/dist/ui/animations/anm_pop_out.js +20 -0
  28. package/dist/ui/animations/anm_press.d.ts +19 -0
  29. package/dist/ui/animations/anm_press.js +10 -0
  30. package/dist/ui/animations/anm_pulse.d.ts +20 -0
  31. package/dist/ui/animations/anm_pulse.js +11 -0
  32. package/dist/ui/animations/anm_rise.d.ts +22 -0
  33. package/dist/ui/animations/anm_rise.js +16 -0
  34. package/dist/ui/animations/anm_shake.d.ts +23 -0
  35. package/dist/ui/animations/anm_shake.js +11 -0
  36. package/dist/ui/animations/anm_slide_in_left.d.ts +22 -0
  37. package/dist/ui/animations/anm_slide_in_left.js +16 -0
  38. package/dist/ui/animations/anm_slide_in_right.d.ts +22 -0
  39. package/dist/ui/animations/anm_slide_in_right.js +16 -0
  40. package/dist/ui/animations/anm_slide_out_left.d.ts +22 -0
  41. package/dist/ui/animations/anm_slide_out_left.js +16 -0
  42. package/dist/ui/animations/anm_slide_out_right.d.ts +22 -0
  43. package/dist/ui/animations/anm_slide_out_right.js +16 -0
  44. package/dist/ui/animations/anm_spin.d.ts +16 -0
  45. package/dist/ui/animations/anm_spin.js +10 -0
  46. package/dist/ui/animations/anm_swell.d.ts +16 -0
  47. package/dist/ui/animations/anm_swell.js +14 -0
  48. package/dist/ui/animations/anm_wobble.d.ts +27 -0
  49. package/dist/ui/animations/anm_wobble.js +22 -0
  50. package/dist/ui/animations/anm_zoom_in.d.ts +22 -0
  51. package/dist/ui/animations/anm_zoom_in.js +16 -0
  52. package/dist/ui/animations/anm_zoom_out.d.ts +22 -0
  53. package/dist/ui/animations/anm_zoom_out.js +16 -0
  54. package/dist/ui/animations.d.ts +59 -0
  55. package/dist/ui/animations.js +227 -0
  56. package/dist/ui/attach.d.ts +3 -0
  57. package/dist/ui/attach.js +497 -0
  58. package/dist/ui/charts.d.ts +32 -0
  59. package/dist/ui/charts.js +35 -0
  60. package/dist/ui/checked.d.ts +19 -0
  61. package/dist/ui/checked.js +3 -0
  62. package/dist/ui/collector.d.ts +32 -0
  63. package/dist/ui/collector.js +75 -0
  64. package/dist/ui/compositions.d.ts +21 -0
  65. package/dist/ui/compositions.js +305 -0
  66. package/dist/ui/consent.d.ts +22 -0
  67. package/dist/ui/consent.js +44 -0
  68. package/dist/ui/content.d.ts +9 -0
  69. package/dist/ui/content.js +11 -0
  70. package/dist/ui/contrast.d.ts +3 -0
  71. package/dist/ui/contrast.js +23 -0
  72. package/dist/ui/controls.d.ts +14 -0
  73. package/dist/ui/controls.js +2 -0
  74. package/dist/ui/disclosure.d.ts +14 -0
  75. package/dist/ui/disclosure.js +2 -0
  76. package/dist/ui/dismiss-layer.d.ts +14 -0
  77. package/dist/ui/dismiss-layer.js +66 -0
  78. package/dist/ui/door.d.ts +40 -0
  79. package/dist/ui/door.js +100 -0
  80. package/dist/ui/drag.d.ts +82 -0
  81. package/dist/ui/drag.js +212 -0
  82. package/dist/ui/elements/accordion.d.ts +12 -0
  83. package/dist/ui/elements/accordion.js +16 -0
  84. package/dist/ui/elements/accordion.works.d.ts +22 -0
  85. package/dist/ui/elements/accordion.works.js +44 -0
  86. package/dist/ui/elements/aspect-ratio.d.ts +10 -0
  87. package/dist/ui/elements/aspect-ratio.js +9 -0
  88. package/dist/ui/elements/aspect-ratio.works.d.ts +2 -0
  89. package/dist/ui/elements/aspect-ratio.works.js +3 -0
  90. package/dist/ui/elements/avatar.d.ts +11 -0
  91. package/dist/ui/elements/avatar.js +10 -0
  92. package/dist/ui/elements/avatar.works.d.ts +4 -0
  93. package/dist/ui/elements/avatar.works.js +16 -0
  94. package/dist/ui/elements/badge.d.ts +11 -0
  95. package/dist/ui/elements/badge.js +10 -0
  96. package/dist/ui/elements/badge.works.d.ts +5 -0
  97. package/dist/ui/elements/badge.works.js +6 -0
  98. package/dist/ui/elements/bars.d.ts +14 -0
  99. package/dist/ui/elements/bars.js +17 -0
  100. package/dist/ui/elements/bars.works.d.ts +12 -0
  101. package/dist/ui/elements/bars.works.js +20 -0
  102. package/dist/ui/elements/box.d.ts +12 -0
  103. package/dist/ui/elements/box.js +11 -0
  104. package/dist/ui/elements/breadcrumb.d.ts +10 -0
  105. package/dist/ui/elements/breadcrumb.js +12 -0
  106. package/dist/ui/elements/breadcrumb.works.d.ts +7 -0
  107. package/dist/ui/elements/breadcrumb.works.js +21 -0
  108. package/dist/ui/elements/button.d.ts +17 -0
  109. package/dist/ui/elements/button.js +16 -0
  110. package/dist/ui/elements/button.works.d.ts +17 -0
  111. package/dist/ui/elements/button.works.js +34 -0
  112. package/dist/ui/elements/column.d.ts +9 -0
  113. package/dist/ui/elements/column.js +8 -0
  114. package/dist/ui/elements/consent.d.ts +13 -0
  115. package/dist/ui/elements/consent.js +21 -0
  116. package/dist/ui/elements/consent.works.d.ts +41 -0
  117. package/dist/ui/elements/consent.works.js +79 -0
  118. package/dist/ui/elements/donut.d.ts +13 -0
  119. package/dist/ui/elements/donut.js +16 -0
  120. package/dist/ui/elements/donut.works.d.ts +11 -0
  121. package/dist/ui/elements/donut.works.js +28 -0
  122. package/dist/ui/elements/each.d.ts +14 -0
  123. package/dist/ui/elements/each.js +9 -0
  124. package/dist/ui/elements/each.works.d.ts +3 -0
  125. package/dist/ui/elements/each.works.js +68 -0
  126. package/dist/ui/elements/empty.d.ts +9 -0
  127. package/dist/ui/elements/empty.js +12 -0
  128. package/dist/ui/elements/field.d.ts +16 -0
  129. package/dist/ui/elements/field.js +15 -0
  130. package/dist/ui/elements/field.works.d.ts +17 -0
  131. package/dist/ui/elements/field.works.js +45 -0
  132. package/dist/ui/elements/funnel.d.ts +14 -0
  133. package/dist/ui/elements/funnel.js +17 -0
  134. package/dist/ui/elements/funnel.works.d.ts +12 -0
  135. package/dist/ui/elements/funnel.works.js +23 -0
  136. package/dist/ui/elements/gauge.d.ts +12 -0
  137. package/dist/ui/elements/gauge.js +15 -0
  138. package/dist/ui/elements/gauge.works.d.ts +11 -0
  139. package/dist/ui/elements/gauge.works.js +31 -0
  140. package/dist/ui/elements/glyph.d.ts +10 -0
  141. package/dist/ui/elements/glyph.js +9 -0
  142. package/dist/ui/elements/glyph.works.d.ts +5 -0
  143. package/dist/ui/elements/glyph.works.js +16 -0
  144. package/dist/ui/elements/grid.d.ts +9 -0
  145. package/dist/ui/elements/grid.js +8 -0
  146. package/dist/ui/elements/heatmap.d.ts +15 -0
  147. package/dist/ui/elements/heatmap.js +17 -0
  148. package/dist/ui/elements/heatmap.works.d.ts +11 -0
  149. package/dist/ui/elements/heatmap.works.js +11 -0
  150. package/dist/ui/elements/hit-box.d.ts +19 -0
  151. package/dist/ui/elements/hit-box.js +15 -0
  152. package/dist/ui/elements/hit-box.works.d.ts +87 -0
  153. package/dist/ui/elements/hit-box.works.js +451 -0
  154. package/dist/ui/elements/image.d.ts +10 -0
  155. package/dist/ui/elements/image.js +9 -0
  156. package/dist/ui/elements/line-chart.d.ts +13 -0
  157. package/dist/ui/elements/line-chart.js +16 -0
  158. package/dist/ui/elements/line-chart.works.d.ts +12 -0
  159. package/dist/ui/elements/line-chart.works.js +27 -0
  160. package/dist/ui/elements/link.d.ts +12 -0
  161. package/dist/ui/elements/link.js +15 -0
  162. package/dist/ui/elements/link.works.d.ts +10 -0
  163. package/dist/ui/elements/link.works.js +15 -0
  164. package/dist/ui/elements/media.d.ts +11 -0
  165. package/dist/ui/elements/media.js +22 -0
  166. package/dist/ui/elements/menu.d.ts +12 -0
  167. package/dist/ui/elements/menu.js +18 -0
  168. package/dist/ui/elements/menu.works.d.ts +50 -0
  169. package/dist/ui/elements/menu.works.js +100 -0
  170. package/dist/ui/elements/money.d.ts +10 -0
  171. package/dist/ui/elements/money.js +9 -0
  172. package/dist/ui/elements/money.works.d.ts +4 -0
  173. package/dist/ui/elements/money.works.js +4 -0
  174. package/dist/ui/elements/pagination.d.ts +11 -0
  175. package/dist/ui/elements/pagination.js +12 -0
  176. package/dist/ui/elements/pagination.works.d.ts +5 -0
  177. package/dist/ui/elements/pagination.works.js +15 -0
  178. package/dist/ui/elements/progress.d.ts +11 -0
  179. package/dist/ui/elements/progress.js +11 -0
  180. package/dist/ui/elements/progress.works.d.ts +2 -0
  181. package/dist/ui/elements/progress.works.js +6 -0
  182. package/dist/ui/elements/radio-group.d.ts +15 -0
  183. package/dist/ui/elements/radio-group.js +16 -0
  184. package/dist/ui/elements/radio-group.works.d.ts +10 -0
  185. package/dist/ui/elements/radio-group.works.js +22 -0
  186. package/dist/ui/elements/row.d.ts +9 -0
  187. package/dist/ui/elements/row.js +8 -0
  188. package/dist/ui/elements/scatter.d.ts +13 -0
  189. package/dist/ui/elements/scatter.js +15 -0
  190. package/dist/ui/elements/scatter.works.d.ts +11 -0
  191. package/dist/ui/elements/scatter.works.js +24 -0
  192. package/dist/ui/elements/select.d.ts +13 -0
  193. package/dist/ui/elements/select.js +11 -0
  194. package/dist/ui/elements/select.works.d.ts +4 -0
  195. package/dist/ui/elements/select.works.js +3 -0
  196. package/dist/ui/elements/separator.d.ts +10 -0
  197. package/dist/ui/elements/separator.js +9 -0
  198. package/dist/ui/elements/skeleton.d.ts +8 -0
  199. package/dist/ui/elements/skeleton.js +9 -0
  200. package/dist/ui/elements/slider.d.ts +14 -0
  201. package/dist/ui/elements/slider.js +10 -0
  202. package/dist/ui/elements/slider.works.d.ts +4 -0
  203. package/dist/ui/elements/slider.works.js +3 -0
  204. package/dist/ui/elements/sparkline.d.ts +10 -0
  205. package/dist/ui/elements/sparkline.js +15 -0
  206. package/dist/ui/elements/sparkline.works.d.ts +10 -0
  207. package/dist/ui/elements/sparkline.works.js +19 -0
  208. package/dist/ui/elements/spinner.d.ts +9 -0
  209. package/dist/ui/elements/spinner.js +12 -0
  210. package/dist/ui/elements/stack.d.ts +9 -0
  211. package/dist/ui/elements/stack.js +8 -0
  212. package/dist/ui/elements/stat.d.ts +12 -0
  213. package/dist/ui/elements/stat.js +10 -0
  214. package/dist/ui/elements/stat.works.d.ts +3 -0
  215. package/dist/ui/elements/stat.works.js +10 -0
  216. package/dist/ui/elements/surface.d.ts +9 -0
  217. package/dist/ui/elements/surface.js +15 -0
  218. package/dist/ui/elements/surface.works.d.ts +7 -0
  219. package/dist/ui/elements/surface.works.js +4 -0
  220. package/dist/ui/elements/table.d.ts +13 -0
  221. package/dist/ui/elements/table.js +16 -0
  222. package/dist/ui/elements/table.works.d.ts +11 -0
  223. package/dist/ui/elements/table.works.js +15 -0
  224. package/dist/ui/elements/tabs.d.ts +12 -0
  225. package/dist/ui/elements/tabs.js +16 -0
  226. package/dist/ui/elements/tabs.works.d.ts +25 -0
  227. package/dist/ui/elements/tabs.works.js +53 -0
  228. package/dist/ui/elements/text.d.ts +13 -0
  229. package/dist/ui/elements/text.js +9 -0
  230. package/dist/ui/elements/textarea.d.ts +14 -0
  231. package/dist/ui/elements/textarea.js +11 -0
  232. package/dist/ui/elements/textarea.works.d.ts +4 -0
  233. package/dist/ui/elements/textarea.works.js +3 -0
  234. package/dist/ui/elements/time.d.ts +11 -0
  235. package/dist/ui/elements/time.js +14 -0
  236. package/dist/ui/elements/time.works.d.ts +11 -0
  237. package/dist/ui/elements/time.works.js +16 -0
  238. package/dist/ui/elements/toggle.d.ts +11 -0
  239. package/dist/ui/elements/toggle.js +10 -0
  240. package/dist/ui/elements/toggle.works.d.ts +4 -0
  241. package/dist/ui/elements/toggle.works.js +3 -0
  242. package/dist/ui/elements/tooltip.d.ts +12 -0
  243. package/dist/ui/elements/tooltip.js +15 -0
  244. package/dist/ui/elements/tooltip.works.d.ts +28 -0
  245. package/dist/ui/elements/tooltip.works.js +54 -0
  246. package/dist/ui/elements/value.d.ts +12 -0
  247. package/dist/ui/elements/value.js +9 -0
  248. package/dist/ui/elements/value.works.d.ts +4 -0
  249. package/dist/ui/elements/value.works.js +4 -0
  250. package/dist/ui/elements.d.ts +1143 -0
  251. package/dist/ui/elements.js +68 -0
  252. package/dist/ui/focus-scope.d.ts +7 -0
  253. package/dist/ui/focus-scope.js +109 -0
  254. package/dist/ui/fonts.d.ts +103 -0
  255. package/dist/ui/fonts.js +243 -0
  256. package/dist/ui/generators/dev.d.ts +2 -0
  257. package/dist/ui/generators/dev.js +61 -0
  258. package/dist/ui/generators/elements.d.ts +31 -0
  259. package/dist/ui/generators/elements.js +520 -0
  260. package/dist/ui/generators/i18n.d.ts +5 -0
  261. package/dist/ui/generators/i18n.js +264 -0
  262. package/dist/ui/generators/icons.d.ts +1 -0
  263. package/dist/ui/generators/icons.js +187 -0
  264. package/dist/ui/generators/react.d.ts +26 -0
  265. package/dist/ui/generators/react.js +218 -0
  266. package/dist/ui/generators/routes.d.ts +11 -0
  267. package/dist/ui/generators/routes.js +597 -0
  268. package/dist/ui/generators/show.d.ts +1 -0
  269. package/dist/ui/generators/show.js +231 -0
  270. package/dist/ui/generators/styles.d.ts +1 -0
  271. package/dist/ui/generators/styles.js +502 -0
  272. package/dist/ui/generators/variants.d.ts +12 -0
  273. package/dist/ui/generators/variants.js +162 -0
  274. package/dist/ui/i18n/catalogs/en.d.ts +172 -0
  275. package/dist/ui/i18n/catalogs/en.js +148 -0
  276. package/dist/ui/i18n/format.d.ts +13 -0
  277. package/dist/ui/i18n/format.js +161 -0
  278. package/dist/ui/i18n/locales.d.ts +9 -0
  279. package/dist/ui/i18n/locales.js +20 -0
  280. package/dist/ui/i18n/parse.d.ts +45 -0
  281. package/dist/ui/i18n/parse.js +249 -0
  282. package/dist/ui/i18n/translator.d.ts +10 -0
  283. package/dist/ui/i18n/translator.js +22 -0
  284. package/dist/ui/i18n/types.d.ts +33 -0
  285. package/dist/ui/i18n/types.js +9 -0
  286. package/dist/ui/icons.d.ts +67 -0
  287. package/dist/ui/icons.js +249 -0
  288. package/dist/ui/islands/map.d.ts +33 -0
  289. package/dist/ui/islands/map.js +44 -0
  290. package/dist/ui/localizations.d.ts +33 -0
  291. package/dist/ui/localizations.js +51 -0
  292. package/dist/ui/makers/message.d.ts +1 -0
  293. package/dist/ui/makers/message.js +230 -0
  294. package/dist/ui/material.d.ts +83 -0
  295. package/dist/ui/material.js +95 -0
  296. package/dist/ui/materials/mat_bordered.d.ts +22 -0
  297. package/dist/ui/materials/mat_bordered.js +12 -0
  298. package/dist/ui/materials/mat_ceramic.d.ts +22 -0
  299. package/dist/ui/materials/mat_ceramic.js +12 -0
  300. package/dist/ui/materials/mat_clay.d.ts +22 -0
  301. package/dist/ui/materials/mat_clay.js +12 -0
  302. package/dist/ui/materials/mat_elevated.d.ts +32 -0
  303. package/dist/ui/materials/mat_elevated.js +23 -0
  304. package/dist/ui/materials/mat_flat.d.ts +50 -0
  305. package/dist/ui/materials/mat_flat.js +33 -0
  306. package/dist/ui/materials/mat_glass.d.ts +32 -0
  307. package/dist/ui/materials/mat_glass.js +19 -0
  308. package/dist/ui/materials/mat_lit.d.ts +22 -0
  309. package/dist/ui/materials/mat_lit.js +12 -0
  310. package/dist/ui/materials/mat_moulded.d.ts +16 -0
  311. package/dist/ui/materials/mat_moulded.js +10 -0
  312. package/dist/ui/materials.d.ts +56 -0
  313. package/dist/ui/materials.js +175 -0
  314. package/dist/ui/modes.d.ts +25 -0
  315. package/dist/ui/modes.js +25 -0
  316. package/dist/ui/navigation.d.ts +3 -0
  317. package/dist/ui/navigation.js +24 -0
  318. package/dist/ui/positioning.d.ts +24 -0
  319. package/dist/ui/positioning.js +48 -0
  320. package/dist/ui/presented.d.ts +10 -0
  321. package/dist/ui/presented.js +81 -0
  322. package/dist/ui/provider.d.ts +31 -0
  323. package/dist/ui/provider.js +104 -0
  324. package/dist/ui/render-loop.d.ts +12 -0
  325. package/dist/ui/render-loop.js +94 -0
  326. package/dist/ui/roving-focus.d.ts +15 -0
  327. package/dist/ui/roving-focus.js +143 -0
  328. package/dist/ui/screens.d.ts +17 -0
  329. package/dist/ui/screens.js +112 -0
  330. package/dist/ui/scroll-lock.d.ts +2 -0
  331. package/dist/ui/scroll-lock.js +24 -0
  332. package/dist/ui/series.d.ts +9 -0
  333. package/dist/ui/series.js +67 -0
  334. package/dist/ui/signals.d.ts +120 -0
  335. package/dist/ui/signals.js +286 -0
  336. package/dist/ui/styleguide.d.ts +27 -0
  337. package/dist/ui/styleguide.js +138 -0
  338. package/dist/ui/styleguides.d.ts +11 -0
  339. package/dist/ui/styleguides.js +299 -0
  340. package/dist/ui/themes.d.ts +5 -0
  341. package/dist/ui/themes.js +16 -0
  342. package/dist/ui/token.d.ts +16 -0
  343. package/dist/ui/token.js +37 -0
  344. package/dist/ui/tokens/shadow.d.ts +6 -0
  345. package/dist/ui/tokens/shadow.js +17 -0
  346. package/dist/ui/tokens.d.ts +180 -0
  347. package/dist/ui/tokens.js +200 -0
  348. package/dist/ui/validators.d.ts +37 -0
  349. package/dist/ui/validators.js +184 -0
  350. package/dist/ui/variant.d.ts +122 -0
  351. package/dist/ui/variant.js +201 -0
  352. package/dist/ui/variants/var_avatar-round.d.ts +23 -0
  353. package/dist/ui/variants/var_avatar-round.js +13 -0
  354. package/dist/ui/variants/var_bubble-me.d.ts +21 -0
  355. package/dist/ui/variants/var_bubble-me.js +13 -0
  356. package/dist/ui/variants/var_bubble-them.d.ts +18 -0
  357. package/dist/ui/variants/var_bubble-them.js +12 -0
  358. package/dist/ui/variants/var_button-border.d.ts +116 -0
  359. package/dist/ui/variants/var_button-border.js +75 -0
  360. package/dist/ui/variants/var_button-cta.d.ts +116 -0
  361. package/dist/ui/variants/var_button-cta.js +75 -0
  362. package/dist/ui/variants/var_button-destructive-ghost.d.ts +113 -0
  363. package/dist/ui/variants/var_button-destructive-ghost.js +71 -0
  364. package/dist/ui/variants/var_button-destructive.d.ts +116 -0
  365. package/dist/ui/variants/var_button-destructive.js +75 -0
  366. package/dist/ui/variants/var_button-fill.d.ts +116 -0
  367. package/dist/ui/variants/var_button-fill.js +75 -0
  368. package/dist/ui/variants/var_button-ghost.d.ts +113 -0
  369. package/dist/ui/variants/var_button-ghost.js +71 -0
  370. package/dist/ui/variants/var_button-glass.d.ts +84 -0
  371. package/dist/ui/variants/var_button-glass.js +54 -0
  372. package/dist/ui/variants/var_button-normal.d.ts +116 -0
  373. package/dist/ui/variants/var_button-normal.js +75 -0
  374. package/dist/ui/variants/var_button-quiet.d.ts +119 -0
  375. package/dist/ui/variants/var_button-quiet.js +73 -0
  376. package/dist/ui/variants/var_card.d.ts +30 -0
  377. package/dist/ui/variants/var_card.js +16 -0
  378. package/dist/ui/variants/var_chip.d.ts +18 -0
  379. package/dist/ui/variants/var_chip.js +12 -0
  380. package/dist/ui/variants/var_choice.d.ts +26 -0
  381. package/dist/ui/variants/var_choice.js +14 -0
  382. package/dist/ui/variants/var_framed.d.ts +11 -0
  383. package/dist/ui/variants/var_framed.js +9 -0
  384. package/dist/ui/variants/var_glyph-plain.d.ts +14 -0
  385. package/dist/ui/variants/var_glyph-plain.js +10 -0
  386. package/dist/ui/variants/var_input.d.ts +61 -0
  387. package/dist/ui/variants/var_input.js +42 -0
  388. package/dist/ui/variants/var_link-inline.d.ts +39 -0
  389. package/dist/ui/variants/var_link-inline.js +28 -0
  390. package/dist/ui/variants/var_list-row.d.ts +47 -0
  391. package/dist/ui/variants/var_list-row.js +33 -0
  392. package/dist/ui/variants/var_rule.d.ts +11 -0
  393. package/dist/ui/variants/var_rule.js +9 -0
  394. package/dist/ui/variants/var_skeleton-block.d.ts +17 -0
  395. package/dist/ui/variants/var_skeleton-block.js +11 -0
  396. package/dist/ui/variants/var_spinner-turning.d.ts +17 -0
  397. package/dist/ui/variants/var_spinner-turning.js +11 -0
  398. package/dist/ui/variants/var_stat-tile.d.ts +18 -0
  399. package/dist/ui/variants/var_stat-tile.js +12 -0
  400. package/dist/ui/variants/var_tab-bar.d.ts +24 -0
  401. package/dist/ui/variants/var_tab-bar.js +14 -0
  402. package/dist/ui/variants/var_tap-target.d.ts +33 -0
  403. package/dist/ui/variants/var_tap-target.js +24 -0
  404. package/dist/ui/variants.d.ts +174 -0
  405. package/dist/ui/variants.js +50 -0
  406. package/dist/ui/wrappers.d.ts +128 -0
  407. package/dist/ui/wrappers.js +220 -0
  408. package/package.json +16 -0
@@ -0,0 +1,249 @@
1
+ export class MessageSyntaxError extends Error {
2
+ source;
3
+ position;
4
+ constructor(message, source, position) {
5
+ super(`${message} (at ${position} in ${JSON.stringify(source)})`);
6
+ this.name = 'MessageSyntaxError';
7
+ this.source = source;
8
+ this.position = position;
9
+ }
10
+ }
11
+ const ARG_TYPES = new Set(['number', 'date', 'time', 'money', 'plural', 'selectordinal', 'select']);
12
+ class Parser {
13
+ #src;
14
+ #pos = 0;
15
+ constructor(src) {
16
+ this.#src = src;
17
+ }
18
+ parse() {
19
+ const nodes = this.#parseBody(false);
20
+ if (this.#pos < this.#src.length) {
21
+ throw new MessageSyntaxError('unexpected "}"', this.#src, this.#pos);
22
+ }
23
+ return nodes;
24
+ }
25
+ #parseBody(inSub) {
26
+ const nodes = [];
27
+ let text = '';
28
+ const flush = () => {
29
+ if (text !== '') {
30
+ nodes.push({ kind: 'text', value: text });
31
+ text = '';
32
+ }
33
+ };
34
+ while (this.#pos < this.#src.length) {
35
+ const ch = this.#src[this.#pos];
36
+ if (ch === "'") {
37
+ const next = this.#src[this.#pos + 1];
38
+ if (next === "'") {
39
+ text += "'";
40
+ this.#pos += 2;
41
+ continue;
42
+ }
43
+ if (next === '{' || next === '}' || next === '#') {
44
+ this.#pos += 1;
45
+ while (this.#pos < this.#src.length) {
46
+ if (this.#src[this.#pos] === "'") {
47
+ if (this.#src[this.#pos + 1] === "'") {
48
+ text += "'";
49
+ this.#pos += 2;
50
+ continue;
51
+ }
52
+ this.#pos += 1;
53
+ break;
54
+ }
55
+ text += this.#src[this.#pos];
56
+ this.#pos += 1;
57
+ }
58
+ continue;
59
+ }
60
+ text += "'";
61
+ this.#pos += 1;
62
+ continue;
63
+ }
64
+ if (ch === '#' && inSub) {
65
+ flush();
66
+ nodes.push({ kind: 'pound' });
67
+ this.#pos += 1;
68
+ continue;
69
+ }
70
+ if (ch === '}') {
71
+ if (inSub)
72
+ break;
73
+ throw new MessageSyntaxError('unexpected "}"', this.#src, this.#pos);
74
+ }
75
+ if (ch === '{') {
76
+ flush();
77
+ nodes.push(this.#parseArg());
78
+ continue;
79
+ }
80
+ text += ch;
81
+ this.#pos += 1;
82
+ }
83
+ flush();
84
+ return nodes;
85
+ }
86
+ #parseArg() {
87
+ const start = this.#pos;
88
+ this.#pos += 1;
89
+ this.#skipWs();
90
+ const name = this.#readIdent();
91
+ if (name === '')
92
+ throw new MessageSyntaxError('expected an argument name', this.#src, start);
93
+ this.#skipWs();
94
+ if (this.#peek() === '}') {
95
+ this.#pos += 1;
96
+ return { kind: 'arg', name };
97
+ }
98
+ if (this.#peek() !== ',') {
99
+ throw new MessageSyntaxError(`expected "," or "}" after "${name}"`, this.#src, this.#pos);
100
+ }
101
+ this.#pos += 1;
102
+ this.#skipWs();
103
+ const type = this.#readIdent();
104
+ if (!ARG_TYPES.has(type)) {
105
+ throw new MessageSyntaxError(`unknown argument type "${type}"`, this.#src, this.#pos);
106
+ }
107
+ this.#skipWs();
108
+ if (type === 'plural' || type === 'selectordinal') {
109
+ return this.#parsePlural(name, type === 'selectordinal');
110
+ }
111
+ if (type === 'select') {
112
+ return this.#parseSelect(name);
113
+ }
114
+ let style;
115
+ if (this.#peek() === ',') {
116
+ this.#pos += 1;
117
+ this.#skipWs();
118
+ style = this.#readUntil('}').trim();
119
+ }
120
+ this.#expect('}');
121
+ if (type === 'money') {
122
+ if (style !== undefined && style !== '') {
123
+ throw new MessageSyntaxError('money takes no style — the currency travels with the value', this.#src, this.#pos);
124
+ }
125
+ return { kind: 'money', name };
126
+ }
127
+ if (type === 'number')
128
+ return style ? { kind: 'number', name, style } : { kind: 'number', name };
129
+ if (type === 'date')
130
+ return style ? { kind: 'date', name, style } : { kind: 'date', name };
131
+ return style ? { kind: 'time', name, style } : { kind: 'time', name };
132
+ }
133
+ #parsePlural(name, ordinal) {
134
+ if (this.#peek() !== ',') {
135
+ throw new MessageSyntaxError('expected "," before plural options', this.#src, this.#pos);
136
+ }
137
+ this.#pos += 1;
138
+ this.#skipWs();
139
+ let offset = 0;
140
+ if (this.#src.startsWith('offset:', this.#pos)) {
141
+ this.#pos += 'offset:'.length;
142
+ this.#skipWs();
143
+ const digits = this.#readWhile((c) => c >= '0' && c <= '9');
144
+ if (digits === '')
145
+ throw new MessageSyntaxError('expected a number after "offset:"', this.#src, this.#pos);
146
+ offset = Number(digits);
147
+ this.#skipWs();
148
+ }
149
+ const options = this.#parseOptions();
150
+ if (!options.has('other')) {
151
+ throw new MessageSyntaxError(`plural "${name}" is missing the required "other" branch`, this.#src, this.#pos);
152
+ }
153
+ return { kind: 'plural', name, ordinal, offset, options };
154
+ }
155
+ #parseSelect(name) {
156
+ if (this.#peek() !== ',') {
157
+ throw new MessageSyntaxError('expected "," before select options', this.#src, this.#pos);
158
+ }
159
+ this.#pos += 1;
160
+ this.#skipWs();
161
+ const options = this.#parseOptions();
162
+ if (!options.has('other')) {
163
+ throw new MessageSyntaxError(`select "${name}" is missing the required "other" branch`, this.#src, this.#pos);
164
+ }
165
+ return { kind: 'select', name, options };
166
+ }
167
+ #parseOptions() {
168
+ const options = new Map();
169
+ while (this.#pos < this.#src.length && this.#peek() !== '}') {
170
+ this.#skipWs();
171
+ if (this.#peek() === '}')
172
+ break;
173
+ const key = this.#readWhile((c) => !/\s/.test(c) && c !== '{');
174
+ if (key === '')
175
+ throw new MessageSyntaxError('expected an option key', this.#src, this.#pos);
176
+ if (options.has(key)) {
177
+ throw new MessageSyntaxError(`duplicate option "${key}"`, this.#src, this.#pos);
178
+ }
179
+ this.#skipWs();
180
+ this.#expect('{');
181
+ options.set(key, this.#parseBody(true));
182
+ this.#expect('}');
183
+ this.#skipWs();
184
+ }
185
+ this.#expect('}');
186
+ return options;
187
+ }
188
+ #peek() {
189
+ return this.#src[this.#pos];
190
+ }
191
+ #expect(ch) {
192
+ if (this.#src[this.#pos] !== ch) {
193
+ throw new MessageSyntaxError(`expected "${ch}"`, this.#src, this.#pos);
194
+ }
195
+ this.#pos += 1;
196
+ }
197
+ #skipWs() {
198
+ while (this.#pos < this.#src.length && /\s/.test(this.#src[this.#pos] ?? ''))
199
+ this.#pos += 1;
200
+ }
201
+ #readWhile(pred) {
202
+ let out = '';
203
+ while (this.#pos < this.#src.length) {
204
+ const c = this.#src[this.#pos];
205
+ if (c === undefined || !pred(c))
206
+ break;
207
+ out += c;
208
+ this.#pos += 1;
209
+ }
210
+ return out;
211
+ }
212
+ #readIdent() {
213
+ return this.#readWhile((c) => /[A-Za-z0-9_]/.test(c));
214
+ }
215
+ #readUntil(stop) {
216
+ return this.#readWhile((c) => c !== stop);
217
+ }
218
+ }
219
+ const cache = new Map();
220
+ export function parseMessage(src) {
221
+ const hit = cache.get(src);
222
+ if (hit)
223
+ return hit;
224
+ const parsed = new Parser(src).parse();
225
+ cache.set(src, parsed);
226
+ return parsed;
227
+ }
228
+ export function messageArgs(src) {
229
+ const names = new Set();
230
+ const pass = (nodes) => {
231
+ for (const node of nodes) {
232
+ switch (node.kind) {
233
+ case 'text':
234
+ case 'pound':
235
+ break;
236
+ case 'plural':
237
+ case 'select':
238
+ names.add(node.name);
239
+ for (const body of node.options.values())
240
+ pass(body);
241
+ break;
242
+ default:
243
+ names.add(node.name);
244
+ }
245
+ }
246
+ };
247
+ pass(parseMessage(src));
248
+ return names;
249
+ }
@@ -0,0 +1,10 @@
1
+ import { type CatalogShape, type Locale, type Translator } from './types.ts';
2
+ export declare class UnknownMessageKeyError extends Error {
3
+ readonly key: string;
4
+ constructor(key: string, locale: Locale);
5
+ }
6
+ export interface TranslatorOptions {
7
+ readonly locale: Locale;
8
+ readonly timeZone?: string;
9
+ }
10
+ export declare function createTranslator<C extends CatalogShape>(catalog: C, options: TranslatorOptions): Translator<C>;
@@ -0,0 +1,22 @@
1
+ import { formatMessage } from "./format.js";
2
+ import { entryText } from "./types.js";
3
+ export class UnknownMessageKeyError extends Error {
4
+ key;
5
+ constructor(key, locale) {
6
+ super(`no message "${key}" in locale "${locale}"`);
7
+ this.name = 'UnknownMessageKeyError';
8
+ this.key = key;
9
+ }
10
+ }
11
+ export function createTranslator(catalog, options) {
12
+ const translate = (key, params) => {
13
+ const entry = catalog[key];
14
+ if (entry === undefined)
15
+ throw new UnknownMessageKeyError(key, options.locale);
16
+ return formatMessage(entryText(entry), params ?? {}, {
17
+ locale: options.locale,
18
+ timeZone: options.timeZone,
19
+ });
20
+ };
21
+ return translate;
22
+ }
@@ -0,0 +1,33 @@
1
+ import type { Money } from './parse.ts';
2
+ export type { Money } from './parse.ts';
3
+ export type Locale = string;
4
+ type Trim<S extends string> = S extends ` ${infer R}` ? Trim<R> : S extends `${infer R} ` ? Trim<R> : S;
5
+ type HasSubMessages<S extends string> = S extends `${string},plural${string}` ? true : S extends `${string}, plural${string}` ? true : S extends `${string},select${string}` ? true : S extends `${string}, select${string}` ? true : false;
6
+ type ArgName<Inner extends string> = Inner extends `${infer N},${string}` ? Trim<N> : Trim<Inner>;
7
+ type ArgValue<Inner extends string> = Inner extends `${string},${infer Rest}` ? Trim<Rest> extends `number${string}` ? number : Trim<Rest> extends `date${string}` ? Date | number : Trim<Rest> extends `time${string}` ? Date | number : Trim<Rest> extends `money${string}` ? Money : string | number : string | number;
8
+ type SimpleParams<S extends string> = S extends `${string}{${infer Inner}}${infer Rest}` ? {
9
+ [K in ArgName<Inner>]: ArgValue<Inner>;
10
+ } & SimpleParams<Rest> : unknown;
11
+ type Prettify<T> = {
12
+ [K in keyof T]: T[K];
13
+ } & {};
14
+ export type MessageParams<S extends string> = Prettify<SimpleParams<S>>;
15
+ declare const PARAMS: unique symbol;
16
+ export interface DeclaredMessage<P extends Record<string, unknown>> {
17
+ readonly text: string;
18
+ readonly [PARAMS]?: P;
19
+ }
20
+ export declare function msg<P extends Record<string, unknown>>(text: string): DeclaredMessage<P>;
21
+ export type MessageEntry = string | DeclaredMessage<Record<string, unknown>>;
22
+ export interface RequiresExplicitParams {
23
+ readonly __error: 'plural/select messages must declare params: use msg<{ ... }>(text)';
24
+ }
25
+ export type ValidEntry<E> = E extends string ? HasSubMessages<E> extends true ? RequiresExplicitParams : E : E;
26
+ export type CatalogShape = Readonly<Record<string, MessageEntry>>;
27
+ export type ParamsOf<E> = E extends DeclaredMessage<infer P> ? P : E extends string ? MessageParams<E> : never;
28
+ type HasNoKeys<T> = [keyof T] extends [never] ? true : false;
29
+ export type Translator<C extends CatalogShape> = <K extends keyof C & string>(key: K, ...args: HasNoKeys<ParamsOf<C[K]>> extends true ? [params?: Record<string, never>] : [params: ParamsOf<C[K]>]) => string;
30
+ export declare function entryText(entry: MessageEntry): string;
31
+ export declare function defineCatalog<const C extends Record<string, MessageEntry>>(catalog: {
32
+ [K in keyof C]: ValidEntry<C[K]>;
33
+ }): C;
@@ -0,0 +1,9 @@
1
+ export function msg(text) {
2
+ return { text };
3
+ }
4
+ export function entryText(entry) {
5
+ return typeof entry === 'string' ? entry : entry.text;
6
+ }
7
+ export function defineCatalog(catalog) {
8
+ return catalog;
9
+ }
@@ -0,0 +1,67 @@
1
+ import type { Threaded } from '@prestack/thread/core/thread';
2
+ export interface IconSet {
3
+ readonly name: string;
4
+ readonly module: string;
5
+ readonly size: number;
6
+ readonly nativeStroke?: number;
7
+ readonly viewBox: number;
8
+ }
9
+ export declare const ICON_TARGET: {
10
+ readonly size: 24;
11
+ readonly normalizedStroke: 1.75;
12
+ };
13
+ export declare const DEFAULT_ICON = "md";
14
+ export declare function sizeRows(rows: readonly {
15
+ readonly id: string;
16
+ readonly is?: string;
17
+ }[]): readonly {
18
+ readonly id: string;
19
+ readonly is: string;
20
+ }[];
21
+ export declare function sizeNamed(name: string): string;
22
+ export declare function strokeFor(set: {
23
+ readonly viewBox: number;
24
+ readonly nativeStroke?: number;
25
+ }, target?: number): number | undefined;
26
+ export declare const BRAND_MODULE = "simple-icons";
27
+ export declare function defineIconSet(set: IconSet): void;
28
+ export declare function defineIcon(semantic: string, names: Readonly<Record<string, string>>): void;
29
+ export declare function iconSets(): readonly IconSet[];
30
+ export declare function iconSet(name: string): IconSet | undefined;
31
+ export declare function iconNames(): readonly string[];
32
+ export declare function iconIn(set: string, semantic: string): string | undefined;
33
+ export declare function brandExport(brand: string): string;
34
+ type Row = Omit<Threaded, 'at'> & {
35
+ readonly section?: string;
36
+ readonly is?: string;
37
+ readonly sets?: Readonly<Record<string, string>>;
38
+ };
39
+ export declare const SET_ROW = "library";
40
+ export declare const SIZE_PREFIX = "icon-";
41
+ export declare const holds: readonly Row[];
42
+ export declare const ICONS: {
43
+ id: string;
44
+ at: string;
45
+ describes: string;
46
+ version: number;
47
+ cites: {
48
+ on: string;
49
+ said: string;
50
+ }[];
51
+ holds: readonly Row[];
52
+ };
53
+ export declare function drawnAs(set: string, semantic: string, by: string): string;
54
+ export declare function setNamed(name: string): IconSet;
55
+ export type IconComponent = (props: {
56
+ readonly size?: number;
57
+ readonly strokeWidth?: number;
58
+ readonly className?: string;
59
+ readonly 'aria-hidden'?: boolean;
60
+ readonly 'aria-label'?: string;
61
+ readonly role?: string;
62
+ }) => unknown;
63
+ export declare function installIcons(set: IconSet, drawn: Readonly<Record<string, IconComponent>>, sizes?: Readonly<Record<string, string>>): void;
64
+ export declare function installedSet(): IconSet | undefined;
65
+ export declare function iconSize(name?: string): number;
66
+ export declare function drawnFor(semantic: string): IconComponent;
67
+ export {};
@@ -0,0 +1,249 @@
1
+ const SETS = {
2
+ lucide: { name: 'lucide', module: 'lucide-react', size: 24, nativeStroke: 2, viewBox: 24 },
3
+ phosphor: { name: 'phosphor', module: '@phosphor-icons/react', size: 24, nativeStroke: 1.5, viewBox: 256 },
4
+ tabler: { name: 'tabler', module: '@tabler/icons-react', size: 24, nativeStroke: 2, viewBox: 24 },
5
+ heroicons: { name: 'heroicons', module: '@heroicons/react/24/outline', size: 24, nativeStroke: 1.5, viewBox: 24 },
6
+ feather: { name: 'feather', module: 'react-icons/fi', size: 24, nativeStroke: 2, viewBox: 24 },
7
+ remix: { name: 'remix', module: 'react-icons/ri', size: 24, viewBox: 24 },
8
+ bootstrap: { name: 'bootstrap', module: 'react-icons/bs', size: 16, viewBox: 16 },
9
+ material: { name: 'material', module: 'react-icons/md', size: 24, viewBox: 24 },
10
+ ionicons: { name: 'ionicons', module: 'react-icons/io5', size: 24, viewBox: 512 },
11
+ };
12
+ export const ICON_TARGET = { size: 24, normalizedStroke: 1.75 };
13
+ export const DEFAULT_ICON = 'md';
14
+ export function sizeRows(rows) {
15
+ return rows
16
+ .filter((row) => row.id !== SET_ROW && typeof row.is === 'string')
17
+ .map((row) => ({ id: row.id, is: row.is }));
18
+ }
19
+ export function sizeNamed(name) {
20
+ return name.startsWith(SIZE_PREFIX) ? name : `${SIZE_PREFIX}${name}`;
21
+ }
22
+ export function strokeFor(set, target = ICON_TARGET.normalizedStroke) {
23
+ if (set.nativeStroke === undefined)
24
+ return undefined;
25
+ return Number(((target * set.viewBox) / ICON_TARGET.size).toFixed(3));
26
+ }
27
+ export const BRAND_MODULE = 'simple-icons';
28
+ const DRAWN = {
29
+ bell: { lucide: 'Bell' },
30
+ star: { lucide: 'Star' },
31
+ heart: { lucide: 'Heart' },
32
+ share: { lucide: 'Share2' },
33
+ bookmark: { lucide: 'Bookmark' },
34
+ send: { lucide: 'Send' },
35
+ attach: { lucide: 'Paperclip' },
36
+ play: { lucide: 'Play' },
37
+ pause: { lucide: 'Pause' },
38
+ chevronLeft: { lucide: 'ChevronLeft' },
39
+ chevronUp: { lucide: 'ChevronUp' },
40
+ arrowUp: { lucide: 'ArrowUp' },
41
+ arrowDown: { lucide: 'ArrowDown' },
42
+ list: { lucide: 'List' },
43
+ signOut: { lucide: 'LogOut' },
44
+ signIn: { lucide: 'LogIn' },
45
+ secure: { lucide: 'ShieldCheck' },
46
+ card: { lucide: 'CreditCard' },
47
+ place: { lucide: 'MapPin' },
48
+ phone: { lucide: 'Phone' },
49
+ globe: { lucide: 'Globe' },
50
+ unlock: { lucide: 'Unlock' },
51
+ warning: { lucide: 'CircleAlert' },
52
+ success: { lucide: 'CircleCheck' },
53
+ failure: { lucide: 'CircleX' },
54
+ help: { lucide: 'CircleHelp' },
55
+ save: { lucide: 'Save' },
56
+ undo: { lucide: 'Undo2' },
57
+ redo: { lucide: 'Redo2' },
58
+ zoomIn: { lucide: 'ZoomIn' },
59
+ zoomOut: { lucide: 'ZoomOut' },
60
+ folder: { lucide: 'Folder' },
61
+ document: { lucide: 'FileText' },
62
+ people: { lucide: 'Users' },
63
+ addPerson: { lucide: 'UserPlus' },
64
+ tag: { lucide: 'Tag' },
65
+ flag: { lucide: 'Flag' },
66
+ archive: { lucide: 'Archive' },
67
+ inbox: { lucide: 'Inbox' },
68
+ light: { lucide: 'Sun' },
69
+ dark: { lucide: 'Moon' },
70
+ sound: { lucide: 'Volume2' },
71
+ mute: { lucide: 'VolumeX' },
72
+ microphone: { lucide: 'Mic' },
73
+ camera: { lucide: 'Camera' },
74
+ close: { lucide: 'X', phosphor: 'X', tabler: 'IconX', heroicons: 'XMarkIcon', feather: 'FiX', remix: 'RiCloseLine', bootstrap: 'BsX', material: 'MdClose', ionicons: 'IoClose' },
75
+ search: { lucide: 'Search', phosphor: 'MagnifyingGlass', tabler: 'IconSearch', heroicons: 'MagnifyingGlassIcon', feather: 'FiSearch', remix: 'RiSearchLine', bootstrap: 'BsSearch', material: 'MdSearch', ionicons: 'IoSearch' },
76
+ check: { lucide: 'Check', phosphor: 'Check', tabler: 'IconCheck', heroicons: 'CheckIcon', feather: 'FiCheck', remix: 'RiCheckLine', bootstrap: 'BsCheck', material: 'MdCheck', ionicons: 'IoCheckmark' },
77
+ chevronDown: { lucide: 'ChevronDown', phosphor: 'CaretDown', tabler: 'IconChevronDown', heroicons: 'ChevronDownIcon', feather: 'FiChevronDown', remix: 'RiArrowDownSLine', bootstrap: 'BsChevronDown', material: 'MdKeyboardArrowDown', ionicons: 'IoChevronDown' },
78
+ chevronRight: { lucide: 'ChevronRight', phosphor: 'CaretRight', tabler: 'IconChevronRight', heroicons: 'ChevronRightIcon', feather: 'FiChevronRight', remix: 'RiArrowRightSLine', bootstrap: 'BsChevronRight', material: 'MdKeyboardArrowRight', ionicons: 'IoChevronForward' },
79
+ plus: { lucide: 'Plus', phosphor: 'Plus', tabler: 'IconPlus', heroicons: 'PlusIcon', feather: 'FiPlus', remix: 'RiAddLine', bootstrap: 'BsPlus', material: 'MdAdd', ionicons: 'IoAdd' },
80
+ minus: { lucide: 'Minus', phosphor: 'Minus', tabler: 'IconMinus', heroicons: 'MinusIcon', feather: 'FiMinus', remix: 'RiSubtractLine', bootstrap: 'BsDash', material: 'MdRemove', ionicons: 'IoRemove' },
81
+ menu: { lucide: 'Menu', phosphor: 'List', tabler: 'IconMenu2', heroicons: 'Bars3Icon', feather: 'FiMenu', remix: 'RiMenuLine', bootstrap: 'BsList', material: 'MdMenu', ionicons: 'IoMenu' },
82
+ more: { lucide: 'MoreHorizontal', phosphor: 'DotsThree', tabler: 'IconDots', heroicons: 'EllipsisHorizontalIcon', feather: 'FiMoreHorizontal', remix: 'RiMoreLine', bootstrap: 'BsThreeDots', material: 'MdMoreHoriz', ionicons: 'IoEllipsisHorizontal' },
83
+ user: { lucide: 'User', phosphor: 'User', tabler: 'IconUser', heroicons: 'UserIcon', feather: 'FiUser', remix: 'RiUserLine', bootstrap: 'BsPerson', material: 'MdPerson', ionicons: 'IoPerson' },
84
+ settings: { lucide: 'Settings', phosphor: 'Gear', tabler: 'IconSettings', heroicons: 'Cog6ToothIcon', feather: 'FiSettings', remix: 'RiSettingsLine', bootstrap: 'BsGear', material: 'MdSettings', ionicons: 'IoSettings' },
85
+ trash: { lucide: 'Trash2', phosphor: 'Trash', tabler: 'IconTrash', heroicons: 'TrashIcon', feather: 'FiTrash2', remix: 'RiDeleteBinLine', bootstrap: 'BsTrash', material: 'MdDelete', ionicons: 'IoTrash' },
86
+ edit: { lucide: 'Pencil', phosphor: 'PencilSimple', tabler: 'IconPencil', heroicons: 'PencilIcon', feather: 'FiEdit2', remix: 'RiPencilLine', bootstrap: 'BsPencil', material: 'MdEdit', ionicons: 'IoPencil' },
87
+ calendar: { lucide: 'Calendar', phosphor: 'Calendar', tabler: 'IconCalendar', heroicons: 'CalendarIcon', feather: 'FiCalendar', remix: 'RiCalendarLine', bootstrap: 'BsCalendar', material: 'MdCalendarToday', ionicons: 'IoCalendar' },
88
+ clock: { lucide: 'Clock', phosphor: 'Clock', tabler: 'IconClock', heroicons: 'ClockIcon', feather: 'FiClock', remix: 'RiTimeLine', bootstrap: 'BsClock', material: 'MdAccessTime', ionicons: 'IoTime' },
89
+ eye: { lucide: 'Eye', phosphor: 'Eye', tabler: 'IconEye', heroicons: 'EyeIcon', feather: 'FiEye', remix: 'RiEyeLine', bootstrap: 'BsEye', material: 'MdVisibility', ionicons: 'IoEye' },
90
+ eyeOff: { lucide: 'EyeOff', phosphor: 'EyeSlash', tabler: 'IconEyeOff', heroicons: 'EyeSlashIcon', feather: 'FiEyeOff', remix: 'RiEyeOffLine', bootstrap: 'BsEyeSlash', material: 'MdVisibilityOff', ionicons: 'IoEyeOff' },
91
+ alert: { lucide: 'TriangleAlert', phosphor: 'Warning', tabler: 'IconAlertTriangle', heroicons: 'ExclamationTriangleIcon', feather: 'FiAlertTriangle', remix: 'RiErrorWarningLine', bootstrap: 'BsExclamationTriangle', material: 'MdWarning', ionicons: 'IoWarning' },
92
+ info: { lucide: 'Info', phosphor: 'Info', tabler: 'IconInfoCircle', heroicons: 'InformationCircleIcon', feather: 'FiInfo', remix: 'RiInformationLine', bootstrap: 'BsInfoCircle', material: 'MdInfo', ionicons: 'IoInformationCircle' },
93
+ externalLink: { lucide: 'ExternalLink', phosphor: 'ArrowSquareOut', tabler: 'IconExternalLink', heroicons: 'ArrowTopRightOnSquareIcon', feather: 'FiExternalLink', remix: 'RiExternalLinkLine', bootstrap: 'BsBoxArrowUpRight', material: 'MdOpenInNew', ionicons: 'IoOpenOutline' },
94
+ copy: { lucide: 'Copy', phosphor: 'Copy', tabler: 'IconCopy', heroicons: 'DocumentDuplicateIcon', feather: 'FiCopy', remix: 'RiFileCopyLine', bootstrap: 'BsClipboard', material: 'MdContentCopy', ionicons: 'IoCopy' },
95
+ download: { lucide: 'Download', phosphor: 'DownloadSimple', tabler: 'IconDownload', heroicons: 'ArrowDownTrayIcon', feather: 'FiDownload', remix: 'RiDownloadLine', bootstrap: 'BsDownload', material: 'MdDownload', ionicons: 'IoDownload' },
96
+ upload: { lucide: 'Upload', phosphor: 'UploadSimple', tabler: 'IconUpload', heroicons: 'ArrowUpTrayIcon', feather: 'FiUpload', remix: 'RiUploadLine', bootstrap: 'BsUpload', material: 'MdUpload', ionicons: 'IoCloudUpload' },
97
+ filter: { lucide: 'Filter', phosphor: 'Funnel', tabler: 'IconFilter', heroicons: 'FunnelIcon', feather: 'FiFilter', remix: 'RiFilterLine', bootstrap: 'BsFunnel', material: 'MdFilterList', ionicons: 'IoFilter' },
98
+ home: { lucide: 'House', phosphor: 'House', tabler: 'IconHome', heroicons: 'HomeIcon', feather: 'FiHome', remix: 'RiHomeLine', bootstrap: 'BsHouse', material: 'MdHome', ionicons: 'IoHome' },
99
+ mail: { lucide: 'Mail', phosphor: 'Envelope', tabler: 'IconMail', heroicons: 'EnvelopeIcon', feather: 'FiMail', remix: 'RiMailLine', bootstrap: 'BsEnvelope', material: 'MdMail', ionicons: 'IoMail' },
100
+ lock: { lucide: 'Lock', phosphor: 'Lock', tabler: 'IconLock', heroicons: 'LockClosedIcon', feather: 'FiLock', remix: 'RiLockLine', bootstrap: 'BsLock', material: 'MdLock', ionicons: 'IoLockClosed' },
101
+ refresh: { lucide: 'RefreshCw', phosphor: 'ArrowsClockwise', tabler: 'IconRefresh', heroicons: 'ArrowPathIcon', feather: 'FiRefreshCw', remix: 'RiRefreshLine', bootstrap: 'BsArrowRepeat', material: 'MdRefresh', ionicons: 'IoRefresh' },
102
+ arrowLeft: { lucide: 'ArrowLeft', phosphor: 'ArrowLeft', tabler: 'IconArrowLeft', heroicons: 'ArrowLeftIcon', feather: 'FiArrowLeft', remix: 'RiArrowLeftLine', bootstrap: 'BsArrowLeft', material: 'MdArrowBack', ionicons: 'IoArrowBack' },
103
+ arrowRight: { lucide: 'ArrowRight', phosphor: 'ArrowRight', tabler: 'IconArrowRight', heroicons: 'ArrowRightIcon', feather: 'FiArrowRight', remix: 'RiArrowRightLine', bootstrap: 'BsArrowRight', material: 'MdArrowForward', ionicons: 'IoArrowForward' },
104
+ };
105
+ const REGISTRY = new Map(Object.entries(DRAWN));
106
+ const SET_REGISTRY = new Map(Object.entries(SETS));
107
+ export function defineIconSet(set) {
108
+ if (SET_REGISTRY.has(set.name))
109
+ throw new Error(`icon set "${set.name}" is already registered`);
110
+ SET_REGISTRY.set(set.name, set);
111
+ }
112
+ export function defineIcon(semantic, names) {
113
+ REGISTRY.set(semantic, { ...REGISTRY.get(semantic), ...names });
114
+ }
115
+ export function iconSets() {
116
+ return [...SET_REGISTRY.values()].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
117
+ }
118
+ export function iconSet(name) {
119
+ return SET_REGISTRY.get(name);
120
+ }
121
+ export function iconNames() {
122
+ return [...REGISTRY.keys()].sort();
123
+ }
124
+ export function iconIn(set, semantic) {
125
+ return REGISTRY.get(semantic)?.[set];
126
+ }
127
+ export function brandExport(brand) {
128
+ return `si${brand.charAt(0).toUpperCase()}${brand.slice(1)}`;
129
+ }
130
+ const GROUPED = {
131
+ navigation: ['chevronUp', 'chevronDown', 'chevronLeft', 'chevronRight', 'arrowUp', 'arrowDown', 'arrowLeft', 'arrowRight', 'home', 'menu', 'more', 'externalLink', 'list'],
132
+ action: ['close', 'check', 'plus', 'minus', 'search', 'filter', 'edit', 'trash', 'save', 'undo', 'redo', 'copy', 'download', 'upload', 'share', 'send', 'attach', 'refresh', 'archive', 'zoomIn', 'zoomOut'],
133
+ status: ['alert', 'info', 'warning', 'success', 'failure', 'help', 'bell', 'flag', 'tag'],
134
+ account: ['user', 'people', 'addPerson', 'signIn', 'signOut', 'settings', 'lock', 'unlock', 'secure', 'eye', 'eyeOff'],
135
+ content: ['document', 'folder', 'inbox', 'mail', 'calendar', 'clock', 'bookmark', 'star', 'heart', 'card', 'place', 'phone', 'globe'],
136
+ media: ['play', 'pause', 'sound', 'mute', 'microphone', 'camera', 'light', 'dark'],
137
+ };
138
+ const sectionOf = (id) => {
139
+ for (const [name, held] of Object.entries(GROUPED))
140
+ if (held.includes(id))
141
+ return name;
142
+ return 'other';
143
+ };
144
+ export const SET_ROW = 'library';
145
+ export const SIZE_PREFIX = 'icon-';
146
+ export const holds = [
147
+ {
148
+ id: SET_ROW,
149
+ section: 'the library',
150
+ is: 'lucide',
151
+ describes: 'Which library every icon is drawn from. One name, because a set answers for the whole app — swapping it redraws every icon at once, and an icon a set does not carry is refused rather than quietly missing.',
152
+ version: 1,
153
+ },
154
+ {
155
+ id: `${SIZE_PREFIX}sm`,
156
+ section: 'size',
157
+ is: '16px',
158
+ describes: 'A symbol drawn inside a line of text, at the size that sits on the same baseline as the words around it.',
159
+ version: 1,
160
+ },
161
+ {
162
+ id: `${SIZE_PREFIX}md`,
163
+ section: 'size',
164
+ is: '24px',
165
+ describes: 'A symbol beside wording, at the size most controls use. What anything asking for an icon is drawn at unless it says otherwise.',
166
+ version: 1,
167
+ },
168
+ {
169
+ id: `${SIZE_PREFIX}lg`,
170
+ section: 'size',
171
+ is: '32px',
172
+ describes: 'A symbol standing on its own, where the drawing is the content rather than a marker beside it.',
173
+ version: 1,
174
+ },
175
+ ...Object.keys(DRAWN)
176
+ .sort((one, two) => {
177
+ const group = sectionOf(one) < sectionOf(two) ? -1 : sectionOf(one) > sectionOf(two) ? 1 : 0;
178
+ return group !== 0 ? group : one < two ? -1 : one > two ? 1 : 0;
179
+ })
180
+ .map((semantic) => ({
181
+ id: semantic,
182
+ section: sectionOf(semantic),
183
+ sets: DRAWN[semantic] ?? {},
184
+ describes: `The \`${semantic}\` icon, and what it is called in each library — so wording asks for the meaning and the set decides the drawing.`,
185
+ version: 1,
186
+ })),
187
+ ];
188
+ export const ICONS = {
189
+ id: 'icon',
190
+ at: 'thread/ui/icons.ts',
191
+ describes: 'Every icon an app may draw and which library it is drawn from. A row is a meaning — close, search, the chevron that opens a thing — and holds what that meaning is called in each library, so an element asks for the meaning and never for a library’s own name for it. One row says which library answers, and changing it redraws the whole app. An icon nothing declares is refused rather than rendered as a gap, and an app adds its own rows to this same list.',
192
+ version: 1,
193
+ cites: [
194
+ {
195
+ on: '2026-08-28',
196
+ said: 'Same for icons. We define icons available in icons.ts AND we make UI read from there and icons.ts pick what icon from what library.',
197
+ },
198
+ ],
199
+ holds,
200
+ };
201
+ export function drawnAs(set, semantic, by) {
202
+ const held = REGISTRY.get(semantic);
203
+ if (held === undefined) {
204
+ const has = [...REGISTRY.keys()].sort().map((one) => `\`${one}\``);
205
+ throw new Error(`\`${by}\` asks for the \`${semantic}\` icon, and no row declares one by that name. ` +
206
+ `The declared icons are ${has.join(', ')}. Add a row for it, or name one that exists.`);
207
+ }
208
+ const drawn = held[set];
209
+ if (drawn !== undefined)
210
+ return drawn;
211
+ const has = Object.keys(held).sort().map((one) => `\`${one}\``);
212
+ throw new Error(`\`${by}\` asks for the \`${semantic}\` icon and the app draws from \`${set}\`, which does not carry it. ` +
213
+ `It is carried by ${has.join(', ')}. Add \`${set}\` to that row, or draw from a library that has it.`);
214
+ }
215
+ export function setNamed(name) {
216
+ const found = SET_REGISTRY.get(name);
217
+ if (found !== undefined)
218
+ return found;
219
+ const has = [...SET_REGISTRY.keys()].sort().map((one) => `\`${one}\``);
220
+ throw new Error(`\`${name}\` is named as the icon library, and no set by that name is registered. ` +
221
+ `The registered libraries are ${has.join(', ')}.`);
222
+ }
223
+ let installed;
224
+ export function installIcons(set, drawn, sizes) {
225
+ installed = { set, drawn, ...(sizes === undefined ? {} : { sizes }) };
226
+ }
227
+ export function installedSet() {
228
+ return installed?.set;
229
+ }
230
+ export function iconSize(name = DEFAULT_ICON) {
231
+ const held = installed?.sizes?.[sizeNamed(name)];
232
+ if (held === undefined)
233
+ return ICON_TARGET.size;
234
+ const measured = Number.parseFloat(held);
235
+ return Number.isFinite(measured) ? measured : ICON_TARGET.size;
236
+ }
237
+ const NOT_INSTALLED = 'No icons are installed. The library an app draws from and the symbols it draws are generated ' +
238
+ 'from the icon rows — run `thread icons` and import what it writes, beside the stylesheet. ' +
239
+ 'Without it every icon renders as an empty box, which looks like a missing glyph and is a wiring gap.';
240
+ export function drawnFor(semantic) {
241
+ if (installed === undefined)
242
+ throw new Error(NOT_INSTALLED);
243
+ const component = installed.drawn[semantic];
244
+ if (component !== undefined)
245
+ return component;
246
+ const has = Object.keys(installed.drawn).sort().map((one) => `\`${one}\``);
247
+ throw new Error(`\`${semantic}\` is asked for as an icon, and no row declares one by that name. ` +
248
+ `The declared icons are ${has.join(', ')}. Add a row for it, or name one that exists.`);
249
+ }