@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,167 @@
1
+ /**
2
+ * Shared building blocks for the component API.
3
+ *
4
+ * Each component exports one function that takes an object of options and
5
+ * returns the attributes you spread onto the element. The shape is the same
6
+ * for all of them, so you only need to learn it once.
7
+ */
8
+ /**
9
+ * The attributes each set manages, including those that are off right now.
10
+ *
11
+ * `attributes()` drops the keys without a value, and with them the record of
12
+ * which attributes the builder function has a say in. `setAttributes` needs
13
+ * exactly that: `lt.switch()` manages `disabled` and must be able to remove
14
+ * it, while `lt.button()` has never written it and must leave it alone. The
15
+ * list is kept in a map beside the object, not on it, so spreading, JSON and
16
+ * React see the same as before.
17
+ */
18
+ const managed = new WeakMap();
19
+ /** The names the set manages, or `undefined` for a set we did not create. */
20
+ export function managedNames(set) {
21
+ return managed.get(set);
22
+ }
23
+ /**
24
+ * Gives a set rewritten from another the same managed names.
25
+ *
26
+ * `/react` renames `class` to `className` in a new object, and the new object
27
+ * was not in the map. `lt.setAttributes` from there then only cleaned up
28
+ * `data-*`, and `aria-invalid` stayed after the field was corrected. The
29
+ * names are given as they are spelled in the new set.
30
+ *
31
+ * For `/react` and other entry points that rewrite the sets, not for apps: a
32
+ * set from `lt.*` is already managed.
33
+ */
34
+ export function rememberManaged(set, names) {
35
+ managed.set(set, names);
36
+ }
37
+ /**
38
+ * Removes attributes without a value, so `{...spread}` does not set empty
39
+ * fields.
40
+ *
41
+ * When the set builds on another, as `lt.search()` does on `lt.input()`, the
42
+ * other is passed in as `based`. The spread has already lost the keys that
43
+ * were off, and without this the search field only managed `data-state` when
44
+ * it happened to be set: it could be set, but not removed.
45
+ */
46
+ export function attributes(values, ...based) {
47
+ const result = {};
48
+ for (const [name, value] of Object.entries(values)) {
49
+ if (value !== undefined) {
50
+ ;
51
+ result[name] = value;
52
+ }
53
+ }
54
+ const names = new Set(Object.keys(values));
55
+ for (const set of based) {
56
+ for (const name of managed.get(set) ?? [])
57
+ names.add(name);
58
+ }
59
+ managed.set(result, [...names]);
60
+ return result;
61
+ }
62
+ /** Creates a type guard for a list of allowed strings. */
63
+ export function createGuard(allowed) {
64
+ return (value) => allowed.includes(value);
65
+ }
66
+ /**
67
+ * Validation state for form controls.
68
+ *
69
+ * Input, textarea and select each had an identical type of their own. Now
70
+ * there is one, so a value can pass between them without conversion.
71
+ */
72
+ export const fieldStates = ["default", "invalid", "success"];
73
+ export const isFieldState = createGuard(fieldStates);
74
+ /** How a required field is marked in its label. */
75
+ export const requiredMarkers = ["symbol", "text"];
76
+ export const isRequiredMarker = createGuard(requiredMarkers);
77
+ /**
78
+ * Warns once per message, in the console.
79
+ *
80
+ * The builder functions are pure functions without an element to attach the
81
+ * message to, so they cannot use `warnAboutMarkup`. The deduplication is
82
+ * needed all the same: an app that renders a list of fields would otherwise
83
+ * say the same thing per field and per render.
84
+ */
85
+ const said = new Set();
86
+ export function warnOnce(message) {
87
+ if (typeof console === "undefined" || said.has(message))
88
+ return;
89
+ said.add(message);
90
+ console.warn(message);
91
+ }
92
+ let idCounter = 0;
93
+ /**
94
+ * Creates an id that is unique within the document.
95
+ *
96
+ * Safe only when the markup is rendered once. When the same field is rendered
97
+ * both on a server and in the browser, the two runs give two different ids,
98
+ * and the wiring is broken until the framework has corrected it.
99
+ */
100
+ export function createFieldId() {
101
+ idCounter += 1;
102
+ return `lt-field-${idCounter}-${Math.random().toString(36).slice(2, 8)}`;
103
+ }
104
+ /**
105
+ * The keys a builder function creates ids from, checked.
106
+ *
107
+ * A key is the same as `key` in React: a fixed value from the data, such as
108
+ * a record id. The id is the same on every render, and a server update
109
+ * recognises the element. An index is not a key: if the server inserts a row
110
+ * first, the same index points to something else.
111
+ *
112
+ * Throws, instead of warning and creating a fallback as `idOrFallback` does:
113
+ * an empty key, one with whitespace or two identical ones give ids that are
114
+ * empty, invalid or identical, and there is no fallback that is right.
115
+ * Whitespace is what JavaScript counts as whitespace (`\s`), which the
116
+ * Kotlin version spells out.
117
+ */
118
+ export function checkedKeys(builder, keys) {
119
+ if (!Array.isArray(keys)) {
120
+ throw new Error(`${builder}: keys is missing. Pass a list with one key per element, taken from the data, such as a record id.`);
121
+ }
122
+ const seen = new Set();
123
+ for (const key of keys) {
124
+ if (typeof key !== "string") {
125
+ throw new Error(`${builder}: a key in keys is not a string but ${typeof key}. The keys become ids; turn numbers into strings, as in String(recordId).`);
126
+ }
127
+ if (key === "") {
128
+ throw new Error(`${builder}: a key in keys is empty. The keys become ids, and each must be a fixed value from the data.`);
129
+ }
130
+ if (/\s/.test(key)) {
131
+ throw new Error(`${builder}: the key "${key}" contains whitespace. The keys become ids, and an id cannot contain whitespace.`);
132
+ }
133
+ if (seen.has(key)) {
134
+ throw new Error(`${builder}: the key "${key}" appears twice in keys. The keys become ids, and two equal ids point to the same element.`);
135
+ }
136
+ seen.add(key);
137
+ }
138
+ return keys;
139
+ }
140
+ /**
141
+ * The id the builder function received, or a fallback with a warning.
142
+ *
143
+ * Every builder function that takes an id requires it in the type. That is
144
+ * not enough on its own: a consumer without TypeScript sees no type, and
145
+ * plain HTML with `<script type="module">` is a first-class way to use
146
+ * LO-TEK. Without the fallback the ids became strings like `undefined-list`,
147
+ * `aria-controls` pointed there, and the wiring was broken in a way that
148
+ * looked valid.
149
+ *
150
+ * The empty string counts as no id. `lt.field({ id: "" })` gave `for=""` and
151
+ * `help.id="-help"`, the same problem without anything saying so.
152
+ *
153
+ * The name of the builder function is in the message. Without it the
154
+ * suggestion field said "lt.field()" and sent the developer to the wrong
155
+ * place.
156
+ */
157
+ export function idOrFallback(builder, id, option = "id") {
158
+ if (typeof id === "string" && id.trim() !== "")
159
+ return id;
160
+ warnOnce(`${builder}: no ${option} given, so a random one is created, and two runs ` +
161
+ "create two different ones. Rendered on a server and in the browser, the " +
162
+ "wiring points to something that does not exist, and a server that sends " +
163
+ "the region again with a new id makes the morph replace the elements and " +
164
+ `lose what the user did in them. Pass ${option}, in React from useId().`);
165
+ return createFieldId();
166
+ }
167
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/components/css/shared.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,29 @@
1
+ export declare const SKELETON_CLASS: "lt-skeleton";
2
+ export declare const skeletonVariants: readonly ["block", "text", "circle"];
3
+ export type SkeletonVariant = (typeof skeletonVariants)[number];
4
+ export type NonDefaultSkeletonVariant = Exclude<SkeletonVariant, "block">;
5
+ export type SkeletonOptions = {
6
+ /** Shape. Default: `block`. */
7
+ variant?: SkeletonVariant;
8
+ };
9
+ export type SkeletonAttributes = {
10
+ class: typeof SKELETON_CLASS;
11
+ "data-variant"?: NonDefaultSkeletonVariant;
12
+ "aria-hidden": "true";
13
+ };
14
+ /**
15
+ * The attributes for a placeholder while the content loads.
16
+ *
17
+ * The shapes are always hidden from screen readers. They say nothing about
18
+ * what is coming, and a row of empty boxes being announced is worse than
19
+ * silence. Announce the wait in one place instead, with `role="status"`.
20
+ *
21
+ * ```ts
22
+ * <div {...skeleton({ variant: "text" })} />
23
+ * ```
24
+ */
25
+ export declare const skeleton: (({ variant }?: SkeletonOptions) => SkeletonAttributes) & {
26
+ variants: readonly ["block", "text", "circle"];
27
+ isVariant: (value: string) => value is "text" | "circle" | "block";
28
+ };
29
+ //# sourceMappingURL=skeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/css/skeleton/skeleton.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,EAAG,aAAsB,CAAA;AAEpD,eAAO,MAAM,gBAAgB,sCAAuC,CAAA;AAEpE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAC/D,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;AAEzE,MAAM,MAAM,eAAe,GAAG;IAC5B,+BAA+B;IAC/B,OAAO,CAAC,EAAE,eAAe,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,OAAO,cAAc,CAAA;IAC5B,cAAc,CAAC,EAAE,yBAAyB,CAAA;IAC1C,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,kBACK,eAAe,KAAQ,kBAAkB;;;CAUlE,CAAA"}
@@ -0,0 +1,23 @@
1
+ import { attributes, createGuard } from "../shared.js";
2
+ export const SKELETON_CLASS = "lt-skeleton";
3
+ export const skeletonVariants = ["block", "text", "circle"];
4
+ /**
5
+ * The attributes for a placeholder while the content loads.
6
+ *
7
+ * The shapes are always hidden from screen readers. They say nothing about
8
+ * what is coming, and a row of empty boxes being announced is worse than
9
+ * silence. Announce the wait in one place instead, with `role="status"`.
10
+ *
11
+ * ```ts
12
+ * <div {...skeleton({ variant: "text" })} />
13
+ * ```
14
+ */
15
+ export const skeleton = Object.assign(({ variant = "block" } = {}) => attributes({
16
+ class: SKELETON_CLASS,
17
+ "data-variant": variant === "block" ? undefined : variant,
18
+ "aria-hidden": "true",
19
+ }), {
20
+ variants: skeletonVariants,
21
+ isVariant: createGuard(skeletonVariants),
22
+ });
23
+ //# sourceMappingURL=skeleton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.js","sourceRoot":"","sources":["../../../../src/components/css/skeleton/skeleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEtD,MAAM,CAAC,MAAM,cAAc,GAAG,aAAsB,CAAA;AAEpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAA;AAgBpE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CACnC,CAAC,EAAE,OAAO,GAAG,OAAO,KAAsB,EAAE,EAAsB,EAAE,CAClE,UAAU,CAAC;IACT,KAAK,EAAE,cAAc;IACrB,cAAc,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;IACzD,aAAa,EAAE,MAAe;CAC/B,CAAC,EACJ;IACE,QAAQ,EAAE,gBAAgB;IAC1B,SAAS,EAAE,WAAW,CAAC,gBAAgB,CAAC;CACzC,CACF,CAAA"}
@@ -0,0 +1,18 @@
1
+ export declare const SKIP_LINK_CLASS: "lt-skip-link";
2
+ export type SkipLinkAttributes = {
3
+ class: typeof SKIP_LINK_CLASS;
4
+ };
5
+ /**
6
+ * The attributes for a skip-to-content link.
7
+ *
8
+ * The link must be the first element in `<body>`, and point to the id of the
9
+ * main content. It sits off screen until it gets focus, and therefore cannot
10
+ * be hidden with `display: none`: the keyboard could not reach it either,
11
+ * and the whole point is lost.
12
+ *
13
+ * ```ts
14
+ * <a {...skipLink()} href="#main-content">Skip to main content</a>
15
+ * ```
16
+ */
17
+ export declare const skipLink: () => SkipLinkAttributes;
18
+ //# sourceMappingURL=skip-link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skip-link.d.ts","sourceRoot":"","sources":["../../../../src/components/css/skip-link/skip-link.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,EAAG,cAAuB,CAAA;AAEtD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,OAAO,eAAe,CAAA;CAC9B,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ,QAAO,kBACY,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { attributes } from "../shared.js";
2
+ export const SKIP_LINK_CLASS = "lt-skip-link";
3
+ /**
4
+ * The attributes for a skip-to-content link.
5
+ *
6
+ * The link must be the first element in `<body>`, and point to the id of the
7
+ * main content. It sits off screen until it gets focus, and therefore cannot
8
+ * be hidden with `display: none`: the keyboard could not reach it either,
9
+ * and the whole point is lost.
10
+ *
11
+ * ```ts
12
+ * <a {...skipLink()} href="#main-content">Skip to main content</a>
13
+ * ```
14
+ */
15
+ export const skipLink = () => attributes({ class: SKIP_LINK_CLASS });
16
+ //# sourceMappingURL=skip-link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skip-link.js","sourceRoot":"","sources":["../../../../src/components/css/skip-link/skip-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,CAAC,MAAM,eAAe,GAAG,cAAuB,CAAA;AAMtD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAuB,EAAE,CAC/C,UAAU,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAA"}
@@ -0,0 +1,33 @@
1
+ export declare const SPINNER_CLASS: "lt-spinner";
2
+ export declare const spinnerSizes: readonly ["small", "medium", "large"];
3
+ export type SpinnerSize = (typeof spinnerSizes)[number];
4
+ export type NonDefaultSpinnerSize = Exclude<SpinnerSize, "medium">;
5
+ export type SpinnerOptions = {
6
+ /** Size. Default: `medium`. */
7
+ size?: SpinnerSize;
8
+ /** What is loading. Becomes `aria-label`, so the ring has a name for screen readers. */
9
+ label?: string;
10
+ };
11
+ export type SpinnerAttributes = {
12
+ class: typeof SPINNER_CLASS;
13
+ "data-size"?: NonDefaultSpinnerSize;
14
+ role?: "status";
15
+ "aria-label"?: string;
16
+ };
17
+ /**
18
+ * The attributes for a loading indicator.
19
+ *
20
+ * Without `label` the ring is only a shape, and screen readers announce
21
+ * nothing. With `label` it becomes a `role="status"` that says what is going
22
+ * on. If you already have a visible text next to it, let that carry the
23
+ * message and drop `label`, so the same thing is not announced twice.
24
+ *
25
+ * ```ts
26
+ * <span {...spinner({ label: "Loading applications" })} />
27
+ * ```
28
+ */
29
+ export declare const spinner: (({ size, label }?: SpinnerOptions) => SpinnerAttributes) & {
30
+ sizes: readonly ["small", "medium", "large"];
31
+ isSize: (value: string) => value is "small" | "medium" | "large";
32
+ };
33
+ //# sourceMappingURL=spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/css/spinner/spinner.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,EAAG,YAAqB,CAAA;AAElD,eAAO,MAAM,YAAY,uCAAwC,CAAA;AAEjE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AACvD,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;AAElE,MAAM,MAAM,cAAc,GAAG;IAC3B,+BAA+B;IAC/B,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,OAAO,aAAa,CAAA;IAC3B,WAAW,CAAC,EAAE,qBAAqB,CAAA;IACnC,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,sBACW,cAAc,KAAQ,iBAAiB;;;CAWrE,CAAA"}
@@ -0,0 +1,25 @@
1
+ import { attributes, createGuard } from "../shared.js";
2
+ export const SPINNER_CLASS = "lt-spinner";
3
+ export const spinnerSizes = ["small", "medium", "large"];
4
+ /**
5
+ * The attributes for a loading indicator.
6
+ *
7
+ * Without `label` the ring is only a shape, and screen readers announce
8
+ * nothing. With `label` it becomes a `role="status"` that says what is going
9
+ * on. If you already have a visible text next to it, let that carry the
10
+ * message and drop `label`, so the same thing is not announced twice.
11
+ *
12
+ * ```ts
13
+ * <span {...spinner({ label: "Loading applications" })} />
14
+ * ```
15
+ */
16
+ export const spinner = Object.assign(({ size = "medium", label } = {}) => attributes({
17
+ class: SPINNER_CLASS,
18
+ "data-size": size === "medium" ? undefined : size,
19
+ role: label ? "status" : undefined,
20
+ "aria-label": label,
21
+ }), {
22
+ sizes: spinnerSizes,
23
+ isSize: createGuard(spinnerSizes),
24
+ });
25
+ //# sourceMappingURL=spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../../src/components/css/spinner/spinner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEtD,MAAM,CAAC,MAAM,aAAa,GAAG,YAAqB,CAAA;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAA;AAmBjE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAClC,CAAC,EAAE,IAAI,GAAG,QAAQ,EAAE,KAAK,KAAqB,EAAE,EAAqB,EAAE,CACrE,UAAU,CAAC;IACT,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;IACjD,IAAI,EAAE,KAAK,CAAC,CAAC,CAAE,QAAkB,CAAC,CAAC,CAAC,SAAS;IAC7C,YAAY,EAAE,KAAK;CACpB,CAAC,EACJ;IACE,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC;CAClC,CACF,CAAA"}
@@ -0,0 +1,17 @@
1
+ export declare const SR_ONLY_CLASS: "lt-sr-only";
2
+ export type SrOnlyAttributes = {
3
+ class: typeof SR_ONLY_CLASS;
4
+ };
5
+ /**
6
+ * The attributes for text that only screen readers should get.
7
+ *
8
+ * ```ts
9
+ * <span {...srOnly()}>Opens in a new tab</span>
10
+ * ```
11
+ *
12
+ * Use it when a label or explanation is needed by someone listening to the
13
+ * page, but would be noise to someone looking at it. If the content should
14
+ * be gone for everyone, use `hidden` instead.
15
+ */
16
+ export declare const srOnly: () => SrOnlyAttributes;
17
+ //# sourceMappingURL=sr-only.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sr-only.d.ts","sourceRoot":"","sources":["../../../../src/components/css/sr-only/sr-only.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,EAAG,YAAqB,CAAA;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,QAAO,gBACY,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { attributes } from "../shared.js";
2
+ export const SR_ONLY_CLASS = "lt-sr-only";
3
+ /**
4
+ * The attributes for text that only screen readers should get.
5
+ *
6
+ * ```ts
7
+ * <span {...srOnly()}>Opens in a new tab</span>
8
+ * ```
9
+ *
10
+ * Use it when a label or explanation is needed by someone listening to the
11
+ * page, but would be noise to someone looking at it. If the content should
12
+ * be gone for everyone, use `hidden` instead.
13
+ */
14
+ export const srOnly = () => attributes({ class: SR_ONLY_CLASS });
15
+ //# sourceMappingURL=sr-only.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sr-only.js","sourceRoot":"","sources":["../../../../src/components/css/sr-only/sr-only.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,CAAC,MAAM,aAAa,GAAG,YAAqB,CAAA;AAMlD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAqB,EAAE,CAC3C,UAAU,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAA"}
@@ -0,0 +1,37 @@
1
+ export declare const SWITCH_CLASS: "lt-switch";
2
+ /** The row that holds the switch and the text next to each other. */
3
+ export declare const SWITCH_ROW_CLASS: "lt-switch-row";
4
+ export type SwitchOptions = {
5
+ /**
6
+ * The control is disabled. Do not use it to lock the switch while a save
7
+ * is in progress: `disabled` takes focus away from it, and focus does not
8
+ * come back.
9
+ */
10
+ disabled?: boolean;
11
+ };
12
+ export type SwitchAttributes = {
13
+ class: typeof SWITCH_CLASS;
14
+ type: "checkbox";
15
+ role: "switch";
16
+ disabled?: true;
17
+ };
18
+ /**
19
+ * The attributes for an on/off switch.
20
+ *
21
+ * The switch is a checkbox with `role="switch"`. Screen readers then
22
+ * announce it as "on" and "off" rather than "checked", while the keyboard
23
+ * and `FormData` work as for a plain checkbox.
24
+ *
25
+ * The switch has no validation state. A choice that is on or off cannot be
26
+ * invalid in itself; if turning it on is required, the requirement belongs
27
+ * in a checkbox with `required`.
28
+ *
29
+ * ```ts
30
+ * <input {...switchControl()} />
31
+ * ```
32
+ */
33
+ export declare const switchControl: (({ disabled }?: SwitchOptions) => SwitchAttributes) & {
34
+ /** The class on the row around the switch and the text. */
35
+ row: "lt-switch-row";
36
+ };
37
+ //# sourceMappingURL=switch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../src/components/css/switch/switch.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,EAAG,WAAoB,CAAA;AAChD,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,EAAG,eAAwB,CAAA;AAExD,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,OAAO,YAAY,CAAA;IAC1B,IAAI,EAAE,UAAU,CAAA;IAChB,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,CAAC,EAAE,IAAI,CAAA;CAChB,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,mBACT,aAAa,KAAQ,gBAAgB;IAQlD,2DAA2D;;CAG9D,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { attributes } from "../shared.js";
2
+ export const SWITCH_CLASS = "lt-switch";
3
+ /** The row that holds the switch and the text next to each other. */
4
+ export const SWITCH_ROW_CLASS = "lt-switch-row";
5
+ /**
6
+ * The attributes for an on/off switch.
7
+ *
8
+ * The switch is a checkbox with `role="switch"`. Screen readers then
9
+ * announce it as "on" and "off" rather than "checked", while the keyboard
10
+ * and `FormData` work as for a plain checkbox.
11
+ *
12
+ * The switch has no validation state. A choice that is on or off cannot be
13
+ * invalid in itself; if turning it on is required, the requirement belongs
14
+ * in a checkbox with `required`.
15
+ *
16
+ * ```ts
17
+ * <input {...switchControl()} />
18
+ * ```
19
+ */
20
+ export const switchControl = Object.assign(({ disabled } = {}) => attributes({
21
+ class: SWITCH_CLASS,
22
+ type: "checkbox",
23
+ role: "switch",
24
+ disabled: disabled ? true : undefined,
25
+ }), {
26
+ /** The class on the row around the switch and the text. */
27
+ row: SWITCH_ROW_CLASS,
28
+ });
29
+ //# sourceMappingURL=switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../../src/components/css/switch/switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,CAAC,MAAM,YAAY,GAAG,WAAoB,CAAA;AAChD,qEAAqE;AACrE,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAwB,CAAA;AAkBxD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CACxC,CAAC,EAAE,QAAQ,KAAoB,EAAE,EAAoB,EAAE,CACrD,UAAU,CAAC;IACT,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,UAAmB;IACzB,IAAI,EAAE,QAAiB;IACvB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAE,IAAc,CAAC,CAAC,CAAC,SAAS;CACjD,CAAC,EACJ;IACE,2DAA2D;IAC3D,GAAG,EAAE,gBAAgB;CACtB,CACF,CAAA"}
@@ -0,0 +1,76 @@
1
+ export declare const TABLE_CLASS: "lt-table";
2
+ /** The container that lets a wide table scroll sideways. */
3
+ export declare const TABLE_SCROLL_CLASS: "lt-table-scroll";
4
+ export declare const tableVariants: readonly ["default", "striped"];
5
+ export type TableVariant = (typeof tableVariants)[number];
6
+ export type NonDefaultTableVariant = Exclude<TableVariant, "default">;
7
+ export type TableOptions = {
8
+ /** Every other row on a muted surface. Default: `default`. */
9
+ variant?: TableVariant;
10
+ /** Highlights the row under the mouse. Use only when rows can be pressed. */
11
+ hoverable?: boolean;
12
+ };
13
+ export type TableAttributes = {
14
+ class: typeof TABLE_CLASS;
15
+ "data-variant"?: NonDefaultTableVariant;
16
+ "data-hoverable"?: "";
17
+ };
18
+ /**
19
+ * The attributes for a table.
20
+ *
21
+ * The class goes on a real `<table>` with `<thead>` and `<th>`. The header
22
+ * cells are what let screen readers say "Amount, 1,240 kroner" when the user
23
+ * is in a cell. Build the table from `<div>` elements, and that connection
24
+ * does not exist.
25
+ *
26
+ * ```ts
27
+ * <table {...table({ variant: "striped" })}>…</table>
28
+ * ```
29
+ */
30
+ export declare const table: (({ variant, hoverable }?: TableOptions) => TableAttributes) & {
31
+ /** The class on the container around a wide table. */
32
+ scroll: "lt-table-scroll";
33
+ variants: readonly ["default", "striped"];
34
+ isVariant: (value: string) => value is "default" | "striped";
35
+ };
36
+ /** The class on the button in a sortable column header. */
37
+ export declare const TABLE_SORT_CLASS: "lt-table__sort";
38
+ export declare const tableSortDirections: readonly ["ascending", "descending"];
39
+ export type TableSortDirection = (typeof tableSortDirections)[number];
40
+ export type TableSortOptions = {
41
+ /**
42
+ * The direction the column is sorted in. Left out, it means the table is
43
+ * not sorted by this column, and the header gets no `aria-sort`.
44
+ */
45
+ direction?: TableSortDirection;
46
+ };
47
+ export type TableSortAttributes = {
48
+ header: {
49
+ "aria-sort"?: TableSortDirection;
50
+ };
51
+ button: {
52
+ class: typeof TABLE_SORT_CLASS;
53
+ type: "button";
54
+ };
55
+ };
56
+ /**
57
+ * The attributes for a sortable column header.
58
+ *
59
+ * `aria-sort` is on the `<th>`, not on the button, because the cell is what
60
+ * describes the column. Only the sorted column has the attribute. The arrow
61
+ * is drawn from the same attribute, so what the screen reader says and what
62
+ * is shown cannot drift apart. The sorting itself is the app's job.
63
+ *
64
+ * ```ts
65
+ * const date = lt.tableSort({ direction: "descending" })
66
+ * ```
67
+ * ```html
68
+ * <th scope="col" {...date.header}>
69
+ * <button {...date.button}>Date</button>
70
+ * </th>
71
+ * ```
72
+ */
73
+ export declare const tableSort: (({ direction }?: TableSortOptions) => TableSortAttributes) & {
74
+ isDirection: (value: string) => value is "ascending" | "descending";
75
+ };
76
+ //# sourceMappingURL=table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/components/css/table/table.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,EAAG,UAAmB,CAAA;AAC9C,4DAA4D;AAC5D,eAAO,MAAM,kBAAkB,EAAG,iBAA0B,CAAA;AAE5D,eAAO,MAAM,aAAa,iCAAkC,CAAA;AAE5D,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AACzD,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;AAErE,MAAM,MAAM,YAAY,GAAG;IACzB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,OAAO,WAAW,CAAA;IACzB,cAAc,CAAC,EAAE,sBAAsB,CAAA;IACvC,gBAAgB,CAAC,EAAE,EAAE,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,KAAK,6BACqB,YAAY,KAAQ,eAAe;IAOtE,sDAAsD;;;;CAKzD,CAAA;AAED,2DAA2D;AAC3D,eAAO,MAAM,gBAAgB,EAAG,gBAAyB,CAAA;AAEzD,eAAO,MAAM,mBAAmB,sCAAuC,CAAA;AAEvE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAErE,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE;QACN,WAAW,CAAC,EAAE,kBAAkB,CAAA;KACjC,CAAA;IACD,MAAM,EAAE;QACN,KAAK,EAAE,OAAO,gBAAgB,CAAA;QAC9B,IAAI,EAAE,QAAQ,CAAA;KACf,CAAA;CACF,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS,oBACJ,gBAAgB,KAAQ,mBAAmB;;CAY5D,CAAA"}
@@ -0,0 +1,59 @@
1
+ import { attributes, createGuard } from "../shared.js";
2
+ export const TABLE_CLASS = "lt-table";
3
+ /** The container that lets a wide table scroll sideways. */
4
+ export const TABLE_SCROLL_CLASS = "lt-table-scroll";
5
+ export const tableVariants = ["default", "striped"];
6
+ /**
7
+ * The attributes for a table.
8
+ *
9
+ * The class goes on a real `<table>` with `<thead>` and `<th>`. The header
10
+ * cells are what let screen readers say "Amount, 1,240 kroner" when the user
11
+ * is in a cell. Build the table from `<div>` elements, and that connection
12
+ * does not exist.
13
+ *
14
+ * ```ts
15
+ * <table {...table({ variant: "striped" })}>…</table>
16
+ * ```
17
+ */
18
+ export const table = Object.assign(({ variant = "default", hoverable } = {}) => attributes({
19
+ class: TABLE_CLASS,
20
+ "data-variant": variant === "default" ? undefined : variant,
21
+ "data-hoverable": hoverable ? "" : undefined,
22
+ }), {
23
+ /** The class on the container around a wide table. */
24
+ scroll: TABLE_SCROLL_CLASS,
25
+ variants: tableVariants,
26
+ isVariant: createGuard(tableVariants),
27
+ });
28
+ /** The class on the button in a sortable column header. */
29
+ export const TABLE_SORT_CLASS = "lt-table__sort";
30
+ export const tableSortDirections = ["ascending", "descending"];
31
+ /**
32
+ * The attributes for a sortable column header.
33
+ *
34
+ * `aria-sort` is on the `<th>`, not on the button, because the cell is what
35
+ * describes the column. Only the sorted column has the attribute. The arrow
36
+ * is drawn from the same attribute, so what the screen reader says and what
37
+ * is shown cannot drift apart. The sorting itself is the app's job.
38
+ *
39
+ * ```ts
40
+ * const date = lt.tableSort({ direction: "descending" })
41
+ * ```
42
+ * ```html
43
+ * <th scope="col" {...date.header}>
44
+ * <button {...date.button}>Date</button>
45
+ * </th>
46
+ * ```
47
+ */
48
+ export const tableSort = Object.assign(({ direction } = {}) => ({
49
+ header: attributes({ "aria-sort": direction }),
50
+ button: attributes({ class: TABLE_SORT_CLASS, type: "button" }),
51
+ }), {
52
+ // The list sits next to it, as `tableSortDirections`, and not on the
53
+ // function. The guard for the lists requires the attribute and the class
54
+ // to be on the same element, and here `aria-sort` is on the cell and the
55
+ // class on the button. The table test requires each direction to give its
56
+ // own arrow.
57
+ isDirection: createGuard(tableSortDirections),
58
+ });
59
+ //# sourceMappingURL=table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.js","sourceRoot":"","sources":["../../../../src/components/css/table/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEtD,MAAM,CAAC,MAAM,WAAW,GAAG,UAAmB,CAAA;AAC9C,4DAA4D;AAC5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAA0B,CAAA;AAE5D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,SAAS,CAAU,CAAA;AAkB5D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAChC,CAAC,EAAE,OAAO,GAAG,SAAS,EAAE,SAAS,KAAmB,EAAE,EAAmB,EAAE,CACzE,UAAU,CAAC;IACT,KAAK,EAAE,WAAW;IAClB,cAAc,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;IAC3D,gBAAgB,EAAE,SAAS,CAAC,CAAC,CAAE,EAAY,CAAC,CAAC,CAAC,SAAS;CACxD,CAAC,EACJ;IACE,sDAAsD;IACtD,MAAM,EAAE,kBAAkB;IAC1B,QAAQ,EAAE,aAAa;IACvB,SAAS,EAAE,WAAW,CAAC,aAAa,CAAC;CACtC,CACF,CAAA;AAED,2DAA2D;AAC3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAyB,CAAA;AAEzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,WAAW,EAAE,YAAY,CAAU,CAAA;AAsBvE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CACpC,CAAC,EAAE,SAAS,KAAuB,EAAE,EAAuB,EAAE,CAAC,CAAC;IAC9D,MAAM,EAAE,UAAU,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;IAC9C,MAAM,EAAE,UAAU,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAiB,EAAE,CAAC;CACzE,CAAC,EACF;IACE,qEAAqE;IACrE,yEAAyE;IACzE,yEAAyE;IACzE,0EAA0E;IAC1E,aAAa;IACb,WAAW,EAAE,WAAW,CAAC,mBAAmB,CAAC;CAC9C,CACF,CAAA"}
@@ -0,0 +1,35 @@
1
+ export declare const TAG_CLASS: "lt-tag";
2
+ export declare const tagVariants: readonly ["outline", "filled"];
3
+ export type TagVariant = (typeof tagVariants)[number];
4
+ export type NonDefaultTagVariant = Exclude<TagVariant, "outline">;
5
+ export type TagOptions = {
6
+ /** Outline or muted surface. Default: `outline`. */
7
+ variant?: TagVariant;
8
+ /** The tag can be toggled on and off. Use only on a `<button>`. */
9
+ selectable?: boolean;
10
+ };
11
+ export type TagAttributes = {
12
+ class: typeof TAG_CLASS;
13
+ "data-variant"?: NonDefaultTagVariant;
14
+ "data-selectable"?: "";
15
+ };
16
+ /**
17
+ * The attributes for a tag.
18
+ *
19
+ * A tag labels content: keywords on an article, selected filters above a
20
+ * list. If it says what state something is in, [Badge](../badge/badge.js)
21
+ * is right instead.
22
+ *
23
+ * `selectable` gives hover and a focus ring, but makes nothing pressable.
24
+ * The element must be a `<button>`, and you set `aria-pressed` yourself,
25
+ * since only you know whether the tag is selected.
26
+ *
27
+ * ```ts
28
+ * <button {...tag({ selectable: true })} aria-pressed="true">Housing benefit</button>
29
+ * ```
30
+ */
31
+ export declare const tag: (({ variant, selectable }?: TagOptions) => TagAttributes) & {
32
+ variants: readonly ["outline", "filled"];
33
+ isVariant: (value: string) => value is "outline" | "filled";
34
+ };
35
+ //# sourceMappingURL=tag.d.ts.map