@aurodesignsystem/auro-formkit 2.0.0-beta.1 → 2.0.0-beta.11

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 (568) hide show
  1. package/.turbo/cache/0c8124a987c1cc05-meta.json +1 -0
  2. package/.turbo/cache/0c8124a987c1cc05.tar.zst +0 -0
  3. package/.turbo/cache/0cd512cdf86242c7-meta.json +1 -0
  4. package/.turbo/cache/0cd512cdf86242c7.tar.zst +0 -0
  5. package/.turbo/cache/123c83cd8727dff3-meta.json +1 -0
  6. package/.turbo/cache/123c83cd8727dff3.tar.zst +0 -0
  7. package/.turbo/cache/18129dba20f51b6b-meta.json +1 -0
  8. package/.turbo/cache/18129dba20f51b6b.tar.zst +0 -0
  9. package/.turbo/cache/253e861af7025ed4-meta.json +1 -0
  10. package/.turbo/cache/253e861af7025ed4.tar.zst +0 -0
  11. package/.turbo/cache/2787020e69f50af2-meta.json +1 -0
  12. package/.turbo/cache/2787020e69f50af2.tar.zst +0 -0
  13. package/.turbo/cache/2a5295c8f561ed84-meta.json +1 -0
  14. package/.turbo/cache/2a5295c8f561ed84.tar.zst +0 -0
  15. package/.turbo/cache/2c0d681132c153dd-meta.json +1 -0
  16. package/.turbo/cache/2c0d681132c153dd.tar.zst +0 -0
  17. package/.turbo/cache/4006a206400d5c7b-meta.json +1 -0
  18. package/.turbo/cache/4006a206400d5c7b.tar.zst +0 -0
  19. package/.turbo/cache/492dda333b8d15f1-meta.json +1 -0
  20. package/.turbo/cache/492dda333b8d15f1.tar.zst +0 -0
  21. package/.turbo/cache/4e3619d9dfc86809-meta.json +1 -0
  22. package/.turbo/cache/4e3619d9dfc86809.tar.zst +0 -0
  23. package/.turbo/cache/50993de942ec15a9-meta.json +1 -0
  24. package/.turbo/cache/50993de942ec15a9.tar.zst +0 -0
  25. package/.turbo/cache/50cd7dcfc9f820c5-meta.json +1 -0
  26. package/.turbo/cache/50cd7dcfc9f820c5.tar.zst +0 -0
  27. package/.turbo/cache/51eaa58d5c167de8-meta.json +1 -0
  28. package/.turbo/cache/51eaa58d5c167de8.tar.zst +0 -0
  29. package/.turbo/cache/5a0d3e26da304c62-meta.json +1 -0
  30. package/.turbo/cache/5a0d3e26da304c62.tar.zst +0 -0
  31. package/.turbo/cache/5c960af698582835-meta.json +1 -0
  32. package/.turbo/cache/5c960af698582835.tar.zst +0 -0
  33. package/.turbo/cache/5dbbb71dffc3f542-meta.json +1 -0
  34. package/.turbo/cache/5dbbb71dffc3f542.tar.zst +0 -0
  35. package/.turbo/cache/6081837e8943b62e-meta.json +1 -0
  36. package/.turbo/cache/6081837e8943b62e.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/77da375a012de9d0-meta.json +1 -0
  42. package/.turbo/cache/77da375a012de9d0.tar.zst +0 -0
  43. package/.turbo/cache/7964d1656e9e702a-meta.json +1 -0
  44. package/.turbo/cache/7964d1656e9e702a.tar.zst +0 -0
  45. package/.turbo/cache/7bf2b06a479d0b30-meta.json +1 -0
  46. package/.turbo/cache/7bf2b06a479d0b30.tar.zst +0 -0
  47. package/.turbo/cache/7c9ca6163e61285c-meta.json +1 -0
  48. package/.turbo/cache/7c9ca6163e61285c.tar.zst +0 -0
  49. package/.turbo/cache/80aca269cd346fb4-meta.json +1 -0
  50. package/.turbo/cache/80aca269cd346fb4.tar.zst +0 -0
  51. package/.turbo/cache/8602fc2bb737a5cf-meta.json +1 -0
  52. package/.turbo/cache/8602fc2bb737a5cf.tar.zst +0 -0
  53. package/.turbo/cache/89e0e7a6148e854f-meta.json +1 -0
  54. package/.turbo/cache/89e0e7a6148e854f.tar.zst +0 -0
  55. package/.turbo/cache/8bb856bd31b5b479-meta.json +1 -0
  56. package/.turbo/cache/8bb856bd31b5b479.tar.zst +0 -0
  57. package/.turbo/cache/93c887fb93a10daa-meta.json +1 -0
  58. package/.turbo/cache/93c887fb93a10daa.tar.zst +0 -0
  59. package/.turbo/cache/94dae2a64e9d8356-meta.json +1 -0
  60. package/.turbo/cache/94dae2a64e9d8356.tar.zst +0 -0
  61. package/.turbo/cache/97f6fe83b54acf09-meta.json +1 -0
  62. package/.turbo/cache/97f6fe83b54acf09.tar.zst +0 -0
  63. package/.turbo/cache/98317b0d14d94df7-meta.json +1 -0
  64. package/.turbo/cache/98317b0d14d94df7.tar.zst +0 -0
  65. package/.turbo/cache/9ae99e8e7bd83d06-meta.json +1 -0
  66. package/.turbo/cache/9ae99e8e7bd83d06.tar.zst +0 -0
  67. package/.turbo/cache/9cbcd13b1d031f63-meta.json +1 -0
  68. package/.turbo/cache/9cbcd13b1d031f63.tar.zst +0 -0
  69. package/.turbo/cache/afbbd49ed1a558b9-meta.json +1 -0
  70. package/.turbo/cache/afbbd49ed1a558b9.tar.zst +0 -0
  71. package/.turbo/cache/b353ce8f6da43dea-meta.json +1 -0
  72. package/.turbo/cache/b353ce8f6da43dea.tar.zst +0 -0
  73. package/.turbo/cache/b5e6dc7fb9ae1a2f-meta.json +1 -0
  74. package/.turbo/cache/b5e6dc7fb9ae1a2f.tar.zst +0 -0
  75. package/.turbo/cache/b6a202cc85cb61a0-meta.json +1 -0
  76. package/.turbo/cache/b6a202cc85cb61a0.tar.zst +0 -0
  77. package/.turbo/cache/b8db059a9b9ccb5d-meta.json +1 -0
  78. package/.turbo/cache/b8db059a9b9ccb5d.tar.zst +0 -0
  79. package/.turbo/cache/bc24a38aa1b1a102-meta.json +1 -0
  80. package/.turbo/cache/bc24a38aa1b1a102.tar.zst +0 -0
  81. package/.turbo/cache/be0b95293ea517cc-meta.json +1 -0
  82. package/.turbo/cache/be0b95293ea517cc.tar.zst +0 -0
  83. package/.turbo/cache/c3a4f7a3565d6706-meta.json +1 -0
  84. package/.turbo/cache/c3a4f7a3565d6706.tar.zst +0 -0
  85. package/.turbo/cache/c44efc9e4ddd8a0e-meta.json +1 -0
  86. package/.turbo/cache/c44efc9e4ddd8a0e.tar.zst +0 -0
  87. package/.turbo/cache/c6c6411199b68170-meta.json +1 -0
  88. package/.turbo/cache/c6c6411199b68170.tar.zst +0 -0
  89. package/.turbo/cache/c97b043e748e3580-meta.json +1 -0
  90. package/.turbo/cache/c97b043e748e3580.tar.zst +0 -0
  91. package/.turbo/cache/d5db503b2eaf239c-meta.json +1 -0
  92. package/.turbo/cache/d5db503b2eaf239c.tar.zst +0 -0
  93. package/.turbo/cache/d775555355d6b8fc-meta.json +1 -0
  94. package/.turbo/cache/d775555355d6b8fc.tar.zst +0 -0
  95. package/.turbo/cache/d7c3007be148d2a1-meta.json +1 -0
  96. package/.turbo/cache/d7c3007be148d2a1.tar.zst +0 -0
  97. package/.turbo/cache/dad3d78b33edd9e4-meta.json +1 -0
  98. package/.turbo/cache/dad3d78b33edd9e4.tar.zst +0 -0
  99. package/.turbo/cache/dc597b3ea4f61ec8-meta.json +1 -0
  100. package/.turbo/cache/dc597b3ea4f61ec8.tar.zst +0 -0
  101. package/.turbo/cache/df40b180126e5351-meta.json +1 -0
  102. package/.turbo/cache/df40b180126e5351.tar.zst +0 -0
  103. package/.turbo/cache/e5f217f77c32c93b-meta.json +1 -0
  104. package/.turbo/cache/e5f217f77c32c93b.tar.zst +0 -0
  105. package/.turbo/cache/e62cfee068e3ef36-meta.json +1 -0
  106. package/.turbo/cache/e62cfee068e3ef36.tar.zst +0 -0
  107. package/.turbo/cache/e9e36823f6c98f07-meta.json +1 -0
  108. package/.turbo/cache/e9e36823f6c98f07.tar.zst +0 -0
  109. package/.turbo/cache/ee1a3c1fe389da51-meta.json +1 -0
  110. package/.turbo/cache/ee1a3c1fe389da51.tar.zst +0 -0
  111. package/.turbo/cache/f3c7b40f2c6a4094-meta.json +1 -0
  112. package/.turbo/cache/f3c7b40f2c6a4094.tar.zst +0 -0
  113. package/.turbo/cache/f5958c3acb889631-meta.json +1 -0
  114. package/.turbo/cache/f5958c3acb889631.tar.zst +0 -0
  115. package/.turbo/cache/fb3809ac3f90e3b2-meta.json +1 -0
  116. package/.turbo/cache/fb3809ac3f90e3b2.tar.zst +0 -0
  117. package/.turbo/cache/fd5ddfa43ebd8e5c-meta.json +1 -0
  118. package/.turbo/cache/fd5ddfa43ebd8e5c.tar.zst +0 -0
  119. package/.vscode/settings.json +3 -0
  120. package/CHANGELOG.md +122 -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 +65 -65
  130. package/components/checkbox/demo/api.min.js +184 -84
  131. package/components/checkbox/demo/index.md +62 -62
  132. package/components/checkbox/demo/index.min.js +184 -84
  133. package/components/checkbox/dist/auro-checkbox-group.d.ts +35 -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 +184 -84
  138. package/components/checkbox/package.json +1 -1
  139. package/components/checkbox/src/auro-checkbox-group.js +46 -17
  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 +24 -22
  147. package/components/combobox/demo/api.min.js +3156 -893
  148. package/components/combobox/demo/index.md +1 -1
  149. package/components/combobox/demo/index.min.js +3153 -890
  150. package/components/combobox/dist/auro-combobox.d.ts +20 -8
  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 +2512 -564
  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 +138 -95
  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 +179 -7
  227. package/components/counter/.turbo/turbo-build$colon$version.log +10 -0
  228. package/components/counter/.turbo/turbo-build.log +288 -14
  229. package/components/counter/.turbo/turbo-bundler.log +4 -4
  230. package/components/counter/.turbo/turbo-postCss$colon$component.log +1 -2
  231. package/components/counter/.turbo/turbo-sass$colon$render.log +39 -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 +98 -1016
  235. package/components/counter/demo/api.min.js +1670 -32
  236. package/components/counter/demo/index.js +2 -1
  237. package/components/counter/demo/index.md +194 -0
  238. package/components/counter/demo/index.min.js +1702 -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 +77 -6
  242. package/components/counter/dist/auro-counter-group.d.ts.map +1 -1
  243. package/components/counter/dist/auro-counter.d.ts +78 -0
  244. package/components/counter/dist/auro-counter.d.ts.map +1 -1
  245. package/components/counter/dist/dropdownVersion.d.ts +3 -0
  246. package/components/counter/dist/dropdownVersion.d.ts.map +1 -0
  247. package/components/counter/dist/formkit/auro-dropdownVersion.d.ts +3 -0
  248. package/components/counter/dist/formkit/auro-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 +1670 -32
  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-group-color-css.d.ts +3 -0
  261. package/components/counter/dist/styles/counter-group-color-css.d.ts.map +1 -0
  262. package/components/counter/dist/styles/tokens-css.d.ts +3 -0
  263. package/components/counter/dist/styles/tokens-css.d.ts.map +1 -0
  264. package/components/counter/package.json +9 -3
  265. package/components/counter/src/auro-counter-button.js +42 -0
  266. package/components/counter/src/auro-counter-group.js +150 -21
  267. package/components/counter/src/auro-counter.js +272 -12
  268. package/components/counter/src/dropdownVersion.js +1 -0
  269. package/components/counter/src/formkit/auro-dropdownVersion.js +1 -0
  270. package/components/counter/src/iconVersion.js +1 -0
  271. package/components/counter/src/index.js +1 -1
  272. package/components/counter/src/styles/color-css.js +2 -0
  273. package/components/counter/src/styles/color.css +25 -0
  274. package/components/counter/src/styles/color.scss +44 -0
  275. package/components/counter/src/styles/counter-button-color-css.js +2 -0
  276. package/components/counter/src/styles/counter-button-color.css +14 -0
  277. package/components/counter/src/styles/counter-button-color.scss +29 -0
  278. package/components/counter/src/styles/counter-button-css.js +2 -0
  279. package/components/counter/src/styles/counter-button-tokens-css.js +2 -0
  280. package/components/counter/src/styles/counter-button-tokens.css +7 -0
  281. package/components/counter/src/styles/counter-button-tokens.scss +9 -0
  282. package/components/counter/src/styles/counter-button.css +187 -0
  283. package/components/counter/src/styles/counter-button.scss +83 -0
  284. package/components/counter/src/styles/counter-group-color-css.js +2 -0
  285. package/components/counter/src/styles/counter-group-color.css +4 -0
  286. package/components/counter/src/styles/counter-group-color.scss +19 -0
  287. package/components/counter/src/styles/counter-group-css.js +1 -1
  288. package/components/counter/src/styles/counter-group.css +13 -1
  289. package/components/counter/src/styles/counter-group.scss +14 -1
  290. package/components/counter/src/styles/style-css.js +1 -1
  291. package/components/counter/src/styles/style.css +43 -1
  292. package/components/counter/src/styles/style.scss +48 -2
  293. package/components/counter/src/styles/tokens-css.js +2 -0
  294. package/components/counter/src/styles/tokens.css +11 -0
  295. package/components/counter/src/styles/tokens.scss +24 -0
  296. package/components/datepicker/.turbo/turbo-build$colon$sass.log +34 -34
  297. package/components/datepicker/.turbo/turbo-build.log +58 -58
  298. package/components/datepicker/.turbo/turbo-postCss$colon$component.log +1 -2
  299. package/components/datepicker/.turbo/turbo-sass$colon$render.log +10 -10
  300. package/components/datepicker/README.md +21 -26
  301. package/components/datepicker/demo/api.md +177 -131
  302. package/components/datepicker/demo/api.min.js +995 -559
  303. package/components/datepicker/demo/index.md +1 -1
  304. package/components/datepicker/demo/index.min.js +995 -559
  305. package/components/datepicker/dist/auro-datepicker.d.ts +89 -78
  306. package/components/datepicker/dist/auro-datepicker.d.ts.map +1 -1
  307. package/components/datepicker/dist/dropdownVersion.d.ts +2 -0
  308. package/components/datepicker/dist/dropdownVersion.d.ts.map +1 -1
  309. package/components/datepicker/dist/index.js +995 -559
  310. package/components/datepicker/dist/inputVersion.d.ts +3 -0
  311. package/components/datepicker/dist/inputVersion.d.ts.map +1 -0
  312. package/components/datepicker/package.json +3 -3
  313. package/components/datepicker/src/auro-datepicker.js +142 -104
  314. package/components/datepicker/src/dropdownVersion.js +1 -0
  315. package/components/datepicker/src/inputVersion.js +1 -0
  316. package/components/datepicker/src/styles/color-cell-css.js +1 -1
  317. package/components/datepicker/src/styles/color-cell.css +1 -1
  318. package/components/datepicker/src/styles/color-cell.scss +1 -1
  319. package/components/dropdown/.turbo/turbo-build$colon$sass.log +8 -8
  320. package/components/dropdown/.turbo/turbo-build$colon$version.log +1 -1
  321. package/components/dropdown/.turbo/turbo-build.log +19 -20
  322. package/components/dropdown/.turbo/turbo-bundler.log +4 -4
  323. package/components/dropdown/.turbo/turbo-postCss$colon$component.log +1 -2
  324. package/components/dropdown/.turbo/turbo-sass$colon$render.log +6 -6
  325. package/components/dropdown/.turbo/turbo-types.log +1 -1
  326. package/components/dropdown/README.md +18 -26
  327. package/components/dropdown/demo/api.md +4 -4
  328. package/components/dropdown/demo/api.min.js +205 -81
  329. package/components/dropdown/demo/index.min.js +205 -81
  330. package/components/dropdown/dist/auro-dropdown.d.ts +93 -34
  331. package/components/dropdown/dist/auro-dropdown.d.ts.map +1 -1
  332. package/components/dropdown/dist/auro-dropdownBib.d.ts +9 -3
  333. package/components/dropdown/dist/auro-dropdownBib.d.ts.map +1 -1
  334. package/components/dropdown/dist/index.js +205 -81
  335. package/components/dropdown/package.json +1 -1
  336. package/components/dropdown/src/auro-dropdown.js +154 -39
  337. package/components/dropdown/src/auro-dropdownBib.js +12 -3
  338. package/components/dropdown/src/styles/style-css.js +1 -1
  339. package/components/dropdown/src/styles/style.css +4 -0
  340. package/components/dropdown/src/styles/style.scss +5 -0
  341. package/components/form/.turbo/turbo-build$colon$sass.log +6 -6
  342. package/components/form/.turbo/turbo-build$colon$version.log +1 -1
  343. package/components/form/.turbo/turbo-build.log +17 -18
  344. package/components/form/.turbo/turbo-bundler.log +4 -4
  345. package/components/form/.turbo/turbo-postCss$colon$component.log +1 -2
  346. package/components/form/.turbo/turbo-sass$colon$render.log +2 -2
  347. package/components/form/.turbo/turbo-types.log +1 -1
  348. package/components/form/README.md +18 -26
  349. package/components/form/demo/api.min.js +4 -4
  350. package/components/form/demo/index.min.js +4 -4
  351. package/components/form/dist/index.js +4 -4
  352. package/components/form/package.json +1 -1
  353. package/components/input/.turbo/turbo-build$colon$sass.log +66 -16
  354. package/components/input/.turbo/turbo-build$colon$version.log +1 -1
  355. package/components/input/.turbo/turbo-build.log +79 -32
  356. package/components/input/.turbo/turbo-bundler.log +4 -4
  357. package/components/input/.turbo/turbo-postCss$colon$component.log +1 -2
  358. package/components/input/.turbo/turbo-sass$colon$render.log +15 -9
  359. package/components/input/.turbo/turbo-types.log +1 -1
  360. package/components/input/README.md +18 -28
  361. package/components/input/demo/api.md +146 -311
  362. package/components/input/demo/api.min.js +365 -145
  363. package/components/input/demo/index.md +11 -61
  364. package/components/input/demo/index.min.js +365 -145
  365. package/components/input/dist/auro-input.d.ts.map +1 -1
  366. package/components/input/dist/base-input.d.ts +155 -84
  367. package/components/input/dist/base-input.d.ts.map +1 -1
  368. package/components/input/dist/index.js +365 -145
  369. package/components/input/dist/styles/mixins-css.d.ts +3 -0
  370. package/components/input/dist/styles/mixins-css.d.ts.map +1 -0
  371. package/components/input/package.json +1 -1
  372. package/components/input/src/auro-input.js +0 -1
  373. package/components/input/src/base-input.js +252 -85
  374. package/components/input/src/styles/borders.scss +3 -19
  375. package/components/input/src/styles/color.css +1 -2
  376. package/components/input/src/styles/color.scss +3 -10
  377. package/components/input/src/styles/input-css.js +1 -1
  378. package/components/input/src/styles/input.css +1 -1
  379. package/components/input/src/styles/input.scss +4 -1
  380. package/components/input/src/styles/label-css.js +1 -1
  381. package/components/input/src/styles/label.css +1 -1
  382. package/components/input/src/styles/label.scss +4 -7
  383. package/components/input/src/styles/mixins-css.js +2 -0
  384. package/components/input/src/styles/mixins.css +1 -0
  385. package/components/input/src/styles/mixins.scss +45 -0
  386. package/components/input/src/styles/notificationIcons-css.js +1 -1
  387. package/components/input/src/styles/notificationIcons.css +13 -12
  388. package/components/input/src/styles/notificationIcons.scss +17 -25
  389. package/components/input/src/styles/style-css.js +1 -1
  390. package/components/input/src/styles/style.css +15 -17
  391. package/components/input/src/styles/style.scss +0 -4
  392. package/components/menu/.turbo/turbo-build$colon$sass.log +9 -9
  393. package/components/menu/.turbo/turbo-build$colon$version.log +1 -1
  394. package/components/menu/.turbo/turbo-build.log +22 -21
  395. package/components/menu/.turbo/turbo-bundler.log +4 -4
  396. package/components/menu/.turbo/turbo-postCss$colon$component.log +1 -2
  397. package/components/menu/.turbo/turbo-sass$colon$render.log +6 -6
  398. package/components/menu/.turbo/turbo-types.log +1 -1
  399. package/components/menu/README.md +18 -26
  400. package/components/menu/demo/api.md +57 -20
  401. package/components/menu/demo/api.min.js +626 -311
  402. package/components/menu/demo/index.min.js +624 -309
  403. package/components/menu/dist/auro-menu-utils.d.ts +43 -0
  404. package/components/menu/dist/auro-menu-utils.d.ts.map +1 -0
  405. package/components/menu/dist/auro-menu.d.ts +97 -81
  406. package/components/menu/dist/auro-menu.d.ts.map +1 -1
  407. package/components/menu/dist/index.d.ts +1 -0
  408. package/components/menu/dist/index.js +625 -310
  409. package/components/menu/package.json +1 -1
  410. package/components/menu/src/auro-menu-utils.js +131 -0
  411. package/components/menu/src/auro-menu.js +493 -303
  412. package/components/menu/src/index.js +7 -0
  413. package/components/radio/.turbo/turbo-build$colon$sass.log +13 -13
  414. package/components/radio/.turbo/turbo-build.log +23 -24
  415. package/components/radio/.turbo/turbo-bundler.log +4 -4
  416. package/components/radio/.turbo/turbo-postCss$colon$component.log +1 -2
  417. package/components/radio/.turbo/turbo-sass$colon$render.log +6 -6
  418. package/components/radio/.turbo/turbo-types.log +1 -1
  419. package/components/radio/README.md +18 -26
  420. package/components/radio/demo/api.md +3 -1
  421. package/components/radio/demo/api.min.js +111 -57
  422. package/components/radio/demo/index.min.js +111 -57
  423. package/components/radio/dist/index.js +111 -57
  424. package/components/radio/package.json +1 -1
  425. package/components/radio/src/auro-radio-group.js +1 -1
  426. package/components/select/.turbo/turbo-build$colon$sass.log +12 -12
  427. package/components/select/.turbo/turbo-build.log +32 -33
  428. package/components/select/.turbo/turbo-postCss$colon$component.log +1 -2
  429. package/components/select/.turbo/turbo-sass$colon$render.log +4 -4
  430. package/components/select/README.md +21 -42
  431. package/components/select/demo/api.md +88 -118
  432. package/components/select/demo/api.min.js +2720 -714
  433. package/components/select/demo/index.md +101 -59
  434. package/components/select/demo/index.min.js +2719 -709
  435. package/components/select/dist/auro-select.d.ts +74 -50
  436. package/components/select/dist/auro-select.d.ts.map +1 -1
  437. package/components/select/dist/dropdownVersion.d.ts +3 -0
  438. package/components/select/dist/dropdownVersion.d.ts.map +1 -0
  439. package/components/select/dist/index.js +2078 -370
  440. package/components/select/package.json +3 -3
  441. package/components/select/src/auro-select.js +143 -132
  442. package/components/select/src/dropdownVersion.js +1 -0
  443. package/components/select/src/styles/style-css.js +1 -1
  444. package/components/select/src/styles/style.css +14 -0
  445. package/components/select/src/styles/style.scss +24 -1
  446. package/package.json +21 -21
  447. package/packages/build-tools/src/docProcessor.mjs +37 -8
  448. package/packages/form-validation/src/validation.js +104 -50
  449. package/packages/utils/package.json +12 -0
  450. package/packages/utils/src/iconUtil.js +25 -0
  451. package/packages/utils/src/index.js +1 -0
  452. package/turbo.json +8 -8
  453. package/.turbo/cache/013a48308b893dac-meta.json +0 -1
  454. package/.turbo/cache/013a48308b893dac.tar.zst +0 -0
  455. package/.turbo/cache/0663fcbb1d711029-meta.json +0 -1
  456. package/.turbo/cache/0663fcbb1d711029.tar.zst +0 -0
  457. package/.turbo/cache/07ca42419b9f050c-meta.json +0 -1
  458. package/.turbo/cache/07ca42419b9f050c.tar.zst +0 -0
  459. package/.turbo/cache/0a2b0a4df8a0443f-meta.json +0 -1
  460. package/.turbo/cache/0a2b0a4df8a0443f.tar.zst +0 -0
  461. package/.turbo/cache/0cea4c1f34f3683b-meta.json +0 -1
  462. package/.turbo/cache/0cea4c1f34f3683b.tar.zst +0 -0
  463. package/.turbo/cache/120c8e207aa1ba35-meta.json +0 -1
  464. package/.turbo/cache/120c8e207aa1ba35.tar.zst +0 -0
  465. package/.turbo/cache/141bb7d9a95e288b-meta.json +0 -1
  466. package/.turbo/cache/141bb7d9a95e288b.tar.zst +0 -0
  467. package/.turbo/cache/17259cf94d8f8925-meta.json +0 -1
  468. package/.turbo/cache/17259cf94d8f8925.tar.zst +0 -0
  469. package/.turbo/cache/17dd4bdef6550a07-meta.json +0 -1
  470. package/.turbo/cache/17dd4bdef6550a07.tar.zst +0 -0
  471. package/.turbo/cache/1c99a949ec63ab35-meta.json +0 -1
  472. package/.turbo/cache/1c99a949ec63ab35.tar.zst +0 -0
  473. package/.turbo/cache/1de15d89eed2d760-meta.json +0 -1
  474. package/.turbo/cache/1de15d89eed2d760.tar.zst +0 -0
  475. package/.turbo/cache/257a7a26ea72dbc5-meta.json +0 -1
  476. package/.turbo/cache/257a7a26ea72dbc5.tar.zst +0 -0
  477. package/.turbo/cache/2990aaa7ebc5b967-meta.json +0 -1
  478. package/.turbo/cache/2990aaa7ebc5b967.tar.zst +0 -0
  479. package/.turbo/cache/32c0b9995fb5f8dd-meta.json +0 -1
  480. package/.turbo/cache/32c0b9995fb5f8dd.tar.zst +0 -0
  481. package/.turbo/cache/3bf45120d0cc9bd8-meta.json +0 -1
  482. package/.turbo/cache/3bf45120d0cc9bd8.tar.zst +0 -0
  483. package/.turbo/cache/45035bf5c4147ccd-meta.json +0 -1
  484. package/.turbo/cache/45035bf5c4147ccd.tar.zst +0 -0
  485. package/.turbo/cache/4f92cea2d8c63de2-meta.json +0 -1
  486. package/.turbo/cache/4f92cea2d8c63de2.tar.zst +0 -0
  487. package/.turbo/cache/56cb35d4c7473a23-meta.json +0 -1
  488. package/.turbo/cache/56cb35d4c7473a23.tar.zst +0 -0
  489. package/.turbo/cache/5c16ce3cff5c9dff-meta.json +0 -1
  490. package/.turbo/cache/5c16ce3cff5c9dff.tar.zst +0 -0
  491. package/.turbo/cache/5f304c0f37ef25f3-meta.json +0 -1
  492. package/.turbo/cache/5f304c0f37ef25f3.tar.zst +0 -0
  493. package/.turbo/cache/626afdc67e0cb540-meta.json +0 -1
  494. package/.turbo/cache/626afdc67e0cb540.tar.zst +0 -0
  495. package/.turbo/cache/64de7a53e02db647-meta.json +0 -1
  496. package/.turbo/cache/64de7a53e02db647.tar.zst +0 -0
  497. package/.turbo/cache/691a74627ec57993-meta.json +0 -1
  498. package/.turbo/cache/691a74627ec57993.tar.zst +0 -0
  499. package/.turbo/cache/69aae513b7ec6c7d-meta.json +0 -1
  500. package/.turbo/cache/69aae513b7ec6c7d.tar.zst +0 -0
  501. package/.turbo/cache/6dd7058e6703cb35-meta.json +0 -1
  502. package/.turbo/cache/6dd7058e6703cb35.tar.zst +0 -0
  503. package/.turbo/cache/6ef81cf9a66f982a-meta.json +0 -1
  504. package/.turbo/cache/6ef81cf9a66f982a.tar.zst +0 -0
  505. package/.turbo/cache/73e9073a5274616d-meta.json +0 -1
  506. package/.turbo/cache/73e9073a5274616d.tar.zst +0 -0
  507. package/.turbo/cache/773edc0f83c8c5a5-meta.json +0 -1
  508. package/.turbo/cache/773edc0f83c8c5a5.tar.zst +0 -0
  509. package/.turbo/cache/784c03fe9fd5ac05-meta.json +0 -1
  510. package/.turbo/cache/784c03fe9fd5ac05.tar.zst +0 -0
  511. package/.turbo/cache/786a822763403879-meta.json +0 -1
  512. package/.turbo/cache/786a822763403879.tar.zst +0 -0
  513. package/.turbo/cache/80b5d974184a01df-meta.json +0 -1
  514. package/.turbo/cache/80b5d974184a01df.tar.zst +0 -0
  515. package/.turbo/cache/87219c41a4ace9cd-meta.json +0 -1
  516. package/.turbo/cache/87219c41a4ace9cd.tar.zst +0 -0
  517. package/.turbo/cache/8954c6073396fadd-meta.json +0 -1
  518. package/.turbo/cache/8954c6073396fadd.tar.zst +0 -0
  519. package/.turbo/cache/9154e8fe6ab767ea-meta.json +0 -1
  520. package/.turbo/cache/9154e8fe6ab767ea.tar.zst +0 -0
  521. package/.turbo/cache/92daa6d7c389d548-meta.json +0 -1
  522. package/.turbo/cache/92daa6d7c389d548.tar.zst +0 -0
  523. package/.turbo/cache/993dff2edb7b6766-meta.json +0 -1
  524. package/.turbo/cache/993dff2edb7b6766.tar.zst +0 -0
  525. package/.turbo/cache/9a097d6576dadd64-meta.json +0 -1
  526. package/.turbo/cache/9a097d6576dadd64.tar.zst +0 -0
  527. package/.turbo/cache/a49cc58242467fdc-meta.json +0 -1
  528. package/.turbo/cache/a49cc58242467fdc.tar.zst +0 -0
  529. package/.turbo/cache/a6a56bb802e1c20f-meta.json +0 -1
  530. package/.turbo/cache/a6a56bb802e1c20f.tar.zst +0 -0
  531. package/.turbo/cache/a77bc920ea508bb8-meta.json +0 -1
  532. package/.turbo/cache/a77bc920ea508bb8.tar.zst +0 -0
  533. package/.turbo/cache/af061e7a077a9ba5-meta.json +0 -1
  534. package/.turbo/cache/af061e7a077a9ba5.tar.zst +0 -0
  535. package/.turbo/cache/b50f1b283b4b81cd-meta.json +0 -1
  536. package/.turbo/cache/b50f1b283b4b81cd.tar.zst +0 -0
  537. package/.turbo/cache/b54fc4f664a7a5a0-meta.json +0 -1
  538. package/.turbo/cache/b54fc4f664a7a5a0.tar.zst +0 -0
  539. package/.turbo/cache/ba4418918621fbcd-meta.json +0 -1
  540. package/.turbo/cache/ba4418918621fbcd.tar.zst +0 -0
  541. package/.turbo/cache/bb8b41cd0ade3986-meta.json +0 -1
  542. package/.turbo/cache/bb8b41cd0ade3986.tar.zst +0 -0
  543. package/.turbo/cache/be7c23c37b8ec74b-meta.json +0 -1
  544. package/.turbo/cache/be7c23c37b8ec74b.tar.zst +0 -0
  545. package/.turbo/cache/bf85bc040b7e64db-meta.json +0 -1
  546. package/.turbo/cache/bf85bc040b7e64db.tar.zst +0 -0
  547. package/.turbo/cache/caa0b4ac8d2a04dd-meta.json +0 -1
  548. package/.turbo/cache/caa0b4ac8d2a04dd.tar.zst +0 -0
  549. package/.turbo/cache/cc81de9c0b452a7c-meta.json +0 -1
  550. package/.turbo/cache/cc81de9c0b452a7c.tar.zst +0 -0
  551. package/.turbo/cache/cd5f6987783fb56d-meta.json +0 -1
  552. package/.turbo/cache/cd5f6987783fb56d.tar.zst +0 -0
  553. package/.turbo/cache/cd845bb6102c589a-meta.json +0 -1
  554. package/.turbo/cache/cd845bb6102c589a.tar.zst +0 -0
  555. package/.turbo/cache/ce67b6522dd09e64-meta.json +0 -1
  556. package/.turbo/cache/ce67b6522dd09e64.tar.zst +0 -0
  557. package/.turbo/cache/d7a47b77deb3d9a4-meta.json +0 -1
  558. package/.turbo/cache/d7a47b77deb3d9a4.tar.zst +0 -0
  559. package/.turbo/cache/dad1301ac69bcb85-meta.json +0 -1
  560. package/.turbo/cache/dad1301ac69bcb85.tar.zst +0 -0
  561. package/.turbo/cache/e992dab20aeefbaf-meta.json +0 -1
  562. package/.turbo/cache/e992dab20aeefbaf.tar.zst +0 -0
  563. package/.turbo/cache/fa132b5b5f0e75f8-meta.json +0 -1
  564. package/.turbo/cache/fa132b5b5f0e75f8.tar.zst +0 -0
  565. package/.turbo/cache/fbbe2704bf9cb90b-meta.json +0 -1
  566. package/.turbo/cache/fbbe2704bf9cb90b.tar.zst +0 -0
  567. package/.turbo/cache/ff58f630c9d69af4-meta.json +0 -1
  568. 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,329 @@ 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.classList.toggle('active', isSelected);
276
+ option.setAttribute('aria-selected', isSelected ? 'true' : 'false');
277
+
278
+ // Add/remove selected attribute based on state
279
+ if (isSelected) {
280
+ option.setAttribute('selected', '');
281
+ } else {
282
+ option.removeAttribute('selected');
162
283
  }
284
+ }
285
+
286
+ // Update text highlighting if matchWord changed
287
+ if (changedProperties.has('matchWord') && regexWord &&
288
+ isOptionInteractive(option) && !option.hasAttribute('persistent')) {
289
+ const nested = option.querySelectorAll('.nestingSpacer');
290
+ // Create nested spacers
291
+ const nestingSpacerBundle = [...nested].map(() => this.nestingSpacer).join('');
292
+
293
+ // Update with spacers and matchWord
294
+ option.innerHTML = nestingSpacerBundle +
295
+ option.textContent.replace(
296
+ regexWord,
297
+ (match) => `<strong>${match}</strong>`
298
+ );
299
+ }
300
+
301
+ // Update disabled state
302
+ if (changedProperties.has('disabled')) {
303
+ option.disabled = this.disabled;
304
+ }
305
+ });
306
+
307
+ // Handle loading state changes
308
+ if (changedProperties.has('loading')) {
309
+ this.setAttribute("aria-busy", this.loading);
310
+ dispatchMenuEvent(this, "auroMenu-loadingChange", {
311
+ loading: this.loading,
312
+ hasLoadingPlaceholder: this.hasLoadingPlaceholder
163
313
  });
164
- this.setAttribute("aria-busy", this.hasAttribute("loading"));
165
- this.dispatchEvent(event);
166
314
  }
167
315
  }
168
316
 
317
+ // Init Methods
318
+
169
319
  /**
320
+ * Initializes the menu's state and structure.
170
321
  * @private
171
- * @param {Object} option - The menuoption to check for interactive state.
172
- * @returns {Boolean} Returns true if the option is interactive.
173
322
  */
174
- optionInteractive(option) {
175
- return !option.hasAttribute('hidden') && !option.hasAttribute('disabled') && !option.hasAttribute('static');
323
+ initializeMenu() {
324
+ this.initItems();
325
+ if (this.rootMenu) {
326
+ this.setAttribute('role', 'listbox');
327
+ this.setAttribute('root', '');
328
+ this.handleNestedMenus(this);
329
+ }
176
330
  }
177
331
 
178
332
  /**
333
+ * Initializes menu items and their attributes.
179
334
  * @private
180
- * @returns {void} When called will update the DOM with visible suggest text matches.
181
335
  */
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
- });
336
+ initItems() {
337
+ this.items = Array.from(this.querySelectorAll('auro-menuoption, [auro-menuoption]'));
338
+ if (this.noCheckmark) {
339
+ this.updateItemsState(new Map([
340
+ [
341
+ 'noCheckmark',
342
+ true
343
+ ]
344
+ ]));
199
345
  }
200
346
  }
201
347
 
348
+ // Logic Methods
349
+
202
350
  /**
203
- * Reset the menu and all options.
351
+ * Updates menu state when an option is selected.
352
+ * @private
353
+ * @param {HTMLElement} option - The option element to select.
204
354
  */
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
- });
355
+ handleSelectState(option) {
356
+ if (this.multiSelect) {
357
+ const currentValue = this.value || [];
358
+ const currentSelected = this.optionSelected || [];
359
+
360
+ if (!currentValue.includes(option.value)) {
361
+ this.value = [
362
+ ...currentValue,
363
+ option.value
364
+ ];
365
+ }
366
+ if (!currentSelected.includes(option)) {
367
+ this.optionSelected = [
368
+ ...currentSelected,
369
+ option
370
+ ];
371
+ }
372
+ } else {
373
+ // Single select - use arrays with single values
374
+ this.value = [option.value];
375
+ this.optionSelected = [option];
212
376
  }
377
+
378
+ this.index = this.items.indexOf(option);
213
379
  }
214
380
 
215
381
  /**
216
- * Set the attributes on the selected menuoption, the menu value and stored option.
217
- * @param {Object} option - The menuoption to be selected.
382
+ * Deselects a menu option and updates related state.
218
383
  * @private
384
+ * @param {HTMLElement} option - The menuoption to be deselected.
219
385
  */
220
- handleLocalSelectState(option) {
221
- option.setAttribute('selected', '');
222
- option.classList.add('active');
223
- option.ariaSelected = true;
386
+ handleDeselectState(option) {
387
+ if (this.multiSelect && Array.isArray(this.value)) {
388
+ // Remove this option from array
389
+ this.value = this.value.filter((val) => val !== option.value);
390
+
391
+ // If array is empty after removal, set back to undefined
392
+ if (this.value.length === 0) {
393
+ this.value = undefined;
394
+ }
395
+
396
+ this.optionSelected = this.optionSelected.filter((val) => val !== option);
397
+ if (this.optionSelected.length === 0) {
398
+ this.optionSelected = undefined;
399
+ }
400
+ } else {
401
+ // For single-select: Back to undefined when deselected
402
+ this.value = undefined;
403
+ this.optionSelected = undefined;
404
+ }
224
405
 
225
- this.value = option.value;
226
- this.optionSelected = option;
406
+ // Update the index tracking
227
407
  this.index = this.items.indexOf(option);
408
+
409
+ // Update UI to reflect changes
410
+ this.updateItemsState(new Map([
411
+ [
412
+ 'optionSelected',
413
+ true
414
+ ]
415
+ ]));
416
+
417
+ // Notify of selection change
418
+ this.notifySelectionChange();
228
419
  }
229
420
 
230
421
  /**
231
- * Notify selection change.
422
+ * Resets all options to their default state.
232
423
  * @private
233
- * @return {void}
234
424
  */
235
- notifySelectionChange() {
236
- this.dispatchEvent(new CustomEvent('auroMenu-selectedOption', {
237
- bubbles: true,
238
- cancelable: false,
239
- composed: true,
240
- }));
425
+ clearSelection() {
426
+ this.optionSelected = undefined;
427
+ this.value = undefined;
241
428
  }
242
429
 
243
430
  /**
244
- * Process actions for making making a menuoption selection.
431
+ * Resets the menu to its initial state.
432
+ * This is the only way to return value to undefined.
433
+ * @public
245
434
  */
246
- makeSelection() {
247
- if (!this.items) {
248
- this.initItems();
249
- }
435
+ reset() {
436
+ // Reset to undefined - initial state
437
+ this.value = undefined;
438
+ this.optionSelected = undefined;
439
+ this.index = -1;
440
+
441
+ // Reset UI state
442
+ this.updateItemsState(new Map([
443
+ [
444
+ 'optionSelected',
445
+ true
446
+ ]
447
+ ]));
448
+
449
+ // Dispatch reset event
450
+ dispatchMenuEvent(this, 'auroMenu-selectValueReset');
451
+ }
250
452
 
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
- }
453
+ /**
454
+ * Handles nested menu structure.
455
+ * @private
456
+ * @param {HTMLElement} menu - Root menu element.
457
+ */
458
+ handleNestedMenus(menu) {
459
+ const nestedMenus = menu.querySelectorAll('auro-menu, [auro-menu]');
460
+
461
+ nestedMenus.forEach((nestedMenu) => {
462
+ // role="listbox" only allows "role=group" for children.
463
+ nestedMenu.setAttribute('role', 'group');
464
+ if (!nestedMenu.hasAttribute('aria-label')) {
465
+ nestedMenu.setAttribute('aria-label', 'submenu');
276
466
  }
277
- }
278
467
 
279
- this.notifySelectionChange();
468
+ const options = nestedMenu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption]');
469
+ options.forEach((option) => {
470
+ option.innerHTML = this.nestingSpacer + option.innerHTML;
471
+ });
472
+
473
+ this.handleNestedMenus(nestedMenu);
474
+ });
280
475
  }
281
476
 
477
+ // Event Handlers
478
+
282
479
  /**
283
- * Manage ArrowDown, ArrowUp and Enter keyboard events.
480
+ * Handles keyboard navigation.
284
481
  * @private
285
- * @param {Object} event - Event object from the browser.
482
+ * @param {KeyboardEvent} event - Event object from the browser.
286
483
  */
287
484
  handleKeyDown(event) {
288
485
  event.preventDefault();
289
-
290
- // With ArrowDown/ArrowUp events, pass new value to selectNextItem()
291
- // With Enter event, set value and apply attrs
292
486
  switch (event.key) {
293
487
  case "ArrowDown":
294
- this.selectNextItem('down');
488
+ this.navigateOptions('down');
295
489
  break;
296
-
297
490
  case "ArrowUp":
298
- this.selectNextItem('up');
491
+ this.navigateOptions('up');
299
492
  break;
300
-
301
493
  case "Enter":
302
494
  this.makeSelection();
303
495
  break;
@@ -307,222 +499,218 @@ export class AuroMenu extends LitElement {
307
499
  }
308
500
 
309
501
  /**
310
- * Initializes all menu options in the DOM. This must be re-run every time the options are changed.
502
+ * Makes a selection based on the current index or clicked option.
311
503
  * @private
312
504
  */
313
- initItems() {
314
- this.items = Array.from(this.querySelectorAll('auro-menuoption, [auro-menuoption]'));
315
- this.handleNoCheckmarkAttr();
505
+ makeSelection() {
506
+ if (!this.items) {
507
+ this.initItems();
508
+ }
509
+
510
+ // Get currently selected menu option based on index
511
+ const option = this.items[this.index];
512
+
513
+ // Return early if option is not interactive
514
+ if (!option || !isOptionInteractive(option)) {
515
+ return;
516
+ }
517
+
518
+ // Handle custom events first
519
+ if (option.hasAttribute('event')) {
520
+ this.handleCustomEvent(option);
521
+ return;
522
+ }
523
+
524
+ if (this.multiSelect) {
525
+ // In multiselect, toggle individual selections
526
+ this.toggleOption(option);
527
+ // In single select, only handle selection of new options
528
+ } else if (!this.isOptionSelected(option)) {
529
+ this.clearSelection();
530
+ this.handleSelectState(option);
531
+ }
532
+
533
+ this.notifySelectionChange();
316
534
  }
317
535
 
318
536
  /**
319
- * Sets the index value of the selected item or first non-disabled menuoption.
537
+ * Toggle the selection state of the menuoption.
320
538
  * @private
539
+ * @param {HTMLElement} option - The menuoption to toggle.
321
540
  */
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));
541
+ toggleOption(option) {
542
+ const isCurrentlySelected = this.isOptionSelected(option);
325
543
 
326
- if (index >= 0) {
327
- this.index = index;
328
- this.makeSelection();
544
+ if (isCurrentlySelected) {
545
+ this.handleDeselectState(option);
546
+ } else if (option.value === undefined || option.value === '') {
547
+ dispatchMenuEvent(this, 'auroMenu-selectValueFailure');
548
+ } else {
549
+ this.handleSelectState(option);
329
550
  }
330
551
  }
331
552
 
332
553
  /**
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.
554
+ * Handles option selection via mouse.
555
+ * @private
556
+ * @param {MouseEvent} event - Event object from the browser.
340
557
  */
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;
558
+ handleMouseSelect(event) {
559
+ if (event.target === this) {
560
+ return;
561
+ }
372
562
 
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
- }
563
+ const option = event.target.closest('auro-menuoption, [auro-menuoption]');
564
+ if (option) {
565
+ this.index = this.items.indexOf(option);
566
+ this.makeSelection();
378
567
  }
379
568
  }
380
569
 
381
570
  /**
382
- * Used for applying indentation to each level of nested menu.
571
+ * Handles option hover events.
383
572
  * @private
384
- * @param {String} menu - Root level menu object.
573
+ * @param {CustomEvent} event - Event object from the browser.
385
574
  */
386
- handleNestedMenus(menu) {
387
- const nestedMenus = menu.querySelectorAll('auro-menu, [auro-menu');
575
+ handleOptionHover(event) {
576
+ const option = event.target;
577
+ this.index = this.items.indexOf(option);
578
+ this.updateActiveOption(this.index);
579
+ }
388
580
 
389
- if (nestedMenus.length === 0) {
390
- return;
581
+ /**
582
+ * Handles slot change events.
583
+ * @private
584
+ */
585
+ handleSlotChange() {
586
+ if (this.parentElement && this.parentElement.closest('auro-menu, [auro-menu]')) {
587
+ this.rootMenu = false;
391
588
  }
392
589
 
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
- });
590
+ if (this.rootMenu) {
591
+ this.initializeMenu();
592
+ } else if (this.noCheckmark) {
593
+ this.updateItemsState(new Map([
594
+ [
595
+ 'noCheckmark',
596
+ true
597
+ ]
598
+ ]));
599
+ }
402
600
  }
403
601
 
404
602
  /**
405
- * Method to apply `selected` attribute to `menuoption` via `value`.
603
+ * Navigates through options using keyboard.
406
604
  * @private
407
- * @param {String} value - Must match a unique `menuoption` value.
605
+ * @param {string} direction - 'up' or 'down'.
408
606
  */
409
- selectByValue(value) {
410
- let valueMatch = false;
411
- if (!this.items) {
412
- this.initItems();
607
+ navigateOptions(direction) {
608
+ // Return early if no items exist
609
+ if (!this.items || !this.items.length) {
610
+ return;
413
611
  }
414
612
 
415
- this.index = undefined;
613
+ let newIndex = this.index;
614
+ const increment = direction === 'down' ? 1 : -1;
615
+ const maxIterations = this.items.length;
616
+ let iterations = 0;
617
+ let foundInteractiveOption = false;
416
618
 
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
- }
619
+ do {
620
+ newIndex = (newIndex + increment + this.items.length) % this.items.length;
621
+ iterations += 1;
424
622
 
425
- if (!valueMatch) {
426
- // reset the menu to no selection
427
- this.index = undefined;
623
+ // Check if current option is interactive
624
+ const currentOption = this.items[newIndex];
625
+ if (isOptionInteractive(currentOption)) {
626
+ foundInteractiveOption = true;
627
+ break;
628
+ }
428
629
 
429
- this.dispatchEvent(new CustomEvent('auroMenu-selectValueFailure', {
430
- bubbles: true,
431
- cancelable: false,
432
- composed: true,
433
- }));
434
- } else {
435
- this.makeSelection();
630
+ // Break if all options were checked
631
+ if (iterations >= maxIterations) {
632
+ break;
436
633
  }
437
- } else {
438
- this.resetOptionsStates();
634
+ } while (iterations < maxIterations);
439
635
 
440
- this.dispatchEvent(new CustomEvent('auroMenu-selectValueReset', {
441
- bubbles: true,
442
- cancelable: false,
443
- composed: true,
444
- }));
636
+ // Handle the results of the search
637
+ if (foundInteractiveOption) {
638
+ // Update only if an interactive option was found
639
+ this.index = newIndex;
640
+ this.updateActiveOption(this.index);
641
+ } else {
642
+ // All options are disabled or non-interactive
643
+ // Keep the current index unchanged
644
+ dispatchMenuEvent(this, 'auroMenu-navigateFailure', {
645
+ reason: 'No interactive options available',
646
+ direction,
647
+ currentIndex: this.index
648
+ });
445
649
  }
446
650
  }
447
651
 
448
652
  /**
449
- * Used to make the active state for options follow mouseover.
450
- * @param {Number} index - Index of the menuoption that will be made active.
653
+ * Updates the active option state and dispatches events.
451
654
  * @private
655
+ * @param {number} index - Index of the option to make active.
452
656
  */
453
657
  updateActiveOption(index) {
454
- this.items.forEach((item) => {
455
- item.classList.remove('active');
456
- });
658
+ if (!this.items || !this.items[index]) {
659
+ return;
660
+ }
661
+
662
+ this.items.forEach((item) => item.classList.remove('active'));
457
663
  this.items[index].classList.add('active');
458
664
  this.optionActive = this.items[index];
459
665
 
460
- this.dispatchEvent(new CustomEvent('auroMenu-activatedOption', {
461
- bubbles: true,
462
- cancelable: false,
463
- composed: true,
464
- detail: this.items[index]
465
- }));
666
+ dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
466
667
  }
467
668
 
468
669
  /**
469
- * Used to only make a selection when a menuoption is receiving a mousedown event.
470
- * @param {Event} evt - Mousedown event.
670
+ * Handles custom events defined on options.
471
671
  * @private
672
+ * @param {HTMLElement} option - Option with custom event.
472
673
  */
473
- handleMenuMouseDown(evt) {
474
- if (evt.target !== this) {
475
- this.makeSelection();
476
- }
674
+ handleCustomEvent(option) {
675
+ const eventName = option.getAttribute('event');
676
+ dispatchMenuEvent(this, eventName);
677
+ dispatchMenuEvent(this, 'auroMenu-customEventFired');
477
678
  }
478
679
 
479
680
  /**
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.
681
+ * Notifies selection change to parent components.
682
+ * @private
489
683
  */
490
- get hasLoadingPlaceholder() {
491
- return this.loadingSlots.length > 0;
684
+ notifySelectionChange() {
685
+ dispatchMenuEvent(this, 'auroMenu-selectedOption');
492
686
  }
493
687
 
494
688
  /**
495
- * Used for @slotchange event on slotted element.
689
+ * Checks if an option is currently selected.
496
690
  * @private
691
+ * @param {HTMLElement} option - The option to check.
692
+ * @returns {boolean}
497
693
  */
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;
694
+ isOptionSelected(option) {
695
+ if (!this.optionSelected) {
696
+ return false;
502
697
  }
698
+ // Always treat as array for both single and multi-select
699
+ return Array.isArray(this.optionSelected) && this.optionSelected.includes(option);
700
+ }
503
701
 
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
- }
702
+ /**
703
+ * Getter for loading placeholder state.
704
+ * @returns {boolean} - True if loading slots are present and non-empty.
705
+ */
706
+ get hasLoadingPlaceholder() {
707
+ return this.loadingSlots && this.loadingSlots.length > 0;
524
708
  }
525
709
 
710
+ /**
711
+ * Renders the component.
712
+ * @returns {boolean} - True if loading slots are present and non-empty.
713
+ */
526
714
  render() {
527
715
  if (this.loading) {
528
716
  return html`
@@ -534,6 +722,8 @@ export class AuroMenu extends LitElement {
534
722
  </auro-menuoption>
535
723
  `;
536
724
  }
537
- return html`<slot @slotchange=${this.handleSlotItems}></slot>`;
725
+
726
+ return html`<slot @slotchange=${this.handleSlotChange}></slot>`;
538
727
  }
539
728
  }
729
+