@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,172 @@
1
+ export declare const en: {
2
+ readonly 'errors.auth.unauthenticated.title': "You need to sign in to do this";
3
+ readonly 'errors.auth.invalid_credentials.title': "That email or password did not match";
4
+ readonly 'errors.auth.token_expired.title': "Your session expired — sign in again";
5
+ readonly 'errors.auth.token_reused.title': "This sign-in link was already used, so we signed you out everywhere";
6
+ readonly 'errors.auth.session_revoked.title': "This session was signed out";
7
+ readonly 'errors.auth.denied.title': "You do not have permission to do this";
8
+ readonly 'errors.quota.exceeded.title': "You have used everything included in your plan";
9
+ readonly 'errors.quota.reservation_expired.title': "That request took too long and was released";
10
+ readonly 'errors.rate_limit.exceeded.title': "Too many attempts — wait a moment and try again";
11
+ readonly 'errors.feature.not_in_plan.title': "Your plan does not include this feature";
12
+ readonly 'errors.db.not_found.title': "We could not find that";
13
+ readonly 'errors.db.constraint_violation.title': "That change would break a rule on this data";
14
+ readonly 'errors.db.already_exists.title': "That already exists";
15
+ readonly 'errors.db.conflict.title': "Someone else changed this first — reload and try again";
16
+ readonly 'errors.db.migration_checksum_mismatch.title': "A migration that already ran has been edited";
17
+ readonly 'errors.db.destructive_without_dry_run.title': "This change can delete data, so it needs a test run first";
18
+ readonly 'errors.db.round_trip_budget_exceeded.title': "This node asked the database for more than it was built to need";
19
+ readonly 'errors.db.cursor_invalid.title': "That link to the next page does not belong to this list";
20
+ readonly 'errors.db.cursor_expired.title': "That link to the next page is too old — start again from the first page";
21
+ readonly 'errors.workflow.node_failed.title': "A node in this process failed";
22
+ readonly 'errors.workflow.invalid_transition.title': "This process cannot move to that state from here";
23
+ readonly 'errors.workflow.compensation_failed.title': "We could not undo a failed process — someone needs to look at this";
24
+ readonly 'errors.workflow.already_running.title': "This is already running — wait for it to finish before starting another";
25
+ readonly 'errors.queue.job_failed.title': "A background job failed";
26
+ readonly 'errors.queue.dlq_exhausted.title': "A background job failed too many times and was set aside";
27
+ readonly 'errors.ai.provider_unavailable.title': "The AI service is not responding";
28
+ readonly 'errors.ai.schema_validation_failed.title': "The AI returned something we could not use";
29
+ readonly 'errors.ai.tool_not_in_mask.title': "The AI tried to use a tool it is not allowed to use";
30
+ readonly 'errors.ai.node_cap_exceeded.title': "The AI took too many turns and was stopped";
31
+ readonly 'errors.search.index_failed.title': "We could not add that to the search index";
32
+ readonly 'errors.search.query_invalid.title': "That search is not valid";
33
+ readonly 'errors.comms.channel_kind_undeclared.title': "A way of messaging was added without a name";
34
+ readonly 'errors.comms.channel_kind_undescribed.title': "A way of messaging was added without a description";
35
+ readonly 'errors.comms.channel_kind_unlabelled.title': "A way of messaging has no name people can be shown";
36
+ readonly 'errors.comms.channel_kind_undocumented.title': "A way of messaging was added with no instructions for using it";
37
+ readonly 'errors.comms.channel_kind_duplicate.title': "Two ways of messaging were added under the same name";
38
+ readonly 'errors.config.invalid.title': "The configuration is not valid";
39
+ readonly 'errors.config.missing_env.title': "A required setting is missing";
40
+ readonly 'errors.config.secret_in_public_var.title': "A secret is named so the browser would see it";
41
+ readonly 'errors.config.credential_invalid.title': "That credential was not accepted";
42
+ readonly 'errors.config.scope_missing.title': "That credential does not have the access this needs";
43
+ readonly 'errors.config.resource_not_found.title': "That credential works, but the resource it points to was not found";
44
+ readonly 'errors.config.destination_incompatible.title': "The destination cannot receive this — check its plan";
45
+ readonly 'errors.config.blocks_exit.title': "This was set up in a way that blocks moving it out — contact support";
46
+ readonly 'errors.net.timeout.title': "That took too long";
47
+ readonly 'errors.net.upstream_unavailable.title': "A service we depend on is down";
48
+ readonly 'errors.net.destination_refused.title': "That address cannot receive webhooks";
49
+ readonly 'errors.internal.unexpected.title': "Something went wrong on our side";
50
+ readonly 'errors.internal.not_implemented.title': "This is not built yet";
51
+ readonly 'errors.internal.invalid_argument.title': "Some of the information sent was not valid";
52
+ readonly 'quota.exceeded.detail': import("../types.ts").DeclaredMessage<{
53
+ used: number;
54
+ allowance: number;
55
+ meter: string;
56
+ }>;
57
+ readonly 'rate_limit.retry_after': import("../types.ts").DeclaredMessage<{
58
+ seconds: number;
59
+ }>;
60
+ readonly 'migration.impact.rows': import("../types.ts").DeclaredMessage<{
61
+ rows: number;
62
+ table: string;
63
+ }>;
64
+ readonly 'migration.dry_run.required': "Run this on a test copy before applying it.";
65
+ readonly 'sandbox.created': "Test environment ready.";
66
+ readonly 'sandbox.torn_down': "Test environment removed.";
67
+ readonly 'platform.event.deploy_reverted.version_id': "Restored version";
68
+ readonly 'platform.event.deploy_reverted.description': "A prior version was restored by a new forward deployment.";
69
+ readonly 'billing.invoice.total': import("../types.ts").DeclaredMessage<{
70
+ total: {
71
+ amount: number;
72
+ currency: string;
73
+ };
74
+ }>;
75
+ readonly 'billing.invoice.due': import("../types.ts").DeclaredMessage<{
76
+ due: Date | number;
77
+ }>;
78
+ readonly 'billing.usage.summary': import("../types.ts").DeclaredMessage<{
79
+ cost: {
80
+ amount: number;
81
+ currency: string;
82
+ };
83
+ calls: number;
84
+ }>;
85
+ readonly 'common.empty': "Nothing here yet.";
86
+ readonly 'common.loading': "Loading…";
87
+ readonly 'common.error': "Something went wrong.";
88
+ readonly 'common.retry': "Try again";
89
+ readonly 'common.cancel': "Cancel";
90
+ readonly 'common.confirm': "Confirm";
91
+ readonly 'common.saved': "Saved.";
92
+ readonly 'comms.kind.email.label': "Email";
93
+ readonly 'comms.kind.internal.label': "Internal message";
94
+ readonly 'comms.kind.push.label': "Push notification";
95
+ readonly 'comms.kind.widget.label': "Live chat";
96
+ readonly 'auth.ui.signIn.title': "Sign in";
97
+ readonly 'auth.ui.signIn.submit': "Sign in";
98
+ readonly 'auth.ui.signUp.title': "Create your account";
99
+ readonly 'auth.ui.signUp.submit': "Create account";
100
+ readonly 'auth.ui.field.email': "Email";
101
+ readonly 'auth.ui.field.password': "Password";
102
+ readonly 'auth.ui.field.name': "Name";
103
+ readonly 'auth.ui.field.code': "Code";
104
+ readonly 'auth.ui.field.optional': "optional";
105
+ readonly 'auth.ui.magicLink.submit': "Email me a sign-in link";
106
+ readonly 'auth.ui.magicLink.sent': "If that address can be used, we have sent it a sign-in link.";
107
+ readonly 'auth.ui.otp.submit': "Email me a code";
108
+ readonly 'auth.ui.otp.confirm': "Sign in with the code";
109
+ readonly 'auth.ui.otp.sent': "If that address can be used, we have sent it a code.";
110
+ readonly 'auth.ui.reset.submit': "Email me a reset link";
111
+ readonly 'auth.ui.reset.sent': "If that address can be used, we have sent it a reset link.";
112
+ readonly 'auth.ui.oauth.continueWith': import("../types.ts").DeclaredMessage<{
113
+ provider: string;
114
+ }>;
115
+ readonly 'auth.ui.passkey.signIn': "Use a passkey";
116
+ readonly 'auth.ui.passkey.register': "Add a passkey";
117
+ readonly 'auth.ui.passkey.added': "Passkey added. You can use it to sign in from now on.";
118
+ readonly 'auth.ui.passkey.unsupported': "This browser cannot use passkeys.";
119
+ readonly 'auth.ui.passkey.cancelled': "Passkey sign-in was cancelled.";
120
+ readonly 'auth.ui.passkey.failed': "That passkey could not be used.";
121
+ readonly 'consent.telemetry.label': "Product analytics";
122
+ readonly 'consent.telemetry.describe': "Which screens you visit and which buttons you press, so we can see where this app is confusing. Never what you type — passwords, messages and form contents are not recorded.";
123
+ readonly 'consent.title': "Choose what you share";
124
+ readonly 'consent.accept': "Accept selected";
125
+ readonly 'consent.acceptAll': "Accept all";
126
+ readonly 'consent.decline': "Decline all";
127
+ readonly 'consent.withdraw': "Withdraw consent";
128
+ readonly 'consent.required': "Always on";
129
+ readonly 'auth.ui.switch.toSignUp': "Need an account? Create one";
130
+ readonly 'auth.ui.switch.toSignIn': "Already have an account? Sign in";
131
+ readonly 'auth.ui.switch.toReset': "Forgotten your password?";
132
+ readonly 'auth.ui.switch.back': "Back";
133
+ readonly 'auth.ui.working': "Working…";
134
+ readonly 'auth.ui.separator': "or";
135
+ readonly 'auth.ui.error.generic': "That did not work. Check what you entered and try again.";
136
+ readonly 'auth.ui.error.offline': "We could not reach the server. Check your connection and try again.";
137
+ readonly 'auth.ui.signedIn': "You are signed in.";
138
+ readonly 'auth.provider.google': "Google";
139
+ readonly 'auth.provider.apple': "Apple";
140
+ readonly 'auth.provider.github': "GitHub";
141
+ readonly 'auth.provider.microsoft': "Microsoft";
142
+ readonly 'validation.required': "This is required.";
143
+ readonly 'validation.text.invalid': "Enter some text.";
144
+ readonly 'validation.text.too_long': "This is too long.";
145
+ readonly 'validation.richtext.invalid': "This content could not be read.";
146
+ readonly 'validation.richtext.too_many_blocks': "This content is too long.";
147
+ readonly 'validation.number.invalid': "Enter a number.";
148
+ readonly 'validation.number.below_min': "This is below the lowest value allowed.";
149
+ readonly 'validation.number.above_max': "This is above the highest value allowed.";
150
+ readonly 'validation.integer.invalid': "Enter a whole number.";
151
+ readonly 'validation.money.invalid': "Enter an amount.";
152
+ readonly 'validation.money.bare_number': "An amount needs a currency. Choose one and enter the amount again.";
153
+ readonly 'validation.percent.range': "Enter a number between 0 and 100.";
154
+ readonly 'validation.duration.negative': "A length of time cannot be negative.";
155
+ readonly 'validation.bool.invalid': "Choose yes or no.";
156
+ readonly 'validation.date.format': "Enter a date as YYYY-MM-DD.";
157
+ readonly 'validation.date.invalid': "That date does not exist.";
158
+ readonly 'validation.datetime.format': "Enter a date and time.";
159
+ readonly 'validation.phone.invalid': "Enter a phone number with 6 to 15 digits.";
160
+ readonly 'validation.email.invalid': "Enter an email address.";
161
+ readonly 'validation.password.tooShort': "Use at least 8 characters.";
162
+ readonly 'validation.otp.invalid': "Enter the 6-digit code.";
163
+ readonly 'validation.url.invalid': "Enter a web address.";
164
+ readonly 'validation.url.scheme': "Only web, email and phone links are allowed.";
165
+ readonly 'validation.ref.invalid': "That file could not be found.";
166
+ readonly 'validation.geo.invalid': "Enter a location.";
167
+ readonly 'validation.rating.range': "Choose a rating.";
168
+ readonly 'validation.select.undeclared': "Choose one of the options.";
169
+ readonly 'validation.json.too_deep': "This data is nested too deeply.";
170
+ readonly 'validation.json.too_large': "This data is too large.";
171
+ };
172
+ export type EnCatalog = typeof en;
@@ -0,0 +1,148 @@
1
+ import { defineCatalog, msg } from "../types.js";
2
+ export const en = defineCatalog({
3
+ 'errors.auth.unauthenticated.title': 'You need to sign in to do this',
4
+ 'errors.auth.invalid_credentials.title': 'That email or password did not match',
5
+ 'errors.auth.token_expired.title': 'Your session expired — sign in again',
6
+ 'errors.auth.token_reused.title': 'This sign-in link was already used, so we signed you out everywhere',
7
+ 'errors.auth.session_revoked.title': 'This session was signed out',
8
+ 'errors.auth.denied.title': 'You do not have permission to do this',
9
+ 'errors.quota.exceeded.title': 'You have used everything included in your plan',
10
+ 'errors.quota.reservation_expired.title': 'That request took too long and was released',
11
+ 'errors.rate_limit.exceeded.title': 'Too many attempts — wait a moment and try again',
12
+ 'errors.feature.not_in_plan.title': 'Your plan does not include this feature',
13
+ 'errors.db.not_found.title': 'We could not find that',
14
+ 'errors.db.constraint_violation.title': 'That change would break a rule on this data',
15
+ 'errors.db.already_exists.title': 'That already exists',
16
+ 'errors.db.conflict.title': 'Someone else changed this first — reload and try again',
17
+ 'errors.db.migration_checksum_mismatch.title': 'A migration that already ran has been edited',
18
+ 'errors.db.destructive_without_dry_run.title': 'This change can delete data, so it needs a test run first',
19
+ 'errors.db.round_trip_budget_exceeded.title': 'This node asked the database for more than it was built to need',
20
+ 'errors.db.cursor_invalid.title': 'That link to the next page does not belong to this list',
21
+ 'errors.db.cursor_expired.title': 'That link to the next page is too old — start again from the first page',
22
+ 'errors.workflow.node_failed.title': 'A node in this process failed',
23
+ 'errors.workflow.invalid_transition.title': 'This process cannot move to that state from here',
24
+ 'errors.workflow.compensation_failed.title': 'We could not undo a failed process — someone needs to look at this',
25
+ 'errors.workflow.already_running.title': 'This is already running — wait for it to finish before starting another',
26
+ 'errors.queue.job_failed.title': 'A background job failed',
27
+ 'errors.queue.dlq_exhausted.title': 'A background job failed too many times and was set aside',
28
+ 'errors.ai.provider_unavailable.title': 'The AI service is not responding',
29
+ 'errors.ai.schema_validation_failed.title': 'The AI returned something we could not use',
30
+ 'errors.ai.tool_not_in_mask.title': 'The AI tried to use a tool it is not allowed to use',
31
+ 'errors.ai.node_cap_exceeded.title': 'The AI took too many turns and was stopped',
32
+ 'errors.search.index_failed.title': 'We could not add that to the search index',
33
+ 'errors.search.query_invalid.title': 'That search is not valid',
34
+ 'errors.comms.channel_kind_undeclared.title': 'A way of messaging was added without a name',
35
+ 'errors.comms.channel_kind_undescribed.title': 'A way of messaging was added without a description',
36
+ 'errors.comms.channel_kind_unlabelled.title': 'A way of messaging has no name people can be shown',
37
+ 'errors.comms.channel_kind_undocumented.title': 'A way of messaging was added with no instructions for using it',
38
+ 'errors.comms.channel_kind_duplicate.title': 'Two ways of messaging were added under the same name',
39
+ 'errors.config.invalid.title': 'The configuration is not valid',
40
+ 'errors.config.missing_env.title': 'A required setting is missing',
41
+ 'errors.config.secret_in_public_var.title': 'A secret is named so the browser would see it',
42
+ 'errors.config.credential_invalid.title': 'That credential was not accepted',
43
+ 'errors.config.scope_missing.title': 'That credential does not have the access this needs',
44
+ 'errors.config.resource_not_found.title': 'That credential works, but the resource it points to was not found',
45
+ 'errors.config.destination_incompatible.title': 'The destination cannot receive this — check its plan',
46
+ 'errors.config.blocks_exit.title': 'This was set up in a way that blocks moving it out — contact support',
47
+ 'errors.net.timeout.title': 'That took too long',
48
+ 'errors.net.upstream_unavailable.title': 'A service we depend on is down',
49
+ 'errors.net.destination_refused.title': 'That address cannot receive webhooks',
50
+ 'errors.internal.unexpected.title': 'Something went wrong on our side',
51
+ 'errors.internal.not_implemented.title': 'This is not built yet',
52
+ 'errors.internal.invalid_argument.title': 'Some of the information sent was not valid',
53
+ 'quota.exceeded.detail': msg('{used, number} of {allowance, number} {meter} used.'),
54
+ 'rate_limit.retry_after': msg('Try again in {seconds, plural, one {# second} other {# seconds}}.'),
55
+ 'migration.impact.rows': msg('{rows, plural, =0 {No rows} one {# row} other {# rows}} in {table} will be affected.'),
56
+ 'migration.dry_run.required': 'Run this on a test copy before applying it.',
57
+ 'sandbox.created': 'Test environment ready.',
58
+ 'sandbox.torn_down': 'Test environment removed.',
59
+ 'platform.event.deploy_reverted.version_id': 'Restored version',
60
+ 'platform.event.deploy_reverted.description': 'A prior version was restored by a new forward deployment.',
61
+ 'billing.invoice.total': msg('Total: {total, money}.'),
62
+ 'billing.invoice.due': msg('Due {due, date, medium}.'),
63
+ 'billing.usage.summary': msg('{calls, plural, one {# call} other {# calls}} costing {cost, money}.'),
64
+ 'common.empty': 'Nothing here yet.',
65
+ 'common.loading': 'Loading…',
66
+ 'common.error': 'Something went wrong.',
67
+ 'common.retry': 'Try again',
68
+ 'common.cancel': 'Cancel',
69
+ 'common.confirm': 'Confirm',
70
+ 'common.saved': 'Saved.',
71
+ 'comms.kind.email.label': 'Email',
72
+ 'comms.kind.internal.label': 'Internal message',
73
+ 'comms.kind.push.label': 'Push notification',
74
+ 'comms.kind.widget.label': 'Live chat',
75
+ 'auth.ui.signIn.title': 'Sign in',
76
+ 'auth.ui.signIn.submit': 'Sign in',
77
+ 'auth.ui.signUp.title': 'Create your account',
78
+ 'auth.ui.signUp.submit': 'Create account',
79
+ 'auth.ui.field.email': 'Email',
80
+ 'auth.ui.field.password': 'Password',
81
+ 'auth.ui.field.name': 'Name',
82
+ 'auth.ui.field.code': 'Code',
83
+ 'auth.ui.field.optional': 'optional',
84
+ 'auth.ui.magicLink.submit': 'Email me a sign-in link',
85
+ 'auth.ui.magicLink.sent': 'If that address can be used, we have sent it a sign-in link.',
86
+ 'auth.ui.otp.submit': 'Email me a code',
87
+ 'auth.ui.otp.confirm': 'Sign in with the code',
88
+ 'auth.ui.otp.sent': 'If that address can be used, we have sent it a code.',
89
+ 'auth.ui.reset.submit': 'Email me a reset link',
90
+ 'auth.ui.reset.sent': 'If that address can be used, we have sent it a reset link.',
91
+ 'auth.ui.oauth.continueWith': msg('Continue with {provider}'),
92
+ 'auth.ui.passkey.signIn': 'Use a passkey',
93
+ 'auth.ui.passkey.register': 'Add a passkey',
94
+ 'auth.ui.passkey.added': 'Passkey added. You can use it to sign in from now on.',
95
+ 'auth.ui.passkey.unsupported': 'This browser cannot use passkeys.',
96
+ 'auth.ui.passkey.cancelled': 'Passkey sign-in was cancelled.',
97
+ 'auth.ui.passkey.failed': 'That passkey could not be used.',
98
+ 'consent.telemetry.label': 'Product analytics',
99
+ 'consent.telemetry.describe': 'Which screens you visit and which buttons you press, so we can see where this app is confusing. Never what you type — passwords, messages and form contents are not recorded.',
100
+ 'consent.title': 'Choose what you share',
101
+ 'consent.accept': 'Accept selected',
102
+ 'consent.acceptAll': 'Accept all',
103
+ 'consent.decline': 'Decline all',
104
+ 'consent.withdraw': 'Withdraw consent',
105
+ 'consent.required': 'Always on',
106
+ 'auth.ui.switch.toSignUp': 'Need an account? Create one',
107
+ 'auth.ui.switch.toSignIn': 'Already have an account? Sign in',
108
+ 'auth.ui.switch.toReset': 'Forgotten your password?',
109
+ 'auth.ui.switch.back': 'Back',
110
+ 'auth.ui.working': 'Working…',
111
+ 'auth.ui.separator': 'or',
112
+ 'auth.ui.error.generic': 'That did not work. Check what you entered and try again.',
113
+ 'auth.ui.error.offline': 'We could not reach the server. Check your connection and try again.',
114
+ 'auth.ui.signedIn': 'You are signed in.',
115
+ 'auth.provider.google': 'Google',
116
+ 'auth.provider.apple': 'Apple',
117
+ 'auth.provider.github': 'GitHub',
118
+ 'auth.provider.microsoft': 'Microsoft',
119
+ 'validation.required': 'This is required.',
120
+ 'validation.text.invalid': 'Enter some text.',
121
+ 'validation.text.too_long': 'This is too long.',
122
+ 'validation.richtext.invalid': 'This content could not be read.',
123
+ 'validation.richtext.too_many_blocks': 'This content is too long.',
124
+ 'validation.number.invalid': 'Enter a number.',
125
+ 'validation.number.below_min': 'This is below the lowest value allowed.',
126
+ 'validation.number.above_max': 'This is above the highest value allowed.',
127
+ 'validation.integer.invalid': 'Enter a whole number.',
128
+ 'validation.money.invalid': 'Enter an amount.',
129
+ 'validation.money.bare_number': 'An amount needs a currency. Choose one and enter the amount again.',
130
+ 'validation.percent.range': 'Enter a number between 0 and 100.',
131
+ 'validation.duration.negative': 'A length of time cannot be negative.',
132
+ 'validation.bool.invalid': 'Choose yes or no.',
133
+ 'validation.date.format': 'Enter a date as YYYY-MM-DD.',
134
+ 'validation.date.invalid': 'That date does not exist.',
135
+ 'validation.datetime.format': 'Enter a date and time.',
136
+ 'validation.phone.invalid': 'Enter a phone number with 6 to 15 digits.',
137
+ 'validation.email.invalid': 'Enter an email address.',
138
+ 'validation.password.tooShort': 'Use at least 8 characters.',
139
+ 'validation.otp.invalid': 'Enter the 6-digit code.',
140
+ 'validation.url.invalid': 'Enter a web address.',
141
+ 'validation.url.scheme': 'Only web, email and phone links are allowed.',
142
+ 'validation.ref.invalid': 'That file could not be found.',
143
+ 'validation.geo.invalid': 'Enter a location.',
144
+ 'validation.rating.range': 'Choose a rating.',
145
+ 'validation.select.undeclared': 'Choose one of the options.',
146
+ 'validation.json.too_deep': 'This data is nested too deeply.',
147
+ 'validation.json.too_large': 'This data is too large.',
148
+ });
@@ -0,0 +1,13 @@
1
+ import type { Locale } from './types.ts';
2
+ export declare class MissingParamError extends Error {
3
+ readonly param: string;
4
+ constructor(param: string, message: string);
5
+ }
6
+ export declare class ParamTypeError extends Error {
7
+ constructor(param: string, expected: string, received: unknown);
8
+ }
9
+ export interface FormatOptions {
10
+ readonly locale: Locale;
11
+ readonly timeZone?: string;
12
+ }
13
+ export declare function formatMessage(source: string, params: Readonly<Record<string, unknown>>, opts: FormatOptions): string;
@@ -0,0 +1,161 @@
1
+ import { parseMessage } from "./parse.js";
2
+ export class MissingParamError extends Error {
3
+ param;
4
+ constructor(param, message) {
5
+ super(`missing parameter "${param}" for message ${JSON.stringify(message)}`);
6
+ this.name = 'MissingParamError';
7
+ this.param = param;
8
+ }
9
+ }
10
+ export class ParamTypeError extends Error {
11
+ constructor(param, expected, received) {
12
+ super(`parameter "${param}" must be ${expected}, received ${typeof received}`);
13
+ this.name = 'ParamTypeError';
14
+ }
15
+ }
16
+ const numberFormats = new Map();
17
+ const dateFormats = new Map();
18
+ const pluralRules = new Map();
19
+ function numberFormat(locale, style) {
20
+ const key = `${locale}|${style ?? ''}`;
21
+ let fmt = numberFormats.get(key);
22
+ if (!fmt) {
23
+ const options = style === 'percent'
24
+ ? { style: 'percent' }
25
+ : style === 'integer'
26
+ ? { maximumFractionDigits: 0 }
27
+ : {};
28
+ fmt = new Intl.NumberFormat(locale, options);
29
+ numberFormats.set(key, fmt);
30
+ }
31
+ return fmt;
32
+ }
33
+ function moneyFormat(locale, currency) {
34
+ const key = `${locale}|money|${currency}`;
35
+ let fmt = numberFormats.get(key);
36
+ if (!fmt) {
37
+ fmt = new Intl.NumberFormat(locale, { style: 'currency', currency });
38
+ numberFormats.set(key, fmt);
39
+ }
40
+ return fmt;
41
+ }
42
+ const DATE_STYLES = new Set(['full', 'long', 'medium', 'short']);
43
+ function dateFormat(locale, kind, style, timeZone) {
44
+ const resolved = DATE_STYLES.has(style ?? '') ? style : 'medium';
45
+ const key = `${locale}|${kind}|${resolved}|${timeZone ?? ''}`;
46
+ let fmt = dateFormats.get(key);
47
+ if (!fmt) {
48
+ const options = kind === 'date' ? { dateStyle: resolved } : { timeStyle: resolved };
49
+ if (timeZone !== undefined)
50
+ options.timeZone = timeZone;
51
+ fmt = new Intl.DateTimeFormat(locale, options);
52
+ dateFormats.set(key, fmt);
53
+ }
54
+ return fmt;
55
+ }
56
+ function plural(locale, ordinal) {
57
+ const key = `${locale}|${ordinal ? 'ordinal' : 'cardinal'}`;
58
+ let rules = pluralRules.get(key);
59
+ if (!rules) {
60
+ rules = new Intl.PluralRules(locale, { type: ordinal ? 'ordinal' : 'cardinal' });
61
+ pluralRules.set(key, rules);
62
+ }
63
+ return rules;
64
+ }
65
+ function requireParam(params, name, source) {
66
+ if (!(name in params) || params[name] === undefined) {
67
+ throw new MissingParamError(name, source);
68
+ }
69
+ return params[name];
70
+ }
71
+ function asNumber(value, name) {
72
+ if (typeof value !== 'number' || Number.isNaN(value)) {
73
+ throw new ParamTypeError(name, 'a number', value);
74
+ }
75
+ return value;
76
+ }
77
+ function asMoney(value, name) {
78
+ if (typeof value !== 'object' ||
79
+ value === null ||
80
+ typeof value.amount !== 'number' ||
81
+ typeof value.currency !== 'string' ||
82
+ value.currency === '') {
83
+ throw new ParamTypeError(name, 'a { amount, currency } pair', value);
84
+ }
85
+ return value;
86
+ }
87
+ function asDate(value, name) {
88
+ if (value instanceof Date)
89
+ return value;
90
+ if (typeof value === 'number')
91
+ return value;
92
+ throw new ParamTypeError(name, 'a Date or a timestamp', value);
93
+ }
94
+ function render(nodes, ctx) {
95
+ let out = '';
96
+ for (const node of nodes) {
97
+ switch (node.kind) {
98
+ case 'text':
99
+ out += node.value;
100
+ break;
101
+ case 'pound':
102
+ out +=
103
+ ctx.poundValue === undefined
104
+ ? '#'
105
+ : numberFormat(ctx.locale, undefined).format(ctx.poundValue);
106
+ break;
107
+ case 'arg': {
108
+ const value = requireParam(ctx.params, node.name, ctx.source);
109
+ out += typeof value === 'number' ? numberFormat(ctx.locale, undefined).format(value) : String(value);
110
+ break;
111
+ }
112
+ case 'number': {
113
+ const value = asNumber(requireParam(ctx.params, node.name, ctx.source), node.name);
114
+ out += numberFormat(ctx.locale, node.style).format(value);
115
+ break;
116
+ }
117
+ case 'money': {
118
+ const value = asMoney(requireParam(ctx.params, node.name, ctx.source), node.name);
119
+ out += moneyFormat(ctx.locale, value.currency).format(value.amount);
120
+ break;
121
+ }
122
+ case 'date': {
123
+ const value = asDate(requireParam(ctx.params, node.name, ctx.source), node.name);
124
+ out += dateFormat(ctx.locale, 'date', node.style, ctx.timeZone).format(value);
125
+ break;
126
+ }
127
+ case 'time': {
128
+ const value = asDate(requireParam(ctx.params, node.name, ctx.source), node.name);
129
+ out += dateFormat(ctx.locale, 'time', node.style, ctx.timeZone).format(value);
130
+ break;
131
+ }
132
+ case 'plural': {
133
+ const value = asNumber(requireParam(ctx.params, node.name, ctx.source), node.name);
134
+ const adjusted = value - node.offset;
135
+ let body = node.options.get(`=${value}`);
136
+ if (!body) {
137
+ const category = plural(ctx.locale, node.ordinal).select(adjusted);
138
+ body = node.options.get(category) ?? node.options.get('other');
139
+ }
140
+ out += render(body ?? [], { ...ctx, poundValue: adjusted });
141
+ break;
142
+ }
143
+ case 'select': {
144
+ const value = requireParam(ctx.params, node.name, ctx.source);
145
+ const body = node.options.get(String(value)) ?? node.options.get('other');
146
+ out += render(body ?? [], ctx);
147
+ break;
148
+ }
149
+ }
150
+ }
151
+ return out;
152
+ }
153
+ export function formatMessage(source, params, opts) {
154
+ return render(parseMessage(source), {
155
+ locale: opts.locale,
156
+ timeZone: opts.timeZone,
157
+ params,
158
+ source,
159
+ poundValue: undefined,
160
+ });
161
+ }
@@ -0,0 +1,9 @@
1
+ export declare const REFERENCE_LOCALE = "en";
2
+ export interface LocaleDecl {
3
+ readonly tag: string;
4
+ readonly endonym: string;
5
+ }
6
+ export declare function defineLocale(locale: LocaleDecl): void;
7
+ export declare function locales(): readonly LocaleDecl[];
8
+ export declare function locale(tag: string): LocaleDecl | undefined;
9
+ export declare function resetLocales(): void;
@@ -0,0 +1,20 @@
1
+ export const REFERENCE_LOCALE = 'en';
2
+ const REGISTRY = new Map([[REFERENCE_LOCALE, { tag: 'en', endonym: 'English' }]]);
3
+ export function defineLocale(locale) {
4
+ if (!/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(locale.tag)) {
5
+ throw new Error(`"${locale.tag}" is not a BCP 47 tag — write \`pt-BR\`, \`zh-Hans\`, \`en\``);
6
+ }
7
+ if (REGISTRY.has(locale.tag))
8
+ throw new Error(`locale "${locale.tag}" is already declared`);
9
+ REGISTRY.set(locale.tag, locale);
10
+ }
11
+ export function locales() {
12
+ return [...REGISTRY.values()].sort((a, b) => (a.tag < b.tag ? -1 : a.tag > b.tag ? 1 : 0));
13
+ }
14
+ export function locale(tag) {
15
+ return REGISTRY.get(tag);
16
+ }
17
+ export function resetLocales() {
18
+ REGISTRY.clear();
19
+ REGISTRY.set(REFERENCE_LOCALE, { tag: 'en', endonym: 'English' });
20
+ }
@@ -0,0 +1,45 @@
1
+ export interface Money {
2
+ readonly amount: number;
3
+ readonly currency: string;
4
+ }
5
+ export type Node = {
6
+ readonly kind: 'text';
7
+ readonly value: string;
8
+ } | {
9
+ readonly kind: 'arg';
10
+ readonly name: string;
11
+ } | {
12
+ readonly kind: 'number';
13
+ readonly name: string;
14
+ readonly style?: string;
15
+ } | {
16
+ readonly kind: 'date';
17
+ readonly name: string;
18
+ readonly style?: string;
19
+ } | {
20
+ readonly kind: 'time';
21
+ readonly name: string;
22
+ readonly style?: string;
23
+ } | {
24
+ readonly kind: 'money';
25
+ readonly name: string;
26
+ } | {
27
+ readonly kind: 'plural';
28
+ readonly name: string;
29
+ readonly ordinal: boolean;
30
+ readonly offset: number;
31
+ readonly options: ReadonlyMap<string, readonly Node[]>;
32
+ } | {
33
+ readonly kind: 'select';
34
+ readonly name: string;
35
+ readonly options: ReadonlyMap<string, readonly Node[]>;
36
+ } | {
37
+ readonly kind: 'pound';
38
+ };
39
+ export declare class MessageSyntaxError extends Error {
40
+ readonly source: string;
41
+ readonly position: number;
42
+ constructor(message: string, source: string, position: number);
43
+ }
44
+ export declare function parseMessage(src: string): readonly Node[];
45
+ export declare function messageArgs(src: string): ReadonlySet<string>;