@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,580 @@
1
+ import { ERROR_TEXT_CLASS } from "../../css/error-text/error-text.js";
2
+ import { HELP_TEXT_CLASS } from "../../css/help-text/help-text.js";
3
+ import { addClass, defineElement, HostElement, setAttr, setFlag, uniqueId, warnAboutMarkup, } from "../../host-element.js";
4
+ import { computeFieldAttributes } from "./field-core.js";
5
+ export const LT_FIELD_TAG = "lt-field";
6
+ /**
7
+ * The parts the field looks for, as selectors relative to the element. The
8
+ * component finds its parts with these, and the manifest describes them for
9
+ * whoever assembles the markup by hand, so the two cannot say different
10
+ * things.
11
+ */
12
+ export const LT_FIELD_PARTS = {
13
+ label: "label",
14
+ control: "input:not([type='hidden']), textarea, select",
15
+ help: `.${HELP_TEXT_CLASS}`,
16
+ error: `.${ERROR_TEXT_CLASS}`,
17
+ };
18
+ const CONTROL_SELECTOR = LT_FIELD_PARTS.control;
19
+ function readMarker(value) {
20
+ return value === "none" || value === "symbol" || value === "text"
21
+ ? value
22
+ : undefined;
23
+ }
24
+ /**
25
+ * The attributes `<lt-field>` observes. It computes most of them itself, and
26
+ * sets them back if they disappear. `id` on the control, and `hidden` and
27
+ * `style` on the error text, it only reads: they come from the template.
28
+ *
29
+ * The same list once lived in `FIELD_PRESERVED_ATTRIBUTES`, which the
30
+ * template had to copy into `data-preserve-attr`. That list no longer
31
+ * exists: the component sees that the attributes are gone and sets them
32
+ * back.
33
+ */
34
+ const DERIVED_ATTRIBUTES = [
35
+ "class",
36
+ "for",
37
+ "id",
38
+ "aria-describedby",
39
+ "aria-invalid",
40
+ "aria-disabled",
41
+ "data-state",
42
+ "data-required",
43
+ "data-optional",
44
+ "disabled",
45
+ "hidden",
46
+ // `data-show` in Datastar hides the error text with `display: none`.
47
+ "style",
48
+ ];
49
+ function readControlWord(control) {
50
+ return {
51
+ invalid: control.getAttribute("aria-invalid"),
52
+ describedBy: control.getAttribute("aria-describedby"),
53
+ disabled: control.hasAttribute("disabled"),
54
+ };
55
+ }
56
+ /**
57
+ * Connects label, control, help text and error text in plain DOM.
58
+ *
59
+ * The component is for markup produced without JavaScript: a Go template, a
60
+ * PHP file, a Razor view or handwritten HTML. When the markup is written with
61
+ * JavaScript, wherever the code runs, `lt.field()` should write the
62
+ * attributes instead, and this element is not needed.
63
+ *
64
+ * The component renders nothing. It used to insert a `<slot>` element into
65
+ * plain DOM, and since the server did not know about it, Datastar's morph
66
+ * removed it on every patch.
67
+ *
68
+ * The template writes what HTML requires for the field to work without
69
+ * JavaScript: `for` on the label and `id` on the control, or the label
70
+ * wrapping the control. The component writes the rest: the ids of the help
71
+ * text and the error text, `aria-describedby`, `aria-invalid` and the
72
+ * classes. If a morph removes them, the component sees it and sets them back.
73
+ *
74
+ * The component never writes an id on the control. Datastar and idiomorph
75
+ * recognise a node by its id, and a control with an id the server did not
76
+ * send is replaced on the next update, along with focus and what the user
77
+ * has typed.
78
+ *
79
+ * The field is invalid when the error text is visible, that is when it has
80
+ * no `hidden`, or when the server has written `aria-invalid` on the control.
81
+ * There is no separate state on the host: a template renders the error text
82
+ * when the field is invalid, and client code toggles `hidden`.
83
+ */
84
+ export class LtField extends HostElement {
85
+ constructor() {
86
+ super(...arguments);
87
+ this.managedIds = new Set();
88
+ /**
89
+ * What the component wrote on each control, keyed on the control itself.
90
+ *
91
+ * A `WeakMap` and not a "previous control" property. The memory has to
92
+ * survive the host being disconnected and connected again, as when React
93
+ * moves a field, and the control disappearing and coming back in a patch.
94
+ * A property that was reset in `disconnectedCallback` made the component
95
+ * read its own `aria-invalid="true"` as the server's word after a move, and
96
+ * the field could never become valid again. A `WeakMap` also keeps no
97
+ * detached node alive: when the control is gone for good, so is the memory.
98
+ */
99
+ this.memory = new WeakMap();
100
+ this.labelMemory = new WeakMap();
101
+ /** The `for` the component itself wrote on the label. */
102
+ this.forByMe = new WeakMap();
103
+ /**
104
+ * Labels where the server wrote a `for` pointing to a different id than
105
+ * the control's. The component rewrites it, but without JavaScript the
106
+ * field had no label, so it must be reported, once. The memory is not
107
+ * reset: after the rewrite the right value is there, and it cannot be told
108
+ * apart from a server that corrected itself.
109
+ */
110
+ this.wrongFor = new WeakSet();
111
+ /** The controls where `data-state` was written by the component. */
112
+ this.stateByMe = new WeakSet();
113
+ }
114
+ /**
115
+ * The properties mirror the attributes.
116
+ *
117
+ * The state lives in the attribute and not in a field on the class, so what
118
+ * the server sent and what the component thinks are always the same.
119
+ */
120
+ get disabled() {
121
+ return this.hasAttribute("disabled");
122
+ }
123
+ set disabled(value) {
124
+ setFlag(this, "disabled", value);
125
+ }
126
+ get optional() {
127
+ return this.hasAttribute("optional");
128
+ }
129
+ set optional(value) {
130
+ setFlag(this, "optional", value);
131
+ }
132
+ get describedBy() {
133
+ return this.getAttribute("described-by") ?? undefined;
134
+ }
135
+ set describedBy(value) {
136
+ setAttr(this, "described-by", value ?? null);
137
+ }
138
+ connectedCallback() {
139
+ /*
140
+ * `slotchange` does not fire in plain DOM, and the content is replaced
141
+ * while the user fills in the form.
142
+ *
143
+ * The attributes are observed, not just the children. A morph removes
144
+ * whatever is not in the server's HTML, and the wiring between label,
145
+ * field and help text is exactly that: something the component computed,
146
+ * not something the server sent. The template used to have to list the
147
+ * attributes in `data-preserve-attr` for them to survive. Now the
148
+ * component sees that they are gone, and sets them back.
149
+ *
150
+ * The list is limited to what the component derives itself. The other
151
+ * components do the same with their state, each with its own list.
152
+ *
153
+ * Every write in `sync()` compares first. Without that the observer
154
+ * would trigger itself forever.
155
+ */
156
+ this.observer = new MutationObserver((records) => {
157
+ // `style` is observed for `display: none` on the error text. A style
158
+ // write elsewhere in the field, such as a popover positioning its
159
+ // panel, does not concern the wiring.
160
+ const onlyForeignStyle = records.every((r) => r.type === "attributes" &&
161
+ r.attributeName === "style" &&
162
+ !r.target.matches?.(LT_FIELD_PARTS.error));
163
+ if (!onlyForeignStyle)
164
+ this.sync();
165
+ });
166
+ this.observer.observe(this, {
167
+ childList: true,
168
+ subtree: true,
169
+ attributes: true,
170
+ attributeFilter: DERIVED_ATTRIBUTES,
171
+ // A morph can change the text of the error text without replacing the node.
172
+ characterData: true,
173
+ });
174
+ this.sync();
175
+ }
176
+ disconnectedCallback() {
177
+ this.observer?.disconnect();
178
+ this.observer = undefined;
179
+ }
180
+ attributeChangedCallback() {
181
+ if (this.isConnected)
182
+ this.sync();
183
+ }
184
+ /**
185
+ * The label the field belongs with.
186
+ *
187
+ * Usually it is inside the element. If it is outside, with `for` pointing
188
+ * to the control, the field is just as well named, and the component
189
+ * connects it the same way. One difference is worth knowing: a label
190
+ * outside is not in what the component observes, so if a patch removes its
191
+ * class, the class does not come back by itself.
192
+ */
193
+ /**
194
+ * Remembers whether the server wrote a `for` that was not the control's
195
+ * id. What the component itself wrote last does not count.
196
+ */
197
+ noteFor(label, id) {
198
+ const current = label.getAttribute("for");
199
+ if (current === null || current === id)
200
+ return;
201
+ if (current !== this.forByMe.get(label))
202
+ this.wrongFor.add(label);
203
+ }
204
+ resolveLabel(control) {
205
+ const inside = this.ownPart(LT_FIELD_PARTS.label);
206
+ if (inside || !control?.id)
207
+ return inside;
208
+ const root = this.getRootNode();
209
+ return (root.querySelector?.(`label[for="${CSS.escape(control.id)}"]`) ?? null);
210
+ }
211
+ /**
212
+ * The server's word about the control, derived from what is there now
213
+ * compared with what the component itself wrote last.
214
+ *
215
+ * A control the component has never written on holds only the server's
216
+ * word. Otherwise each attribute is the server's if it differs from what
217
+ * the component wrote, and unchanged if it is the same.
218
+ */
219
+ serverLabelWord(label) {
220
+ if (!label)
221
+ return { required: null, optional: false };
222
+ const now = {
223
+ required: label.getAttribute("data-required"),
224
+ optional: label.hasAttribute("data-optional"),
225
+ };
226
+ const known = this.labelMemory.get(label);
227
+ if (!known)
228
+ return now;
229
+ return {
230
+ required: now.required !== known.written.required
231
+ ? now.required
232
+ : known.server.required,
233
+ optional: now.optional !== known.written.optional
234
+ ? now.optional
235
+ : known.server.optional,
236
+ };
237
+ }
238
+ serverWord(control, now) {
239
+ const known = this.memory.get(control);
240
+ if (!known)
241
+ return now;
242
+ return {
243
+ invalid: now.invalid !== known.written.invalid
244
+ ? now.invalid
245
+ : known.server.invalid,
246
+ describedBy: now.describedBy !== known.written.describedBy
247
+ ? now.describedBy
248
+ : known.server.describedBy,
249
+ disabled: now.disabled !== known.written.disabled
250
+ ? now.disabled
251
+ : known.server.disabled,
252
+ };
253
+ }
254
+ /**
255
+ * The parts that belong to this field, and not to a field further down.
256
+ *
257
+ * A field can be inside another: a search field in a popover inside the
258
+ * field, or an `<lt-field>` in an `<lt-field>`. `querySelector` over the
259
+ * whole subtree then found the innermost field's control first, and the
260
+ * outer field wrote its wiring on it. The scoping is the same as the one
261
+ * `derivedParts()` in `host-element.ts` uses for the other components.
262
+ */
263
+ ownParts(selector) {
264
+ return [...this.querySelectorAll(selector)].filter((part) => part.closest(this.localName) === this);
265
+ }
266
+ ownPart(selector) {
267
+ return this.ownParts(selector)[0] ?? null;
268
+ }
269
+ /**
270
+ * Reports when an update replaced the control because the id from the
271
+ * server changed.
272
+ *
273
+ * The message only comes when the user had something to lose: the old
274
+ * control has left the tree, both had an id from the server, the ids
275
+ * differ, and the old one contained something other than the new one. A
276
+ * server that sends a different field on purpose usually also has a
277
+ * different label or a different `name`; then it stays silent. The
278
+ * comparison is with the new control, not with the old one's
279
+ * `defaultValue`: a `<select>` always has a selected option without any
280
+ * being `defaultSelected`, and a server that sends back the text the user
281
+ * typed has lost nothing.
282
+ */
283
+ warnAboutReplacedControl(lost, control) {
284
+ if (lost.isConnected || !lost.id || !control.id || lost.id === control.id)
285
+ return;
286
+ if (lost.getAttribute("name") !== control.getAttribute("name"))
287
+ return;
288
+ if (!this.differs(lost, control))
289
+ return;
290
+ warnAboutMarkup(this, "a server update replaced the control and lost what the user " +
291
+ "had typed in it, because the control's id was different from " +
292
+ "last time and the update did not recognise it. Build the id " +
293
+ "from something that is the same every time, such as the field " +
294
+ "name or a key in the data, not from a random number or a " +
295
+ "counter.",
296
+ // The replacement has happened and cannot undo itself, unless a new
297
+ // update has already replaced the control again.
298
+ () => !lost.isConnected &&
299
+ this.ownPart(CONTROL_SELECTOR) === control);
300
+ }
301
+ /**
302
+ * Did the old control contain something other than the new one?
303
+ *
304
+ * A checkbox and a radio button have the same `value` either way, so there
305
+ * the checked state is what counts. A `<select>` is compared on the
306
+ * selected options, since `value` is only the first of them.
307
+ */
308
+ differs(lost, control) {
309
+ if (lost instanceof HTMLSelectElement &&
310
+ control instanceof HTMLSelectElement) {
311
+ const chosen = (select) => [...select.selectedOptions].map((o) => o.value).join("\n");
312
+ return chosen(lost) !== chosen(control);
313
+ }
314
+ if (lost instanceof HTMLInputElement &&
315
+ control instanceof HTMLInputElement &&
316
+ (lost.type === "checkbox" || lost.type === "radio")) {
317
+ return lost.checked !== control.checked;
318
+ }
319
+ return (lost.value !== control.value);
320
+ }
321
+ sync() {
322
+ const control = this.ownPart(CONTROL_SELECTOR);
323
+ const help = this.ownPart(LT_FIELD_PARTS.help);
324
+ const error = this.ownPart(LT_FIELD_PARTS.error);
325
+ if (!control) {
326
+ warnAboutMarkup(this, "found no control to connect. Add an <input>, <textarea> or " +
327
+ "<select>, or the label, help text and error text have no field " +
328
+ "to be connected to.",
329
+ // An empty element is a region the server has not filled yet, and
330
+ // that is not an error in the markup.
331
+ () => this.childElementCount > 0 &&
332
+ this.ownParts(CONTROL_SELECTOR).length === 0);
333
+ return;
334
+ }
335
+ // The wiring applies to one control, and that is the first. Another
336
+ // control in the same field has no label, help text or error text, and
337
+ // that must be reported rather than left silently unconnected.
338
+ warnAboutMarkup(this, "has more than one control, and only the first gets the label, " +
339
+ "help text and error text connected to it. Give each control " +
340
+ "its own <lt-field>, or put a group in a <fieldset> with a " +
341
+ "<legend>.", () => this.ownParts(CONTROL_SELECTOR).length > 1);
342
+ // The label can be outside the element. The lookup has to happen after
343
+ // the control is found, since it goes through the control's id.
344
+ const label = this.resolveLabel(control);
345
+ warnAboutMarkup(this, "<label> is not connected to the field: the field has no id, " +
346
+ "and the label does not wrap it, so without JavaScript a screen " +
347
+ "reader announces the field without a name. Write an id on the " +
348
+ "field and the same value in for on the label, or wrap the " +
349
+ "field in the <label>; the component does not write the id " +
350
+ "itself, because an id the server did not send makes a server " +
351
+ "update replace the field.", () => {
352
+ const now = this.ownPart(CONTROL_SELECTOR);
353
+ const labelNow = this.resolveLabel(now);
354
+ return (now !== null &&
355
+ labelNow !== null &&
356
+ !now.id &&
357
+ !labelNow.contains(now) &&
358
+ !now.hasAttribute("aria-label") &&
359
+ !now.hasAttribute("aria-labelledby"));
360
+ });
361
+ // `for` wins over the label wrapping the field. If it points to another
362
+ // id, the field has no label, with JavaScript too.
363
+ warnAboutMarkup(this, "<label> wraps the field, but its for points to a different id " +
364
+ "than the field's, and for wins, so a screen reader announces " +
365
+ "the field without a name. Remove for, or give the field the " +
366
+ "same id.", () => {
367
+ const now = this.ownPart(CONTROL_SELECTOR);
368
+ const labelNow = this.ownPart(LT_FIELD_PARTS.label);
369
+ if (!now || !labelNow?.contains(now))
370
+ return false;
371
+ const target = labelNow.getAttribute("for");
372
+ return target !== null && target !== now.id;
373
+ });
374
+ warnAboutMarkup(this, "for on the label pointed to a different id than the field's. " +
375
+ "The component rewrote it, but without JavaScript the field has " +
376
+ "no label and a screen reader announces it without a name, so " +
377
+ "write the field's id in for in the template.", () => {
378
+ const now = this.ownPart(CONTROL_SELECTOR);
379
+ const labelNow = this.resolveLabel(now);
380
+ return now !== null && labelNow !== null && this.wrongFor.has(labelNow);
381
+ });
382
+ warnAboutMarkup(this, "found no <label>, so the field has no label and a screen " +
383
+ "reader announces it without a name. If the label is outside " +
384
+ "<lt-field>, its for must point to the field's id.",
385
+ /*
386
+ * Three valid ways to give the field a name, and none of them should
387
+ * give a warning: a `<label>` inside, a `<label for>` outside, or
388
+ * `aria-label` and `aria-labelledby` on the control, as in a search
389
+ * field with only an icon.
390
+ */
391
+ () => {
392
+ const named = this.ownPart(CONTROL_SELECTOR);
393
+ if (!named || this.resolveLabel(named))
394
+ return false;
395
+ // A <label> around the whole <lt-field> also gives the control a name.
396
+ if ((named.labels?.length ?? 0) > 0)
397
+ return false;
398
+ return (!named.hasAttribute("aria-label") &&
399
+ !named.hasAttribute("aria-labelledby"));
400
+ });
401
+ /*
402
+ * The ids the help text and the error text last had, remembered between
403
+ * rounds.
404
+ *
405
+ * The markup is the source as long as it has them. If a morph removes
406
+ * them, a new id would be created for every single patch, and a screen
407
+ * reader in the middle of announcing would follow a reference that
408
+ * changed under it. The memory is not a parallel copy of the state: if
409
+ * the id is in the markup, that is the one that applies.
410
+ */
411
+ if (help) {
412
+ if (help.id)
413
+ this.lastHelpId = help.id;
414
+ else {
415
+ this.lastHelpId ??= uniqueId("lt-field-help");
416
+ setAttr(help, "id", this.lastHelpId);
417
+ }
418
+ this.managedIds.add(help.id);
419
+ }
420
+ if (error) {
421
+ if (error.id)
422
+ this.lastErrorId = error.id;
423
+ else {
424
+ this.lastErrorId ??= uniqueId("lt-field-error");
425
+ setAttr(error, "id", this.lastErrorId);
426
+ }
427
+ this.managedIds.add(error.id);
428
+ }
429
+ // The markers are also read from the markup. If the server wrote them
430
+ // with `lt.field()`, they are on the label, and a component that only
431
+ // looked at its own attributes would remove them again. In React that
432
+ // gave a hydration error: the server sent `data-required="symbol"`, the
433
+ // component removed it, and then React decided the HTML did not match.
434
+ const serverLabel = this.serverLabelWord(label);
435
+ const marker = readMarker(serverLabel.required);
436
+ // The state is read from the markup, not just from an attribute on the
437
+ // host. If the server wrote the field with `lt.field()`, the answer is
438
+ // already on the control, and a component that computed its own would
439
+ // remove it again. The two halves of the API then fought each other. See
440
+ // `ControlMemory` for how the server's word is told apart from what the
441
+ // component wrote.
442
+ const server = this.serverWord(control, readControlWord(control));
443
+ // `aria-invalid` has four valid values, and both `grammar` and
444
+ // `spelling` mean invalid. Absence, `false` and the empty string mean
445
+ // valid; ARIA says the empty string is read as `false`, and assistive
446
+ // technology does so, so the component cannot show a red border for it.
447
+ const serverInvalid = server.invalid !== null &&
448
+ server.invalid !== "false" &&
449
+ server.invalid !== "";
450
+ // A visible error text means the field is invalid. It is not the
451
+ // component's to hide: the template renders it when the field is
452
+ // invalid, and client code toggles `hidden`, or `display: none` as
453
+ // `data-show` in Datastar does. An empty error text says nothing, such as
454
+ // a container that `data-text` fills.
455
+ const errorShown = error !== null &&
456
+ !error.hasAttribute("hidden") &&
457
+ (error.textContent ?? "").trim() !== "" &&
458
+ // Last, since it forces a style computation.
459
+ getComputedStyle(error).display !== "none";
460
+ const invalid = serverInvalid || errorShown;
461
+ const disabled = this.hasAttribute("disabled") || server.disabled;
462
+ /*
463
+ * The ids the server put in `aria-describedby`, apart from those the
464
+ * component manages. `lt.field({ describedBy })` writes them straight on
465
+ * the control, and they must be kept. The managed ones are removed here
466
+ * and added again from the current state, or the error text's id stayed
467
+ * after the error was gone.
468
+ *
469
+ * Managed means the current help text and error text, and an id the
470
+ * component managed before that no longer points to anything. The latter
471
+ * is for a script that removes the help text without touching the
472
+ * control. Who an id belongs to is decided by the DOM and not by the
473
+ * history alone: if the id still points to an element, as when the
474
+ * server moves the help text out of the field and keeps the id, it is the
475
+ * server's.
476
+ */
477
+ const root = this.getRootNode();
478
+ const managedNow = (id) => id === help?.id ||
479
+ id === error?.id ||
480
+ (this.managedIds.has(id) && !root.getElementById?.(id));
481
+ const serverExtras = (server.describedBy ?? "")
482
+ .split(/\s+/)
483
+ .filter((id) => id && !managedNow(id));
484
+ const computed = computeFieldAttributes({
485
+ // `computeFieldAttributes` requires an id. The control's id is used
486
+ // when it exists; otherwise a stem that is never written, since the
487
+ // component writes neither an id on the control nor `for` from it.
488
+ id: control.id || "lt-field",
489
+ help: Boolean(help),
490
+ // Only a visible error text describes the field. If the server says
491
+ // invalid while the message is hidden, the reference must not point to
492
+ // something hidden.
493
+ error: errorShown,
494
+ helpId: help?.id,
495
+ errorId: error?.id,
496
+ required: marker === "symbol" || marker === "text" ? marker : undefined,
497
+ optional: this.hasAttribute("optional") || serverLabel.optional,
498
+ invalid,
499
+ disabled,
500
+ describedBy: [...serverExtras, this.getAttribute("described-by") ?? ""],
501
+ });
502
+ if (this.lastControl && this.lastControl !== control) {
503
+ this.warnAboutReplacedControl(this.lastControl, control);
504
+ }
505
+ this.lastControl = control;
506
+ if (label) {
507
+ addClass(label, computed.label.class);
508
+ // `for` and `id` are the same piece of information, and the two must
509
+ // not say different things. It is written from the control's id, never
510
+ // the other way round, and not when the label wraps the control, where
511
+ // the wiring is implicit.
512
+ if (control.id && !label.contains(control)) {
513
+ this.noteFor(label, control.id);
514
+ setAttr(label, "for", control.id);
515
+ this.forByMe.set(label, control.id);
516
+ }
517
+ setAttr(label, "data-required", computed.label["data-required"]);
518
+ setAttr(label, "data-optional", computed.label["data-optional"]);
519
+ this.labelMemory.set(label, {
520
+ written: {
521
+ required: computed.label["data-required"] ?? null,
522
+ optional: computed.label["data-optional"] !== undefined,
523
+ },
524
+ server: serverLabel,
525
+ });
526
+ setAttr(label, "aria-disabled", computed.label["aria-disabled"]);
527
+ }
528
+ // The server's word stays verbatim when it is the server that says the
529
+ // field is invalid, `spelling` and `grammar` included. Otherwise the
530
+ // component writes `true` when the host says so, and leaves a `false`
531
+ // the server wrote: it is valid and common in handwritten HTML, and used
532
+ // to be removed on every patch.
533
+ const ariaInvalid = serverInvalid
534
+ ? server.invalid
535
+ : invalid
536
+ ? "true"
537
+ : server.invalid;
538
+ setAttr(control, "aria-describedby", computed.control["aria-describedby"]);
539
+ setAttr(control, "aria-invalid", ariaInvalid);
540
+ // `setFlag` and not `setAttr`: a template may have written
541
+ // `disabled="disabled"`, and it must stay as it is. `setAttr` would
542
+ // normalise the value to the empty string, and since `disabled` is among
543
+ // the attributes the component observes, the server and the component
544
+ // would each write their own value on every patch. No `aria-disabled`
545
+ // alongside it: a real `disabled` is already visible to assistive
546
+ // technology, and `computeFieldAttributes` only writes it on the label.
547
+ setFlag(control, "disabled", disabled);
548
+ this.memory.set(control, {
549
+ written: {
550
+ invalid: ariaInvalid,
551
+ describedBy: computed.control["aria-describedby"] ?? null,
552
+ disabled,
553
+ },
554
+ server,
555
+ });
556
+ // `data-state` is only set on the system's controls, and only when the
557
+ // consumer has not set it. It is only removed when the component set it
558
+ // and the field is no longer invalid. A `data-state` a template wrote by
559
+ // hand stays as the template wrote it.
560
+ const isSystemField = control.classList.contains("lt-input") ||
561
+ control.classList.contains("lt-textarea") ||
562
+ control.classList.contains("lt-select");
563
+ const state = computed.control["data-state"];
564
+ if (state && isSystemField && !control.hasAttribute("data-state")) {
565
+ setAttr(control, "data-state", state);
566
+ this.stateByMe.add(control);
567
+ }
568
+ else if (!state &&
569
+ this.stateByMe.has(control) &&
570
+ control.getAttribute("data-state") === "invalid") {
571
+ control.removeAttribute("data-state");
572
+ this.stateByMe.delete(control);
573
+ }
574
+ }
575
+ }
576
+ LtField.observedAttributes = ["disabled", "optional", "described-by"];
577
+ export function defineLtField(tagName = LT_FIELD_TAG) {
578
+ defineElement(tagName, LtField);
579
+ }
580
+ //# sourceMappingURL=lt-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lt-field.js","sourceRoot":"","sources":["../../../../src/components/frame/field/lt-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,OAAO,EACP,OAAO,EACP,QAAQ,EACR,eAAe,GAChB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAExD,MAAM,CAAC,MAAM,YAAY,GAAG,UAAmB,CAAA;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,KAAK,EAAE,OAAO;IACd,OA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