@lo-tek/interfaces 0.0.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (456) hide show
  1. package/CHANGELOG.md +3254 -0
  2. package/LICENSE +21 -0
  3. package/README.md +128 -1
  4. package/agent/astro.md +400 -0
  5. package/agent/bundles.md +429 -0
  6. package/agent/datastar.md +409 -0
  7. package/agent/html.md +388 -0
  8. package/agent/react.md +440 -0
  9. package/agent/templates.md +472 -0
  10. package/core/lotek-core.wasm +0 -0
  11. package/core/lotek.wasm +0 -0
  12. package/dist/cli.d.ts +12 -0
  13. package/dist/cli.d.ts.map +1 -0
  14. package/dist/cli.js +14 -0
  15. package/dist/cli.js.map +1 -0
  16. package/dist/components/css/accordion/accordion.d.ts +37 -0
  17. package/dist/components/css/accordion/accordion.d.ts.map +1 -0
  18. package/dist/components/css/accordion/accordion.js +31 -0
  19. package/dist/components/css/accordion/accordion.js.map +1 -0
  20. package/dist/components/css/alert/alert.d.ts +35 -0
  21. package/dist/components/css/alert/alert.d.ts.map +1 -0
  22. package/dist/components/css/alert/alert.js +29 -0
  23. package/dist/components/css/alert/alert.js.map +1 -0
  24. package/dist/components/css/avatar/avatar.d.ts +40 -0
  25. package/dist/components/css/avatar/avatar.d.ts.map +1 -0
  26. package/dist/components/css/avatar/avatar.js +30 -0
  27. package/dist/components/css/avatar/avatar.js.map +1 -0
  28. package/dist/components/css/badge/badge.d.ts +24 -0
  29. package/dist/components/css/badge/badge.d.ts.map +1 -0
  30. package/dist/components/css/badge/badge.js +24 -0
  31. package/dist/components/css/badge/badge.js.map +1 -0
  32. package/dist/components/css/breadcrumbs/breadcrumbs.d.ts +26 -0
  33. package/dist/components/css/breadcrumbs/breadcrumbs.d.ts.map +1 -0
  34. package/dist/components/css/breadcrumbs/breadcrumbs.js +24 -0
  35. package/dist/components/css/breadcrumbs/breadcrumbs.js.map +1 -0
  36. package/dist/components/css/button/button.d.ts +26 -0
  37. package/dist/components/css/button/button.d.ts.map +1 -0
  38. package/dist/components/css/button/button.js +25 -0
  39. package/dist/components/css/button/button.js.map +1 -0
  40. package/dist/components/css/card/card.d.ts +36 -0
  41. package/dist/components/css/card/card.d.ts.map +1 -0
  42. package/dist/components/css/card/card.js +28 -0
  43. package/dist/components/css/card/card.js.map +1 -0
  44. package/dist/components/css/checkbox/checkbox.d.ts +32 -0
  45. package/dist/components/css/checkbox/checkbox.d.ts.map +1 -0
  46. package/dist/components/css/checkbox/checkbox.js +27 -0
  47. package/dist/components/css/checkbox/checkbox.js.map +1 -0
  48. package/dist/components/css/divider/divider.d.ts +29 -0
  49. package/dist/components/css/divider/divider.d.ts.map +1 -0
  50. package/dist/components/css/divider/divider.js +23 -0
  51. package/dist/components/css/divider/divider.js.map +1 -0
  52. package/dist/components/css/error-text/error-text.d.ts +24 -0
  53. package/dist/components/css/error-text/error-text.d.ts.map +1 -0
  54. package/dist/components/css/error-text/error-text.js +18 -0
  55. package/dist/components/css/error-text/error-text.js.map +1 -0
  56. package/dist/components/css/fieldset/fieldset.d.ts +55 -0
  57. package/dist/components/css/fieldset/fieldset.d.ts.map +1 -0
  58. package/dist/components/css/fieldset/fieldset.js +39 -0
  59. package/dist/components/css/fieldset/fieldset.js.map +1 -0
  60. package/dist/components/css/file-upload/file-upload.d.ts +41 -0
  61. package/dist/components/css/file-upload/file-upload.d.ts.map +1 -0
  62. package/dist/components/css/file-upload/file-upload.js +32 -0
  63. package/dist/components/css/file-upload/file-upload.js.map +1 -0
  64. package/dist/components/css/heading/heading.d.ts +29 -0
  65. package/dist/components/css/heading/heading.d.ts.map +1 -0
  66. package/dist/components/css/heading/heading.js +23 -0
  67. package/dist/components/css/heading/heading.js.map +1 -0
  68. package/dist/components/css/help-text/help-text.d.ts +24 -0
  69. package/dist/components/css/help-text/help-text.d.ts.map +1 -0
  70. package/dist/components/css/help-text/help-text.js +23 -0
  71. package/dist/components/css/help-text/help-text.js.map +1 -0
  72. package/dist/components/css/icon/icon.d.ts +34 -0
  73. package/dist/components/css/icon/icon.d.ts.map +1 -0
  74. package/dist/components/css/icon/icon.js +25 -0
  75. package/dist/components/css/icon/icon.js.map +1 -0
  76. package/dist/components/css/input/input.d.ts +40 -0
  77. package/dist/components/css/input/input.d.ts.map +1 -0
  78. package/dist/components/css/input/input.js +45 -0
  79. package/dist/components/css/input/input.js.map +1 -0
  80. package/dist/components/css/label/label.d.ts +33 -0
  81. package/dist/components/css/label/label.d.ts.map +1 -0
  82. package/dist/components/css/label/label.js +23 -0
  83. package/dist/components/css/label/label.js.map +1 -0
  84. package/dist/components/css/link/link.d.ts +28 -0
  85. package/dist/components/css/link/link.d.ts.map +1 -0
  86. package/dist/components/css/link/link.js +20 -0
  87. package/dist/components/css/link/link.js.map +1 -0
  88. package/dist/components/css/list/list.d.ts +31 -0
  89. package/dist/components/css/list/list.d.ts.map +1 -0
  90. package/dist/components/css/list/list.js +25 -0
  91. package/dist/components/css/list/list.js.map +1 -0
  92. package/dist/components/css/pagination/pagination.d.ts +27 -0
  93. package/dist/components/css/pagination/pagination.d.ts.map +1 -0
  94. package/dist/components/css/pagination/pagination.js +25 -0
  95. package/dist/components/css/pagination/pagination.js.map +1 -0
  96. package/dist/components/css/paragraph/paragraph.d.ts +36 -0
  97. package/dist/components/css/paragraph/paragraph.d.ts.map +1 -0
  98. package/dist/components/css/paragraph/paragraph.js +26 -0
  99. package/dist/components/css/paragraph/paragraph.js.map +1 -0
  100. package/dist/components/css/progress/progress.d.ts +53 -0
  101. package/dist/components/css/progress/progress.d.ts.map +1 -0
  102. package/dist/components/css/progress/progress.js +38 -0
  103. package/dist/components/css/progress/progress.js.map +1 -0
  104. package/dist/components/css/radio/radio.d.ts +32 -0
  105. package/dist/components/css/radio/radio.d.ts.map +1 -0
  106. package/dist/components/css/radio/radio.js +27 -0
  107. package/dist/components/css/radio/radio.js.map +1 -0
  108. package/dist/components/css/search/search.d.ts +34 -0
  109. package/dist/components/css/search/search.d.ts.map +1 -0
  110. package/dist/components/css/search/search.js +32 -0
  111. package/dist/components/css/search/search.js.map +1 -0
  112. package/dist/components/css/select/select.d.ts +40 -0
  113. package/dist/components/css/select/select.d.ts.map +1 -0
  114. package/dist/components/css/select/select.js +31 -0
  115. package/dist/components/css/select/select.js.map +1 -0
  116. package/dist/components/css/shared.d.ts +90 -0
  117. package/dist/components/css/shared.d.ts.map +1 -0
  118. package/dist/components/css/shared.js +167 -0
  119. package/dist/components/css/shared.js.map +1 -0
  120. package/dist/components/css/skeleton/skeleton.d.ts +29 -0
  121. package/dist/components/css/skeleton/skeleton.d.ts.map +1 -0
  122. package/dist/components/css/skeleton/skeleton.js +23 -0
  123. package/dist/components/css/skeleton/skeleton.js.map +1 -0
  124. package/dist/components/css/skip-link/skip-link.d.ts +18 -0
  125. package/dist/components/css/skip-link/skip-link.d.ts.map +1 -0
  126. package/dist/components/css/skip-link/skip-link.js +16 -0
  127. package/dist/components/css/skip-link/skip-link.js.map +1 -0
  128. package/dist/components/css/spinner/spinner.d.ts +33 -0
  129. package/dist/components/css/spinner/spinner.d.ts.map +1 -0
  130. package/dist/components/css/spinner/spinner.js +25 -0
  131. package/dist/components/css/spinner/spinner.js.map +1 -0
  132. package/dist/components/css/sr-only/sr-only.d.ts +17 -0
  133. package/dist/components/css/sr-only/sr-only.d.ts.map +1 -0
  134. package/dist/components/css/sr-only/sr-only.js +15 -0
  135. package/dist/components/css/sr-only/sr-only.js.map +1 -0
  136. package/dist/components/css/switch/switch.d.ts +37 -0
  137. package/dist/components/css/switch/switch.d.ts.map +1 -0
  138. package/dist/components/css/switch/switch.js +29 -0
  139. package/dist/components/css/switch/switch.js.map +1 -0
  140. package/dist/components/css/table/table.d.ts +76 -0
  141. package/dist/components/css/table/table.d.ts.map +1 -0
  142. package/dist/components/css/table/table.js +59 -0
  143. package/dist/components/css/table/table.js.map +1 -0
  144. package/dist/components/css/tag/tag.d.ts +35 -0
  145. package/dist/components/css/tag/tag.d.ts.map +1 -0
  146. package/dist/components/css/tag/tag.js +27 -0
  147. package/dist/components/css/tag/tag.js.map +1 -0
  148. package/dist/components/css/textarea/textarea.d.ts +23 -0
  149. package/dist/components/css/textarea/textarea.d.ts.map +1 -0
  150. package/dist/components/css/textarea/textarea.js +18 -0
  151. package/dist/components/css/textarea/textarea.js.map +1 -0
  152. package/dist/components/css/toggle-group/toggle-group.d.ts +31 -0
  153. package/dist/components/css/toggle-group/toggle-group.d.ts.map +1 -0
  154. package/dist/components/css/toggle-group/toggle-group.js +29 -0
  155. package/dist/components/css/toggle-group/toggle-group.js.map +1 -0
  156. package/dist/components/css/tooltip/tooltip.d.ts +31 -0
  157. package/dist/components/css/tooltip/tooltip.d.ts.map +1 -0
  158. package/dist/components/css/tooltip/tooltip.js +29 -0
  159. package/dist/components/css/tooltip/tooltip.js.map +1 -0
  160. package/dist/components/default-texts.d.ts +35 -0
  161. package/dist/components/default-texts.d.ts.map +1 -0
  162. package/dist/components/default-texts.js +35 -0
  163. package/dist/components/default-texts.js.map +1 -0
  164. package/dist/components/events.d.ts +77 -0
  165. package/dist/components/events.d.ts.map +1 -0
  166. package/dist/components/events.js +3 -0
  167. package/dist/components/events.js.map +1 -0
  168. package/dist/components/frame/dialog/dialog.d.ts +122 -0
  169. package/dist/components/frame/dialog/dialog.d.ts.map +1 -0
  170. package/dist/components/frame/dialog/dialog.js +112 -0
  171. package/dist/components/frame/dialog/dialog.js.map +1 -0
  172. package/dist/components/frame/dialog/lt-dialog.d.ts +104 -0
  173. package/dist/components/frame/dialog/lt-dialog.d.ts.map +1 -0
  174. package/dist/components/frame/dialog/lt-dialog.js +431 -0
  175. package/dist/components/frame/dialog/lt-dialog.js.map +1 -0
  176. package/dist/components/frame/error-summary/error-summary.d.ts +40 -0
  177. package/dist/components/frame/error-summary/error-summary.d.ts.map +1 -0
  178. package/dist/components/frame/error-summary/error-summary.js +32 -0
  179. package/dist/components/frame/error-summary/error-summary.js.map +1 -0
  180. package/dist/components/frame/error-summary/lt-error-summary.d.ts +82 -0
  181. package/dist/components/frame/error-summary/lt-error-summary.d.ts.map +1 -0
  182. package/dist/components/frame/error-summary/lt-error-summary.js +302 -0
  183. package/dist/components/frame/error-summary/lt-error-summary.js.map +1 -0
  184. package/dist/components/frame/field/field-core.d.ts +92 -0
  185. package/dist/components/frame/field/field-core.d.ts.map +1 -0
  186. package/dist/components/frame/field/field-core.js +63 -0
  187. package/dist/components/frame/field/field-core.js.map +1 -0
  188. package/dist/components/frame/field/lt-field.d.ts +173 -0
  189. package/dist/components/frame/field/lt-field.d.ts.map +1 -0
  190. package/dist/components/frame/field/lt-field.js +580 -0
  191. package/dist/components/frame/field/lt-field.js.map +1 -0
  192. package/dist/components/frame/popover/lt-popover.d.ts +132 -0
  193. package/dist/components/frame/popover/lt-popover.d.ts.map +1 -0
  194. package/dist/components/frame/popover/lt-popover.js +490 -0
  195. package/dist/components/frame/popover/lt-popover.js.map +1 -0
  196. package/dist/components/frame/popover/popover.d.ts +49 -0
  197. package/dist/components/frame/popover/popover.d.ts.map +1 -0
  198. package/dist/components/frame/popover/popover.js +64 -0
  199. package/dist/components/frame/popover/popover.js.map +1 -0
  200. package/dist/components/frame/session-timeout/lt-session-timeout.d.ts +198 -0
  201. package/dist/components/frame/session-timeout/lt-session-timeout.d.ts.map +1 -0
  202. package/dist/components/frame/session-timeout/lt-session-timeout.js +573 -0
  203. package/dist/components/frame/session-timeout/lt-session-timeout.js.map +1 -0
  204. package/dist/components/frame/session-timeout/session-timeout.d.ts +113 -0
  205. package/dist/components/frame/session-timeout/session-timeout.d.ts.map +1 -0
  206. package/dist/components/frame/session-timeout/session-timeout.js +101 -0
  207. package/dist/components/frame/session-timeout/session-timeout.js.map +1 -0
  208. package/dist/components/frame/suggestion/lt-suggestion.d.ts +361 -0
  209. package/dist/components/frame/suggestion/lt-suggestion.d.ts.map +1 -0
  210. package/dist/components/frame/suggestion/lt-suggestion.js +1152 -0
  211. package/dist/components/frame/suggestion/lt-suggestion.js.map +1 -0
  212. package/dist/components/frame/suggestion/suggestion.d.ts +143 -0
  213. package/dist/components/frame/suggestion/suggestion.d.ts.map +1 -0
  214. package/dist/components/frame/suggestion/suggestion.js +127 -0
  215. package/dist/components/frame/suggestion/suggestion.js.map +1 -0
  216. package/dist/components/frame/tabs/lt-tabs.d.ts +404 -0
  217. package/dist/components/frame/tabs/lt-tabs.d.ts.map +1 -0
  218. package/dist/components/frame/tabs/lt-tabs.js +1201 -0
  219. package/dist/components/frame/tabs/lt-tabs.js.map +1 -0
  220. package/dist/components/frame/tabs/tabs.d.ts +112 -0
  221. package/dist/components/frame/tabs/tabs.d.ts.map +1 -0
  222. package/dist/components/frame/tabs/tabs.js +107 -0
  223. package/dist/components/frame/tabs/tabs.js.map +1 -0
  224. package/dist/components/host-element.d.ts +135 -0
  225. package/dist/components/host-element.d.ts.map +1 -0
  226. package/dist/components/host-element.js +366 -0
  227. package/dist/components/host-element.js.map +1 -0
  228. package/dist/components/standalone/connection-status/connection-status.d.ts +28 -0
  229. package/dist/components/standalone/connection-status/connection-status.d.ts.map +1 -0
  230. package/dist/components/standalone/connection-status/connection-status.js +22 -0
  231. package/dist/components/standalone/connection-status/connection-status.js.map +1 -0
  232. package/dist/components/standalone/connection-status/lt-connection-status.d.ts +81 -0
  233. package/dist/components/standalone/connection-status/lt-connection-status.d.ts.map +1 -0
  234. package/dist/components/standalone/connection-status/lt-connection-status.js +216 -0
  235. package/dist/components/standalone/connection-status/lt-connection-status.js.map +1 -0
  236. package/dist/components/standalone/toast/lt-toast.d.ts +109 -0
  237. package/dist/components/standalone/toast/lt-toast.d.ts.map +1 -0
  238. package/dist/components/standalone/toast/lt-toast.js +256 -0
  239. package/dist/components/standalone/toast/lt-toast.js.map +1 -0
  240. package/dist/components/standalone/toast/toast.d.ts +52 -0
  241. package/dist/components/standalone/toast/toast.d.ts.map +1 -0
  242. package/dist/components/standalone/toast/toast.js +42 -0
  243. package/dist/components/standalone/toast/toast.js.map +1 -0
  244. package/dist/diagnostics/core.d.ts +137 -0
  245. package/dist/diagnostics/core.d.ts.map +1 -0
  246. package/dist/diagnostics/core.js +72 -0
  247. package/dist/diagnostics/core.js.map +1 -0
  248. package/dist/diagnostics/default-core.d.ts +10 -0
  249. package/dist/diagnostics/default-core.d.ts.map +1 -0
  250. package/dist/diagnostics/default-core.js +72 -0
  251. package/dist/diagnostics/default-core.js.map +1 -0
  252. package/dist/diagnostics/index.d.ts +84 -0
  253. package/dist/diagnostics/index.d.ts.map +1 -0
  254. package/dist/diagnostics/index.js +106 -0
  255. package/dist/diagnostics/index.js.map +1 -0
  256. package/dist/dom.d.ts +55 -0
  257. package/dist/dom.d.ts.map +1 -0
  258. package/dist/dom.js +162 -0
  259. package/dist/dom.js.map +1 -0
  260. package/dist/index.d.ts +97 -0
  261. package/dist/index.d.ts.map +1 -0
  262. package/dist/index.js +58 -0
  263. package/dist/index.js.map +1 -0
  264. package/dist/jsx/react.d.ts +180 -0
  265. package/dist/jsx/react.d.ts.map +1 -0
  266. package/dist/jsx/react.js +2 -0
  267. package/dist/jsx/react.js.map +1 -0
  268. package/dist/lotek.css +3617 -0
  269. package/dist/lt.d.ts +325 -0
  270. package/dist/lt.d.ts.map +1 -0
  271. package/dist/lt.js +183 -0
  272. package/dist/lt.js.map +1 -0
  273. package/dist/react.d.ts +492 -0
  274. package/dist/react.d.ts.map +1 -0
  275. package/dist/react.js +296 -0
  276. package/dist/react.js.map +1 -0
  277. package/dist/register.d.ts +17 -0
  278. package/dist/register.d.ts.map +1 -0
  279. package/dist/register.js +35 -0
  280. package/dist/register.js.map +1 -0
  281. package/dist/tokens/color.d.ts +43 -0
  282. package/dist/tokens/color.d.ts.map +1 -0
  283. package/dist/tokens/color.js +123 -0
  284. package/dist/tokens/color.js.map +1 -0
  285. package/dist/tokens/contract.d.ts +18 -0
  286. package/dist/tokens/contract.d.ts.map +1 -0
  287. package/dist/tokens/contract.js +18 -0
  288. package/dist/tokens/contract.js.map +1 -0
  289. package/dist/tokens/matrix-cells.d.ts +30 -0
  290. package/dist/tokens/matrix-cells.d.ts.map +1 -0
  291. package/dist/tokens/matrix-cells.js +273 -0
  292. package/dist/tokens/matrix-cells.js.map +1 -0
  293. package/dist/tokens/matrix.d.ts +18 -0
  294. package/dist/tokens/matrix.d.ts.map +1 -0
  295. package/dist/tokens/matrix.js +21 -0
  296. package/dist/tokens/matrix.js.map +1 -0
  297. package/dist/tokens/theme-check.d.ts +42 -0
  298. package/dist/tokens/theme-check.d.ts.map +1 -0
  299. package/dist/tokens/theme-check.js +10 -0
  300. package/dist/tokens/theme-check.js.map +1 -0
  301. package/dist/tokens/theme.d.ts +94 -0
  302. package/dist/tokens/theme.d.ts.map +1 -0
  303. package/dist/tokens/theme.js +14 -0
  304. package/dist/tokens/theme.js.map +1 -0
  305. package/dist/tokens/tokens.d.ts +122 -0
  306. package/dist/tokens/tokens.d.ts.map +1 -0
  307. package/dist/tokens/tokens.js +158 -0
  308. package/dist/tokens/tokens.js.map +1 -0
  309. package/dist/vocabulary/classes.d.ts +3 -0
  310. package/dist/vocabulary/classes.d.ts.map +1 -0
  311. package/dist/vocabulary/classes.js +1320 -0
  312. package/dist/vocabulary/classes.js.map +1 -0
  313. package/dist/vocabulary/elements.d.ts +3 -0
  314. package/dist/vocabulary/elements.d.ts.map +1 -0
  315. package/dist/vocabulary/elements.js +410 -0
  316. package/dist/vocabulary/elements.js.map +1 -0
  317. package/dist/vocabulary/types.d.ts +175 -0
  318. package/dist/vocabulary/types.d.ts.map +1 -0
  319. package/dist/vocabulary/types.js +11 -0
  320. package/dist/vocabulary/types.js.map +1 -0
  321. package/dist/wasi-host.d.ts +24 -0
  322. package/dist/wasi-host.d.ts.map +1 -0
  323. package/dist/wasi-host.js +140 -0
  324. package/dist/wasi-host.js.map +1 -0
  325. package/live-templates.xml +62 -0
  326. package/manifest/files.json +373 -0
  327. package/manifest/manifest.json +4965 -0
  328. package/manifest/manifest.schema.json +513 -0
  329. package/package.json +398 -5
  330. package/src/cli.ts +21 -0
  331. package/src/components/css/accordion/accordion.css +102 -0
  332. package/src/components/css/accordion/accordion.ts +50 -0
  333. package/src/components/css/alert/alert.css +53 -0
  334. package/src/components/css/alert/alert.ts +48 -0
  335. package/src/components/css/avatar/avatar.css +96 -0
  336. package/src/components/css/avatar/avatar.ts +57 -0
  337. package/src/components/css/badge/badge.css +42 -0
  338. package/src/components/css/badge/badge.ts +43 -0
  339. package/src/components/css/breadcrumbs/breadcrumbs.css +62 -0
  340. package/src/components/css/breadcrumbs/breadcrumbs.ts +30 -0
  341. package/src/components/css/button/button.css +128 -0
  342. package/src/components/css/button/button.ts +44 -0
  343. package/src/components/css/card/card.css +65 -0
  344. package/src/components/css/card/card.ts +50 -0
  345. package/src/components/css/checkbox/checkbox.css +114 -0
  346. package/src/components/css/checkbox/checkbox.ts +50 -0
  347. package/src/components/css/divider/divider.css +38 -0
  348. package/src/components/css/divider/divider.ts +42 -0
  349. package/src/components/css/error-text/error-text.css +21 -0
  350. package/src/components/css/error-text/error-text.ts +37 -0
  351. package/src/components/css/fieldset/fieldset.css +72 -0
  352. package/src/components/css/fieldset/fieldset.ts +87 -0
  353. package/src/components/css/file-upload/file-upload.css +102 -0
  354. package/src/components/css/file-upload/file-upload.ts +65 -0
  355. package/src/components/css/heading/heading.css +33 -0
  356. package/src/components/css/heading/heading.ts +42 -0
  357. package/src/components/css/help-text/help-text.css +24 -0
  358. package/src/components/css/help-text/help-text.ts +42 -0
  359. package/src/components/css/icon/icon.css +20 -0
  360. package/src/components/css/icon/icon.ts +44 -0
  361. package/src/components/css/input/input.css +145 -0
  362. package/src/components/css/input/input.ts +77 -0
  363. package/src/components/css/label/label.css +42 -0
  364. package/src/components/css/label/label.ts +51 -0
  365. package/src/components/css/link/link.css +38 -0
  366. package/src/components/css/link/link.ts +38 -0
  367. package/src/components/css/list/list.css +53 -0
  368. package/src/components/css/list/list.ts +44 -0
  369. package/src/components/css/pagination/pagination.css +95 -0
  370. package/src/components/css/pagination/pagination.ts +33 -0
  371. package/src/components/css/paragraph/paragraph.css +31 -0
  372. package/src/components/css/paragraph/paragraph.ts +53 -0
  373. package/src/components/css/progress/progress.css +161 -0
  374. package/src/components/css/progress/progress.ts +78 -0
  375. package/src/components/css/radio/radio.css +94 -0
  376. package/src/components/css/radio/radio.ts +50 -0
  377. package/src/components/css/search/search.css +50 -0
  378. package/src/components/css/search/search.ts +56 -0
  379. package/src/components/css/select/select.css +321 -0
  380. package/src/components/css/select/select.ts +63 -0
  381. package/src/components/css/shared.ts +199 -0
  382. package/src/components/css/skeleton/skeleton.css +62 -0
  383. package/src/components/css/skeleton/skeleton.ts +43 -0
  384. package/src/components/css/skip-link/skip-link.css +41 -0
  385. package/src/components/css/skip-link/skip-link.ts +22 -0
  386. package/src/components/css/spinner/spinner.css +48 -0
  387. package/src/components/css/spinner/spinner.ts +48 -0
  388. package/src/components/css/sr-only/sr-only.css +16 -0
  389. package/src/components/css/sr-only/sr-only.ts +21 -0
  390. package/src/components/css/switch/switch.css +105 -0
  391. package/src/components/css/switch/switch.ts +50 -0
  392. package/src/components/css/table/table.css +159 -0
  393. package/src/components/css/table/table.ts +107 -0
  394. package/src/components/css/tag/tag.css +58 -0
  395. package/src/components/css/tag/tag.ts +49 -0
  396. package/src/components/css/textarea/textarea.css +83 -0
  397. package/src/components/css/textarea/textarea.ts +40 -0
  398. package/src/components/css/toggle-group/toggle-group.css +92 -0
  399. package/src/components/css/toggle-group/toggle-group.ts +37 -0
  400. package/src/components/css/tooltip/tooltip.css +89 -0
  401. package/src/components/css/tooltip/tooltip.ts +37 -0
  402. package/src/components/default-texts.ts +34 -0
  403. package/src/components/events.ts +68 -0
  404. package/src/components/frame/dialog/dialog.css +306 -0
  405. package/src/components/frame/dialog/dialog.ts +166 -0
  406. package/src/components/frame/dialog/lt-dialog.ts +510 -0
  407. package/src/components/frame/error-summary/error-summary.css +47 -0
  408. package/src/components/frame/error-summary/error-summary.ts +56 -0
  409. package/src/components/frame/error-summary/lt-error-summary.ts +344 -0
  410. package/src/components/frame/field/field-core.ts +152 -0
  411. package/src/components/frame/field/field.css +17 -0
  412. package/src/components/frame/field/lt-field.ts +753 -0
  413. package/src/components/frame/popover/lt-popover.ts +555 -0
  414. package/src/components/frame/popover/popover.css +50 -0
  415. package/src/components/frame/popover/popover.ts +102 -0
  416. package/src/components/frame/session-timeout/lt-session-timeout.ts +681 -0
  417. package/src/components/frame/session-timeout/session-timeout.css +50 -0
  418. package/src/components/frame/session-timeout/session-timeout.ts +156 -0
  419. package/src/components/frame/suggestion/lt-suggestion.ts +1358 -0
  420. package/src/components/frame/suggestion/suggestion.css +132 -0
  421. package/src/components/frame/suggestion/suggestion.ts +172 -0
  422. package/src/components/frame/tabs/lt-tabs.ts +1319 -0
  423. package/src/components/frame/tabs/tabs.css +128 -0
  424. package/src/components/frame/tabs/tabs.ts +188 -0
  425. package/src/components/host-element.ts +400 -0
  426. package/src/components/standalone/connection-status/connection-status.css +41 -0
  427. package/src/components/standalone/connection-status/connection-status.ts +41 -0
  428. package/src/components/standalone/connection-status/lt-connection-status.ts +242 -0
  429. package/src/components/standalone/toast/lt-toast.ts +300 -0
  430. package/src/components/standalone/toast/toast.css +78 -0
  431. package/src/components/standalone/toast/toast.ts +70 -0
  432. package/src/diagnostics/core.ts +210 -0
  433. package/src/diagnostics/default-core.ts +81 -0
  434. package/src/diagnostics/index.ts +150 -0
  435. package/src/dom.ts +185 -0
  436. package/src/index.ts +218 -0
  437. package/src/jsx/react.ts +212 -0
  438. package/src/lt.ts +192 -0
  439. package/src/react.ts +411 -0
  440. package/src/register.ts +43 -0
  441. package/src/tailwind/tailwind.css +169 -0
  442. package/src/tokens/boundary.css +104 -0
  443. package/src/tokens/color-contract.json +231 -0
  444. package/src/tokens/color.ts +150 -0
  445. package/src/tokens/contract.ts +24 -0
  446. package/src/tokens/matrix-cells.ts +375 -0
  447. package/src/tokens/matrix.ts +32 -0
  448. package/src/tokens/theme-check.ts +51 -0
  449. package/src/tokens/theme.ts +104 -0
  450. package/src/tokens/tokens.css +569 -0
  451. package/src/tokens/tokens.ts +223 -0
  452. package/src/vocabulary/classes.ts +1322 -0
  453. package/src/vocabulary/elements.ts +412 -0
  454. package/src/vocabulary/types.ts +178 -0
  455. package/src/wasi-host.ts +155 -0
  456. package/web-types.json +800 -0
@@ -0,0 +1,375 @@
1
+ // Generated by scripts/generate-matrix.ts from the core and color-contract.json. Do not edit.
2
+
3
+ /** The families LO-TEK ships itself. A consumer can have others. */
4
+ export const FAMILIES = ["accent","visited","brand1","brand2","brand3","neutral","danger","warning","success"] as const
5
+
6
+ export type Family = (typeof FAMILIES)[number]
7
+
8
+ /** LO-TEK's own brand colours. */
9
+ export const LOTEK_BRANDS: Record<Family, string> = {
10
+ "accent": "#1362ae",
11
+ "visited": "#5a77a8",
12
+ "brand1": "#0d7a5f",
13
+ "brand2": "#5b3fa0",
14
+ "brand3": "#b04c5c",
15
+ "neutral": "#24272b",
16
+ "danger": "#a82e39",
17
+ "warning": "#896508",
18
+ "success": "#316f2a"
19
+ }
20
+
21
+ /** A role is a job a colour does, and it is the same in every family. */
22
+ export type Role = "surface" | "borderSubtle" | "border" | "borderStrong" | "fill" | "text" | "textStrong" | "textSubtle" | "content"
23
+
24
+ /** Light or dark. A theme is one or the other, never both. */
25
+ export type Appearance = "light" | "dark"
26
+
27
+ type Spec = { lightness: Record<Appearance, number>; chroma: number }
28
+
29
+ /** Lightness and chroma share per role, in each appearance. */
30
+ export const ROLES: Record<Role, Spec> = {
31
+ "surface": {
32
+ "lightness": {
33
+ "light": 0.96,
34
+ "dark": 0.26
35
+ },
36
+ "chroma": 0.22
37
+ },
38
+ "borderSubtle": {
39
+ "lightness": {
40
+ "light": 0.88,
41
+ "dark": 0.34
42
+ },
43
+ "chroma": 0.35
44
+ },
45
+ "border": {
46
+ "lightness": {
47
+ "light": 0.575,
48
+ "dark": 0.625
49
+ },
50
+ "chroma": 0.55
51
+ },
52
+ "borderStrong": {
53
+ "lightness": {
54
+ "light": 0.48,
55
+ "dark": 0.74
56
+ },
57
+ "chroma": 0.6
58
+ },
59
+ "fill": {
60
+ "lightness": {
61
+ "light": 0.53,
62
+ "dark": 0.65
63
+ },
64
+ "chroma": 1
65
+ },
66
+ "text": {
67
+ "lightness": {
68
+ "light": 0.42,
69
+ "dark": 0.82
70
+ },
71
+ "chroma": 0.85
72
+ },
73
+ "textStrong": {
74
+ "lightness": {
75
+ "light": 0.28,
76
+ "dark": 0.93
77
+ },
78
+ "chroma": 0.5
79
+ },
80
+ "textSubtle": {
81
+ "lightness": {
82
+ "light": 0.485,
83
+ "dark": 0.73
84
+ },
85
+ "chroma": 0.7
86
+ },
87
+ "content": {
88
+ "lightness": {
89
+ "light": 0.99,
90
+ "dark": 0.16
91
+ },
92
+ "chroma": 0.04
93
+ }
94
+ }
95
+
96
+ /** The page and the raised surface, which only the neutral family has. */
97
+ export const NEUTRAL_LAYERS: Record<"canvas" | "raised", Spec> = {
98
+ "canvas": {
99
+ "lightness": {
100
+ "light": 1,
101
+ "dark": 0.18
102
+ },
103
+ "chroma": 0.08
104
+ },
105
+ "raised": {
106
+ "lightness": {
107
+ "light": 0.92,
108
+ "dark": 0.32
109
+ },
110
+ "chroma": 0.12
111
+ }
112
+ }
113
+
114
+ /** The contrast requirements, with a margin above WCAG. Text is 4.5 and graphics 3. */
115
+ export const REQUIREMENT = {"text":4.6,"graphic":3.1} as const
116
+
117
+ /** Every name the matrix emits. */
118
+ export type MatrixToken =
119
+ | "--lt-color-accent-surface"
120
+ | "--lt-color-accent-border-subtle"
121
+ | "--lt-color-accent-border"
122
+ | "--lt-color-accent-border-strong"
123
+ | "--lt-color-accent-fill"
124
+ | "--lt-color-accent-text"
125
+ | "--lt-color-accent-text-strong"
126
+ | "--lt-color-accent-text-subtle"
127
+ | "--lt-color-accent-content"
128
+ | "--lt-color-visited-surface"
129
+ | "--lt-color-visited-border-subtle"
130
+ | "--lt-color-visited-border"
131
+ | "--lt-color-visited-border-strong"
132
+ | "--lt-color-visited-fill"
133
+ | "--lt-color-visited-text"
134
+ | "--lt-color-visited-text-strong"
135
+ | "--lt-color-visited-text-subtle"
136
+ | "--lt-color-visited-content"
137
+ | "--lt-color-brand1-surface"
138
+ | "--lt-color-brand1-border-subtle"
139
+ | "--lt-color-brand1-border"
140
+ | "--lt-color-brand1-border-strong"
141
+ | "--lt-color-brand1-fill"
142
+ | "--lt-color-brand1-text"
143
+ | "--lt-color-brand1-text-strong"
144
+ | "--lt-color-brand1-text-subtle"
145
+ | "--lt-color-brand1-content"
146
+ | "--lt-color-brand2-surface"
147
+ | "--lt-color-brand2-border-subtle"
148
+ | "--lt-color-brand2-border"
149
+ | "--lt-color-brand2-border-strong"
150
+ | "--lt-color-brand2-fill"
151
+ | "--lt-color-brand2-text"
152
+ | "--lt-color-brand2-text-strong"
153
+ | "--lt-color-brand2-text-subtle"
154
+ | "--lt-color-brand2-content"
155
+ | "--lt-color-brand3-surface"
156
+ | "--lt-color-brand3-border-subtle"
157
+ | "--lt-color-brand3-border"
158
+ | "--lt-color-brand3-border-strong"
159
+ | "--lt-color-brand3-fill"
160
+ | "--lt-color-brand3-text"
161
+ | "--lt-color-brand3-text-strong"
162
+ | "--lt-color-brand3-text-subtle"
163
+ | "--lt-color-brand3-content"
164
+ | "--lt-color-neutral-surface"
165
+ | "--lt-color-neutral-border-subtle"
166
+ | "--lt-color-neutral-border"
167
+ | "--lt-color-neutral-border-strong"
168
+ | "--lt-color-neutral-fill"
169
+ | "--lt-color-neutral-text"
170
+ | "--lt-color-neutral-text-strong"
171
+ | "--lt-color-neutral-text-subtle"
172
+ | "--lt-color-neutral-content"
173
+ | "--lt-color-danger-surface"
174
+ | "--lt-color-danger-border-subtle"
175
+ | "--lt-color-danger-border"
176
+ | "--lt-color-danger-border-strong"
177
+ | "--lt-color-danger-fill"
178
+ | "--lt-color-danger-text"
179
+ | "--lt-color-danger-text-strong"
180
+ | "--lt-color-danger-text-subtle"
181
+ | "--lt-color-danger-content"
182
+ | "--lt-color-warning-surface"
183
+ | "--lt-color-warning-border-subtle"
184
+ | "--lt-color-warning-border"
185
+ | "--lt-color-warning-border-strong"
186
+ | "--lt-color-warning-fill"
187
+ | "--lt-color-warning-text"
188
+ | "--lt-color-warning-text-strong"
189
+ | "--lt-color-warning-text-subtle"
190
+ | "--lt-color-warning-content"
191
+ | "--lt-color-success-surface"
192
+ | "--lt-color-success-border-subtle"
193
+ | "--lt-color-success-border"
194
+ | "--lt-color-success-border-strong"
195
+ | "--lt-color-success-fill"
196
+ | "--lt-color-success-text"
197
+ | "--lt-color-success-text-strong"
198
+ | "--lt-color-success-text-subtle"
199
+ | "--lt-color-success-content"
200
+ | "--lt-color-neutral-canvas"
201
+ | "--lt-color-neutral-raised"
202
+
203
+ /** LO-TEK's own colours in the light theme. */
204
+ export const lightCells: Record<MatrixToken, string> = {
205
+ "--lt-color-accent-surface": "#e9f3ff",
206
+ "--lt-color-accent-border-subtle": "#c1daf8",
207
+ "--lt-color-accent-border": "#577ca6",
208
+ "--lt-color-accent-border-strong": "#39608c",
209
+ "--lt-color-accent-fill": "#226dba",
210
+ "--lt-color-accent-text": "#0d4e8c",
211
+ "--lt-color-accent-text-strong": "#0b2a4a",
212
+ "--lt-color-accent-text-subtle": "#336195",
213
+ "--lt-color-accent-content": "#f9fcff",
214
+ "--lt-color-visited-surface": "#ebf2ff",
215
+ "--lt-color-visited-border-subtle": "#cdd8eb",
216
+ "--lt-color-visited-border": "#697a95",
217
+ "--lt-color-visited-border-strong": "#4d5e7a",
218
+ "--lt-color-visited-fill": "#4f6c9c",
219
+ "--lt-color-visited-text": "#364d74",
220
+ "--lt-color-visited-text-strong": "#1d293e",
221
+ "--lt-color-visited-text-subtle": "#4c6080",
222
+ "--lt-color-visited-content": "#fafcfe",
223
+ "--lt-color-brand1-surface": "#e4f7ef",
224
+ "--lt-color-brand1-border-subtle": "#c2dfd4",
225
+ "--lt-color-brand1-border": "#578474",
226
+ "--lt-color-brand1-border-strong": "#386958",
227
+ "--lt-color-brand1-fill": "#157e63",
228
+ "--lt-color-brand1-text": "#005b46",
229
+ "--lt-color-brand1-text-strong": "#073125",
230
+ "--lt-color-brand1-text-subtle": "#316c59",
231
+ "--lt-color-brand1-content": "#f9fdfb",
232
+ "--lt-color-brand2-surface": "#f2efff",
233
+ "--lt-color-brand2-border-subtle": "#d8d2f8",
234
+ "--lt-color-brand2-border": "#7a70a6",
235
+ "--lt-color-brand2-border-strong": "#5f538c",
236
+ "--lt-color-brand2-fill": "#7156ba",
237
+ "--lt-color-brand2-text": "#513b8b",
238
+ "--lt-color-brand2-text-strong": "#2b204a",
239
+ "--lt-color-brand2-text-subtle": "#625295",
240
+ "--lt-color-brand2-content": "#fcfbff",
241
+ "--lt-color-brand3-surface": "#ffecee",
242
+ "--lt-color-brand3-border-subtle": "#f4cccf",
243
+ "--lt-color-brand3-border": "#9f676d",
244
+ "--lt-color-brand3-border-strong": "#844a51",
245
+ "--lt-color-brand3-fill": "#a94656",
246
+ "--lt-color-brand3-text": "#7e2e3c",
247
+ "--lt-color-brand3-text-strong": "#431920",
248
+ "--lt-color-brand3-text-subtle": "#8b4750",
249
+ "--lt-color-brand3-content": "#fffafb",
250
+ "--lt-color-neutral-surface": "#f1f2f3",
251
+ "--lt-color-neutral-border-subtle": "#d6d7d9",
252
+ "--lt-color-neutral-border": "#77797c",
253
+ "--lt-color-neutral-border-strong": "#5c5e60",
254
+ "--lt-color-neutral-fill": "#696c71",
255
+ "--lt-color-neutral-text": "#4a4d51",
256
+ "--lt-color-neutral-text-strong": "#27292b",
257
+ "--lt-color-neutral-text-subtle": "#5d5f62",
258
+ "--lt-color-neutral-content": "#fbfcfc",
259
+ "--lt-color-danger-surface": "#ffedec",
260
+ "--lt-color-danger-border-subtle": "#facac8",
261
+ "--lt-color-danger-border": "#a66363",
262
+ "--lt-color-danger-border-strong": "#8b4647",
263
+ "--lt-color-danger-fill": "#b53b43",
264
+ "--lt-color-danger-text": "#87232c",
265
+ "--lt-color-danger-text-strong": "#481518",
266
+ "--lt-color-danger-text-subtle": "#934244",
267
+ "--lt-color-danger-content": "#fffafa",
268
+ "--lt-color-warning-surface": "#f9f1e1",
269
+ "--lt-color-warning-border-subtle": "#e3d6bc",
270
+ "--lt-color-warning-border": "#8a7650",
271
+ "--lt-color-warning-border-strong": "#6f5a31",
272
+ "--lt-color-warning-fill": "#896508",
273
+ "--lt-color-warning-text": "#644800",
274
+ "--lt-color-warning-text-strong": "#352604",
275
+ "--lt-color-warning-text-subtle": "#735b29",
276
+ "--lt-color-warning-content": "#fdfcf9",
277
+ "--lt-color-success-surface": "#e8f7e6",
278
+ "--lt-color-success-border-subtle": "#c9dfc5",
279
+ "--lt-color-success-border": "#63835e",
280
+ "--lt-color-success-border-strong": "#466841",
281
+ "--lt-color-success-fill": "#3f7d37",
282
+ "--lt-color-success-text": "#285a22",
283
+ "--lt-color-success-text-strong": "#163013",
284
+ "--lt-color-success-text-subtle": "#426b3d",
285
+ "--lt-color-success-content": "#fafdfa",
286
+ "--lt-color-neutral-canvas": "#ffffff",
287
+ "--lt-color-neutral-raised": "#e4e4e5"
288
+ }
289
+
290
+ /** LO-TEK's own colours in the dark theme. */
291
+ export const darkCells: Record<MatrixToken, string> = {
292
+ "--lt-color-accent-surface": "#192533",
293
+ "--lt-color-accent-border-subtle": "#253951",
294
+ "--lt-color-accent-border": "#668bb6",
295
+ "--lt-color-accent-border-strong": "#85aedf",
296
+ "--lt-color-accent-fill": "#4992e2",
297
+ "--lt-color-accent-text": "#99c8ff",
298
+ "--lt-color-accent-text-strong": "#d8eaff",
299
+ "--lt-color-accent-text-subtle": "#7aabe4",
300
+ "--lt-color-accent-content": "#0c0d10",
301
+ "--lt-color-visited-surface": "#1f242d",
302
+ "--lt-color-visited-border-subtle": "#2f3847",
303
+ "--lt-color-visited-border": "#7888a4",
304
+ "--lt-color-visited-border-strong": "#99accb",
305
+ "--lt-color-visited-fill": "#7290c2",
306
+ "--lt-color-visited-text": "#aac5f3",
307
+ "--lt-color-visited-text-strong": "#dbe9ff",
308
+ "--lt-color-visited-text-subtle": "#93a9cd",
309
+ "--lt-color-visited-content": "#0c0d0f",
310
+ "--lt-color-brand1-surface": "#192822",
311
+ "--lt-color-brand1-border-subtle": "#253e35",
312
+ "--lt-color-brand1-border": "#669382",
313
+ "--lt-color-brand1-border-strong": "#85b7a5",
314
+ "--lt-color-brand1-fill": "#45a386",
315
+ "--lt-color-brand1-text": "#8bd6bc",
316
+ "--lt-color-brand1-text-strong": "#c8f3e3",
317
+ "--lt-color-brand1-text-subtle": "#7bb6a1",
318
+ "--lt-color-brand1-content": "#0c0e0d",
319
+ "--lt-color-brand2-surface": "#242133",
320
+ "--lt-color-brand2-border-subtle": "#393351",
321
+ "--lt-color-brand2-border": "#897eb6",
322
+ "--lt-color-brand2-border-strong": "#aca0df",
323
+ "--lt-color-brand2-fill": "#937be2",
324
+ "--lt-color-brand2-text": "#c6b8ff",
325
+ "--lt-color-brand2-text-strong": "#e8e4ff",
326
+ "--lt-color-brand2-text-subtle": "#aa9be4",
327
+ "--lt-color-brand2-content": "#0d0d10",
328
+ "--lt-color-brand3-surface": "#311e20",
329
+ "--lt-color-brand3-border-subtle": "#4d2e31",
330
+ "--lt-color-brand3-border": "#af767c",
331
+ "--lt-color-brand3-border-strong": "#d7979d",
332
+ "--lt-color-brand3-fill": "#d26a79",
333
+ "--lt-color-brand3-text": "#ffa8b1",
334
+ "--lt-color-brand3-text-strong": "#ffdee1",
335
+ "--lt-color-brand3-text-subtle": "#db9098",
336
+ "--lt-color-brand3-content": "#0f0c0d",
337
+ "--lt-color-neutral-surface": "#232425",
338
+ "--lt-color-neutral-border-subtle": "#373839",
339
+ "--lt-color-neutral-border": "#86888a",
340
+ "--lt-color-neutral-border-strong": "#a9abae",
341
+ "--lt-color-neutral-fill": "#8c8f94",
342
+ "--lt-color-neutral-text": "#c1c4c9",
343
+ "--lt-color-neutral-text-strong": "#e6e8eb",
344
+ "--lt-color-neutral-text-subtle": "#a5a8ab",
345
+ "--lt-color-neutral-content": "#0d0d0d",
346
+ "--lt-color-danger-surface": "#331d1d",
347
+ "--lt-color-danger-border-subtle": "#512c2c",
348
+ "--lt-color-danger-border": "#b67271",
349
+ "--lt-color-danger-border-strong": "#e09392",
350
+ "--lt-color-danger-fill": "#df6165",
351
+ "--lt-color-danger-text": "#ffa9a8",
352
+ "--lt-color-danger-text-strong": "#ffdfde",
353
+ "--lt-color-danger-text-subtle": "#e58b8a",
354
+ "--lt-color-danger-content": "#100c0c",
355
+ "--lt-color-warning-surface": "#292317",
356
+ "--lt-color-warning-border-subtle": "#413621",
357
+ "--lt-color-warning-border": "#99855f",
358
+ "--lt-color-warning-border-strong": "#bea87d",
359
+ "--lt-color-warning-fill": "#ae893a",
360
+ "--lt-color-warning-text": "#e0bf7f",
361
+ "--lt-color-warning-text-strong": "#f9e6c0",
362
+ "--lt-color-warning-text-subtle": "#bea471",
363
+ "--lt-color-warning-content": "#0e0d0b",
364
+ "--lt-color-success-surface": "#1d271b",
365
+ "--lt-color-success-border-subtle": "#2b3e29",
366
+ "--lt-color-success-border": "#71926d",
367
+ "--lt-color-success-border-strong": "#91b78c",
368
+ "--lt-color-success-fill": "#62a15b",
369
+ "--lt-color-success-text": "#9ed597",
370
+ "--lt-color-success-text-strong": "#d2f3cd",
371
+ "--lt-color-success-text-subtle": "#8ab684",
372
+ "--lt-color-success-content": "#0c0e0c",
373
+ "--lt-color-neutral-canvas": "#111212",
374
+ "--lt-color-neutral-raised": "#323333"
375
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The matrix, as `@lo-tek/interfaces/matrix`: family times role, as finished
3
+ * tokens.
4
+ *
5
+ * No palette, no steps, no pins: the role *is* the colour. The names follow
6
+ * the namespaces of Tailwind and daisyUI: system prefix, kind and path.
7
+ *
8
+ * The colours are computed by the core. Here are LO-TEK's colours, and the
9
+ * names. A matrix for other brand colours is `light` and `dark` in the theme
10
+ * `buildTheme` returns.
11
+ */
12
+
13
+ import type { Role } from "./matrix-cells.js"
14
+
15
+ export {
16
+ darkCells,
17
+ FAMILIES,
18
+ type Family,
19
+ LOTEK_BRANDS,
20
+ lightCells,
21
+ type MatrixToken,
22
+ } from "./matrix-cells.js"
23
+
24
+ /** The role name as it is written in CSS. `textSubtle` becomes `text-subtle`. */
25
+ export function roleToCss(role: Role): string {
26
+ return role.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)
27
+ }
28
+
29
+ /** The token name for one cell in the matrix. */
30
+ export function tokenName(family: string, role: string): string {
31
+ return `--lt-color-${family}-${role}`
32
+ }
@@ -0,0 +1,51 @@
1
+ import { defaultCore } from "../diagnostics/default-core.js"
2
+
3
+ /**
4
+ * Checks a theme a consumer has written by hand.
5
+ *
6
+ * The generator keeps the promises by construction. When someone writes in
7
+ * values of their choosing, keeping the promises is up to them, and then we
8
+ * owe them an answer about which cell breaks. Without this, "you can override
9
+ * anything" is a trap.
10
+ *
11
+ * All that matters is which `--lt-color-*` is in which block, and whether the
12
+ * block is light or dark, read from `color-scheme` or the selector. A value
13
+ * that cannot be computed is reported as exactly that instead of being
14
+ * skipped, and missing values are filled from LO-TEK's default theme, so
15
+ * someone who has overridden a single cell gets it checked against the rest
16
+ * of the system.
17
+ *
18
+ * The check is the core, written in Rust, the same one `lotek check-theme`
19
+ * uses.
20
+ */
21
+
22
+ export type ThemeReport = {
23
+ problems: ThemeProblem[]
24
+ /** Blocks that were actually read. */
25
+ blocks: number
26
+ /**
27
+ * Values the consumer wrote, and that were understood.
28
+ *
29
+ * The promise count alone is no proof of work: the defaults fill the gaps,
30
+ * so one line gives as many promises as a whole theme. This number counts
31
+ * what the file actually contained.
32
+ */
33
+ declarations: number
34
+ /** Promises that were actually checked. */
35
+ promises: number
36
+ }
37
+
38
+ export type ThemeProblem = {
39
+ selector: string
40
+ message: string
41
+ }
42
+
43
+ /** Reads a theme and checks every promise in every block. */
44
+ export function inspectTheme(css: string): ThemeReport {
45
+ return defaultCore().inspectTheme(css)
46
+ }
47
+
48
+ /** Only the problems, for anyone who does not need the counts. */
49
+ export function checkTheme(css: string): ThemeProblem[] {
50
+ return inspectTheme(css).problems
51
+ }
@@ -0,0 +1,104 @@
1
+ import type { Violation } from "../diagnostics/core.js"
2
+ import { defaultCore } from "../diagnostics/default-core.js"
3
+ import type { Family } from "./matrix.js"
4
+
5
+ export type { Violation }
6
+
7
+ /**
8
+ * Builds a complete colour theme from a few brand colours.
9
+ *
10
+ * The theme is the contract applied to the consumer's hues. The hue comes
11
+ * from the consumer, the lightness from the role, and the promises hold by
12
+ * construction. That is why there is no adjustment pass here: there is
13
+ * nothing to move.
14
+ *
15
+ * ```ts
16
+ * const theme = buildTheme({ accent: "#7c3aed", danger: "#b3261e" })
17
+ * console.log(theme.css)
18
+ * ```
19
+ */
20
+
21
+ export type ThemeTypography = {
22
+ /** The font stack the whole theme uses, written as in CSS. */
23
+ fontFamily?: string
24
+ /** The weights, as numbers or keywords. */
25
+ weights?: {
26
+ regular?: string | number
27
+ medium?: string | number
28
+ semibold?: string | number
29
+ bold?: string | number
30
+ }
31
+ /** Line heights for controls, headings, body text and small surfaces. */
32
+ lineHeights?: {
33
+ default?: string | number
34
+ heading?: string | number
35
+ article?: string | number
36
+ compact?: string | number
37
+ }
38
+ }
39
+
40
+ /**
41
+ * The shape of the theme: corners and borders.
42
+ *
43
+ * The button, the field and the surfaces are set separately. The distinction
44
+ * is worth keeping: another Norwegian design system has fully round buttons
45
+ * and fields with almost square corners, and one shared number would have
46
+ * turned the fields into capsules.
47
+ *
48
+ * The checkbox, the badge, the tag, the toggle group, the avatar and the
49
+ * skeleton are left out on purpose. There the corner is not a style choice
50
+ * but the shape itself: a checkbox that turns round looks like a radio
51
+ * button, and a badge that turns square looks like a button.
52
+ */
53
+ export type ThemeShape = {
54
+ /** Corners on the button, the pagination and the skip link. */
55
+ buttonRadius?: string
56
+ /** Corners on the field, the text area and the select. */
57
+ fieldRadius?: string
58
+ /**
59
+ * Corners on the card, dialog, popover, alert, accordion, error summary,
60
+ * file upload, session timeout, suggestion list, toast and tooltip.
61
+ */
62
+ surfaceRadius?: string
63
+ /** The border width of the button. */
64
+ buttonBorderWidth?: string
65
+ /** The font weight of the button text. */
66
+ buttonFontWeight?: string | number
67
+ }
68
+
69
+ /**
70
+ * The brand colours.
71
+ *
72
+ * Each family is optional on its own, and one you leave out inherits
73
+ * LO-TEK's default hue. Leave them all out, and the theme only sets type and
74
+ * shape.
75
+ */
76
+ export type ThemeColors = Partial<Record<Family, string>>
77
+
78
+ export type ThemeInput = ThemeColors & {
79
+ /** Type and line height. Left out, LO-TEK's default typography stays. */
80
+ typography?: ThemeTypography
81
+ /** Corners and borders. Left out, LO-TEK's default shape stays. */
82
+ shape?: ThemeShape
83
+ }
84
+
85
+ export type Theme = {
86
+ light: Record<string, string>
87
+ dark: Record<string, string>
88
+ /** Promises that do not hold. Empty when the theme is sound. */
89
+ violations: Violation[]
90
+ css: string
91
+ }
92
+
93
+ /**
94
+ * Builds the theme, and checks every promise while it is built.
95
+ *
96
+ * The arithmetic happens in the core, written in Rust, which `lotek theme` and
97
+ * LO-TEK for Kotlin use. The typography and shape values are written straight
98
+ * into a CSS rule, so a value that could break out of it, such as
99
+ * `4px; } html {`, an unclosed parenthesis or `</style>`, is rejected with an
100
+ * explanation that names the field in the recipe.
101
+ */
102
+ export function buildTheme(input: ThemeInput): Theme {
103
+ return defaultCore().buildTheme(input)
104
+ }