@aurodesignsystem/auro-formkit 2.0.0-beta.2 → 2.0.0-beta.20

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 (583) hide show
  1. package/.turbo/cache/0185585abae43d38-meta.json +1 -0
  2. package/.turbo/cache/0185585abae43d38.tar.zst +0 -0
  3. package/.turbo/cache/092e1fe054c68113-meta.json +1 -0
  4. package/.turbo/cache/092e1fe054c68113.tar.zst +0 -0
  5. package/.turbo/cache/19eb9b69e5625309-meta.json +1 -0
  6. package/.turbo/cache/19eb9b69e5625309.tar.zst +0 -0
  7. package/.turbo/cache/2059bc724ac24519-meta.json +1 -0
  8. package/.turbo/cache/2059bc724ac24519.tar.zst +0 -0
  9. package/.turbo/cache/23b3a2fea223679d-meta.json +1 -0
  10. package/.turbo/cache/23b3a2fea223679d.tar.zst +0 -0
  11. package/.turbo/cache/2c0d681132c153dd-meta.json +1 -0
  12. package/.turbo/cache/2c0d681132c153dd.tar.zst +0 -0
  13. package/.turbo/cache/2e79b1c1455468a1-meta.json +1 -0
  14. package/.turbo/cache/2e79b1c1455468a1.tar.zst +0 -0
  15. package/.turbo/cache/341f87099beb533e-meta.json +1 -0
  16. package/.turbo/cache/341f87099beb533e.tar.zst +0 -0
  17. package/.turbo/cache/363aa008d976f81d-meta.json +1 -0
  18. package/.turbo/cache/363aa008d976f81d.tar.zst +0 -0
  19. package/.turbo/cache/4006a206400d5c7b-meta.json +1 -0
  20. package/.turbo/cache/4006a206400d5c7b.tar.zst +0 -0
  21. package/.turbo/cache/43ab6002bc2cd191-meta.json +1 -0
  22. package/.turbo/cache/43ab6002bc2cd191.tar.zst +0 -0
  23. package/.turbo/cache/45cd32cd38eacbcb-meta.json +1 -0
  24. package/.turbo/cache/45cd32cd38eacbcb.tar.zst +0 -0
  25. package/.turbo/cache/492dda333b8d15f1-meta.json +1 -0
  26. package/.turbo/cache/492dda333b8d15f1.tar.zst +0 -0
  27. package/.turbo/cache/493e064c221aa745-meta.json +1 -0
  28. package/.turbo/cache/493e064c221aa745.tar.zst +0 -0
  29. package/.turbo/cache/50cd7dcfc9f820c5-meta.json +1 -0
  30. package/.turbo/cache/50cd7dcfc9f820c5.tar.zst +0 -0
  31. package/.turbo/cache/51eaa58d5c167de8-meta.json +1 -0
  32. package/.turbo/cache/51eaa58d5c167de8.tar.zst +0 -0
  33. package/.turbo/cache/56ee89ef1c48963e-meta.json +1 -0
  34. package/.turbo/cache/56ee89ef1c48963e.tar.zst +0 -0
  35. package/.turbo/cache/5b57cc0e26e1fd5d-meta.json +1 -0
  36. package/.turbo/cache/5b57cc0e26e1fd5d.tar.zst +0 -0
  37. package/.turbo/cache/60ad74320c682a2b-meta.json +1 -0
  38. package/.turbo/cache/60ad74320c682a2b.tar.zst +0 -0
  39. package/.turbo/cache/61e218aba69cff58-meta.json +1 -0
  40. package/.turbo/cache/61e218aba69cff58.tar.zst +0 -0
  41. package/.turbo/cache/631d441eebe7e4ac-meta.json +1 -0
  42. package/.turbo/cache/631d441eebe7e4ac.tar.zst +0 -0
  43. package/.turbo/cache/6c582e957afdd75f-meta.json +1 -0
  44. package/.turbo/cache/6c582e957afdd75f.tar.zst +0 -0
  45. package/.turbo/cache/77da375a012de9d0-meta.json +1 -0
  46. package/.turbo/cache/77da375a012de9d0.tar.zst +0 -0
  47. package/.turbo/cache/78418f9089673a21-meta.json +1 -0
  48. package/.turbo/cache/78418f9089673a21.tar.zst +0 -0
  49. package/.turbo/cache/7964d1656e9e702a-meta.json +1 -0
  50. package/.turbo/cache/7964d1656e9e702a.tar.zst +0 -0
  51. package/.turbo/cache/7bf2b06a479d0b30-meta.json +1 -0
  52. package/.turbo/cache/7bf2b06a479d0b30.tar.zst +0 -0
  53. package/.turbo/cache/7c9ca6163e61285c-meta.json +1 -0
  54. package/.turbo/cache/7c9ca6163e61285c.tar.zst +0 -0
  55. package/.turbo/cache/80ebd4b1fa5c1e3a-meta.json +1 -0
  56. package/.turbo/cache/80ebd4b1fa5c1e3a.tar.zst +0 -0
  57. package/.turbo/cache/8bb856bd31b5b479-meta.json +1 -0
  58. package/.turbo/cache/8bb856bd31b5b479.tar.zst +0 -0
  59. package/.turbo/cache/8c5b86ca67d33b17-meta.json +1 -0
  60. package/.turbo/cache/8c5b86ca67d33b17.tar.zst +0 -0
  61. package/.turbo/cache/8f5fef3e04a6fcfa-meta.json +1 -0
  62. package/.turbo/cache/8f5fef3e04a6fcfa.tar.zst +0 -0
  63. package/.turbo/cache/9d99fa3ab31d272f-meta.json +1 -0
  64. package/.turbo/cache/9d99fa3ab31d272f.tar.zst +0 -0
  65. package/.turbo/cache/a779ea8b78ce9d59-meta.json +1 -0
  66. package/.turbo/cache/a779ea8b78ce9d59.tar.zst +0 -0
  67. package/.turbo/cache/a9c36a3534c5496b-meta.json +1 -0
  68. package/.turbo/cache/a9c36a3534c5496b.tar.zst +0 -0
  69. package/.turbo/cache/ac1b55ad6757fd54-meta.json +1 -0
  70. package/.turbo/cache/ac1b55ad6757fd54.tar.zst +0 -0
  71. package/.turbo/cache/b1cd3922508c11c0-meta.json +1 -0
  72. package/.turbo/cache/b1cd3922508c11c0.tar.zst +0 -0
  73. package/.turbo/cache/b3c5c13bb1c28c92-meta.json +1 -0
  74. package/.turbo/cache/b3c5c13bb1c28c92.tar.zst +0 -0
  75. package/.turbo/cache/b5e6dc7fb9ae1a2f-meta.json +1 -0
  76. package/.turbo/cache/b5e6dc7fb9ae1a2f.tar.zst +0 -0
  77. package/.turbo/cache/b6a202cc85cb61a0-meta.json +1 -0
  78. package/.turbo/cache/b6a202cc85cb61a0.tar.zst +0 -0
  79. package/.turbo/cache/ba270a0ef147f2e5-meta.json +1 -0
  80. package/.turbo/cache/ba270a0ef147f2e5.tar.zst +0 -0
  81. package/.turbo/cache/bb5213773d5d3b04-meta.json +1 -0
  82. package/.turbo/cache/bb5213773d5d3b04.tar.zst +0 -0
  83. package/.turbo/cache/bbefd8d9606f1e87-meta.json +1 -0
  84. package/.turbo/cache/bbefd8d9606f1e87.tar.zst +0 -0
  85. package/.turbo/cache/be0b95293ea517cc-meta.json +1 -0
  86. package/.turbo/cache/be0b95293ea517cc.tar.zst +0 -0
  87. package/.turbo/cache/c03a12ff38ba1e02-meta.json +1 -0
  88. package/.turbo/cache/c03a12ff38ba1e02.tar.zst +0 -0
  89. package/.turbo/cache/c1312c6f8c051461-meta.json +1 -0
  90. package/.turbo/cache/c1312c6f8c051461.tar.zst +0 -0
  91. package/.turbo/cache/c289a5a9a6b897a9-meta.json +1 -0
  92. package/.turbo/cache/c289a5a9a6b897a9.tar.zst +0 -0
  93. package/.turbo/cache/c376d692c092d4d1-meta.json +1 -0
  94. package/.turbo/cache/c376d692c092d4d1.tar.zst +0 -0
  95. package/.turbo/cache/c6c6411199b68170-meta.json +1 -0
  96. package/.turbo/cache/c6c6411199b68170.tar.zst +0 -0
  97. package/.turbo/cache/c6dbc49c3038946d-meta.json +1 -0
  98. package/.turbo/cache/c6dbc49c3038946d.tar.zst +0 -0
  99. package/.turbo/cache/cae7586c45bed13e-meta.json +1 -0
  100. package/.turbo/cache/cae7586c45bed13e.tar.zst +0 -0
  101. package/.turbo/cache/d5db503b2eaf239c-meta.json +1 -0
  102. package/.turbo/cache/d5db503b2eaf239c.tar.zst +0 -0
  103. package/.turbo/cache/d775555355d6b8fc-meta.json +1 -0
  104. package/.turbo/cache/d775555355d6b8fc.tar.zst +0 -0
  105. package/.turbo/cache/d7c3007be148d2a1-meta.json +1 -0
  106. package/.turbo/cache/d7c3007be148d2a1.tar.zst +0 -0
  107. package/.turbo/cache/db5e65d819bfe66b-meta.json +1 -0
  108. package/.turbo/cache/db5e65d819bfe66b.tar.zst +0 -0
  109. package/.turbo/cache/dbe6a08c64601aec-meta.json +1 -0
  110. package/.turbo/cache/dbe6a08c64601aec.tar.zst +0 -0
  111. package/.turbo/cache/dc597b3ea4f61ec8-meta.json +1 -0
  112. package/.turbo/cache/dc597b3ea4f61ec8.tar.zst +0 -0
  113. package/.turbo/cache/df5f651693145406-meta.json +1 -0
  114. package/.turbo/cache/df5f651693145406.tar.zst +0 -0
  115. package/.turbo/cache/e62cfee068e3ef36-meta.json +1 -0
  116. package/.turbo/cache/e62cfee068e3ef36.tar.zst +0 -0
  117. package/.turbo/cache/ee40cab15d5b1fad-meta.json +1 -0
  118. package/.turbo/cache/ee40cab15d5b1fad.tar.zst +0 -0
  119. package/.vscode/settings.json +3 -0
  120. package/CHANGELOG.md +202 -0
  121. package/README.md +59 -59
  122. package/components/checkbox/.turbo/turbo-build$colon$sass.log +10 -10
  123. package/components/checkbox/.turbo/turbo-build.log +20 -21
  124. package/components/checkbox/.turbo/turbo-bundler.log +4 -4
  125. package/components/checkbox/.turbo/turbo-postCss$colon$component.log +1 -2
  126. package/components/checkbox/.turbo/turbo-sass$colon$render.log +6 -6
  127. package/components/checkbox/.turbo/turbo-types.log +1 -1
  128. package/components/checkbox/README.md +26 -34
  129. package/components/checkbox/demo/api.md +69 -68
  130. package/components/checkbox/demo/api.min.js +195 -87
  131. package/components/checkbox/demo/index.md +62 -62
  132. package/components/checkbox/demo/index.min.js +195 -87
  133. package/components/checkbox/dist/auro-checkbox-group.d.ts +40 -16
  134. package/components/checkbox/dist/auro-checkbox-group.d.ts.map +1 -1
  135. package/components/checkbox/dist/auro-checkbox.d.ts +20 -11
  136. package/components/checkbox/dist/auro-checkbox.d.ts.map +1 -1
  137. package/components/checkbox/dist/index.js +195 -87
  138. package/components/checkbox/package.json +1 -1
  139. package/components/checkbox/src/auro-checkbox-group.js +57 -20
  140. package/components/checkbox/src/auro-checkbox.js +29 -12
  141. package/components/combobox/.turbo/turbo-build$colon$sass.log +5 -5
  142. package/components/combobox/.turbo/turbo-build.log +22 -23
  143. package/components/combobox/.turbo/turbo-postCss$colon$component.log +1 -2
  144. package/components/combobox/.turbo/turbo-sass$colon$render.log +2 -2
  145. package/components/combobox/README.md +21 -26
  146. package/components/combobox/demo/api.md +30 -26
  147. package/components/combobox/demo/api.min.js +3227 -948
  148. package/components/combobox/demo/index.md +1 -1
  149. package/components/combobox/demo/index.min.js +3224 -945
  150. package/components/combobox/dist/auro-combobox.d.ts +76 -74
  151. package/components/combobox/dist/auro-combobox.d.ts.map +1 -1
  152. package/components/combobox/dist/dropdownVersion.d.ts +3 -0
  153. package/components/combobox/dist/dropdownVersion.d.ts.map +1 -0
  154. package/components/combobox/dist/index.js +2593 -628
  155. package/components/combobox/dist/inputVersion.d.ts +3 -0
  156. package/components/combobox/dist/inputVersion.d.ts.map +1 -0
  157. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/.husky/pre-commit +1 -0
  158. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/CHANGELOG.md +863 -0
  159. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/README.md +109 -0
  160. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/dist/auroElement/README.md +86 -0
  161. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/dist/auroElement/_auroElement.scss +45 -0
  162. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/dist/auroElement/auroElement.js +38 -0
  163. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/dist/auroElement/auroElement.mjs +38 -0
  164. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/dist/bundled/essentials+fv.css +110 -0
  165. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/dist/bundled/essentials.css +106 -0
  166. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/dist/demoWrapper.css +8 -0
  167. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/dist/elementDemoStyles.css +813 -0
  168. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/package.json +134 -0
  169. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/packageScripts/postinstall.mjs +39 -0
  170. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/_animation.scss +30 -0
  171. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/_blockquote.scss +46 -0
  172. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/_breakpoints.scss +155 -0
  173. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/_core.scss +25 -0
  174. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/_essentials.scss +267 -0
  175. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/_focus-visible.scss +36 -0
  176. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/_fonts.scss +50 -0
  177. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/_grids.scss +395 -0
  178. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/_headings.scss +255 -0
  179. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/_normalize.scss +663 -0
  180. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/_picture.scss +31 -0
  181. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/_utilityClasses.scss +22 -0
  182. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/bundled/essentials+fv.scss +19 -0
  183. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/bundled/essentials.scss +18 -0
  184. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/componentSupport/_anchor-roleButton.scss +32 -0
  185. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/componentSupport/_anchor-roleTab.scss +26 -0
  186. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/componentSupport/_containedButtons.scss +59 -0
  187. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/componentSupport/_table.scss +54 -0
  188. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/componentSupport/_tablist.scss +37 -0
  189. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/elementDemoStyles/README.md +5 -0
  190. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/elementDemoStyles/demoWrapper.scss +18 -0
  191. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/elementDemoStyles/elementDemoStyles.scss +123 -0
  192. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/libSupport/_deprecated.scss +16 -0
  193. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/libSupport/_manageScope.scss +42 -0
  194. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityClasses/_displayProperties.scss +142 -0
  195. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityClasses/_fontStyles.scss +151 -0
  196. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityClasses/_inset.scss +188 -0
  197. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityClasses/_layoutProperties.scss +75 -0
  198. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityClasses/_listProperties.scss +176 -0
  199. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityClasses/_responsive.scss +249 -0
  200. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityClasses/_typeProperties.scss +49 -0
  201. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityFunctions/_capitalize.scss +20 -0
  202. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityFunctions/_contains.scss +26 -0
  203. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityFunctions/_map-deep-get.scss +29 -0
  204. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityMixins/_anchor-roleButton.scss +76 -0
  205. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityMixins/_anchor-roleTab.scss +86 -0
  206. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityMixins/_insetUtility.scss +9 -0
  207. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityMixins/_layoutPropertiesGenerator.scss +75 -0
  208. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityMixins/_spacingUtility.scss +96 -0
  209. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityVariables/_important.scss +20 -0
  210. package/components/combobox/node_modules/@aurodesignsystem/webcorestylesheets/src/utilityVariables/_spacing-options.scss +13 -0
  211. package/components/combobox/node_modules/@rollup/plugin-node-resolve/README.md +293 -0
  212. package/components/combobox/node_modules/@rollup/plugin-node-resolve/dist/cjs/index.js +1377 -0
  213. package/components/combobox/node_modules/@rollup/plugin-node-resolve/dist/es/index.js +1370 -0
  214. package/components/combobox/node_modules/@rollup/plugin-node-resolve/dist/es/package.json +1 -0
  215. package/components/combobox/node_modules/@rollup/plugin-node-resolve/package.json +89 -0
  216. package/components/combobox/node_modules/@rollup/plugin-node-resolve/types/index.d.ts +115 -0
  217. package/components/combobox/node_modules/chalk/package.json +3 -3
  218. package/components/combobox/node_modules/chalk/readme.md +25 -53
  219. package/components/combobox/node_modules/chalk/source/index.d.ts +6 -1
  220. package/components/combobox/node_modules/chalk/source/vendor/supports-color/browser.js +6 -2
  221. package/components/combobox/node_modules/chalk/source/vendor/supports-color/index.js +2 -2
  222. package/components/combobox/package.json +8 -8
  223. package/components/combobox/src/auro-combobox.js +225 -164
  224. package/components/combobox/src/dropdownVersion.js +1 -0
  225. package/components/combobox/src/inputVersion.js +1 -0
  226. package/components/counter/.turbo/turbo-build$colon$sass.log +210 -7
  227. package/components/counter/.turbo/turbo-build$colon$version.log +10 -0
  228. package/components/counter/.turbo/turbo-build.log +325 -14
  229. package/components/counter/.turbo/turbo-bundler.log +7 -4
  230. package/components/counter/.turbo/turbo-postCss$colon$component.log +1 -2
  231. package/components/counter/.turbo/turbo-sass$colon$render.log +45 -3
  232. package/components/counter/.turbo/turbo-types.log +1 -1
  233. package/components/counter/README.md +188 -0
  234. package/components/counter/demo/api.md +104 -1014
  235. package/components/counter/demo/api.min.js +4773 -36
  236. package/components/counter/demo/index.js +2 -1
  237. package/components/counter/demo/index.md +190 -0
  238. package/components/counter/demo/index.min.js +4801 -19
  239. package/components/counter/dist/auro-counter-button.d.ts +13 -0
  240. package/components/counter/dist/auro-counter-button.d.ts.map +1 -0
  241. package/components/counter/dist/auro-counter-group.d.ts +112 -5
  242. package/components/counter/dist/auro-counter-group.d.ts.map +1 -1
  243. package/components/counter/dist/auro-counter-wrapper.d.ts +23 -0
  244. package/components/counter/dist/auro-counter-wrapper.d.ts.map +1 -0
  245. package/components/counter/dist/auro-counter.d.ts +89 -0
  246. package/components/counter/dist/auro-counter.d.ts.map +1 -1
  247. package/components/counter/dist/dropdownVersion.d.ts +3 -0
  248. package/components/counter/dist/dropdownVersion.d.ts.map +1 -0
  249. package/components/counter/dist/iconVersion.d.ts +3 -0
  250. package/components/counter/dist/iconVersion.d.ts.map +1 -0
  251. package/components/counter/dist/index.js +4773 -36
  252. package/components/counter/dist/styles/color-css.d.ts +3 -0
  253. package/components/counter/dist/styles/color-css.d.ts.map +1 -0
  254. package/components/counter/dist/styles/counter-button-color-css.d.ts +3 -0
  255. package/components/counter/dist/styles/counter-button-color-css.d.ts.map +1 -0
  256. package/components/counter/dist/styles/counter-button-css.d.ts +3 -0
  257. package/components/counter/dist/styles/counter-button-css.d.ts.map +1 -0
  258. package/components/counter/dist/styles/counter-button-tokens-css.d.ts +3 -0
  259. package/components/counter/dist/styles/counter-button-tokens-css.d.ts.map +1 -0
  260. package/components/counter/dist/styles/counter-wrapper-color-css.d.ts +3 -0
  261. package/components/counter/dist/styles/counter-wrapper-color-css.d.ts.map +1 -0
  262. package/components/counter/dist/styles/counter-wrapper-css.d.ts +3 -0
  263. package/components/counter/dist/styles/counter-wrapper-css.d.ts.map +1 -0
  264. package/components/counter/dist/styles/tokens-css.d.ts +3 -0
  265. package/components/counter/dist/styles/tokens-css.d.ts.map +1 -0
  266. package/components/counter/package.json +9 -3
  267. package/components/counter/src/auro-counter-button.js +42 -0
  268. package/components/counter/src/auro-counter-group.js +229 -20
  269. package/components/counter/src/auro-counter-wrapper.js +54 -0
  270. package/components/counter/src/auro-counter.js +287 -12
  271. package/components/counter/src/dropdownVersion.js +1 -0
  272. package/components/counter/src/iconVersion.js +1 -0
  273. package/components/counter/src/index.js +1 -1
  274. package/components/counter/src/styles/color-css.js +2 -0
  275. package/components/counter/src/styles/color.css +25 -0
  276. package/components/counter/src/styles/color.scss +44 -0
  277. package/components/counter/src/styles/counter-button-color-css.js +2 -0
  278. package/components/counter/src/styles/counter-button-color.css +14 -0
  279. package/components/counter/src/styles/counter-button-color.scss +29 -0
  280. package/components/counter/src/styles/counter-button-css.js +2 -0
  281. package/components/counter/src/styles/counter-button-tokens-css.js +2 -0
  282. package/components/counter/src/styles/counter-button-tokens.css +7 -0
  283. package/components/counter/src/styles/counter-button-tokens.scss +9 -0
  284. package/components/counter/src/styles/counter-button.css +187 -0
  285. package/components/counter/src/styles/counter-button.scss +83 -0
  286. package/components/counter/src/styles/counter-group-css.js +1 -1
  287. package/components/counter/src/styles/counter-group.css +9 -1
  288. package/components/counter/src/styles/counter-group.scss +10 -1
  289. package/components/counter/src/styles/counter-wrapper-color-css.js +2 -0
  290. package/components/counter/src/styles/counter-wrapper-color.css +4 -0
  291. package/components/counter/src/styles/counter-wrapper-color.scss +19 -0
  292. package/components/counter/src/styles/counter-wrapper-css.js +2 -0
  293. package/components/counter/src/styles/counter-wrapper.css +15 -0
  294. package/components/counter/src/styles/counter-wrapper.scss +29 -0
  295. package/components/counter/src/styles/style-css.js +1 -1
  296. package/components/counter/src/styles/style.css +43 -1
  297. package/components/counter/src/styles/style.scss +48 -2
  298. package/components/counter/src/styles/tokens-css.js +2 -0
  299. package/components/counter/src/styles/tokens.css +11 -0
  300. package/components/counter/src/styles/tokens.scss +24 -0
  301. package/components/datepicker/.turbo/turbo-build$colon$sass.log +34 -34
  302. package/components/datepicker/.turbo/turbo-build.log +57 -57
  303. package/components/datepicker/.turbo/turbo-postCss$colon$component.log +1 -2
  304. package/components/datepicker/.turbo/turbo-sass$colon$render.log +10 -10
  305. package/components/datepicker/README.md +21 -26
  306. package/components/datepicker/demo/api.md +182 -135
  307. package/components/datepicker/demo/api.min.js +1010 -566
  308. package/components/datepicker/demo/index.md +1 -1
  309. package/components/datepicker/demo/index.min.js +1010 -566
  310. package/components/datepicker/dist/auro-datepicker.d.ts +94 -78
  311. package/components/datepicker/dist/auro-datepicker.d.ts.map +1 -1
  312. package/components/datepicker/dist/dropdownVersion.d.ts +2 -0
  313. package/components/datepicker/dist/dropdownVersion.d.ts.map +1 -1
  314. package/components/datepicker/dist/index.js +1010 -566
  315. package/components/datepicker/dist/inputVersion.d.ts +3 -0
  316. package/components/datepicker/dist/inputVersion.d.ts.map +1 -0
  317. package/components/datepicker/package.json +3 -3
  318. package/components/datepicker/src/auro-datepicker.js +152 -106
  319. package/components/datepicker/src/dropdownVersion.js +1 -0
  320. package/components/datepicker/src/inputVersion.js +1 -0
  321. package/components/datepicker/src/styles/color-cell-css.js +1 -1
  322. package/components/datepicker/src/styles/color-cell.css +1 -1
  323. package/components/datepicker/src/styles/color-cell.scss +1 -1
  324. package/components/dropdown/.turbo/turbo-build$colon$sass.log +8 -8
  325. package/components/dropdown/.turbo/turbo-build$colon$version.log +1 -1
  326. package/components/dropdown/.turbo/turbo-build.log +19 -20
  327. package/components/dropdown/.turbo/turbo-bundler.log +4 -4
  328. package/components/dropdown/.turbo/turbo-postCss$colon$component.log +1 -2
  329. package/components/dropdown/.turbo/turbo-sass$colon$render.log +6 -6
  330. package/components/dropdown/.turbo/turbo-types.log +1 -1
  331. package/components/dropdown/README.md +18 -26
  332. package/components/dropdown/demo/api.md +4 -4
  333. package/components/dropdown/demo/api.min.js +205 -81
  334. package/components/dropdown/demo/index.min.js +205 -81
  335. package/components/dropdown/dist/auro-dropdown.d.ts +93 -34
  336. package/components/dropdown/dist/auro-dropdown.d.ts.map +1 -1
  337. package/components/dropdown/dist/auro-dropdownBib.d.ts +9 -3
  338. package/components/dropdown/dist/auro-dropdownBib.d.ts.map +1 -1
  339. package/components/dropdown/dist/index.js +205 -81
  340. package/components/dropdown/package.json +1 -1
  341. package/components/dropdown/src/auro-dropdown.js +154 -39
  342. package/components/dropdown/src/auro-dropdownBib.js +12 -3
  343. package/components/dropdown/src/styles/style-css.js +1 -1
  344. package/components/dropdown/src/styles/style.css +4 -0
  345. package/components/dropdown/src/styles/style.scss +5 -0
  346. package/components/form/.turbo/turbo-build$colon$sass.log +6 -6
  347. package/components/form/.turbo/turbo-build$colon$version.log +1 -1
  348. package/components/form/.turbo/turbo-build.log +17 -18
  349. package/components/form/.turbo/turbo-bundler.log +4 -4
  350. package/components/form/.turbo/turbo-postCss$colon$component.log +1 -2
  351. package/components/form/.turbo/turbo-sass$colon$render.log +2 -2
  352. package/components/form/.turbo/turbo-types.log +1 -1
  353. package/components/form/README.md +28 -34
  354. package/components/form/demo/api.min.js +338 -25
  355. package/components/form/demo/index.min.js +338 -25
  356. package/components/form/demo/registerDemoDeps.js +6 -0
  357. package/components/form/demo/working.html +108 -0
  358. package/components/form/dist/auro-form.d.ts +137 -2
  359. package/components/form/dist/auro-form.d.ts.map +1 -1
  360. package/components/form/dist/index.js +338 -25
  361. package/components/form/package.json +4 -2
  362. package/components/form/src/auro-form.js +335 -25
  363. package/components/input/.turbo/turbo-build$colon$sass.log +66 -16
  364. package/components/input/.turbo/turbo-build$colon$version.log +1 -1
  365. package/components/input/.turbo/turbo-build.log +79 -32
  366. package/components/input/.turbo/turbo-bundler.log +4 -4
  367. package/components/input/.turbo/turbo-postCss$colon$component.log +1 -2
  368. package/components/input/.turbo/turbo-sass$colon$render.log +15 -9
  369. package/components/input/.turbo/turbo-types.log +1 -1
  370. package/components/input/README.md +18 -28
  371. package/components/input/demo/api.md +151 -316
  372. package/components/input/demo/api.min.js +370 -150
  373. package/components/input/demo/index.md +11 -61
  374. package/components/input/demo/index.min.js +370 -150
  375. package/components/input/dist/auro-input.d.ts.map +1 -1
  376. package/components/input/dist/base-input.d.ts +158 -87
  377. package/components/input/dist/base-input.d.ts.map +1 -1
  378. package/components/input/dist/index.js +370 -150
  379. package/components/input/dist/styles/mixins-css.d.ts +3 -0
  380. package/components/input/dist/styles/mixins-css.d.ts.map +1 -0
  381. package/components/input/package.json +1 -1
  382. package/components/input/src/auro-input.js +0 -1
  383. package/components/input/src/base-input.js +257 -90
  384. package/components/input/src/styles/borders.scss +3 -19
  385. package/components/input/src/styles/color.css +1 -2
  386. package/components/input/src/styles/color.scss +3 -10
  387. package/components/input/src/styles/input-css.js +1 -1
  388. package/components/input/src/styles/input.css +1 -1
  389. package/components/input/src/styles/input.scss +4 -1
  390. package/components/input/src/styles/label-css.js +1 -1
  391. package/components/input/src/styles/label.css +1 -1
  392. package/components/input/src/styles/label.scss +4 -7
  393. package/components/input/src/styles/mixins-css.js +2 -0
  394. package/components/input/src/styles/mixins.css +1 -0
  395. package/components/input/src/styles/mixins.scss +45 -0
  396. package/components/input/src/styles/notificationIcons-css.js +1 -1
  397. package/components/input/src/styles/notificationIcons.css +13 -12
  398. package/components/input/src/styles/notificationIcons.scss +17 -25
  399. package/components/input/src/styles/style-css.js +1 -1
  400. package/components/input/src/styles/style.css +15 -17
  401. package/components/input/src/styles/style.scss +0 -4
  402. package/components/menu/.turbo/turbo-build$colon$sass.log +9 -9
  403. package/components/menu/.turbo/turbo-build$colon$version.log +1 -1
  404. package/components/menu/.turbo/turbo-build.log +22 -21
  405. package/components/menu/.turbo/turbo-bundler.log +4 -4
  406. package/components/menu/.turbo/turbo-postCss$colon$component.log +1 -2
  407. package/components/menu/.turbo/turbo-sass$colon$render.log +6 -6
  408. package/components/menu/.turbo/turbo-types.log +1 -1
  409. package/components/menu/README.md +18 -26
  410. package/components/menu/demo/api.md +57 -20
  411. package/components/menu/demo/api.min.js +626 -312
  412. package/components/menu/demo/index.min.js +624 -310
  413. package/components/menu/dist/auro-menu-utils.d.ts +43 -0
  414. package/components/menu/dist/auro-menu-utils.d.ts.map +1 -0
  415. package/components/menu/dist/auro-menu.d.ts +97 -81
  416. package/components/menu/dist/auro-menu.d.ts.map +1 -1
  417. package/components/menu/dist/index.d.ts +1 -0
  418. package/components/menu/dist/index.js +625 -311
  419. package/components/menu/package.json +1 -1
  420. package/components/menu/src/auro-menu-utils.js +131 -0
  421. package/components/menu/src/auro-menu.js +492 -303
  422. package/components/menu/src/index.js +7 -0
  423. package/components/menu/src/styles/color-menuoption-css.js +1 -1
  424. package/components/menu/src/styles/color-menuoption.css +3 -0
  425. package/components/menu/src/styles/color-menuoption.scss +4 -0
  426. package/components/radio/.turbo/turbo-build$colon$sass.log +13 -13
  427. package/components/radio/.turbo/turbo-build.log +23 -24
  428. package/components/radio/.turbo/turbo-bundler.log +4 -4
  429. package/components/radio/.turbo/turbo-postCss$colon$component.log +1 -2
  430. package/components/radio/.turbo/turbo-sass$colon$render.log +6 -6
  431. package/components/radio/.turbo/turbo-types.log +1 -1
  432. package/components/radio/README.md +18 -26
  433. package/components/radio/demo/api.md +7 -4
  434. package/components/radio/demo/api.min.js +120 -58
  435. package/components/radio/demo/index.min.js +120 -58
  436. package/components/radio/dist/auro-radio-group.d.ts +5 -0
  437. package/components/radio/dist/auro-radio-group.d.ts.map +1 -1
  438. package/components/radio/dist/index.js +120 -58
  439. package/components/radio/package.json +1 -1
  440. package/components/radio/src/auro-radio-group.js +10 -2
  441. package/components/select/.turbo/turbo-build$colon$sass.log +12 -12
  442. package/components/select/.turbo/turbo-build.log +32 -33
  443. package/components/select/.turbo/turbo-postCss$colon$component.log +1 -2
  444. package/components/select/.turbo/turbo-sass$colon$render.log +4 -4
  445. package/components/select/README.md +21 -42
  446. package/components/select/demo/api.md +92 -121
  447. package/components/select/demo/api.min.js +2723 -711
  448. package/components/select/demo/index.md +101 -59
  449. package/components/select/demo/index.min.js +2722 -706
  450. package/components/select/dist/auro-select.d.ts +77 -48
  451. package/components/select/dist/auro-select.d.ts.map +1 -1
  452. package/components/select/dist/dropdownVersion.d.ts +3 -0
  453. package/components/select/dist/dropdownVersion.d.ts.map +1 -0
  454. package/components/select/dist/index.js +2082 -367
  455. package/components/select/package.json +3 -3
  456. package/components/select/src/auro-select.js +148 -129
  457. package/components/select/src/dropdownVersion.js +1 -0
  458. package/components/select/src/styles/style-css.js +1 -1
  459. package/components/select/src/styles/style.css +14 -0
  460. package/components/select/src/styles/style.scss +24 -1
  461. package/package.json +21 -21
  462. package/packages/build-tools/src/docProcessor.mjs +37 -8
  463. package/packages/form-validation/src/validation.js +104 -50
  464. package/packages/utils/package.json +12 -0
  465. package/packages/utils/src/iconUtil.js +25 -0
  466. package/packages/utils/src/index.js +1 -0
  467. package/turbo.json +8 -8
  468. package/.turbo/cache/013a48308b893dac-meta.json +0 -1
  469. package/.turbo/cache/013a48308b893dac.tar.zst +0 -0
  470. package/.turbo/cache/0663fcbb1d711029-meta.json +0 -1
  471. package/.turbo/cache/0663fcbb1d711029.tar.zst +0 -0
  472. package/.turbo/cache/07ca42419b9f050c-meta.json +0 -1
  473. package/.turbo/cache/07ca42419b9f050c.tar.zst +0 -0
  474. package/.turbo/cache/0a2b0a4df8a0443f-meta.json +0 -1
  475. package/.turbo/cache/0a2b0a4df8a0443f.tar.zst +0 -0
  476. package/.turbo/cache/0cea4c1f34f3683b-meta.json +0 -1
  477. package/.turbo/cache/0cea4c1f34f3683b.tar.zst +0 -0
  478. package/.turbo/cache/120c8e207aa1ba35-meta.json +0 -1
  479. package/.turbo/cache/120c8e207aa1ba35.tar.zst +0 -0
  480. package/.turbo/cache/17259cf94d8f8925-meta.json +0 -1
  481. package/.turbo/cache/17259cf94d8f8925.tar.zst +0 -0
  482. package/.turbo/cache/17dd4bdef6550a07-meta.json +0 -1
  483. package/.turbo/cache/17dd4bdef6550a07.tar.zst +0 -0
  484. package/.turbo/cache/1c99a949ec63ab35-meta.json +0 -1
  485. package/.turbo/cache/1c99a949ec63ab35.tar.zst +0 -0
  486. package/.turbo/cache/1de15d89eed2d760-meta.json +0 -1
  487. package/.turbo/cache/1de15d89eed2d760.tar.zst +0 -0
  488. package/.turbo/cache/257a7a26ea72dbc5-meta.json +0 -1
  489. package/.turbo/cache/257a7a26ea72dbc5.tar.zst +0 -0
  490. package/.turbo/cache/2990aaa7ebc5b967-meta.json +0 -1
  491. package/.turbo/cache/2990aaa7ebc5b967.tar.zst +0 -0
  492. package/.turbo/cache/32c0b9995fb5f8dd-meta.json +0 -1
  493. package/.turbo/cache/32c0b9995fb5f8dd.tar.zst +0 -0
  494. package/.turbo/cache/3bf45120d0cc9bd8-meta.json +0 -1
  495. package/.turbo/cache/3bf45120d0cc9bd8.tar.zst +0 -0
  496. package/.turbo/cache/45035bf5c4147ccd-meta.json +0 -1
  497. package/.turbo/cache/45035bf5c4147ccd.tar.zst +0 -0
  498. package/.turbo/cache/47ba2b5ebdb579e9-meta.json +0 -1
  499. package/.turbo/cache/47ba2b5ebdb579e9.tar.zst +0 -0
  500. package/.turbo/cache/4f92cea2d8c63de2-meta.json +0 -1
  501. package/.turbo/cache/4f92cea2d8c63de2.tar.zst +0 -0
  502. package/.turbo/cache/56cb35d4c7473a23-meta.json +0 -1
  503. package/.turbo/cache/56cb35d4c7473a23.tar.zst +0 -0
  504. package/.turbo/cache/5c16ce3cff5c9dff-meta.json +0 -1
  505. package/.turbo/cache/5c16ce3cff5c9dff.tar.zst +0 -0
  506. package/.turbo/cache/5f304c0f37ef25f3-meta.json +0 -1
  507. package/.turbo/cache/5f304c0f37ef25f3.tar.zst +0 -0
  508. package/.turbo/cache/626afdc67e0cb540-meta.json +0 -1
  509. package/.turbo/cache/626afdc67e0cb540.tar.zst +0 -0
  510. package/.turbo/cache/64de7a53e02db647-meta.json +0 -1
  511. package/.turbo/cache/64de7a53e02db647.tar.zst +0 -0
  512. package/.turbo/cache/691a74627ec57993-meta.json +0 -1
  513. package/.turbo/cache/691a74627ec57993.tar.zst +0 -0
  514. package/.turbo/cache/69aae513b7ec6c7d-meta.json +0 -1
  515. package/.turbo/cache/69aae513b7ec6c7d.tar.zst +0 -0
  516. package/.turbo/cache/6dd7058e6703cb35-meta.json +0 -1
  517. package/.turbo/cache/6dd7058e6703cb35.tar.zst +0 -0
  518. package/.turbo/cache/6ef81cf9a66f982a-meta.json +0 -1
  519. package/.turbo/cache/6ef81cf9a66f982a.tar.zst +0 -0
  520. package/.turbo/cache/73e9073a5274616d-meta.json +0 -1
  521. package/.turbo/cache/73e9073a5274616d.tar.zst +0 -0
  522. package/.turbo/cache/773edc0f83c8c5a5-meta.json +0 -1
  523. package/.turbo/cache/773edc0f83c8c5a5.tar.zst +0 -0
  524. package/.turbo/cache/784c03fe9fd5ac05-meta.json +0 -1
  525. package/.turbo/cache/784c03fe9fd5ac05.tar.zst +0 -0
  526. package/.turbo/cache/786a822763403879-meta.json +0 -1
  527. package/.turbo/cache/786a822763403879.tar.zst +0 -0
  528. package/.turbo/cache/80b5d974184a01df-meta.json +0 -1
  529. package/.turbo/cache/80b5d974184a01df.tar.zst +0 -0
  530. package/.turbo/cache/87219c41a4ace9cd-meta.json +0 -1
  531. package/.turbo/cache/87219c41a4ace9cd.tar.zst +0 -0
  532. package/.turbo/cache/8954c6073396fadd-meta.json +0 -1
  533. package/.turbo/cache/8954c6073396fadd.tar.zst +0 -0
  534. package/.turbo/cache/8b735250fa5a62bf-meta.json +0 -1
  535. package/.turbo/cache/8b735250fa5a62bf.tar.zst +0 -0
  536. package/.turbo/cache/9154e8fe6ab767ea-meta.json +0 -1
  537. package/.turbo/cache/9154e8fe6ab767ea.tar.zst +0 -0
  538. package/.turbo/cache/92daa6d7c389d548-meta.json +0 -1
  539. package/.turbo/cache/92daa6d7c389d548.tar.zst +0 -0
  540. package/.turbo/cache/993dff2edb7b6766-meta.json +0 -1
  541. package/.turbo/cache/993dff2edb7b6766.tar.zst +0 -0
  542. package/.turbo/cache/9a097d6576dadd64-meta.json +0 -1
  543. package/.turbo/cache/9a097d6576dadd64.tar.zst +0 -0
  544. package/.turbo/cache/a49cc58242467fdc-meta.json +0 -1
  545. package/.turbo/cache/a49cc58242467fdc.tar.zst +0 -0
  546. package/.turbo/cache/a6a56bb802e1c20f-meta.json +0 -1
  547. package/.turbo/cache/a6a56bb802e1c20f.tar.zst +0 -0
  548. package/.turbo/cache/a77bc920ea508bb8-meta.json +0 -1
  549. package/.turbo/cache/a77bc920ea508bb8.tar.zst +0 -0
  550. package/.turbo/cache/af061e7a077a9ba5-meta.json +0 -1
  551. package/.turbo/cache/af061e7a077a9ba5.tar.zst +0 -0
  552. package/.turbo/cache/b50f1b283b4b81cd-meta.json +0 -1
  553. package/.turbo/cache/b50f1b283b4b81cd.tar.zst +0 -0
  554. package/.turbo/cache/b54fc4f664a7a5a0-meta.json +0 -1
  555. package/.turbo/cache/b54fc4f664a7a5a0.tar.zst +0 -0
  556. package/.turbo/cache/ba4418918621fbcd-meta.json +0 -1
  557. package/.turbo/cache/ba4418918621fbcd.tar.zst +0 -0
  558. package/.turbo/cache/be7c23c37b8ec74b-meta.json +0 -1
  559. package/.turbo/cache/be7c23c37b8ec74b.tar.zst +0 -0
  560. package/.turbo/cache/bf85bc040b7e64db-meta.json +0 -1
  561. package/.turbo/cache/bf85bc040b7e64db.tar.zst +0 -0
  562. package/.turbo/cache/caa0b4ac8d2a04dd-meta.json +0 -1
  563. package/.turbo/cache/caa0b4ac8d2a04dd.tar.zst +0 -0
  564. package/.turbo/cache/cc81de9c0b452a7c-meta.json +0 -1
  565. package/.turbo/cache/cc81de9c0b452a7c.tar.zst +0 -0
  566. package/.turbo/cache/cd5f6987783fb56d-meta.json +0 -1
  567. package/.turbo/cache/cd5f6987783fb56d.tar.zst +0 -0
  568. package/.turbo/cache/ce67b6522dd09e64-meta.json +0 -1
  569. package/.turbo/cache/ce67b6522dd09e64.tar.zst +0 -0
  570. package/.turbo/cache/d716cb7a08152beb-meta.json +0 -1
  571. package/.turbo/cache/d716cb7a08152beb.tar.zst +0 -0
  572. package/.turbo/cache/d7a47b77deb3d9a4-meta.json +0 -1
  573. package/.turbo/cache/d7a47b77deb3d9a4.tar.zst +0 -0
  574. package/.turbo/cache/dad1301ac69bcb85-meta.json +0 -1
  575. package/.turbo/cache/dad1301ac69bcb85.tar.zst +0 -0
  576. package/.turbo/cache/e992dab20aeefbaf-meta.json +0 -1
  577. package/.turbo/cache/e992dab20aeefbaf.tar.zst +0 -0
  578. package/.turbo/cache/fa132b5b5f0e75f8-meta.json +0 -1
  579. package/.turbo/cache/fa132b5b5f0e75f8.tar.zst +0 -0
  580. package/.turbo/cache/fbbe2704bf9cb90b-meta.json +0 -1
  581. package/.turbo/cache/fbbe2704bf9cb90b.tar.zst +0 -0
  582. package/.turbo/cache/ff58f630c9d69af4-meta.json +0 -1
  583. package/.turbo/cache/ff58f630c9d69af4.tar.zst +0 -0
@@ -10,23 +10,32 @@ import colorCss from "./styles/color-menu-css.js";
10
10
  import tokensCss from "./styles/tokens-css.js";
11
11
 
12
12
  import AuroLibraryRuntimeUtils from '@aurodesignsystem/auro-library/scripts/utils/runtimeUtils.mjs';
13
+ import {
14
+ arrayOrUndefinedHasChanged,
15
+ isOptionInteractive,
16
+ dispatchMenuEvent,
17
+ arrayConverter
18
+ } from './auro-menu-utils.js';
19
+
13
20
 
14
21
  // See https://git.io/JJ6SJ for "How to document your components using JSDoc"
15
22
  /**
16
23
  * The auro-menu element provides users a way to select from a list of options.
17
- * @attr {Object} optionSelected - Specifies the current selected menuOption.
18
- * @attr {String} matchWord - Specifies a string used to highlight matched string parts in options.
19
- * @attr {Boolean} disabled - When true, the entire menu and all options are disabled;
20
- * @attr {Boolean} noCheckmark - When true, selected option will not show the checkmark.
21
- * @attr {Boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
22
- * @attr {String} value - Value selected for the menu.
23
- * @prop {Boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
24
- * @event auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
25
- * @event auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
26
- * @event auroMenu-selectValueFailure - Notifies that a an attempt to select a menuoption by matching a value has failed.
27
- * @event auroMenu-customEventFired - Notifies that a custom event has been fired.
28
- * @event auroMenu-selectValueReset - Notifies that the component value has been reset.
29
- * @event auroMenu-loadingChange - Notifies when the loading attribute is changed.
24
+ * @attr {Array<HTMLElement>|undefined} optionselected - An array of currently selected menu options. In single-select mode, the array will contain only one HTMLElement. `undefined` when no options are selected.
25
+ * @attr {object} optionactive - Specifies the current active menuOption.
26
+ * @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
27
+ * @attr {boolean} disabled - When true, the entire menu and all options are disabled;
28
+ * @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
29
+ * @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
30
+ * @attr {boolean} multiselect - When true, the selected option can be multiple options.
31
+ * @attr {Array<string>|undefined} value - Value selected for the menu. `undefined` when no selection has been made, otherwise an array of strings. In single-select mode, the array will contain only one value.
32
+ * @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
33
+ * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
34
+ * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
35
+ * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
36
+ * @event {CustomEvent<any>} auroMenu-selectValueFailure - Notifies that an attempt to select a menuoption by matching a value has failed.
37
+ * @event {CustomEvent<any>} auroMenu-selectValueReset - Notifies that the component value has been reset.
38
+ * @event {CustomEvent<any>} auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
30
39
  * @slot loadingText - Text to show while loading attribute is set
31
40
  * @slot loadingIcon - Icon to show while loading attribute is set
32
41
  * @slot - Slot for insertion of menu options.
@@ -37,52 +46,104 @@ import AuroLibraryRuntimeUtils from '@aurodesignsystem/auro-library/scripts/util
37
46
  export class AuroMenu extends LitElement {
38
47
  constructor() {
39
48
  super();
49
+
50
+ // State properties (reactive)
51
+
52
+ // Value of the selected options
40
53
  this.value = undefined;
54
+ // Currently selected option
41
55
  this.optionSelected = undefined;
56
+ // String used for highlighting/filtering
42
57
  this.matchWord = undefined;
58
+ // Hide the checkmark icon on selected options
43
59
  this.noCheckmark = false;
60
+ // Currently active option
44
61
  this.optionActive = undefined;
62
+ // Loading state
45
63
  this.loading = false;
64
+ // Multi-select mode
65
+ this.multiSelect = false;
66
+
67
+ // Event Bindings
68
+
69
+ /**
70
+ * @private
71
+ */
72
+ this.handleKeyDown = this.handleKeyDown.bind(this);
46
73
 
47
74
  /**
48
75
  * @private
49
76
  */
50
- this.rootMenu = true;
77
+ this.handleMouseSelect = this.handleMouseSelect.bind(this);
51
78
 
52
79
  /**
53
80
  * @private
54
81
  */
55
- this.runtimeUtils = new AuroLibraryRuntimeUtils();
82
+ this.handleOptionHover = this.handleOptionHover.bind(this);
56
83
 
57
84
  /**
58
85
  * @private
59
86
  */
60
- this.nestingSpacer = '<span class="nestingSpacer"></span>';
87
+ this.handleSlotChange = this.handleSlotChange.bind(this);
88
+
89
+ // Instance properties (non-reactive)
61
90
 
62
91
  /**
63
92
  * @private
64
93
  */
65
- this.loadingSlots = null;
94
+ Object.assign(this, {
95
+ // Root-level menu (true) or a nested submenu (false)
96
+ rootMenu: true,
97
+ // Currently focused/active menu item index
98
+ index: -1,
99
+ // Nested menu spacer
100
+ nestingSpacer: '<span class="nestingSpacer"></span>',
101
+ // Loading indicator for slot elements
102
+ loadingSlots: null,
103
+ // Store for menu items
104
+ items: [],
105
+ });
66
106
  }
67
107
 
68
108
  static get properties() {
69
109
  return {
70
- noCheckmark: {
110
+ noCheckmark: {
71
111
  type: Boolean,
72
- reflect: true
112
+ reflect: true,
113
+ attribute: 'nocheckmark'
73
114
  },
74
- disabled: {
115
+ disabled: {
75
116
  type: Boolean,
76
117
  reflect: true
77
118
  },
78
- loading: {
119
+ loading: {
79
120
  type: Boolean,
80
121
  reflect: true
81
122
  },
82
- optionSelected: { type: Object },
83
- optionActive: { type: Object },
84
- matchWord: { type: String },
85
- value: { type: String }
123
+ optionSelected: {
124
+ // Allow HTMLElement[] arrays and undefined
125
+ converter: arrayConverter,
126
+ hasChanged: arrayOrUndefinedHasChanged
127
+ },
128
+ optionActive: {
129
+ type: Object,
130
+ attribute: 'optionactive'
131
+ },
132
+ matchWord: {
133
+ type: String,
134
+ attribute: 'matchword'
135
+ },
136
+ multiSelect: {
137
+ type: Boolean,
138
+ reflect: true,
139
+ attribute: 'multiselect'
140
+ },
141
+ value: {
142
+ // Allow string[] arrays and undefined
143
+ type: Object,
144
+ converter: arrayConverter,
145
+ hasChanged: arrayOrUndefinedHasChanged
146
+ }
86
147
  };
87
148
  }
88
149
 
@@ -106,198 +167,328 @@ export class AuroMenu extends LitElement {
106
167
  AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenu);
107
168
  }
108
169
 
109
- /**
110
- * Passes the noCheckmark attribute to all nested auro-menuoptions.
111
- * @private
112
- * @returns {void}
113
- */
114
- handleNoCheckmarkAttr() {
115
- if (this.noCheckmark) {
116
- const menus = this.querySelectorAll('auro-menu, [auro-menu]');
170
+ // Lifecycle Methods
117
171
 
118
- menus.forEach((menu) => {
119
- menu.setAttribute('noCheckmark', '');
120
- });
172
+ connectedCallback() {
173
+ super.connectedCallback();
121
174
 
122
- const options = this.querySelectorAll('auro-menuoption, [auro-menuoption]');
175
+ this.addEventListener('keydown', this.handleKeyDown);
176
+ this.addEventListener('mousedown', this.handleMouseSelect);
177
+ this.addEventListener('auroMenuOption-mouseover', this.handleOptionHover);
178
+ this.addEventListener('slotchange', this.handleSlotChange);
179
+ }
123
180
 
124
- options.forEach((option) => {
125
- option.setAttribute('noCheckmark', '');
126
- });
127
- }
181
+ disconnectedCallback() {
182
+ this.removeEventListener('keydown', this.handleKeyDown);
183
+ this.removeEventListener('mousedown', this.handleMouseSelect);
184
+ this.removeEventListener('auroMenuOption-mouseover', this.handleOptionHover);
185
+ this.removeEventListener('slotchange', this.handleSlotChange);
186
+
187
+ super.disconnectedCallback();
128
188
  }
129
189
 
130
190
  firstUpdated() {
131
- // Add the tag name as an attribute if it is different than the component name
132
- this.runtimeUtils.handleComponentTagRename(this, 'auro-menu');
133
-
134
- this.addEventListener('keydown', this.handleKeyDown);
191
+ AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-menu');
135
192
 
136
193
  this.loadingSlots = this.querySelectorAll("[slot='loadingText'], [slot='loadingIcon']");
194
+ this.initializeMenu();
137
195
  }
138
196
 
139
197
  updated(changedProperties) {
140
- if (changedProperties.has('matchWord')) {
141
- this.markOptions();
198
+ if (changedProperties.has('value')) {
199
+ // Handle null/undefined case
200
+ if (this.value === undefined || this.value === null) {
201
+ this.optionSelected = undefined;
202
+ // Reset index tracking
203
+ this.index = -1;
204
+ } else {
205
+ // Convert single values to arrays
206
+ const valueArray = Array.isArray(this.value) ? this.value : [this.value];
207
+
208
+ // Find all matching options
209
+ const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
210
+
211
+ if (matchingOptions.length > 0) {
212
+ if (this.multiSelect) {
213
+ // For multiselect, keep all matching options
214
+ this.optionSelected = matchingOptions;
215
+ } else {
216
+ // For single select, only use the first match
217
+ this.optionSelected = [matchingOptions[0]];
218
+ this.index = this.items.indexOf(matchingOptions[0]);
219
+ }
220
+ } else {
221
+ // No matches found - trigger failure event
222
+ dispatchMenuEvent(this, 'auroMenu-selectValueFailure');
223
+ this.optionSelected = undefined;
224
+ this.index = -1;
225
+ }
226
+ }
227
+
228
+ // Update UI state
229
+ this.updateItemsState(new Map([
230
+ [
231
+ 'optionSelected',
232
+ true
233
+ ]
234
+ ]));
235
+
236
+ // Notify of changes
237
+ if (this.optionSelected !== undefined) {
238
+ this.notifySelectionChange();
239
+ }
142
240
  }
143
241
 
144
- if (changedProperties.has('value')) {
145
- this.selectByValue(this.value);
242
+ // Process all other UI updates
243
+ this.updateItemsState(changedProperties);
244
+ }
245
+
246
+ /**
247
+ * Updates the UI state and appearance of menu items based on changed properties.
248
+ * @private
249
+ * @param {Map<string, boolean>} changedProperties - LitElement's changed properties map.
250
+ */
251
+ updateItemsState(changedProperties) {
252
+ if (!this.items) {
253
+ return;
254
+ }
255
+
256
+ // Handle noCheckmark propagation to all menus and options
257
+ if (changedProperties.has('noCheckmark') && this.noCheckmark) {
258
+ // Update both menus and options
259
+ this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]').forEach((element) => element.setAttribute('noCheckmark', ''));
146
260
  }
147
261
 
148
- if (changedProperties.has('disabled')) {
149
- const options = Array.from(this.querySelectorAll('auro-menuoption, [auro-menuoption]'));
262
+ // Regex for matchWord if needed
263
+ let regexWord = null;
150
264
 
151
- for (const element of options) {
152
- element.disabled = this.disabled;
153
- }
265
+ if (changedProperties.has('matchWord') && this.matchWord && this.matchWord.length) {
266
+ const escapedWord = this.matchWord.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
267
+ regexWord = new RegExp(escapedWord, 'giu');
154
268
  }
155
269
 
156
- if (changedProperties.has('loading')) {
157
- const event = new CustomEvent("auroMenu-loadingChange", {
158
- detail: {
159
- loading: this.loading,
160
- hasLoadingPlaceholder:
161
- this.hasLoadingPlaceholder
270
+ // Handle direct item updates
271
+ this.items.forEach((option) => {
272
+ // Update selection if option or value changed
273
+ if (changedProperties.has('optionSelected') || changedProperties.has('value')) {
274
+ const isSelected = this.isOptionSelected(option);
275
+ option.setAttribute('aria-selected', isSelected ? 'true' : 'false');
276
+
277
+ // Add/remove selected attribute based on state
278
+ if (isSelected) {
279
+ option.setAttribute('selected', '');
280
+ } else {
281
+ option.removeAttribute('selected');
162
282
  }
283
+ }
284
+
285
+ // Update text highlighting if matchWord changed
286
+ if (changedProperties.has('matchWord') && regexWord &&
287
+ isOptionInteractive(option) && !option.hasAttribute('persistent')) {
288
+ const nested = option.querySelectorAll('.nestingSpacer');
289
+ // Create nested spacers
290
+ const nestingSpacerBundle = [...nested].map(() => this.nestingSpacer).join('');
291
+
292
+ // Update with spacers and matchWord
293
+ option.innerHTML = nestingSpacerBundle +
294
+ option.textContent.replace(
295
+ regexWord,
296
+ (match) => `<strong>${match}</strong>`
297
+ );
298
+ }
299
+
300
+ // Update disabled state
301
+ if (changedProperties.has('disabled')) {
302
+ option.disabled = this.disabled;
303
+ }
304
+ });
305
+
306
+ // Handle loading state changes
307
+ if (changedProperties.has('loading')) {
308
+ this.setAttribute("aria-busy", this.loading);
309
+ dispatchMenuEvent(this, "auroMenu-loadingChange", {
310
+ loading: this.loading,
311
+ hasLoadingPlaceholder: this.hasLoadingPlaceholder
163
312
  });
164
- this.setAttribute("aria-busy", this.hasAttribute("loading"));
165
- this.dispatchEvent(event);
166
313
  }
167
314
  }
168
315
 
316
+ // Init Methods
317
+
169
318
  /**
319
+ * Initializes the menu's state and structure.
170
320
  * @private
171
- * @param {Object} option - The menuoption to check for interactive state.
172
- * @returns {Boolean} Returns true if the option is interactive.
173
321
  */
174
- optionInteractive(option) {
175
- return !option.hasAttribute('hidden') && !option.hasAttribute('disabled') && !option.hasAttribute('static');
322
+ initializeMenu() {
323
+ this.initItems();
324
+ if (this.rootMenu) {
325
+ this.setAttribute('role', 'listbox');
326
+ this.setAttribute('root', '');
327
+ this.handleNestedMenus(this);
328
+ }
176
329
  }
177
330
 
178
331
  /**
332
+ * Initializes menu items and their attributes.
179
333
  * @private
180
- * @returns {void} When called will update the DOM with visible suggest text matches.
181
334
  */
182
- markOptions() {
183
- if (this.items && this.items.length > 0 && (this.matchWord && this.matchWord.length > 0)) {
184
-
185
- // Escape special regex characters
186
- const escapedWord = this.matchWord.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
187
-
188
- // Global, case-insensitive, unicode matching regex pattern
189
- const regexWord = new RegExp(escapedWord, 'giu');
190
-
191
- this.items.forEach((item) => {
192
- if (this.optionInteractive(item) && !item.hasAttribute('persistent')) {
193
- const nested = item.querySelectorAll('.nestingSpacer');
194
- const nestingSpacerBundle = [...nested].map(() => this.nestingSpacer).join('');
195
-
196
- item.innerHTML = nestingSpacerBundle + item.textContent.replace(regexWord, (match) => `<strong>${match}</strong>`);
197
- }
198
- });
335
+ initItems() {
336
+ this.items = Array.from(this.querySelectorAll('auro-menuoption, [auro-menuoption]'));
337
+ if (this.noCheckmark) {
338
+ this.updateItemsState(new Map([
339
+ [
340
+ 'noCheckmark',
341
+ true
342
+ ]
343
+ ]));
199
344
  }
200
345
  }
201
346
 
347
+ // Logic Methods
348
+
202
349
  /**
203
- * Reset the menu and all options.
350
+ * Updates menu state when an option is selected.
351
+ * @private
352
+ * @param {HTMLElement} option - The option element to select.
204
353
  */
205
- resetOptionsStates() {
206
- this.optionSelected = undefined;
207
- if (this.items) {
208
- this.items.forEach((item) => {
209
- item.classList.remove('active');
210
- item.removeAttribute('selected');
211
- });
354
+ handleSelectState(option) {
355
+ if (this.multiSelect) {
356
+ const currentValue = this.value || [];
357
+ const currentSelected = this.optionSelected || [];
358
+
359
+ if (!currentValue.includes(option.value)) {
360
+ this.value = [
361
+ ...currentValue,
362
+ option.value
363
+ ];
364
+ }
365
+ if (!currentSelected.includes(option)) {
366
+ this.optionSelected = [
367
+ ...currentSelected,
368
+ option
369
+ ];
370
+ }
371
+ } else {
372
+ // Single select - use arrays with single values
373
+ this.value = [option.value];
374
+ this.optionSelected = [option];
212
375
  }
376
+
377
+ this.index = this.items.indexOf(option);
213
378
  }
214
379
 
215
380
  /**
216
- * Set the attributes on the selected menuoption, the menu value and stored option.
217
- * @param {Object} option - The menuoption to be selected.
381
+ * Deselects a menu option and updates related state.
218
382
  * @private
383
+ * @param {HTMLElement} option - The menuoption to be deselected.
219
384
  */
220
- handleLocalSelectState(option) {
221
- option.setAttribute('selected', '');
222
- option.classList.add('active');
223
- option.ariaSelected = true;
385
+ handleDeselectState(option) {
386
+ if (this.multiSelect && Array.isArray(this.value)) {
387
+ // Remove this option from array
388
+ this.value = this.value.filter((val) => val !== option.value);
389
+
390
+ // If array is empty after removal, set back to undefined
391
+ if (this.value.length === 0) {
392
+ this.value = undefined;
393
+ }
394
+
395
+ this.optionSelected = this.optionSelected.filter((val) => val !== option);
396
+ if (this.optionSelected.length === 0) {
397
+ this.optionSelected = undefined;
398
+ }
399
+ } else {
400
+ // For single-select: Back to undefined when deselected
401
+ this.value = undefined;
402
+ this.optionSelected = undefined;
403
+ }
224
404
 
225
- this.value = option.value;
226
- this.optionSelected = option;
405
+ // Update the index tracking
227
406
  this.index = this.items.indexOf(option);
407
+
408
+ // Update UI to reflect changes
409
+ this.updateItemsState(new Map([
410
+ [
411
+ 'optionSelected',
412
+ true
413
+ ]
414
+ ]));
415
+
416
+ // Notify of selection change
417
+ this.notifySelectionChange();
228
418
  }
229
419
 
230
420
  /**
231
- * Notify selection change.
421
+ * Resets all options to their default state.
232
422
  * @private
233
- * @return {void}
234
423
  */
235
- notifySelectionChange() {
236
- this.dispatchEvent(new CustomEvent('auroMenu-selectedOption', {
237
- bubbles: true,
238
- cancelable: false,
239
- composed: true,
240
- }));
424
+ clearSelection() {
425
+ this.optionSelected = undefined;
426
+ this.value = undefined;
241
427
  }
242
428
 
243
429
  /**
244
- * Process actions for making making a menuoption selection.
430
+ * Resets the menu to its initial state.
431
+ * This is the only way to return value to undefined.
432
+ * @public
245
433
  */
246
- makeSelection() {
247
- if (!this.items) {
248
- this.initItems();
249
- }
434
+ reset() {
435
+ // Reset to undefined - initial state
436
+ this.value = undefined;
437
+ this.optionSelected = undefined;
438
+ this.index = -1;
439
+
440
+ // Reset UI state
441
+ this.updateItemsState(new Map([
442
+ [
443
+ 'optionSelected',
444
+ true
445
+ ]
446
+ ]));
447
+
448
+ // Dispatch reset event
449
+ dispatchMenuEvent(this, 'auroMenu-selectValueReset');
450
+ }
250
451
 
251
- if (this.items[this.index] && !this.items[this.index].hasAttribute('disabled')) {
252
- this.resetOptionsStates();
253
-
254
- if (this.index >= 0) {
255
- const option = this.items[this.index];
256
-
257
- // only handle options that are not disabled, hidden or static
258
- if (option && this.optionInteractive(option)) {
259
- // fire custom event if defined otherwise make selection
260
- if (option.hasAttribute('event')) {
261
- this.dispatchEvent(new CustomEvent(option.getAttribute('event'), {
262
- bubbles: true,
263
- cancelable: false,
264
- composed: true,
265
- }));
266
-
267
- this.dispatchEvent(new CustomEvent('auroMenu-customEventFired', {
268
- bubbles: true,
269
- cancelable: false,
270
- composed: true,
271
- }));
272
- } else {
273
- this.handleLocalSelectState(option);
274
- }
275
- }
452
+ /**
453
+ * Handles nested menu structure.
454
+ * @private
455
+ * @param {HTMLElement} menu - Root menu element.
456
+ */
457
+ handleNestedMenus(menu) {
458
+ const nestedMenus = menu.querySelectorAll('auro-menu, [auro-menu]');
459
+
460
+ nestedMenus.forEach((nestedMenu) => {
461
+ // role="listbox" only allows "role=group" for children.
462
+ nestedMenu.setAttribute('role', 'group');
463
+ if (!nestedMenu.hasAttribute('aria-label')) {
464
+ nestedMenu.setAttribute('aria-label', 'submenu');
276
465
  }
277
- }
278
466
 
279
- this.notifySelectionChange();
467
+ const options = nestedMenu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption]');
468
+ options.forEach((option) => {
469
+ option.innerHTML = this.nestingSpacer + option.innerHTML;
470
+ });
471
+
472
+ this.handleNestedMenus(nestedMenu);
473
+ });
280
474
  }
281
475
 
476
+ // Event Handlers
477
+
282
478
  /**
283
- * Manage ArrowDown, ArrowUp and Enter keyboard events.
479
+ * Handles keyboard navigation.
284
480
  * @private
285
- * @param {Object} event - Event object from the browser.
481
+ * @param {KeyboardEvent} event - Event object from the browser.
286
482
  */
287
483
  handleKeyDown(event) {
288
484
  event.preventDefault();
289
-
290
- // With ArrowDown/ArrowUp events, pass new value to selectNextItem()
291
- // With Enter event, set value and apply attrs
292
485
  switch (event.key) {
293
486
  case "ArrowDown":
294
- this.selectNextItem('down');
487
+ this.navigateOptions('down');
295
488
  break;
296
-
297
489
  case "ArrowUp":
298
- this.selectNextItem('up');
490
+ this.navigateOptions('up');
299
491
  break;
300
-
301
492
  case "Enter":
302
493
  this.makeSelection();
303
494
  break;
@@ -307,222 +498,218 @@ export class AuroMenu extends LitElement {
307
498
  }
308
499
 
309
500
  /**
310
- * Initializes all menu options in the DOM. This must be re-run every time the options are changed.
501
+ * Makes a selection based on the current index or clicked option.
311
502
  * @private
312
503
  */
313
- initItems() {
314
- this.items = Array.from(this.querySelectorAll('auro-menuoption, [auro-menuoption]'));
315
- this.handleNoCheckmarkAttr();
504
+ makeSelection() {
505
+ if (!this.items) {
506
+ this.initItems();
507
+ }
508
+
509
+ // Get currently selected menu option based on index
510
+ const option = this.items[this.index];
511
+
512
+ // Return early if option is not interactive
513
+ if (!option || !isOptionInteractive(option)) {
514
+ return;
515
+ }
516
+
517
+ // Handle custom events first
518
+ if (option.hasAttribute('event')) {
519
+ this.handleCustomEvent(option);
520
+ return;
521
+ }
522
+
523
+ if (this.multiSelect) {
524
+ // In multiselect, toggle individual selections
525
+ this.toggleOption(option);
526
+ // In single select, only handle selection of new options
527
+ } else if (!this.isOptionSelected(option)) {
528
+ this.clearSelection();
529
+ this.handleSelectState(option);
530
+ }
531
+
532
+ this.notifySelectionChange();
316
533
  }
317
534
 
318
535
  /**
319
- * Sets the index value of the selected item or first non-disabled menuoption.
536
+ * Toggle the selection state of the menuoption.
320
537
  * @private
538
+ * @param {HTMLElement} option - The menuoption to toggle.
321
539
  */
322
- getSelectedIndex() {
323
- // find the first `selected` and not `disabled`, `hidden` or `static` option
324
- const index = this.items.findIndex((option) => option.hasAttribute('selected') && this.optionInteractive(option));
540
+ toggleOption(option) {
541
+ const isCurrentlySelected = this.isOptionSelected(option);
325
542
 
326
- if (index >= 0) {
327
- this.index = index;
328
- this.makeSelection();
543
+ if (isCurrentlySelected) {
544
+ this.handleDeselectState(option);
545
+ } else if (option.value === undefined || option.value === '') {
546
+ dispatchMenuEvent(this, 'auroMenu-selectValueFailure');
547
+ } else {
548
+ this.handleSelectState(option);
329
549
  }
330
550
  }
331
551
 
332
552
  /**
333
- * Using value of current this.index evaluates index
334
- * of next :focus to set based on array of this.items ignoring items
335
- * with disabled attr.
336
- *
337
- * The event.target is not used as the function needs to know where to go,
338
- * versus knowing where it is.
339
- * @param {String} moveDirection - Up or Down based on keyboard event.
553
+ * Handles option selection via mouse.
554
+ * @private
555
+ * @param {MouseEvent} event - Event object from the browser.
340
556
  */
341
- selectNextItem(moveDirection) {
342
- if (this.index >= 0) {
343
- this.items[this.index].classList.remove('active');
344
-
345
- // calculate which is the selection we should focus next
346
- let increment = 0;
347
-
348
- if (moveDirection === 'down') {
349
- increment = 1;
350
- } else if (moveDirection === 'up') {
351
- increment = -1;
352
- }
353
-
354
- this.index += increment;
355
-
356
- // keep looping inside the array of options
357
- if (this.index > this.items.length - 1) {
358
- this.index = 0;
359
- } else if (this.index < 0) {
360
- this.index = this.items.length - 1;
361
- }
362
-
363
- // check if new index is disabled, static or hidden, if so, execute again
364
- if (!this.optionInteractive(this.items[this.index])) {
365
- this.selectNextItem(moveDirection);
366
- } else {
367
- // apply focus to new index
368
- this.updateActiveOption(this.index);
369
- }
370
- } else {
371
- this.index = 0;
557
+ handleMouseSelect(event) {
558
+ if (event.target === this) {
559
+ return;
560
+ }
372
561
 
373
- if (this.items[this.index].hasAttribute('hidden') || this.items[this.index].hasAttribute('disabled')) {
374
- this.selectNextItem(moveDirection);
375
- } else {
376
- this.updateActiveOption(this.index);
377
- }
562
+ const option = event.target.closest('auro-menuoption, [auro-menuoption]');
563
+ if (option) {
564
+ this.index = this.items.indexOf(option);
565
+ this.makeSelection();
378
566
  }
379
567
  }
380
568
 
381
569
  /**
382
- * Used for applying indentation to each level of nested menu.
570
+ * Handles option hover events.
383
571
  * @private
384
- * @param {String} menu - Root level menu object.
572
+ * @param {CustomEvent} event - Event object from the browser.
385
573
  */
386
- handleNestedMenus(menu) {
387
- const nestedMenus = menu.querySelectorAll('auro-menu, [auro-menu');
574
+ handleOptionHover(event) {
575
+ const option = event.target;
576
+ this.index = this.items.indexOf(option);
577
+ this.updateActiveOption(this.index);
578
+ }
388
579
 
389
- if (nestedMenus.length === 0) {
390
- return;
580
+ /**
581
+ * Handles slot change events.
582
+ * @private
583
+ */
584
+ handleSlotChange() {
585
+ if (this.parentElement && this.parentElement.closest('auro-menu, [auro-menu]')) {
586
+ this.rootMenu = false;
391
587
  }
392
588
 
393
- nestedMenus.forEach((nestedMenu) => {
394
- const options = nestedMenu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption');
395
-
396
- options.forEach((option) => {
397
- option.innerHTML = this.nestingSpacer + option.innerHTML;
398
- });
399
-
400
- this.handleNestedMenus(nestedMenu);
401
- });
589
+ if (this.rootMenu) {
590
+ this.initializeMenu();
591
+ } else if (this.noCheckmark) {
592
+ this.updateItemsState(new Map([
593
+ [
594
+ 'noCheckmark',
595
+ true
596
+ ]
597
+ ]));
598
+ }
402
599
  }
403
600
 
404
601
  /**
405
- * Method to apply `selected` attribute to `menuoption` via `value`.
602
+ * Navigates through options using keyboard.
406
603
  * @private
407
- * @param {String} value - Must match a unique `menuoption` value.
604
+ * @param {string} direction - 'up' or 'down'.
408
605
  */
409
- selectByValue(value) {
410
- let valueMatch = false;
411
- if (!this.items) {
412
- this.initItems();
606
+ navigateOptions(direction) {
607
+ // Return early if no items exist
608
+ if (!this.items || !this.items.length) {
609
+ return;
413
610
  }
414
611
 
415
- this.index = undefined;
612
+ let newIndex = this.index;
613
+ const increment = direction === 'down' ? 1 : -1;
614
+ const maxIterations = this.items.length;
615
+ let iterations = 0;
616
+ let foundInteractiveOption = false;
416
617
 
417
- if (this.value && this.value.length > 0) {
418
- for (let index = 0; index < this.items.length; index += 1) {
419
- if (this.items[index].value === value) {
420
- valueMatch = true;
421
- this.index = index;
422
- }
423
- }
618
+ do {
619
+ newIndex = (newIndex + increment + this.items.length) % this.items.length;
620
+ iterations += 1;
424
621
 
425
- if (!valueMatch) {
426
- // reset the menu to no selection
427
- this.index = undefined;
622
+ // Check if current option is interactive
623
+ const currentOption = this.items[newIndex];
624
+ if (isOptionInteractive(currentOption)) {
625
+ foundInteractiveOption = true;
626
+ break;
627
+ }
428
628
 
429
- this.dispatchEvent(new CustomEvent('auroMenu-selectValueFailure', {
430
- bubbles: true,
431
- cancelable: false,
432
- composed: true,
433
- }));
434
- } else {
435
- this.makeSelection();
629
+ // Break if all options were checked
630
+ if (iterations >= maxIterations) {
631
+ break;
436
632
  }
437
- } else {
438
- this.resetOptionsStates();
633
+ } while (iterations < maxIterations);
439
634
 
440
- this.dispatchEvent(new CustomEvent('auroMenu-selectValueReset', {
441
- bubbles: true,
442
- cancelable: false,
443
- composed: true,
444
- }));
635
+ // Handle the results of the search
636
+ if (foundInteractiveOption) {
637
+ // Update only if an interactive option was found
638
+ this.index = newIndex;
639
+ this.updateActiveOption(this.index);
640
+ } else {
641
+ // All options are disabled or non-interactive
642
+ // Keep the current index unchanged
643
+ dispatchMenuEvent(this, 'auroMenu-navigateFailure', {
644
+ reason: 'No interactive options available',
645
+ direction,
646
+ currentIndex: this.index
647
+ });
445
648
  }
446
649
  }
447
650
 
448
651
  /**
449
- * Used to make the active state for options follow mouseover.
450
- * @param {Number} index - Index of the menuoption that will be made active.
652
+ * Updates the active option state and dispatches events.
451
653
  * @private
654
+ * @param {number} index - Index of the option to make active.
452
655
  */
453
656
  updateActiveOption(index) {
454
- this.items.forEach((item) => {
455
- item.classList.remove('active');
456
- });
657
+ if (!this.items || !this.items[index]) {
658
+ return;
659
+ }
660
+
661
+ this.items.forEach((item) => item.classList.remove('active'));
457
662
  this.items[index].classList.add('active');
458
663
  this.optionActive = this.items[index];
459
664
 
460
- this.dispatchEvent(new CustomEvent('auroMenu-activatedOption', {
461
- bubbles: true,
462
- cancelable: false,
463
- composed: true,
464
- detail: this.items[index]
465
- }));
665
+ dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
466
666
  }
467
667
 
468
668
  /**
469
- * Used to only make a selection when a menuoption is receiving a mousedown event.
470
- * @param {Event} evt - Mousedown event.
669
+ * Handles custom events defined on options.
471
670
  * @private
671
+ * @param {HTMLElement} option - Option with custom event.
472
672
  */
473
- handleMenuMouseDown(evt) {
474
- if (evt.target !== this) {
475
- this.makeSelection();
476
- }
673
+ handleCustomEvent(option) {
674
+ const eventName = option.getAttribute('event');
675
+ dispatchMenuEvent(this, eventName);
676
+ dispatchMenuEvent(this, 'auroMenu-customEventFired');
477
677
  }
478
678
 
479
679
  /**
480
- * Checks if there are any loading placeholders in the component.
481
- *
482
- * This getter evaluates the `loadingSlots` collection to determine if it contains any items.
483
- * If the size of the collection is greater than zero, it indicates the presence of loading
484
- * placeholders, returning true; otherwise, it returns false.
485
- *
486
- * @getter hasLoadingPlaceholder
487
- * @type {boolean}
488
- * @returns {boolean} Returns true if loading placeholders exist; false otherwise.
680
+ * Notifies selection change to parent components.
681
+ * @private
489
682
  */
490
- get hasLoadingPlaceholder() {
491
- return this.loadingSlots.length > 0;
683
+ notifySelectionChange() {
684
+ dispatchMenuEvent(this, 'auroMenu-selectedOption');
492
685
  }
493
686
 
494
687
  /**
495
- * Used for @slotchange event on slotted element.
688
+ * Checks if an option is currently selected.
496
689
  * @private
690
+ * @param {HTMLElement} option - The option to check.
691
+ * @returns {boolean}
497
692
  */
498
- handleSlotItems() {
499
- // Determine if this is the root of the menu/submenu layout.
500
- if (this.parentElement && this.parentElement.closest('auro-menu, [auro-menu]')) {
501
- this.rootMenu = false;
693
+ isOptionSelected(option) {
694
+ if (!this.optionSelected) {
695
+ return false;
502
696
  }
697
+ // Always treat as array for both single and multi-select
698
+ return Array.isArray(this.optionSelected) && this.optionSelected.includes(option);
699
+ }
503
700
 
504
- // If this is the root menu (not a nested menu) handle events, states and styling.
505
- if (this.rootMenu) {
506
- this.initItems();
507
- this.setAttribute('role', 'listbox');
508
- this.setAttribute('root', '');
509
- this.handleNestedMenus(this);
510
- this.markOptions();
511
- this.index = -1;
512
- this.getSelectedIndex();
513
-
514
- this.addEventListener('keydown', this.handleKeyDown);
515
- this.addEventListener('mousedown', this.handleMenuMouseDown);
516
- this.addEventListener('auroMenuOption-mouseover', (evt) => {
517
- this.index = this.items.indexOf(evt.target);
518
- this.updateActiveOption(this.index);
519
- });
520
- } else {
521
- // make sure to update all menuoption noCheckmark attributes when the menu is dynamically changed
522
- this.handleNoCheckmarkAttr();
523
- }
701
+ /**
702
+ * Getter for loading placeholder state.
703
+ * @returns {boolean} - True if loading slots are present and non-empty.
704
+ */
705
+ get hasLoadingPlaceholder() {
706
+ return this.loadingSlots && this.loadingSlots.length > 0;
524
707
  }
525
708
 
709
+ /**
710
+ * Renders the component.
711
+ * @returns {boolean} - True if loading slots are present and non-empty.
712
+ */
526
713
  render() {
527
714
  if (this.loading) {
528
715
  return html`
@@ -534,6 +721,8 @@ export class AuroMenu extends LitElement {
534
721
  </auro-menuoption>
535
722
  `;
536
723
  }
537
- return html`<slot @slotchange=${this.handleSlotItems}></slot>`;
724
+
725
+ return html`<slot @slotchange=${this.handleSlotChange}></slot>`;
538
726
  }
539
727
  }
728
+