@lion/ui 0.2.1 → 0.3.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 (272) hide show
  1. package/README.md +23 -72
  2. package/components/button/src/LionButton.js +1 -1
  3. package/components/core/src/SlotMixin.js +3 -2
  4. package/components/core/test/SlotMixin.test.js +1 -1
  5. package/components/core/types/SlotMixinTypes.ts +4 -1
  6. package/components/dialog/test/lion-dialog.test.js +56 -0
  7. package/components/form-core/src/FocusMixin.js +33 -2
  8. package/components/form-core/src/LionField.js +3 -1
  9. package/components/form-core/src/validate/LionValidationFeedback.js +2 -5
  10. package/components/form-core/src/validate/ResultValidator.js +1 -1
  11. package/components/form-core/test/FocusMixin.test.js +33 -0
  12. package/components/form-core/types/validate/ValidateMixinTypes.ts +2 -2
  13. package/components/form-integrations/test/dialog-integrations.test.js +19 -0
  14. package/components/form-integrations/test/form-group-methods.test.js +11 -37
  15. package/components/form-integrations/test/form-integrations.test.js +4 -0
  16. package/components/form-integrations/test/helpers/umbrella-form.js +21 -18
  17. package/components/input-amount/src/LionInputAmount.js +13 -4
  18. package/components/input-amount/test/lion-input-amount.test.js +19 -20
  19. package/components/input-date/src/LionInputDate.js +2 -11
  20. package/components/input-datepicker/src/LionInputDatepicker.js +5 -2
  21. package/components/input-datepicker/test/lion-input-datepicker.test.js +20 -0
  22. package/components/input-file/src/FileHandle.js +98 -0
  23. package/components/input-file/src/LionInputFile.js +892 -0
  24. package/components/input-file/src/LionSelectedFileList.js +232 -0
  25. package/components/input-file/src/localizeNamespaceLoader.js +75 -0
  26. package/components/input-file/src/validators.js +114 -0
  27. package/components/input-file/test/FileValidators.test.js +170 -0
  28. package/components/input-file/test/lion-input-file.test.js +1168 -0
  29. package/components/input-file/test/lion-selected-file-list.test.js +207 -0
  30. package/components/input-file/translations/bg-BG.js +5 -0
  31. package/components/input-file/translations/bg.js +12 -0
  32. package/components/input-file/translations/cs-CZ.js +5 -0
  33. package/components/input-file/translations/cs.js +13 -0
  34. package/components/input-file/translations/de-DE.js +5 -0
  35. package/components/input-file/translations/de.js +12 -0
  36. package/components/input-file/translations/en-AU.js +5 -0
  37. package/components/input-file/translations/en-GB.js +5 -0
  38. package/components/input-file/translations/en-PH.js +5 -0
  39. package/components/input-file/translations/en-US.js +5 -0
  40. package/components/input-file/translations/en.js +12 -0
  41. package/components/input-file/translations/es-ES.js +5 -0
  42. package/components/input-file/translations/es.js +12 -0
  43. package/components/input-file/translations/fr-BE.js +5 -0
  44. package/components/input-file/translations/fr-FR.js +5 -0
  45. package/components/input-file/translations/fr.js +13 -0
  46. package/components/input-file/translations/hu-HU.js +5 -0
  47. package/components/input-file/translations/hu.js +12 -0
  48. package/components/input-file/translations/it-IT.js +5 -0
  49. package/components/input-file/translations/it.js +12 -0
  50. package/components/input-file/translations/nl-BE.js +5 -0
  51. package/components/input-file/translations/nl-NL.js +5 -0
  52. package/components/input-file/translations/nl.js +12 -0
  53. package/components/input-file/translations/pl-PL.js +5 -0
  54. package/components/input-file/translations/pl.js +12 -0
  55. package/components/input-file/translations/ro-RO.js +5 -0
  56. package/components/input-file/translations/ro.js +12 -0
  57. package/components/input-file/translations/ru-RU.js +5 -0
  58. package/components/input-file/translations/ru.js +12 -0
  59. package/components/input-file/translations/sk-SK.js +5 -0
  60. package/components/input-file/translations/sk.js +12 -0
  61. package/components/input-file/translations/uk-UA.js +5 -0
  62. package/components/input-file/translations/uk.js +12 -0
  63. package/components/input-file/translations/zh-CN.js +5 -0
  64. package/components/input-file/translations/zh.js +12 -0
  65. package/components/input-file/types/input-file.d.ts +32 -0
  66. package/components/input-tel-dropdown/src/LionInputTelDropdown.js +1 -4
  67. package/components/localize/src/number/parseNumber.js +7 -1
  68. package/components/localize/test/number/parseNumber.test.js +18 -4
  69. package/custom-elements.json +21949 -17530
  70. package/dist-types/components/core/src/SlotMixin.d.ts.map +1 -1
  71. package/dist-types/components/core/types/SlotMixinTypes.d.ts +4 -0
  72. package/dist-types/components/core/types/SlotMixinTypes.d.ts.map +1 -1
  73. package/dist-types/components/dialog/test/lion-dialog.test.d.ts.map +1 -1
  74. package/dist-types/components/form-core/src/FocusMixin.d.ts.map +1 -1
  75. package/dist-types/components/form-core/src/LionField.d.ts +2 -1
  76. package/dist-types/components/form-core/src/LionField.d.ts.map +1 -1
  77. package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts +4 -11
  78. package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts.map +1 -1
  79. package/dist-types/components/form-core/src/validate/ResultValidator.d.ts +1 -1
  80. package/dist-types/components/form-core/types/validate/ValidateMixinTypes.d.ts +5 -0
  81. package/dist-types/components/form-core/types/validate/ValidateMixinTypes.d.ts.map +1 -1
  82. package/dist-types/components/form-integrations/test/dialog-integrations.test.d.ts.map +1 -1
  83. package/dist-types/components/form-integrations/test/form-group-methods.test.d.ts +1 -0
  84. package/dist-types/components/form-integrations/test/form-group-methods.test.d.ts.map +1 -1
  85. package/dist-types/components/form-integrations/test/helpers/umbrella-form.d.ts.map +1 -1
  86. package/dist-types/components/input-amount/src/LionInputAmount.d.ts +2 -4
  87. package/dist-types/components/input-amount/src/LionInputAmount.d.ts.map +1 -1
  88. package/dist-types/components/input-amount/test/lion-input-amount.test.d.ts +0 -1
  89. package/dist-types/components/input-amount/test/lion-input-amount.test.d.ts.map +1 -1
  90. package/dist-types/components/input-date/src/LionInputDate.d.ts.map +1 -1
  91. package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts +1 -1
  92. package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts.map +1 -1
  93. package/dist-types/components/input-file/src/FileHandle.d.ts +55 -0
  94. package/dist-types/components/input-file/src/FileHandle.d.ts.map +1 -0
  95. package/dist-types/components/input-file/src/LionInputFile.d.ts +230 -0
  96. package/dist-types/components/input-file/src/LionInputFile.d.ts.map +1 -0
  97. package/dist-types/components/input-file/src/LionSelectedFileList.d.ts +69 -0
  98. package/dist-types/components/input-file/src/LionSelectedFileList.d.ts.map +1 -0
  99. package/dist-types/components/input-file/src/localizeNamespaceLoader.d.ts +2 -0
  100. package/dist-types/components/input-file/src/localizeNamespaceLoader.d.ts.map +1 -0
  101. package/dist-types/components/input-file/src/validators.d.ts +58 -0
  102. package/dist-types/components/input-file/src/validators.d.ts.map +1 -0
  103. package/dist-types/components/input-file/test/FileValidators.test.d.ts +2 -0
  104. package/dist-types/components/input-file/test/FileValidators.test.d.ts.map +1 -0
  105. package/dist-types/components/input-file/test/lion-input-file.test.d.ts +5 -0
  106. package/dist-types/components/input-file/test/lion-input-file.test.d.ts.map +1 -0
  107. package/dist-types/components/input-file/test/lion-selected-file-list.test.d.ts +4 -0
  108. package/dist-types/components/input-file/test/lion-selected-file-list.test.d.ts.map +1 -0
  109. package/dist-types/components/input-file/translations/bg-BG.d.ts +13 -0
  110. package/dist-types/components/input-file/translations/bg-BG.d.ts.map +1 -0
  111. package/dist-types/components/input-file/translations/bg.d.ts +13 -0
  112. package/dist-types/components/input-file/translations/bg.d.ts.map +1 -0
  113. package/dist-types/components/input-file/translations/cs-CZ.d.ts +13 -0
  114. package/dist-types/components/input-file/translations/cs-CZ.d.ts.map +1 -0
  115. package/dist-types/components/input-file/translations/cs.d.ts +13 -0
  116. package/dist-types/components/input-file/translations/cs.d.ts.map +1 -0
  117. package/dist-types/components/input-file/translations/de-DE.d.ts +13 -0
  118. package/dist-types/components/input-file/translations/de-DE.d.ts.map +1 -0
  119. package/dist-types/components/input-file/translations/de.d.ts +13 -0
  120. package/dist-types/components/input-file/translations/de.d.ts.map +1 -0
  121. package/dist-types/components/input-file/translations/en-AU.d.ts +13 -0
  122. package/dist-types/components/input-file/translations/en-AU.d.ts.map +1 -0
  123. package/dist-types/components/input-file/translations/en-GB.d.ts +13 -0
  124. package/dist-types/components/input-file/translations/en-GB.d.ts.map +1 -0
  125. package/dist-types/components/input-file/translations/en-PH.d.ts +13 -0
  126. package/dist-types/components/input-file/translations/en-PH.d.ts.map +1 -0
  127. package/dist-types/components/input-file/translations/en-US.d.ts +13 -0
  128. package/dist-types/components/input-file/translations/en-US.d.ts.map +1 -0
  129. package/dist-types/components/input-file/translations/en.d.ts +13 -0
  130. package/dist-types/components/input-file/translations/en.d.ts.map +1 -0
  131. package/dist-types/components/input-file/translations/es-ES.d.ts +13 -0
  132. package/dist-types/components/input-file/translations/es-ES.d.ts.map +1 -0
  133. package/dist-types/components/input-file/translations/es.d.ts +13 -0
  134. package/dist-types/components/input-file/translations/es.d.ts.map +1 -0
  135. package/dist-types/components/input-file/translations/fr-BE.d.ts +13 -0
  136. package/dist-types/components/input-file/translations/fr-BE.d.ts.map +1 -0
  137. package/dist-types/components/input-file/translations/fr-FR.d.ts +13 -0
  138. package/dist-types/components/input-file/translations/fr-FR.d.ts.map +1 -0
  139. package/dist-types/components/input-file/translations/fr.d.ts +13 -0
  140. package/dist-types/components/input-file/translations/fr.d.ts.map +1 -0
  141. package/dist-types/components/input-file/translations/hu-HU.d.ts +13 -0
  142. package/dist-types/components/input-file/translations/hu-HU.d.ts.map +1 -0
  143. package/dist-types/components/input-file/translations/hu.d.ts +13 -0
  144. package/dist-types/components/input-file/translations/hu.d.ts.map +1 -0
  145. package/dist-types/components/input-file/translations/it-IT.d.ts +13 -0
  146. package/dist-types/components/input-file/translations/it-IT.d.ts.map +1 -0
  147. package/dist-types/components/input-file/translations/it.d.ts +13 -0
  148. package/dist-types/components/input-file/translations/it.d.ts.map +1 -0
  149. package/dist-types/components/input-file/translations/nl-BE.d.ts +13 -0
  150. package/dist-types/components/input-file/translations/nl-BE.d.ts.map +1 -0
  151. package/dist-types/components/input-file/translations/nl-NL.d.ts +13 -0
  152. package/dist-types/components/input-file/translations/nl-NL.d.ts.map +1 -0
  153. package/dist-types/components/input-file/translations/nl.d.ts +13 -0
  154. package/dist-types/components/input-file/translations/nl.d.ts.map +1 -0
  155. package/dist-types/components/input-file/translations/pl-PL.d.ts +13 -0
  156. package/dist-types/components/input-file/translations/pl-PL.d.ts.map +1 -0
  157. package/dist-types/components/input-file/translations/pl.d.ts +13 -0
  158. package/dist-types/components/input-file/translations/pl.d.ts.map +1 -0
  159. package/dist-types/components/input-file/translations/ro-RO.d.ts +13 -0
  160. package/dist-types/components/input-file/translations/ro-RO.d.ts.map +1 -0
  161. package/dist-types/components/input-file/translations/ro.d.ts +13 -0
  162. package/dist-types/components/input-file/translations/ro.d.ts.map +1 -0
  163. package/dist-types/components/input-file/translations/ru-RU.d.ts +13 -0
  164. package/dist-types/components/input-file/translations/ru-RU.d.ts.map +1 -0
  165. package/dist-types/components/input-file/translations/ru.d.ts +13 -0
  166. package/dist-types/components/input-file/translations/ru.d.ts.map +1 -0
  167. package/dist-types/components/input-file/translations/sk-SK.d.ts +13 -0
  168. package/dist-types/components/input-file/translations/sk-SK.d.ts.map +1 -0
  169. package/dist-types/components/input-file/translations/sk.d.ts +13 -0
  170. package/dist-types/components/input-file/translations/sk.d.ts.map +1 -0
  171. package/dist-types/components/input-file/translations/uk-UA.d.ts +13 -0
  172. package/dist-types/components/input-file/translations/uk-UA.d.ts.map +1 -0
  173. package/dist-types/components/input-file/translations/uk.d.ts +13 -0
  174. package/dist-types/components/input-file/translations/uk.d.ts.map +1 -0
  175. package/dist-types/components/input-file/translations/zh-CN.d.ts +13 -0
  176. package/dist-types/components/input-file/translations/zh-CN.d.ts.map +1 -0
  177. package/dist-types/components/input-file/translations/zh.d.ts +13 -0
  178. package/dist-types/components/input-file/translations/zh.d.ts.map +1 -0
  179. package/dist-types/components/input-stepper/src/LionInputStepper.d.ts +6 -0
  180. package/dist-types/components/input-stepper/src/LionInputStepper.d.ts.map +1 -1
  181. package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts +0 -1
  182. package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts.map +1 -1
  183. package/dist-types/components/localize/src/number/parseNumber.d.ts.map +1 -1
  184. package/dist-types/exports/define/lion-input-file.d.ts +2 -0
  185. package/dist-types/exports/define/lion-input-file.d.ts.map +1 -0
  186. package/dist-types/exports/define/lion-selected-file-list.d.ts +2 -0
  187. package/dist-types/exports/define/lion-selected-file-list.d.ts.map +1 -0
  188. package/dist-types/exports/input-file.d.ts +4 -0
  189. package/dist-types/exports/input-file.d.ts.map +1 -0
  190. package/dist-types/tsconfig.tsbuildinfo +1 -1
  191. package/docs/components/button/extensions/bootstrap-button.mjs +240 -0
  192. package/docs/components/button/extensions.md +30 -0
  193. package/docs/components/checkbox-group/overview.md +2 -2
  194. package/docs/components/collapsible/overview.md +1 -1
  195. package/docs/components/combobox/{examples.md → extensions.md} +51 -43
  196. package/docs/components/combobox/overview.md +1 -1
  197. package/docs/components/combobox/src/google-combobox/google-combobox.js +4 -1
  198. package/docs/components/combobox/src/md-combobox/md-combobox.js +40 -38
  199. package/docs/components/combobox/src/wa-combobox/wa-combobox.js +204 -209
  200. package/docs/components/combobox/use-cases.md +1 -1
  201. package/docs/components/dialog/overview.md +1 -1
  202. package/docs/components/fieldset/overview.md +5 -5
  203. package/docs/components/form/overview.md +3 -3
  204. package/docs/components/icon/use-cases.md +1 -1
  205. package/docs/components/input/overview.md +1 -1
  206. package/docs/components/input-amount/overview.md +3 -3
  207. package/docs/components/input-amount/use-cases.md +4 -2
  208. package/docs/components/input-date/overview.md +3 -3
  209. package/docs/components/input-datepicker/overview.md +5 -5
  210. package/docs/components/input-datepicker/use-cases.md +11 -0
  211. package/docs/components/input-email/overview.md +2 -2
  212. package/docs/components/input-file/index.md +3 -0
  213. package/docs/components/input-file/overview.md +32 -0
  214. package/docs/components/input-file/use-cases.md +424 -0
  215. package/docs/components/input-iban/overview.md +2 -2
  216. package/docs/components/input-range/overview.md +2 -2
  217. package/docs/components/input-stepper/overview.md +1 -1
  218. package/docs/components/input-tel/overview.md +1 -1
  219. package/docs/components/input-tel/use-cases.md +6 -6
  220. package/docs/components/input-tel-dropdown/{examples.md → extensions.md} +1 -1
  221. package/docs/components/input-tel-dropdown/overview.md +1 -1
  222. package/docs/components/radio-group/overview.md +3 -3
  223. package/docs/components/select-rich/use-cases.md +1 -1
  224. package/docs/components/tabs/examples.md +1 -1
  225. package/docs/fundamentals/index.md +4 -4
  226. package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
  227. package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
  228. package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
  229. package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
  230. package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
  231. package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
  232. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
  233. package/docs/fundamentals/rationales/accessibility.md +28 -0
  234. package/docs/fundamentals/systems/core/SlotMixin.md +148 -0
  235. package/docs/fundamentals/systems/core/overview.md +1 -1
  236. package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
  237. package/docs/fundamentals/systems/form/model-value.md +1 -1
  238. package/docs/fundamentals/systems/form/overview.md +28 -28
  239. package/docs/fundamentals/systems/form/use-cases.md +2 -0
  240. package/docs/fundamentals/systems/form/validate.md +1 -1
  241. package/docs/fundamentals/systems/localize/overview.md +4 -4
  242. package/docs/fundamentals/systems/overlays/_configuration-positioning.md +116 -0
  243. package/docs/fundamentals/systems/overlays/_edge-cases.md +145 -0
  244. package/docs/fundamentals/systems/overlays/configuration.md +2 -2
  245. package/docs/fundamentals/systems/overlays/overview.md +5 -5
  246. package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
  247. package/docs/fundamentals/tools/helpers/overview.md +1 -1
  248. package/docs/fundamentals/tools/singleton-manager/example-complex/index.md +21 -0
  249. package/docs/fundamentals/tools/singleton-manager/example-fail/index.md +19 -0
  250. package/docs/fundamentals/tools/singleton-manager/example-success/index.md +18 -0
  251. package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
  252. package/docs/guides/how-to/create-a-custom-field.md +5 -5
  253. package/docs/guides/how-to/create-a-form.md +88 -0
  254. package/docs/guides/how-to/extend-a-native-input.md +2 -2
  255. package/docs/guides/index.md +8 -8
  256. package/docs/guides/principles/index.md +5 -5
  257. package/docs/guides/principles/styling.md +1 -1
  258. package/exports/define/lion-input-file.js +3 -0
  259. package/exports/define/lion-selected-file-list.js +3 -0
  260. package/exports/input-file.js +3 -0
  261. package/package.json +3 -2
  262. package/docs/components/combobox/src/google-combobox/assets/googlelogo_color_272x92dp.png +0 -0
  263. package/docs/components/dialog/src/demo-dialog-style.js +0 -3
  264. package/docs/components/select-rich/src/flags.png +0 -0
  265. package/docs/components/select-rich/src/flags@2x.png +0 -0
  266. package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-1.svg +0 -1
  267. package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-2.svg +0 -1
  268. package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-3.svg +0 -84
  269. package/docs/fundamentals/tools/ajax/assets/naga.json +0 -9
  270. package/docs/fundamentals/tools/ajax/assets/pabu.json +0 -9
  271. package/docs/fundamentals/tools/singleton-manager/.gitignore +0 -1
  272. package/docs/override.js +0 -15
package/README.md CHANGED
@@ -8,15 +8,15 @@
8
8
  </p>
9
9
 
10
10
  <p align="center">
11
- <a href="https://github.com/modernweb-dev/rocket/actions"
11
+ <a href="https://github.com/ing-bank/lion/issues"
12
12
  ><img
13
- src="https://img.shields.io/github/workflow/status/modernweb-dev/rocket/Release/main?label=workflow&style=flat-square"
14
- alt="GitHub Actions workflow status"
13
+ src="https://badgen.net/github/open-issues/ing-bank/lion"
14
+ alt="Lion open issues status"
15
15
  /></a>
16
- <a href="https://github.com/modernweb-dev/rocket/actions"
16
+ <a href="https://github.com/ing-bank/lion/pulls"
17
17
  ><img
18
- src="https://img.shields.io/github/workflow/status/modernweb-dev/rocket/Release/main?label=workflow&style=flat-square"
19
- alt="GitHub Actions workflow status"
18
+ src="https://badgen.net/github/open-prs/ing-bank/lion/"
19
+ alt="GitHub open pull requests status"
20
20
  /></a>
21
21
  <a href="https://www.tickgit.com/browse?repo=github.com/ing-bank/lion"
22
22
  ><img
@@ -28,12 +28,12 @@
28
28
  <p align="center">
29
29
  <a href="https://lion-web.netlify.app">Website</a>
30
30
  ·
31
+ <a href="https://lion-web.netlify.app/fundamentals/">Fundamentals</a>
32
+ ·
31
33
  <a href="https://lion-web.netlify.app/guides/">Guides</a>
32
34
  ·
33
35
  <a href="https://lion-web.netlify.app/components/">Components</a>
34
36
  ·
35
- <a href="https://lion-web.netlify.app/docs/">Documentation</a>
36
- ·
37
37
  <a href="https://lion-web.netlify.app/blog/">Blog</a>
38
38
  </p>
39
39
 
@@ -42,7 +42,7 @@
42
42
  They provide an unopinionated, white-label layer that can be extended to your own layer of components.
43
43
 
44
44
  - **High Performance:** Focused on great performance in all relevant browsers with a minimal number of dependencies.
45
- - **Accessibility:** Aimed at compliance with the WCAG 2.1 AA standard to create components that are accessible for everybody.
45
+ - **Accessibility:** Aimed at compliance with the WCAG 2.2 AA standard to create components that are accessible for everybody.
46
46
  - **Flexibility:** Provides solutions through Web Components and JavaScript classes which can be used, adopted and extended to fit all needs.
47
47
  - **Modern Code:** Lion is distributes as pure es modules.
48
48
  - **Exposes functions/classes and Web Components:** Ships a functionality in it's most appropriate form.
@@ -57,7 +57,7 @@ They provide an unopinionated, white-label layer that can be extended to your ow
57
57
  ## How to install
58
58
 
59
59
  ```bash
60
- npm i @lion/<package-name>
60
+ npm i @lion/ui
61
61
  ```
62
62
 
63
63
  ## How to use
@@ -68,7 +68,7 @@ npm i @lion/<package-name>
68
68
 
69
69
  ```js
70
70
  import { css } from 'lit';
71
- import { LionInput } from '@lion/input';
71
+ import { LionInput } from '@lion/ui/input.js';
72
72
 
73
73
  class MyInput extends LionInput {
74
74
  static get styles() {
@@ -89,7 +89,7 @@ There's a couple of "systems" in lion which have a JavaScript API. Examples are
89
89
 
90
90
  ```html
91
91
  <script type="module">
92
- import { ajax } from '@lion/ajax';
92
+ import { ajax } from '@lion/ui/ajax.js';
93
93
 
94
94
  ajax
95
95
  .fetch('data.json')
@@ -106,7 +106,7 @@ You can also use the lion elements directly, although this is likely not a commo
106
106
 
107
107
  ```html
108
108
  <script type="module">
109
- import '@lion/input/define';
109
+ import '@lion/ui/define/lion-input.js';
110
110
  </script>
111
111
 
112
112
  <lion-input name="firstName"></lion-input>
@@ -122,55 +122,16 @@ When you have an idea on how we could improve, please check our [discussions](ht
122
122
 
123
123
  ## Content
124
124
 
125
- Lion web components is logically organized in groups of systems.
126
-
127
- The accessibility column indicates whether the functionality is accessible in its core. Aspects like styling and content determine actual accessibility in usage.
128
-
129
- | Package | Version | Description | Accessibility |
130
- | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -------------------------- |
131
- | **-- [Form System](https://lion-web.netlify.app/fundamentals/systems/form/overview/) --** | | A system that lets you make complex forms with ease, including: validation, translations. | ✔️ |
132
- | [combobox](https://lion-web.netlify.app/components/combobox/overview/) | [![combobox](https://img.shields.io/npm/v/@lion/combobox.svg)](https://www.npmjs.com/package/@lion/form) | Text box controlling popup listbox | ✔️ |
133
- | [form](https://lion-web.netlify.app/components/form/overview) | [![form](https://img.shields.io/npm/v/@lion/form.svg)](https://www.npmjs.com/package/@lion/form) | Wrapper for multiple form elements | ✔️ |
134
- | [form-core](https://lion-web.netlify.app/fundamentals/systems/form/overview/) | [![form-core](https://img.shields.io/npm/v/@lion/form-core.svg)](https://www.npmjs.com/package/@lion/form-core) | Core functionality for all form controls | ✔️ |
135
- | [form-integrations](https://lion-web.netlify.app/fundamentals/systems/form/overview/) | [![form-integrations](https://img.shields.io/npm/v/@lion/form-integrations.svg)](https://www.npmjs.com/package/@lion/form-integrations) | Shows form elements in an integrated way | ✔️ |
136
- | [fieldset](https://lion-web.netlify.app/components/fieldset/overview/) | [![fieldset](https://img.shields.io/npm/v/@lion/fieldset.svg)](https://www.npmjs.com/package/@lion/fieldset) | Group for form inputs | ✔️ |
137
- | [checkbox-group](https://lion-web.netlify.app/components/checkbox-group/overview/) | [![checkbox-group](https://img.shields.io/npm/v/@lion/checkbox-group.svg)](https://www.npmjs.com/package/@lion/checkbox-group) | Group of checkboxes | ✔️ |
138
- | [input](https://lion-web.netlify.app/components/input/overview/) | [![input](https://img.shields.io/npm/v/@lion/input.svg)](https://www.npmjs.com/package/@lion/input) | Input element for strings | ✔️ |
139
- | [input-amount](https://lion-web.netlify.app/components/input-amount/overview/) | [![input-amount](https://img.shields.io/npm/v/@lion/input-amount.svg)](https://www.npmjs.com/package/@lion/input-amount) | Input element for amounts | ✔️ |
140
- | [input-date](https://lion-web.netlify.app/components/input-date/overview/) | [![input-date](https://img.shields.io/npm/v/@lion/input-date.svg)](https://www.npmjs.com/package/@lion/input-date) | Input element for dates | ✔️ |
141
- | [input-datepicker](https://lion-web.netlify.app/components/input-datepicker/overview/) | [![input-datepicker](https://img.shields.io/npm/v/@lion/input-datepicker.svg)](https://www.npmjs.com/package/@lion/input-datepicker) | Input element for dates with a datepicker | ✔️ |
142
- | [input-email](https://lion-web.netlify.app/components/input-email/overview/) | [![input-email](https://img.shields.io/npm/v/@lion/input-email.svg)](https://www.npmjs.com/package/@lion/input-email) | Input element for e-mails | ✔️ |
143
- | [input-iban](https://lion-web.netlify.app/components/input-iban/overview/) | [![input-iban](https://img.shields.io/npm/v/@lion/input-iban.svg)](https://www.npmjs.com/package/@lion/input-iban) | Input element for IBANs | ✔️ |
144
- | [input-range](https://lion-web.netlify.app/components/input-range/overview/) | [![input-range](https://img.shields.io/npm/v/@lion/input-range.svg)](https://www.npmjs.com/package/@lion/input-range) | Input element for a range of values | ✔️ |
145
- | [input-stepper](https://lion-web.netlify.app/components/input-stepper/overview/) | [![input-stepper](https://img.shields.io/npm/v/@lion/input-stepper.svg)](https://www.npmjs.com/package/@lion/input-stepper) | Input stepper element for the predefined range | ✔️ |
146
- | [listbox](https://lion-web.netlify.app/components/listbox/overview/) | [![listbox](https://img.shields.io/npm/v/@lion/listbox.svg)](https://www.npmjs.com/package/@lion/form) | Interactive list with selectable options | ✔️ |
147
- | [radio-group](https://lion-web.netlify.app/components/radio-group/overview/) | [![radio-group](https://img.shields.io/npm/v/@lion/radio-group.svg)](https://www.npmjs.com/package/@lion/radio-group) | Group of radios | ✔️ |
148
- | [select](https://lion-web.netlify.app/components/select/overview/) | [![select](https://img.shields.io/npm/v/@lion/select.svg)](https://www.npmjs.com/package/@lion/select) | Simple native dropdown element | ✔️ |
149
- | [select-rich](https://lion-web.netlify.app/components/select-rich/overview/) | [![select-rich](https://img.shields.io/npm/v/@lion/select-rich.svg)](https://www.npmjs.com/package/@lion/select-rich) | 'rich' version of the native dropdown element | [#243][i243] |
150
- | [textarea](https://lion-web.netlify.app/components/textarea/overview/) | [![textarea](https://img.shields.io/npm/v/@lion/textarea.svg)](https://www.npmjs.com/package/@lion/textarea) | Multiline text input | ✔️ |
151
- | **-- [Button System](https://lion-web.netlify.app/components/buttons-intro--page) --** | | These web components bring common UX patterns while still full integrated with (native) forms. | |
152
- | [button](https://lion-web.netlify.app/components/button/overview/) | [![button](https://img.shields.io/npm/v/@lion/button.svg)](https://www.npmjs.com/package/@lion/button) | Button | ✔️ |
153
- | [switch](https://lion-web.netlify.app/components/switch/overview/) | [![switch](https://img.shields.io/npm/v/@lion/switch.svg)](https://www.npmjs.com/package/@lion/switch) | Switch | ✔️ |
154
- | **-- [Overlay System](https://lion-web.netlify.app/components/overlays-intro--page) --** | | If something needs to overlay content this is your place. | |
155
- | [overlays](https://lion-web.netlify.app/fundamentals/systems/overlays/overview/) | [![overlays](https://img.shields.io/npm/v/@lion/overlays.svg)](https://www.npmjs.com/package/@lion/overlays) | Overlay System | ✔️ |
156
- | [dialog](https://lion-web.netlify.app/components/dialog/overview/) | [![dialog](https://img.shields.io/npm/v/@lion/dialog.svg)](https://www.npmjs.com/package/@lion/dialog) | Dialog element | ✔️ |
157
- | [tooltip](https://lion-web.netlify.app/components/tooltip/overview/) | [![tooltip](https://img.shields.io/npm/v/@lion/tooltip.svg)](https://www.npmjs.com/package/@lion/tooltip) | Tooltip element | [#175][i175] |
158
- | **-- [Navigation System](https://lion-web.netlify.app/components/navigation-intro--page) --** | | Components which are used to guide users | |
159
- | [accordion](https://lion-web.netlify.app/components/accordion/overview/) | [![accordion](https://img.shields.io/npm/v/@lion/accordion.svg)](https://www.npmjs.com/package/@lion/accordion) | Accordion | ✔️ |
160
- | [pagination](https://lion-web.netlify.app/components/pagination/overview/) | [![pagination](https://img.shields.io/npm/v/@lion/pagination.svg)](https://www.npmjs.com/package/@lion/pagination) | Pagination | ✔️ |
161
- | [steps](https://lion-web.netlify.app/components/steps/overview) | [![steps](https://img.shields.io/npm/v/@lion/steps.svg)](https://www.npmjs.com/package/@lion/steps) | Multi Step System | n/a |
162
- | [tabs](https://lion-web.netlify.app/components/tabs/overview) | [![tBS](https://img.shields.io/npm/v/@lion/tabs.svg)](https://www.npmjs.com/package/@lion/tabs) | Move between a small number of equally important views | n/a |
163
- | **-- [localize System](https://lion-web.netlify.app/fundamentals/systems/localize/overview/) --** | | Localize text, numbers, dates and a way to store/fetch these data. | |
164
- | [localize](https://lion-web.netlify.app/fundamentals/systems/localize/overview/) | [![localize](https://img.shields.io/npm/v/@lion/localize.svg)](https://www.npmjs.com/package/@lion/localize) | Localize and translate your application/components | n/a |
165
- | **-- [Icon System](https://lion-web.netlify.app/fundamentals/systems/icon/overview/) --** | | Loading and displaying icons | |
166
- | [icon](https://lion-web.netlify.app/fundamentals/systems/icon/overview/) | [![icon](https://img.shields.io/npm/v/@lion/icon.svg)](https://www.npmjs.com/package/@lion/icon) | Display our svg icons | [#173][i173], [#172][i172] |
167
- | **-- Others --** | | Features not fitting any other category | |
168
- | [core](https://lion-web.netlify.app/fundamentals/systems/core/overview/) | [![core](https://img.shields.io/npm/v/@lion/core.svg)](https://www.npmjs.com/package/@lion/core) | Core System (exports LitElement, lit-html) | n/a |
169
- | [ajax](https://lion-web.netlify.app/fundamentals/tools/ajax/overview/) | [![ajax](https://img.shields.io/npm/v/@lion/ajax.svg)](https://www.npmjs.com/package/@lion/ajax) | Fetching data via ajax request | n/a |
170
- | [calendar](https://lion-web.netlify.app/components/calendar/overview/) | [![calendar](https://img.shields.io/npm/v/@lion/calendar.svg)](https://www.npmjs.com/package/@lion/calendar) | Standalone calendar | [#195][i195], [#194][i194] |
171
- | [collapsible](https://lion-web.netlify.app/components/collapsible/overview/) | [![collapsible](https://img.shields.io/npm/v/@lion/collapsible.svg)](https://www.npmjs.com/package/@lion/collapsible) | Combination of a button and a chunk of extra content | ✔️ |
172
- | **-- [Helpers](https://lion-web.netlify.app/fundamentals/tools/helpers/overview/) --** | [![helpers](https://img.shields.io/npm/v/@lion/helpers.svg)](https://www.npmjs.com/package/@lion/helpers) | Helpers to make your and your life easier | |
173
- | [sb-action-logger](https://lion-web.netlify.app/fundamentals/tools/helpers/action-logger/) | | Storybook action logger |
125
+ | Name | version | description |
126
+ | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
127
+ | [@lion/ui](https://github.com/ing-bank/lion/tree/master/packages/ui) | <img src="https://img.shields.io/npm/v/@lion/ui.svg" alt="@lion/ui version"/> | Set of components |
128
+ | [@lion/ajax](https://github.com/ing-bank/lion/tree/master/packages/ajax) | <img src="https://img.shields.io/npm/v/@lion/ajax.svg" alt="@lion/ajax version"/> | A small wrapper around fetch |
129
+ | [Singleton-manager](https://github.com/ing-bank/lion/tree/master/packages/singleton-manager) | <img src="https://img.shields.io/npm/v/singleton-manager.svg" alt="Singleton-manager version"/> | A singleton manager provides a way to make sure a singleton instance loaded from multiple file locations stays a singleton. Primarily useful if two major version of a package with a singleton is used. |
130
+ | [Babel plugin extend docs](https://github.com/ing-bank/lion/tree/master/packages-node/babel-plugin-extend-docs) | <img src="https://img.shields.io/npm/v/babel-plugin-extend-docs.svg" alt="babel-plugin-extend-docs version"/> | A plugin which rewrites imports and templates according to a configuration. This enables the reuse of existing documentation from source packages while still using your extensions code. |
131
+ | [Providence analytics](https://github.com/ing-bank/lion/tree/master/packages-node/providence-analytics) | <img src="https://img.shields.io/npm/v/providence-analytics.svg" alt="providence-analytics version"/> | Providence is the 'All Seeing Eye' that generates usage statistics by analyzing code. It measures the effectivity and popularity of your software. With just a few commands you can measure the impact for (breaking) changes, making your release process more stable and predictable. |
132
+ | [Publish docs](https://github.com/ing-bank/lion/tree/master/packages-node/publish-docs) | <img src="https://img.shields.io/npm/v/publish-docs.svg" alt="publish-docs version"/> | A tool that copies and processes your documentation (in a monorepo) so it can be published/shipped with your package. |
133
+ | [Remark extend](https://github.com/ing-bank/lion/tree/master/packages-node/remark-extend) | <img src="https://img.shields.io/npm/v/remark-extend.svg" alt="remark-extend version"/> | A plugin for remark to extend markdown by importing from source files. |
134
+ | [Rocket preset extend lion docs](https://github.com/ing-bank/lion/tree/master/packages-node/rocket-preset-extend-lion-docs) | <img src="https://img.shields.io/npm/v/rocket-preset-extend-lion-docs.svg" alt="rocket-preset-extend-lion-docs version"/> | When maintaining your own extension layer of lion you most likely want to maintain a similar documentation. Copying and rewriting the markdown files works, but whenever something changes you need copy and rewrite again. To do this automatically you can use this preset for [rocket](https://rocket.modern-web.dev/). |
174
135
 
175
136
  ## Technologies
176
137
 
@@ -210,13 +171,3 @@ Read our [contribution guide](https://github.com/ing-bank/lion/blob/master/CONTR
210
171
  ## Contact
211
172
 
212
173
  Feel free to create a github issue for any feedback or questions you might have.
213
- You can also find us on the Lit & Friends slack in the [#lion](https://lit-and-friends.slack.com/archives/CJGFWJN9J) channel.
214
-
215
- You can join the Lit & Friends slack by visiting [https://lit.dev/slack-invite/](https://lit.dev/slack-invite/).
216
-
217
- [i172]: https://github.com/ing-bank/lion/issues/172
218
- [i173]: https://github.com/ing-bank/lion/issues/173
219
- [i175]: https://github.com/ing-bank/lion/issues/175
220
- [i194]: https://github.com/ing-bank/lion/issues/194
221
- [i195]: https://github.com/ing-bank/lion/issues/195
222
- [i243]: https://github.com/ing-bank/lion/issues/243
@@ -47,7 +47,7 @@ export class LionButton extends DisabledWithTabIndexMixin(LitElement) {
47
47
  box-sizing: border-box;
48
48
  vertical-align: middle;
49
49
  line-height: 24px;
50
- background: #eee; /* minimal styling to make it recognizable as btn */
50
+ background-color: #eee; /* minimal styling to make it recognizable as btn */
51
51
  padding: 8px; /* padding to fix with min-height */
52
52
  outline: none; /* focus style handled below */
53
53
  cursor: default; /* we should always see the default arrow, never a caret */
@@ -83,6 +83,7 @@ const SlotMixinImplementation = superclass =>
83
83
  slotName,
84
84
  shouldRerender: true,
85
85
  });
86
+ // TODO: this is deprecated, remove later
86
87
  slotFunctionResult.afterRender?.();
87
88
  }
88
89
 
@@ -90,8 +91,8 @@ const SlotMixinImplementation = superclass =>
90
91
  * Here we rerender slots defined with a `SlotRerenderObject`
91
92
  * @param {import('lit-element').PropertyValues } changedProperties
92
93
  */
93
- updated(changedProperties) {
94
- super.updated(changedProperties);
94
+ update(changedProperties) {
95
+ super.update(changedProperties);
95
96
 
96
97
  if (this.__slotsThatNeedRerender.size) {
97
98
  for (const slotName of Array.from(this.__slotsThatNeedRerender)) {
@@ -383,7 +383,7 @@ describe('SlotMixin', () => {
383
383
  expect(slot.tagName).to.equal('SPAN');
384
384
  });
385
385
 
386
- it('supports afterRender logic (type "{ template:TemplateResults; afterRender: Function}" )', async () => {
386
+ it('supports (deprecated) afterRender logic (type "{ template:TemplateResults; afterRender: Function}" )', async () => {
387
387
  let varThatProvesAfterRenderIsCalled = 'not called';
388
388
 
389
389
  const tag = defineCE(
@@ -6,7 +6,10 @@ import { TemplateResult, LitElement } from 'lit';
6
6
  */
7
7
  export type SlotRerenderObject = {
8
8
  template: TemplateResult;
9
- /* Add logic that will be performed after the render */
9
+ /**
10
+ * Add logic that will be performed after the render
11
+ * @deprecated
12
+ */
10
13
  afterRender?: Function;
11
14
  };
12
15
 
@@ -1,3 +1,4 @@
1
+ /* eslint-disable lit-a11y/no-autofocus */
1
2
  import { expect, fixture as _fixture, html, unsafeStatic } from '@open-wc/testing';
2
3
  import { runOverlayMixinSuite } from '../../overlays/test-suites/OverlayMixin.suite.js';
3
4
  import '@lion/ui/define/lion-dialog.js';
@@ -72,4 +73,59 @@ describe('lion-dialog', () => {
72
73
  expect(nestedDialogEl.opened).to.be.true;
73
74
  });
74
75
  });
76
+
77
+ describe('focus', () => {
78
+ it('sets focus on contentSlot by default', async () => {
79
+ const el = await fixture(html`
80
+ <lion-dialog>
81
+ <button slot="invoker">invoker button</button>
82
+ <div slot="content">
83
+ <label for="myInput">Label</label>
84
+ <input id="myInput" />
85
+ </div>
86
+ </lion-dialog>
87
+ `);
88
+ // @ts-expect-error [allow-protected-in-tests]
89
+ const invokerNode = el._overlayInvokerNode;
90
+ invokerNode.focus();
91
+ invokerNode.click();
92
+ const contentNode = el.querySelector('[slot="content"]');
93
+ expect(document.activeElement).to.equal(contentNode);
94
+ });
95
+
96
+ it('sets focus on autofocused element', async () => {
97
+ const el = await fixture(html`
98
+ <lion-dialog>
99
+ <button slot="invoker">invoker button</button>
100
+ <div slot="content">
101
+ <label for="myInput">Label</label>
102
+ <input id="myInput" autofocus />
103
+ </div>
104
+ </lion-dialog>
105
+ `);
106
+ // @ts-expect-error [allow-protected-in-tests]
107
+ const invokerNode = el._overlayInvokerNode;
108
+ invokerNode.focus();
109
+ invokerNode.click();
110
+ const input = el.querySelector('input');
111
+ expect(document.activeElement).to.equal(input);
112
+ });
113
+
114
+ it('with trapsKeyboardFocus set to false the focus stays on the invoker', async () => {
115
+ const el = /** @type {LionDialog} */ await fixture(html`
116
+ <lion-dialog .config=${{ trapsKeyboardFocus: false }}>
117
+ <button slot="invoker">invoker button</button>
118
+ <div slot="content">
119
+ <label for="myInput">Label</label>
120
+ <input id="myInput" autofocus />
121
+ </div>
122
+ </lion-dialog>
123
+ `);
124
+ // @ts-expect-error [allow-protected-in-tests]
125
+ const invokerNode = el._overlayInvokerNode;
126
+ invokerNode.focus();
127
+ invokerNode.click();
128
+ expect(document.activeElement).to.equal(invokerNode);
129
+ });
130
+ });
75
131
  });
@@ -27,6 +27,7 @@ const FocusMixinImplementation = superclass =>
27
27
  return {
28
28
  focused: { type: Boolean, reflect: true },
29
29
  focusedVisible: { type: Boolean, reflect: true, attribute: 'focused-visible' },
30
+ autofocus: { type: Boolean, reflect: true }, // Required in Lit to observe autofocus
30
31
  };
31
32
  }
32
33
 
@@ -47,11 +48,16 @@ const FocusMixinImplementation = superclass =>
47
48
  * @type {boolean}
48
49
  */
49
50
  this.focusedVisible = false;
51
+ this.autofocus = false;
50
52
  }
51
53
 
52
- connectedCallback() {
53
- super.connectedCallback();
54
+ /**
55
+ * @param {import('lit').PropertyValues } changedProperties
56
+ */
57
+ firstUpdated(changedProperties) {
58
+ super.firstUpdated(changedProperties);
54
59
  this.__registerEventsForFocusMixin();
60
+ this.__syncAutofocusToFocusableElement();
55
61
  }
56
62
 
57
63
  disconnectedCallback() {
@@ -59,6 +65,31 @@ const FocusMixinImplementation = superclass =>
59
65
  this.__teardownEventsForFocusMixin();
60
66
  }
61
67
 
68
+ /**
69
+ * @param {import('lit').PropertyValues } changedProperties
70
+ */
71
+ updated(changedProperties) {
72
+ super.updated(changedProperties);
73
+ if (changedProperties.has('autofocus')) {
74
+ this.__syncAutofocusToFocusableElement();
75
+ }
76
+ }
77
+
78
+ /**
79
+ * @private
80
+ */
81
+ __syncAutofocusToFocusableElement() {
82
+ if (!this._focusableNode) {
83
+ return;
84
+ }
85
+
86
+ if (this.hasAttribute('autofocus')) {
87
+ this._focusableNode.setAttribute('autofocus', '');
88
+ } else {
89
+ this._focusableNode.removeAttribute('autofocus');
90
+ }
91
+ }
92
+
62
93
  /**
63
94
  * Calls `focus()` on focusable element within
64
95
  */
@@ -72,9 +72,11 @@ export class LionField extends FormControlMixin(
72
72
 
73
73
  /**
74
74
  * Dispatches custom bubble event
75
+ * @param {Event=} ev
75
76
  * @protected
76
77
  */
77
- _onChange() {
78
+ // eslint-disable-next-line no-unused-vars
79
+ _onChange(ev) {
78
80
  /** @protectedEvent user-input-changed */
79
81
  this.dispatchEvent(new Event('user-input-changed', { bubbles: true }));
80
82
  }
@@ -3,10 +3,7 @@ import { html, LitElement } from 'lit';
3
3
  /**
4
4
  * @typedef {import('./Validator.js').Validator} Validator
5
5
  * @typedef {import('lit').TemplateResult} TemplateResult
6
- * @typedef {Object} messageMap
7
- * @property {string | Node} message
8
- * @property {string} type
9
- * @property {Validator} [validator]
6
+ * @typedef {import('../../types/validate/ValidateMixinTypes.js').FeedbackMessage} FeedbackMessage
10
7
  */
11
8
 
12
9
  /**
@@ -47,7 +44,7 @@ export class LionValidationFeedback extends LitElement {
47
44
  if (this.currentType === 'success') {
48
45
  this.removeMessage = window.setTimeout(() => {
49
46
  this.removeAttribute('type');
50
- /** @type {messageMap[]} */
47
+ /** @type {FeedbackMessage[]} */
51
48
  this.feedbackData = [];
52
49
  }, 3000);
53
50
  }
@@ -1,7 +1,7 @@
1
1
  import { Validator } from './Validator.js';
2
2
 
3
3
  /**
4
- * @desc Instead of evaluating the result of a regular validator, a ResultValidator looks
4
+ * Instead of evaluating the result of a regular Validator, a ResultValidator looks
5
5
  * at the total result of regular Validators. Instead of an execute function, it uses a
6
6
  * 'executeOnResults' Validator.
7
7
  * ResultValidators cannot be async, and should not contain an execute method.
@@ -323,6 +323,39 @@ describe('FocusMixin', () => {
323
323
  spy4.restore();
324
324
  restoreMock4();
325
325
  });
326
+
327
+ it('has mirrors syncs autofocus on the focusable element when autofocus changes', async () => {
328
+ const el = /** @type {Focusable} */ (
329
+ await fixture(html`
330
+ <${tag}><input slot="input"></${tag}>
331
+ `)
332
+ );
333
+
334
+ // @ts-ignore [allow-protected] in test
335
+ const { _focusableNode } = el;
336
+
337
+ el.setAttribute('autofocus', '');
338
+ await el.updateComplete;
339
+ expect(_focusableNode.hasAttribute('autofocus')).to.be.true;
340
+
341
+ el.removeAttribute('autofocus');
342
+ await el.updateComplete;
343
+ expect(_focusableNode.hasAttribute('autofocus')).not.to.be.true;
344
+ });
345
+
346
+ it('has mirrors syncs autofocus on the focusable element when autofocus was set on render', async () => {
347
+ const el = /** @type {Focusable} */ (
348
+ await fixture(html`
349
+ <${tag} autofocus><input slot="input"></${tag}>
350
+ `)
351
+ );
352
+
353
+ // @ts-ignore [allow-protected] in test
354
+ const { _focusableNode } = el;
355
+
356
+ expect(el.hasAttribute('autofocus')).to.be.true;
357
+ expect(_focusableNode.hasAttribute('autofocus')).to.be.true;
358
+ });
326
359
  });
327
360
  });
328
361
  });
@@ -9,9 +9,9 @@ import { FormControlHost } from '../FormControlMixinTypes.js';
9
9
  import { SyncUpdatableHost } from '../utils/SyncUpdatableMixinTypes.js';
10
10
  import { Validator } from '../../src/validate/Validator.js';
11
11
 
12
- type FeedbackMessage = {
12
+ export type FeedbackMessage = {
13
13
  message: string | Node;
14
- type: string;
14
+ type: ValidationType | string;
15
15
  validator?: Validator;
16
16
  };
17
17
 
@@ -1,3 +1,4 @@
1
+ /* eslint-disable lit-a11y/no-autofocus */
1
2
  import { expect, fixture } from '@open-wc/testing';
2
3
  import { html } from 'lit';
3
4
  import { getAllTagNames } from './helpers/helpers.js';
@@ -36,6 +37,7 @@ describe('Form inside dialog Integrations', () => {
36
37
  'lion-input-amount',
37
38
  'lion-input-iban',
38
39
  'lion-input-email',
40
+ 'lion-input-file',
39
41
  'lion-input-tel',
40
42
  'lion-input-tel-dropdown',
41
43
  'lion-checkbox-group',
@@ -70,4 +72,21 @@ describe('Form inside dialog Integrations', () => {
70
72
  'lion-textarea',
71
73
  ]);
72
74
  });
75
+
76
+ it('sets focus on first focusable element with autofocus', async () => {
77
+ const el = /** @type {LionDialog} */ await fixture(html`
78
+ <lion-dialog>
79
+ <button slot="invoker">invoker button</button>
80
+ <div slot="content">
81
+ <lion-input label="label" name="input" autofocus></lion-input>
82
+ <lion-textarea label="label" name="textarea" autofocus></lion-textarea>
83
+ </div>
84
+ </lion-dialog>
85
+ `);
86
+ // @ts-expect-error [allow-protected-in-tests]
87
+ el._overlayInvokerNode.click();
88
+ const lionInput = el.querySelector('[name="input"]');
89
+ // @ts-expect-error [allow-protected-in-tests]
90
+ expect(document.activeElement).to.equal(lionInput._focusableNode);
91
+ });
73
92
  });
@@ -1,49 +1,20 @@
1
1
  import { elementUpdated, expect, fixture } from '@open-wc/testing';
2
2
  import { html } from 'lit';
3
- import './helpers/umbrella-form.js';
4
3
  import { getAllFieldsAndFormGroups } from './helpers/helpers.js';
5
-
6
- import '@lion/ui/define/lion-button.js';
7
- import '@lion/ui/define/lion-button-submit.js';
8
- import '@lion/ui/define/lion-button-reset.js';
9
-
10
- import '@lion/ui/define/lion-checkbox.js';
11
- import '@lion/ui/define/lion-checkbox-group.js';
12
- import '@lion/ui/define/lion-combobox.js';
13
-
14
- import '@lion/ui/define/lion-dialog.js';
15
-
16
- import '@lion/ui/define/lion-form.js';
17
- import '@lion/ui/define/lion-fieldset.js';
18
- import '@lion/ui/define/lion-select-rich.js';
19
- import '@lion/ui/define/lion-select.js';
20
-
21
- import '@lion/ui/define/lion-input-stepper.js';
22
- import '@lion/ui/define/lion-input-range.js';
23
- import '@lion/ui/define/lion-input-amount.js';
24
- import '@lion/ui/define/lion-input.js';
25
- import '@lion/ui/define/lion-input-date.js';
26
- import '@lion/ui/define/lion-input-iban.js';
27
- import '@lion/ui/define/lion-input-email.js';
28
- import '@lion/ui/define/lion-input-tel-dropdown.js';
29
- import '@lion/ui/define/lion-input-datepicker.js';
30
-
31
- import '@lion/ui/define/lion-textarea.js';
32
-
33
- import '@lion/ui/define/lion-radio.js';
34
- import '@lion/ui/define/lion-radio-group.js';
35
-
36
- import '@lion/ui/define/lion-listbox.js';
37
- import '@lion/ui/define/lion-option.js';
38
- import '@lion/ui/define/lion-options.js';
39
-
40
- import '@lion/ui/define/lion-validation-feedback.js';
4
+ import './helpers/umbrella-form.js';
41
5
  /**
42
6
  * @typedef {import('../../form-core/src/LionField.js').LionField} LionField
7
+ * @typedef {import('../../input-file/types/input-file.js').InputFile} InputFile
43
8
  * @typedef {import('../../button/src/LionButton.js').LionButton} LionButton
44
9
  * @typedef {import('./helpers/umbrella-form.js').UmbrellaForm} UmbrellaForm
45
10
  */
46
11
 
12
+ const file = /** @type {InputFile} */ (
13
+ new File(['foo'], 'foo.txt', {
14
+ type: 'text/plain',
15
+ })
16
+ );
17
+
47
18
  const fullyPrefilledSerializedValue = {
48
19
  fullName: { firstName: 'Lorem', lastName: 'Ipsum' },
49
20
  date: '2000-12-12',
@@ -57,6 +28,7 @@ const fullyPrefilledSerializedValue = {
57
28
  favoriteFruit: 'Banana',
58
29
  favoriteMovie: 'Rocky',
59
30
  favoriteColor: 'hotpink',
31
+ file: [],
60
32
  lyrics: '1',
61
33
  notifications: {
62
34
  checked: true,
@@ -81,6 +53,7 @@ const fullyChangedSerializedValue = {
81
53
  favoriteFruit: '',
82
54
  favoriteMovie: '',
83
55
  favoriteColor: '',
56
+ file: [file],
84
57
  lyrics: '2',
85
58
  notifications: {
86
59
  checked: false,
@@ -189,6 +162,7 @@ describe(`Submitting/Resetting/Clearing Form`, async () => {
189
162
  favoriteFruit: '',
190
163
  favoriteMovie: '',
191
164
  favoriteColor: '',
165
+ file: [],
192
166
  lyrics: '',
193
167
  notifications: {
194
168
  checked: false,
@@ -41,6 +41,7 @@ describe('Form Integrations', () => {
41
41
  favoriteFruit: 'Banana',
42
42
  favoriteMovie: 'Rocky',
43
43
  favoriteColor: 'hotpink',
44
+ file: [],
44
45
  lyrics: '1',
45
46
  range: 2.3,
46
47
  terms: [],
@@ -74,6 +75,7 @@ describe('Form Integrations', () => {
74
75
  favoriteFruit: 'Banana',
75
76
  favoriteMovie: 'Rocky',
76
77
  favoriteColor: 'hotpink',
78
+ file: '',
77
79
  lyrics: 'Fire up that loud',
78
80
  range: 2.3,
79
81
  terms: [],
@@ -98,6 +100,7 @@ describe('Form Integrations', () => {
98
100
  money: '',
99
101
  iban: '',
100
102
  email: '',
103
+ file: [],
101
104
  checkers: ['foo', 'bar'],
102
105
  dinosaurs: 'brontosaurus',
103
106
  favoriteFruit: 'Banana',
@@ -129,6 +132,7 @@ describe('Form Integrations', () => {
129
132
  'lion-input-amount',
130
133
  'lion-input-iban',
131
134
  'lion-input-email',
135
+ 'lion-input-file',
132
136
  'lion-input-tel',
133
137
  'lion-input-tel-dropdown',
134
138
  'lion-checkbox-group',