@melodicdev/components 2.0.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/README.md +7 -6
  2. package/assets/melodic-components.js +5568 -4145
  3. package/assets/melodic-components.js.map +1 -1
  4. package/assets/melodic-components.min.js +6469 -5147
  5. package/lib/components/data-display/activity-feed/activity-feed-item.component.d.ts +15 -14
  6. package/lib/components/data-display/activity-feed/activity-feed-item.component.d.ts.map +1 -1
  7. package/lib/components/data-display/activity-feed/activity-feed-item.component.js +36 -16
  8. package/lib/components/data-display/activity-feed/activity-feed-item.styles.d.ts.map +1 -1
  9. package/lib/components/data-display/activity-feed/activity-feed-item.styles.js +4 -0
  10. package/lib/components/data-display/activity-feed/activity-feed-item.template.d.ts.map +1 -1
  11. package/lib/components/data-display/activity-feed/activity-feed-item.template.js +15 -14
  12. package/lib/components/data-display/avatar/avatar.component.d.ts +9 -4
  13. package/lib/components/data-display/avatar/avatar.component.d.ts.map +1 -1
  14. package/lib/components/data-display/avatar/avatar.component.js +12 -3
  15. package/lib/components/data-display/avatar/avatar.template.js +1 -1
  16. package/lib/components/data-display/badge/badge.component.d.ts +2 -3
  17. package/lib/components/data-display/badge/badge.component.d.ts.map +1 -1
  18. package/lib/components/data-display/badge/badge.styles.d.ts.map +1 -1
  19. package/lib/components/data-display/badge/badge.styles.js +56 -35
  20. package/lib/components/data-display/badge/badge.types.d.ts +2 -0
  21. package/lib/components/data-display/badge/badge.types.d.ts.map +1 -1
  22. package/lib/components/data-display/calendar-view/calendar-view.utils.d.ts +10 -0
  23. package/lib/components/data-display/calendar-view/calendar-view.utils.d.ts.map +1 -1
  24. package/lib/components/data-display/calendar-view/calendar-view.utils.js +59 -27
  25. package/lib/components/data-display/data-grid/data-grid.component.d.ts +6 -5
  26. package/lib/components/data-display/data-grid/data-grid.component.d.ts.map +1 -1
  27. package/lib/components/data-display/data-grid/data-grid.component.js +49 -110
  28. package/lib/components/data-display/data-grid/data-grid.template.d.ts.map +1 -1
  29. package/lib/components/data-display/data-grid/data-grid.template.js +2 -6
  30. package/lib/components/data-display/list/list-item.component.d.ts +15 -6
  31. package/lib/components/data-display/list/list-item.component.d.ts.map +1 -1
  32. package/lib/components/data-display/list/list-item.component.js +57 -6
  33. package/lib/components/data-display/list/list-item.styles.d.ts.map +1 -1
  34. package/lib/components/data-display/list/list-item.styles.js +5 -0
  35. package/lib/components/data-display/list/list-item.template.d.ts.map +1 -1
  36. package/lib/components/data-display/list/list-item.template.js +18 -12
  37. package/lib/components/data-display/profile-card/profile-card.component.d.ts +2 -2
  38. package/lib/components/data-display/profile-card/profile-card.component.d.ts.map +1 -1
  39. package/lib/components/data-display/profile-card/profile-card.component.js +17 -15
  40. package/lib/components/data-display/profile-card/profile-card.template.js +1 -1
  41. package/lib/components/data-display/stat-card/stat-card.component.d.ts +6 -6
  42. package/lib/components/data-display/stat-card/stat-card.component.d.ts.map +1 -1
  43. package/lib/components/data-display/stat-card/stat-card.component.js +14 -6
  44. package/lib/components/data-display/stat-card/stat-card.template.js +4 -4
  45. package/lib/components/data-display/table/table.component.d.ts +7 -5
  46. package/lib/components/data-display/table/table.component.d.ts.map +1 -1
  47. package/lib/components/data-display/table/table.component.js +40 -117
  48. package/lib/components/data-display/table/table.styles.d.ts.map +1 -1
  49. package/lib/components/data-display/table/table.styles.js +5 -2
  50. package/lib/components/data-display/table/table.template.d.ts.map +1 -1
  51. package/lib/components/data-display/table/table.template.js +1 -6
  52. package/lib/components/data-display/table-core/index.d.ts +3 -0
  53. package/lib/components/data-display/table-core/index.d.ts.map +1 -0
  54. package/lib/components/data-display/table-core/index.js +2 -0
  55. package/lib/components/data-display/table-core/table-core.d.ts +137 -0
  56. package/lib/components/data-display/table-core/table-core.d.ts.map +1 -0
  57. package/lib/components/data-display/table-core/table-core.js +225 -0
  58. package/lib/components/data-display/tag/tag.component.d.ts +14 -7
  59. package/lib/components/data-display/tag/tag.component.d.ts.map +1 -1
  60. package/lib/components/data-display/tag/tag.component.js +29 -5
  61. package/lib/components/data-display/tag/tag.template.js +2 -2
  62. package/lib/components/data-display/tag/tag.types.d.ts +8 -1
  63. package/lib/components/data-display/tag/tag.types.d.ts.map +1 -1
  64. package/lib/components/feedback/alert/alert.component.d.ts +6 -3
  65. package/lib/components/feedback/alert/alert.component.d.ts.map +1 -1
  66. package/lib/components/feedback/alert/alert.component.js +13 -4
  67. package/lib/components/feedback/alert/alert.template.js +1 -1
  68. package/lib/components/feedback/progress/progress.component.d.ts +4 -0
  69. package/lib/components/feedback/progress/progress.component.d.ts.map +1 -1
  70. package/lib/components/feedback/progress/progress.component.js +9 -0
  71. package/lib/components/feedback/progress/progress.template.d.ts.map +1 -1
  72. package/lib/components/feedback/progress/progress.template.js +19 -5
  73. package/lib/components/feedback/toast/toast.component.d.ts +6 -3
  74. package/lib/components/feedback/toast/toast.component.d.ts.map +1 -1
  75. package/lib/components/feedback/toast/toast.component.js +13 -4
  76. package/lib/components/feedback/toast/toast.service.d.ts.map +1 -1
  77. package/lib/components/feedback/toast/toast.service.js +2 -1
  78. package/lib/components/feedback/toast/toast.template.js +1 -1
  79. package/lib/components/forms/autocomplete/autocomplete.component.d.ts +12 -4
  80. package/lib/components/forms/autocomplete/autocomplete.component.d.ts.map +1 -1
  81. package/lib/components/forms/autocomplete/autocomplete.component.js +39 -30
  82. package/lib/components/forms/autocomplete/autocomplete.template.d.ts.map +1 -1
  83. package/lib/components/forms/autocomplete/autocomplete.template.js +14 -0
  84. package/lib/components/forms/button/button.component.d.ts +28 -3
  85. package/lib/components/forms/button/button.component.d.ts.map +1 -1
  86. package/lib/components/forms/button/button.component.js +81 -6
  87. package/lib/components/forms/button/button.template.js +1 -1
  88. package/lib/components/forms/button/button.types.d.ts +8 -1
  89. package/lib/components/forms/button/button.types.d.ts.map +1 -1
  90. package/lib/components/forms/button-group/button-group-item.component.d.ts +2 -2
  91. package/lib/components/forms/button-group/button-group-item.component.d.ts.map +1 -1
  92. package/lib/components/forms/button-group/button-group.component.d.ts +4 -2
  93. package/lib/components/forms/button-group/button-group.component.d.ts.map +1 -1
  94. package/lib/components/forms/button-group/button-group.component.js +3 -1
  95. package/lib/components/forms/button-group/button-group.styles.d.ts.map +1 -1
  96. package/lib/components/forms/button-group/button-group.styles.js +15 -1
  97. package/lib/components/forms/button-group/button-group.template.d.ts.map +1 -1
  98. package/lib/components/forms/button-group/button-group.template.js +4 -2
  99. package/lib/components/forms/checkbox/checkbox.component.d.ts +4 -2
  100. package/lib/components/forms/checkbox/checkbox.component.d.ts.map +1 -1
  101. package/lib/components/forms/checkbox/checkbox.component.js +3 -1
  102. package/lib/components/forms/checkbox/checkbox.styles.d.ts.map +1 -1
  103. package/lib/components/forms/checkbox/checkbox.styles.js +19 -0
  104. package/lib/components/forms/checkbox/checkbox.template.d.ts.map +1 -1
  105. package/lib/components/forms/checkbox/checkbox.template.js +4 -2
  106. package/lib/components/forms/date-picker/calendar.component.js +1 -1
  107. package/lib/components/forms/date-picker/date-picker.component.d.ts +11 -4
  108. package/lib/components/forms/date-picker/date-picker.component.d.ts.map +1 -1
  109. package/lib/components/forms/date-picker/date-picker.component.js +99 -32
  110. package/lib/components/forms/date-picker/date-picker.styles.d.ts.map +1 -1
  111. package/lib/components/forms/date-picker/date-picker.styles.js +0 -10
  112. package/lib/components/forms/date-picker/date-picker.template.d.ts.map +1 -1
  113. package/lib/components/forms/date-picker/date-picker.template.js +3 -4
  114. package/lib/components/forms/file-upload/file-upload-item.component.d.ts +7 -0
  115. package/lib/components/forms/file-upload/file-upload-item.component.d.ts.map +1 -1
  116. package/lib/components/forms/file-upload/file-upload-item.component.js +15 -0
  117. package/lib/components/forms/file-upload/file-upload.component.d.ts +15 -0
  118. package/lib/components/forms/file-upload/file-upload.component.d.ts.map +1 -1
  119. package/lib/components/forms/file-upload/file-upload.component.js +56 -0
  120. package/lib/components/forms/form-field/form-field.component.d.ts +12 -4
  121. package/lib/components/forms/form-field/form-field.component.d.ts.map +1 -1
  122. package/lib/components/forms/form-field/form-field.component.js +50 -31
  123. package/lib/components/forms/form-field/form-field.template.js +1 -1
  124. package/lib/components/forms/input/input.component.d.ts +2 -2
  125. package/lib/components/forms/input/input.component.d.ts.map +1 -1
  126. package/lib/components/forms/radio/radio-group.component.d.ts +6 -0
  127. package/lib/components/forms/radio/radio-group.component.d.ts.map +1 -1
  128. package/lib/components/forms/radio/radio-group.component.js +69 -2
  129. package/lib/components/forms/radio/radio-group.template.js +1 -1
  130. package/lib/components/forms/radio/radio.component.d.ts +7 -2
  131. package/lib/components/forms/radio/radio.component.d.ts.map +1 -1
  132. package/lib/components/forms/radio/radio.component.js +5 -0
  133. package/lib/components/forms/radio/radio.template.d.ts.map +1 -1
  134. package/lib/components/forms/radio/radio.template.js +1 -0
  135. package/lib/components/forms/select/select.component.d.ts +13 -6
  136. package/lib/components/forms/select/select.component.d.ts.map +1 -1
  137. package/lib/components/forms/select/select.component.js +32 -36
  138. package/lib/components/forms/select/select.template.d.ts.map +1 -1
  139. package/lib/components/forms/select/select.template.js +6 -2
  140. package/lib/components/forms/slider/slider.component.d.ts +2 -2
  141. package/lib/components/forms/slider/slider.component.d.ts.map +1 -1
  142. package/lib/components/forms/slider/slider.component.js +5 -1
  143. package/lib/components/forms/textarea/textarea.component.d.ts +2 -2
  144. package/lib/components/forms/textarea/textarea.component.d.ts.map +1 -1
  145. package/lib/components/forms/toggle/toggle.component.d.ts +4 -2
  146. package/lib/components/forms/toggle/toggle.component.d.ts.map +1 -1
  147. package/lib/components/forms/toggle/toggle.component.js +3 -1
  148. package/lib/components/forms/toggle/toggle.styles.d.ts.map +1 -1
  149. package/lib/components/forms/toggle/toggle.styles.js +19 -0
  150. package/lib/components/forms/toggle/toggle.template.d.ts.map +1 -1
  151. package/lib/components/forms/toggle/toggle.template.js +11 -3
  152. package/lib/components/foundation/card/card.component.d.ts +7 -6
  153. package/lib/components/foundation/card/card.component.d.ts.map +1 -1
  154. package/lib/components/foundation/card/card.component.js +18 -7
  155. package/lib/components/foundation/card/card.styles.d.ts.map +1 -1
  156. package/lib/components/foundation/card/card.styles.js +5 -0
  157. package/lib/components/foundation/card/card.template.d.ts.map +1 -1
  158. package/lib/components/foundation/card/card.template.js +16 -11
  159. package/lib/components/foundation/divider/divider.component.d.ts +5 -4
  160. package/lib/components/foundation/divider/divider.component.d.ts.map +1 -1
  161. package/lib/components/foundation/divider/divider.component.js +11 -3
  162. package/lib/components/foundation/divider/divider.styles.d.ts.map +1 -1
  163. package/lib/components/foundation/divider/divider.styles.js +6 -0
  164. package/lib/components/foundation/divider/divider.template.d.ts +5 -0
  165. package/lib/components/foundation/divider/divider.template.d.ts.map +1 -1
  166. package/lib/components/foundation/divider/divider.template.js +9 -6
  167. package/lib/components/general/icon/icon.template.d.ts.map +1 -1
  168. package/lib/components/general/icon/icon.template.js +3 -1
  169. package/lib/components/navigation/pagination/pagination.component.d.ts +5 -0
  170. package/lib/components/navigation/pagination/pagination.component.d.ts.map +1 -1
  171. package/lib/components/navigation/pagination/pagination.component.js +22 -10
  172. package/lib/components/navigation/pagination/pagination.styles.d.ts.map +1 -1
  173. package/lib/components/navigation/pagination/pagination.styles.js +6 -4
  174. package/lib/components/navigation/sidebar/sidebar-item.component.d.ts +4 -4
  175. package/lib/components/navigation/sidebar/sidebar-item.component.d.ts.map +1 -1
  176. package/lib/components/navigation/sidebar/sidebar-item.component.js +11 -4
  177. package/lib/components/navigation/sidebar/sidebar-item.template.js +2 -2
  178. package/lib/components/navigation/sidebar/sidebar.component.d.ts +7 -0
  179. package/lib/components/navigation/sidebar/sidebar.component.d.ts.map +1 -1
  180. package/lib/components/navigation/sidebar/sidebar.component.js +48 -5
  181. package/lib/components/navigation/steps/step-panel.component.d.ts +7 -0
  182. package/lib/components/navigation/steps/step-panel.component.d.ts.map +1 -1
  183. package/lib/components/navigation/steps/step-panel.component.js +7 -0
  184. package/lib/components/navigation/steps/step-panel.template.d.ts +1 -1
  185. package/lib/components/navigation/steps/step-panel.template.d.ts.map +1 -1
  186. package/lib/components/navigation/steps/step-panel.template.js +2 -2
  187. package/lib/components/navigation/steps/step.component.d.ts +2 -2
  188. package/lib/components/navigation/steps/step.component.d.ts.map +1 -1
  189. package/lib/components/navigation/steps/step.component.js +8 -2
  190. package/lib/components/navigation/steps/step.template.js +1 -1
  191. package/lib/components/navigation/steps/steps.component.d.ts +3 -1
  192. package/lib/components/navigation/steps/steps.component.d.ts.map +1 -1
  193. package/lib/components/navigation/steps/steps.component.js +47 -14
  194. package/lib/components/navigation/steps/steps.template.d.ts.map +1 -1
  195. package/lib/components/navigation/steps/steps.template.js +5 -1
  196. package/lib/components/navigation/tabs/tab-panel.component.d.ts +7 -0
  197. package/lib/components/navigation/tabs/tab-panel.component.d.ts.map +1 -1
  198. package/lib/components/navigation/tabs/tab-panel.component.js +7 -0
  199. package/lib/components/navigation/tabs/tab-panel.template.d.ts +1 -1
  200. package/lib/components/navigation/tabs/tab-panel.template.d.ts.map +1 -1
  201. package/lib/components/navigation/tabs/tab-panel.template.js +2 -2
  202. package/lib/components/navigation/tabs/tabs.component.d.ts +5 -3
  203. package/lib/components/navigation/tabs/tabs.component.d.ts.map +1 -1
  204. package/lib/components/navigation/tabs/tabs.component.js +49 -14
  205. package/lib/components/navigation/tabs/tabs.template.d.ts.map +1 -1
  206. package/lib/components/navigation/tabs/tabs.template.js +6 -1
  207. package/lib/components/overlays/dialog/dialog-ref.class.d.ts +17 -2
  208. package/lib/components/overlays/dialog/dialog-ref.class.d.ts.map +1 -1
  209. package/lib/components/overlays/dialog/dialog-ref.class.js +52 -6
  210. package/lib/components/overlays/dialog/dialog.component.d.ts.map +1 -1
  211. package/lib/components/overlays/dialog/dialog.component.js +5 -1
  212. package/lib/components/overlays/dialog/dialog.service.d.ts +2 -2
  213. package/lib/components/overlays/dialog/dialog.service.d.ts.map +1 -1
  214. package/lib/components/overlays/dialog/dialog.service.js +46 -18
  215. package/lib/components/overlays/drawer/drawer.component.d.ts +9 -2
  216. package/lib/components/overlays/drawer/drawer.component.d.ts.map +1 -1
  217. package/lib/components/overlays/drawer/drawer.component.js +34 -4
  218. package/lib/components/overlays/drawer/drawer.styles.d.ts.map +1 -1
  219. package/lib/components/overlays/drawer/drawer.styles.js +4 -0
  220. package/lib/components/overlays/dropdown/dropdown-item.component.d.ts +5 -2
  221. package/lib/components/overlays/dropdown/dropdown-item.component.d.ts.map +1 -1
  222. package/lib/components/overlays/dropdown/dropdown-item.component.js +18 -0
  223. package/lib/components/overlays/dropdown/dropdown-item.template.d.ts.map +1 -1
  224. package/lib/components/overlays/dropdown/dropdown-item.template.js +0 -3
  225. package/lib/components/overlays/dropdown/dropdown.component.d.ts +8 -4
  226. package/lib/components/overlays/dropdown/dropdown.component.d.ts.map +1 -1
  227. package/lib/components/overlays/dropdown/dropdown.component.js +61 -60
  228. package/lib/components/overlays/popover/popover.component.d.ts +6 -4
  229. package/lib/components/overlays/popover/popover.component.d.ts.map +1 -1
  230. package/lib/components/overlays/popover/popover.component.js +37 -51
  231. package/lib/components/overlays/tooltip/tooltip.component.d.ts +29 -4
  232. package/lib/components/overlays/tooltip/tooltip.component.d.ts.map +1 -1
  233. package/lib/components/overlays/tooltip/tooltip.component.js +73 -31
  234. package/lib/components/overlays/tooltip/tooltip.styles.d.ts.map +1 -1
  235. package/lib/components/overlays/tooltip/tooltip.styles.js +22 -10
  236. package/lib/components/overlays/tooltip/tooltip.template.d.ts.map +1 -1
  237. package/lib/components/overlays/tooltip/tooltip.template.js +3 -2
  238. package/lib/components/pages/auth/login-page.component.d.ts +11 -4
  239. package/lib/components/pages/auth/login-page.component.d.ts.map +1 -1
  240. package/lib/components/pages/auth/login-page.component.js +18 -5
  241. package/lib/components/pages/auth/login-page.template.d.ts.map +1 -1
  242. package/lib/components/pages/auth/login-page.template.js +9 -10
  243. package/lib/components/pages/auth/signup-page.component.d.ts +11 -4
  244. package/lib/components/pages/auth/signup-page.component.d.ts.map +1 -1
  245. package/lib/components/pages/auth/signup-page.component.js +18 -5
  246. package/lib/components/pages/auth/signup-page.template.d.ts.map +1 -1
  247. package/lib/components/pages/auth/signup-page.template.js +9 -10
  248. package/lib/components/pages/dashboard/dashboard-page.component.d.ts +18 -11
  249. package/lib/components/pages/dashboard/dashboard-page.component.d.ts.map +1 -1
  250. package/lib/components/pages/dashboard/dashboard-page.component.js +55 -13
  251. package/lib/components/pages/dashboard/dashboard-page.template.js +1 -1
  252. package/lib/components/sections/app-shell/app-shell.component.d.ts +6 -6
  253. package/lib/components/sections/app-shell/app-shell.component.d.ts.map +1 -1
  254. package/lib/components/sections/app-shell/app-shell.component.js +14 -6
  255. package/lib/components/sections/app-shell/app-shell.template.js +3 -3
  256. package/lib/components/sections/hero/hero-section.component.d.ts +6 -3
  257. package/lib/components/sections/hero/hero-section.component.d.ts.map +1 -1
  258. package/lib/components/sections/hero/hero-section.component.js +13 -4
  259. package/lib/components/sections/hero/hero-section.template.js +2 -2
  260. package/lib/components/sections/page-header/page-header.component.d.ts +16 -17
  261. package/lib/components/sections/page-header/page-header.component.d.ts.map +1 -1
  262. package/lib/components/sections/page-header/page-header.component.js +36 -25
  263. package/lib/components/sections/page-header/page-header.styles.d.ts.map +1 -1
  264. package/lib/components/sections/page-header/page-header.styles.js +9 -0
  265. package/lib/components/sections/page-header/page-header.template.d.ts +5 -0
  266. package/lib/components/sections/page-header/page-header.template.d.ts.map +1 -1
  267. package/lib/components/sections/page-header/page-header.template.js +42 -31
  268. package/lib/components/sections/page-section/page-section.component.d.ts +16 -12
  269. package/lib/components/sections/page-section/page-section.component.d.ts.map +1 -1
  270. package/lib/components/sections/page-section/page-section.component.js +34 -12
  271. package/lib/components/sections/page-section/page-section.styles.d.ts.map +1 -1
  272. package/lib/components/sections/page-section/page-section.styles.js +6 -0
  273. package/lib/components/sections/page-section/page-section.template.d.ts +6 -0
  274. package/lib/components/sections/page-section/page-section.template.d.ts.map +1 -1
  275. package/lib/components/sections/page-section/page-section.template.js +26 -15
  276. package/lib/components/sections/page-section/sanitize-href.function.d.ts +12 -0
  277. package/lib/components/sections/page-section/sanitize-href.function.d.ts.map +1 -0
  278. package/lib/components/sections/page-section/sanitize-href.function.js +15 -0
  279. package/lib/directives/tooltip.directive.d.ts +8 -2
  280. package/lib/directives/tooltip.directive.d.ts.map +1 -1
  281. package/lib/directives/tooltip.directive.js +103 -9
  282. package/lib/functions/deprecation.functions.d.ts +21 -0
  283. package/lib/functions/deprecation.functions.d.ts.map +1 -0
  284. package/lib/functions/deprecation.functions.js +44 -0
  285. package/lib/functions/index.d.ts +2 -0
  286. package/lib/functions/index.d.ts.map +1 -1
  287. package/lib/functions/index.js +2 -0
  288. package/lib/functions/watch-slot-presence.function.d.ts +17 -0
  289. package/lib/functions/watch-slot-presence.function.d.ts.map +1 -0
  290. package/lib/functions/watch-slot-presence.function.js +27 -0
  291. package/lib/theme/functions/create-theme.function.d.ts +15 -1
  292. package/lib/theme/functions/create-theme.function.d.ts.map +1 -1
  293. package/lib/theme/functions/create-theme.function.js +57 -11
  294. package/lib/theme/index.d.ts +1 -0
  295. package/lib/theme/index.d.ts.map +1 -1
  296. package/lib/types/index.d.ts +8 -2
  297. package/lib/types/index.d.ts.map +1 -1
  298. package/lib/utils/accessibility/focus-trap.d.ts +19 -1
  299. package/lib/utils/accessibility/focus-trap.d.ts.map +1 -1
  300. package/lib/utils/accessibility/focus-trap.js +77 -8
  301. package/lib/utils/accessibility/index.d.ts +2 -1
  302. package/lib/utils/accessibility/index.d.ts.map +1 -1
  303. package/lib/utils/accessibility/index.js +1 -1
  304. package/lib/utils/accessibility/live-region.d.ts +10 -3
  305. package/lib/utils/accessibility/live-region.d.ts.map +1 -1
  306. package/lib/utils/accessibility/live-region.js +64 -35
  307. package/lib/utils/directives/click-outside.directive.d.ts.map +1 -1
  308. package/lib/utils/directives/click-outside.directive.js +5 -3
  309. package/lib/utils/overlay/index.d.ts +4 -0
  310. package/lib/utils/overlay/index.d.ts.map +1 -0
  311. package/lib/utils/overlay/index.js +2 -0
  312. package/lib/utils/overlay/overlay-positioner.d.ts +54 -0
  313. package/lib/utils/overlay/overlay-positioner.d.ts.map +1 -0
  314. package/lib/utils/overlay/overlay-positioner.js +85 -0
  315. package/lib/utils/overlay/toggle-dismiss-guard.d.ts +24 -0
  316. package/lib/utils/overlay/toggle-dismiss-guard.d.ts.map +1 -0
  317. package/lib/utils/overlay/toggle-dismiss-guard.js +36 -0
  318. package/lib/utils/positioning/auto-update.d.ts.map +1 -1
  319. package/lib/utils/positioning/auto-update.js +3 -0
  320. package/lib/utils/positioning/compute-position.d.ts.map +1 -1
  321. package/lib/utils/positioning/compute-position.js +8 -4
  322. package/lib/utils/positioning/middlewares/flip.middleware.d.ts.map +1 -1
  323. package/lib/utils/positioning/middlewares/flip.middleware.js +10 -3
  324. package/lib/utils/positioning/middlewares/offset.middleware.d.ts +15 -0
  325. package/lib/utils/positioning/middlewares/offset.middleware.d.ts.map +1 -1
  326. package/lib/utils/positioning/middlewares/offset.middleware.js +31 -1
  327. package/lib/utils/positioning/middlewares/shift.middleware.d.ts +13 -3
  328. package/lib/utils/positioning/middlewares/shift.middleware.d.ts.map +1 -1
  329. package/lib/utils/positioning/middlewares/shift.middleware.js +15 -7
  330. package/package.json +6 -2
@@ -28,7 +28,7 @@ function linearTemplate(c) {
28
28
  </div>
29
29
  `)}
30
30
 
31
- <div class="ml-progress__track" role="progressbar" aria-valuenow=${c.value} aria-valuemin="0" aria-valuemax=${c.max} aria-label=${c.label || 'Progress'}>
31
+ <div class="ml-progress__track" role="progressbar" aria-valuenow=${c.clampedValue} aria-valuemin="0" aria-valuemax=${c.ariaMax} aria-label=${c.label || 'Progress'}>
32
32
  <div class="ml-progress__fill" style=${styleMap({ width: `${c.percentage}%` })}></div>
33
33
  </div>
34
34
 
@@ -49,11 +49,18 @@ function linearTemplate(c) {
49
49
  }
50
50
  function circleTemplate(c) {
51
51
  return html `
52
- <div class=${classMap({
52
+ <div
53
+ class=${classMap({
53
54
  'ml-progress-circle': true,
54
55
  [`ml-progress-circle--${c.variant}`]: true,
55
56
  [`ml-progress-circle--${c.size}`]: true
56
- })}>
57
+ })}
58
+ role="progressbar"
59
+ aria-valuenow=${c.clampedValue}
60
+ aria-valuemin="0"
61
+ aria-valuemax=${c.ariaMax}
62
+ aria-label=${c.label || 'Progress'}
63
+ >
57
64
  <svg
58
65
  width=${c.svgSize}
59
66
  height=${c.svgSize}
@@ -92,11 +99,18 @@ function circleTemplate(c) {
92
99
  }
93
100
  function halfCircleTemplate(c) {
94
101
  return html `
95
- <div class=${classMap({
102
+ <div
103
+ class=${classMap({
96
104
  'ml-progress-half': true,
97
105
  [`ml-progress-half--${c.variant}`]: true,
98
106
  [`ml-progress-half--${c.size}`]: true
99
- })}>
107
+ })}
108
+ role="progressbar"
109
+ aria-valuenow=${c.clampedValue}
110
+ aria-valuemin="0"
111
+ aria-valuemax=${c.ariaMax}
112
+ aria-label=${c.label || 'Progress'}
113
+ >
100
114
  <svg
101
115
  width=${c.svgSize}
102
116
  height=${c.svgCenter + c.circleStroke}
@@ -5,7 +5,7 @@ import type { ToastVariant } from './toast-config.interface.js';
5
5
  *
6
6
  * @example
7
7
  * ```html
8
- * <ml-toast variant="success" title="Saved" message="Your changes have been saved."></ml-toast>
8
+ * <ml-toast variant="success" toast-title="Saved" message="Your changes have been saved."></ml-toast>
9
9
  * ```
10
10
  *
11
11
  * @fires ml:dismiss - Emitted when the toast is dismissed
@@ -14,8 +14,8 @@ export declare class ToastComponent implements IElementRef, OnCreate {
14
14
  elementRef: HTMLElement;
15
15
  /** Toast variant */
16
16
  variant: ToastVariant;
17
- /** Toast title */
18
- title: string;
17
+ /** Toast title (attribute: toast-title) */
18
+ toastTitle: string;
19
19
  /** Toast message */
20
20
  message: string;
21
21
  /** Auto-dismiss duration in ms (0 = no auto-dismiss) */
@@ -23,6 +23,9 @@ export declare class ToastComponent implements IElementRef, OnCreate {
23
23
  /** Show dismiss button */
24
24
  dismissible: boolean;
25
25
  private _timer;
26
+ /** @deprecated Use `toastTitle` (attribute `toast-title`); `title` collides with the global HTML attribute. */
27
+ get title(): string;
28
+ set title(value: string);
26
29
  onCreate(): void;
27
30
  dismiss: () => void;
28
31
  renderIcon: () => import("@melodicdev/core").TemplateResult;
@@ -1 +1 @@
1
- {"version":3,"file":"toast.component.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/toast/toast.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAIhE;;;;;;;;;GASG;AACH,qBAMa,cAAe,YAAW,WAAW,EAAE,QAAQ;IACpD,UAAU,EAAG,WAAW,CAAC;IAEhC,oBAAoB;IACb,OAAO,EAAE,YAAY,CAAU;IAEtC,kBAAkB;IACX,KAAK,SAAM;IAElB,oBAAoB;IACb,OAAO,SAAM;IAEpB,wDAAwD;IACjD,QAAQ,SAAQ;IAEvB,0BAA0B;IACnB,WAAW,UAAQ;IAE1B,OAAO,CAAC,MAAM,CAA8C;IAErD,QAAQ,IAAI,IAAI;IAMhB,OAAO,QAAO,IAAI,CAcvB;IAEK,UAAU,kDASf;CACF"}
1
+ {"version":3,"file":"toast.component.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/toast/toast.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKhE;;;;;;;;;GASG;AACH,qBAMa,cAAe,YAAW,WAAW,EAAE,QAAQ;IACpD,UAAU,EAAG,WAAW,CAAC;IAEhC,oBAAoB;IACb,OAAO,EAAE,YAAY,CAAU;IAEtC,2CAA2C;IACpC,UAAU,SAAM;IAEvB,oBAAoB;IACb,OAAO,SAAM;IAEpB,wDAAwD;IACjD,QAAQ,SAAQ;IAEvB,0BAA0B;IACnB,WAAW,UAAQ;IAE1B,OAAO,CAAC,MAAM,CAA8C;IAE5D,+GAA+G;IAC/G,IAAW,KAAK,IAAI,MAAM,CAEzB;IACD,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAG7B;IAEM,QAAQ,IAAI,IAAI;IAMhB,OAAO,QAAO,IAAI,CAcvB;IAEK,UAAU,kDASf;CACF"}
@@ -7,12 +7,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { MelodicComponent, html } from '@melodicdev/core';
8
8
  import { toastTemplate } from './toast.template.js';
9
9
  import { toastStyles } from './toast.styles.js';
10
+ import { warnDeprecatedTitleOnce } from '../../../functions/index.js';
10
11
  /**
11
12
  * ml-toast - Individual toast notification
12
13
  *
13
14
  * @example
14
15
  * ```html
15
- * <ml-toast variant="success" title="Saved" message="Your changes have been saved."></ml-toast>
16
+ * <ml-toast variant="success" toast-title="Saved" message="Your changes have been saved."></ml-toast>
16
17
  * ```
17
18
  *
18
19
  * @fires ml:dismiss - Emitted when the toast is dismissed
@@ -21,8 +22,8 @@ let ToastComponent = class ToastComponent {
21
22
  constructor() {
22
23
  /** Toast variant */
23
24
  this.variant = 'info';
24
- /** Toast title */
25
- this.title = '';
25
+ /** Toast title (attribute: toast-title) */
26
+ this.toastTitle = '';
26
27
  /** Toast message */
27
28
  this.message = '';
28
29
  /** Auto-dismiss duration in ms (0 = no auto-dismiss) */
@@ -51,6 +52,14 @@ let ToastComponent = class ToastComponent {
51
52
  return html `<ml-icon icon="${icons[this.variant]}"></ml-icon>`;
52
53
  };
53
54
  }
55
+ /** @deprecated Use `toastTitle` (attribute `toast-title`); `title` collides with the global HTML attribute. */
56
+ get title() {
57
+ return this.toastTitle;
58
+ }
59
+ set title(value) {
60
+ warnDeprecatedTitleOnce('ml-toast', 'toast-title');
61
+ this.toastTitle = value;
62
+ }
54
63
  onCreate() {
55
64
  if (this.duration > 0) {
56
65
  this._timer = setTimeout(() => this.dismiss(), this.duration);
@@ -62,7 +71,7 @@ ToastComponent = __decorate([
62
71
  selector: 'ml-toast',
63
72
  template: toastTemplate,
64
73
  styles: toastStyles,
65
- attributes: ['variant', 'title', 'message', 'duration', 'dismissible']
74
+ attributes: ['variant', 'toast-title', 'title', 'message', 'duration', 'dismissible']
66
75
  })
67
76
  ], ToastComponent);
68
77
  export { ToastComponent };
@@ -1 +1 @@
1
- {"version":3,"file":"toast.service.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/toast/toast.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE/E;;;;;;;;;;;;GAYG;AACH,qBACa,YAAY;IACxB,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,SAAS,CAA8B;IAE/C,8CAA8C;IACvC,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAQjD,2CAA2C;IACpC,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAavC,yBAAyB;IAClB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAIlD,2BAA2B;IACpB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAIrD,2BAA2B;IACpB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAIrD,0BAA0B;IACnB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAInD,OAAO,CAAC,eAAe;CAWvB"}
1
+ {"version":3,"file":"toast.service.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/toast/toast.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE/E;;;;;;;;;;;;GAYG;AACH,qBACa,YAAY;IACxB,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,SAAS,CAA8B;IAE/C,8CAA8C;IACvC,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAQjD,2CAA2C;IACpC,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAcvC,yBAAyB;IAClB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAIlD,2BAA2B;IACpB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAIrD,2BAA2B;IACpB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAIrD,0BAA0B;IACnB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAInD,OAAO,CAAC,eAAe;CAWvB"}
@@ -36,8 +36,9 @@ let ToastService = class ToastService {
36
36
  const toast = document.createElement('ml-toast');
37
37
  if (config.variant)
38
38
  toast.setAttribute('variant', config.variant);
39
+ // Use the prefixed attribute: the global 'title' attribute would surface a native browser tooltip.
39
40
  if (config.title)
40
- toast.setAttribute('title', config.title);
41
+ toast.setAttribute('toast-title', config.title);
41
42
  if (config.message)
42
43
  toast.setAttribute('message', config.message);
43
44
  if (config.duration !== undefined)
@@ -12,7 +12,7 @@ export function toastTemplate(c) {
12
12
  ${c.renderIcon()}
13
13
  </div>
14
14
  <div class="ml-toast__content">
15
- ${when(!!c.title, () => html `<div class="ml-toast__title">${c.title}</div>`)}
15
+ ${when(!!c.toastTitle, () => html `<div class="ml-toast__title">${c.toastTitle}</div>`)}
16
16
  ${when(!!c.message, () => html `<div class="ml-toast__message">${c.message}</div>`)}
17
17
  </div>
18
18
  ${when(c.dismissible, () => html `
@@ -77,8 +77,10 @@ export declare class AutocompleteComponent implements IElementRef, OnCreate, OnD
77
77
  initialOptions: AutocompleteOption[];
78
78
  private readonly _handleKeyDown;
79
79
  private readonly _handleDocumentClick;
80
- private _handleScroll;
80
+ private readonly _uid;
81
+ private readonly _positioner;
81
82
  private _debounceTimer;
83
+ private _searchGeneration;
82
84
  private _syncingValues;
83
85
  onCreate(): void;
84
86
  onDestroy(): void;
@@ -92,6 +94,12 @@ export declare class AutocompleteComponent implements IElementRef, OnCreate, OnD
92
94
  /** Filtered options for display */
93
95
  get filteredOptions(): AutocompleteOption[];
94
96
  get hasValue(): boolean;
97
+ /** Unique id of the listbox element (for aria-controls) */
98
+ get listboxId(): string;
99
+ /** Unique id for the option at the given display index */
100
+ optionId: (index: number) => string;
101
+ /** Id of the keyboard-focused option, or undefined when none (omits the attribute) */
102
+ get activeDescendant(): string | undefined;
95
103
  /** Display text for the input in single mode */
96
104
  get displayText(): string;
97
105
  /** Open the dropdown */
@@ -119,9 +127,9 @@ export declare class AutocompleteComponent implements IElementRef, OnCreate, OnD
119
127
  private onDocumentClick;
120
128
  private addDocumentClickListener;
121
129
  private removeDocumentClickListener;
122
- private positionDropdown;
123
- private addScrollListener;
124
- private removeScrollListener;
130
+ /** Keep the dropdown positioned while open (repositions on scroll/resize). */
131
+ private startPositioning;
132
+ private stopPositioning;
125
133
  private getDropdownEl;
126
134
  private onKeyDown;
127
135
  private focusNextOption;
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/autocomplete/autocomplete.component.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"autocomplete.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/autocomplete/autocomplete.component.ts"],"names":[],"mappings":"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"}
@@ -6,7 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { MelodicComponent } from '@melodicdev/core';
8
8
  import { registerAdapter } from '@melodicdev/core/forms';
9
- import { computePosition, offset, flip, shift } from '../../../utils/positioning/index.js';
9
+ import { OverlayPositioner } from '../../../utils/overlay/index.js';
10
+ import { newID } from '../../../functions/index.js';
10
11
  import { autocompleteTemplate } from './autocomplete.template.js';
11
12
  import { autocompleteStyles } from './autocomplete.styles.js';
12
13
  registerAdapter((el) => el.tagName === 'ML-AUTOCOMPLETE', {
@@ -101,9 +102,19 @@ let AutocompleteComponent = class AutocompleteComponent {
101
102
  this.initialOptions = [];
102
103
  this._handleKeyDown = this.onKeyDown.bind(this);
103
104
  this._handleDocumentClick = this.onDocumentClick.bind(this);
104
- this._handleScroll = null;
105
+ this._uid = newID();
106
+ this._positioner = new OverlayPositioner(() => ({
107
+ placement: 'bottom-start',
108
+ offset: 4,
109
+ matchTriggerWidth: true
110
+ }));
105
111
  this._debounceTimer = null;
112
+ this._searchGeneration = 0;
106
113
  this._syncingValues = false;
114
+ /** Unique id for the option at the given display index */
115
+ this.optionId = (index) => {
116
+ return `${this.listboxId}-option-${index}`;
117
+ };
107
118
  /** Open the dropdown */
108
119
  this.open = () => {
109
120
  if (this.disabled || this.isOpen)
@@ -116,8 +127,7 @@ let AutocompleteComponent = class AutocompleteComponent {
116
127
  dropdownEl.showPopover();
117
128
  this.isOpen = true;
118
129
  this.focusedIndex = this.findFirstEnabledIndex();
119
- this.positionDropdown();
120
- this.addScrollListener();
130
+ this.startPositioning();
121
131
  this.addDocumentClickListener();
122
132
  this.elementRef.dispatchEvent(new CustomEvent('ml:open', { bubbles: true, composed: true }));
123
133
  };
@@ -128,7 +138,7 @@ let AutocompleteComponent = class AutocompleteComponent {
128
138
  this.getDropdownEl()?.hidePopover();
129
139
  this.isOpen = false;
130
140
  this.focusedIndex = -1;
131
- this.removeScrollListener();
141
+ this.stopPositioning();
132
142
  this.removeDocumentClickListener();
133
143
  this.elementRef.dispatchEvent(new CustomEvent('ml:close', { bubbles: true, composed: true }));
134
144
  };
@@ -245,7 +255,7 @@ let AutocompleteComponent = class AutocompleteComponent {
245
255
  }
246
256
  onDestroy() {
247
257
  this.elementRef.removeEventListener('keydown', this._handleKeyDown);
248
- this.removeScrollListener();
258
+ this.stopPositioning();
249
259
  this.removeDocumentClickListener();
250
260
  if (this._debounceTimer) {
251
261
  clearTimeout(this._debounceTimer);
@@ -339,6 +349,14 @@ let AutocompleteComponent = class AutocompleteComponent {
339
349
  get hasValue() {
340
350
  return this.multiple ? this.values.length > 0 : !!this.value;
341
351
  }
352
+ /** Unique id of the listbox element (for aria-controls) */
353
+ get listboxId() {
354
+ return `ml-autocomplete-listbox-${this._uid}`;
355
+ }
356
+ /** Id of the keyboard-focused option, or undefined when none (omits the attribute) */
357
+ get activeDescendant() {
358
+ return this.isOpen && this.focusedIndex >= 0 ? this.optionId(this.focusedIndex) : undefined;
359
+ }
342
360
  /** Display text for the input in single mode */
343
361
  get displayText() {
344
362
  if (this.multiple)
@@ -369,13 +387,21 @@ let AutocompleteComponent = class AutocompleteComponent {
369
387
  async executeSearch(query) {
370
388
  if (!this.searchFn)
371
389
  return;
390
+ // Request-generation counter: each search invalidates all in-flight
391
+ // requests so a slow earlier response can never overwrite newer results.
392
+ const generation = ++this._searchGeneration;
372
393
  this.loading = true;
373
394
  try {
374
- this.asyncOptions = await this.searchFn(query);
395
+ const results = await this.searchFn(query);
396
+ if (generation !== this._searchGeneration)
397
+ return;
398
+ this.asyncOptions = results;
375
399
  this.focusedIndex = this.findFirstEnabledIndex();
376
400
  }
377
401
  finally {
378
- this.loading = false;
402
+ if (generation === this._searchGeneration) {
403
+ this.loading = false;
404
+ }
379
405
  }
380
406
  }
381
407
  /** Close dropdown on clicks outside the component */
@@ -391,33 +417,16 @@ let AutocompleteComponent = class AutocompleteComponent {
391
417
  removeDocumentClickListener() {
392
418
  document.removeEventListener('click', this._handleDocumentClick, true);
393
419
  }
394
- positionDropdown() {
420
+ /** Keep the dropdown positioned while open (repositions on scroll/resize). */
421
+ startPositioning() {
395
422
  const triggerEl = this.elementRef.shadowRoot?.querySelector('.ml-autocomplete__trigger');
396
423
  const dropdownEl = this.getDropdownEl();
397
424
  if (!triggerEl || !dropdownEl)
398
425
  return;
399
- dropdownEl.style.width = `${triggerEl.offsetWidth}px`;
400
- const { x, y } = computePosition(triggerEl, dropdownEl, {
401
- placement: 'bottom-start',
402
- middleware: [offset(4), flip(), shift({ padding: 8 })]
403
- });
404
- dropdownEl.style.left = `${x}px`;
405
- dropdownEl.style.top = `${y}px`;
426
+ this._positioner.start(triggerEl, dropdownEl);
406
427
  }
407
- addScrollListener() {
408
- this._handleScroll = (event) => {
409
- const dropdownEl = this.getDropdownEl();
410
- if (dropdownEl?.contains(event.target))
411
- return;
412
- this.close();
413
- };
414
- window.addEventListener('scroll', this._handleScroll, true);
415
- }
416
- removeScrollListener() {
417
- if (this._handleScroll) {
418
- window.removeEventListener('scroll', this._handleScroll, true);
419
- this._handleScroll = null;
420
- }
428
+ stopPositioning() {
429
+ this._positioner.stop();
421
430
  }
422
431
  getDropdownEl() {
423
432
  return this.elementRef.shadowRoot?.querySelector('.ml-autocomplete__dropdown');
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete.template.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/autocomplete/autocomplete.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGzE,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,qBAAqB,6CA8D5D"}
1
+ {"version":3,"file":"autocomplete.template.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/autocomplete/autocomplete.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGzE,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,qBAAqB,6CA+D5D"}
@@ -28,6 +28,7 @@ export function autocompleteTemplate(c) {
28
28
  </div>
29
29
 
30
30
  <div
31
+ id=${c.listboxId}
31
32
  class="ml-autocomplete__dropdown"
32
33
  role="listbox"
33
34
  popover="manual"
@@ -54,6 +55,12 @@ function renderSingleValue(c) {
54
55
  <input
55
56
  class="ml-autocomplete__input"
56
57
  type="text"
58
+ role="combobox"
59
+ aria-expanded=${c.isOpen}
60
+ aria-controls=${c.listboxId}
61
+ aria-autocomplete="list"
62
+ aria-haspopup="listbox"
63
+ aria-activedescendant=${c.activeDescendant}
57
64
  placeholder=${c.hasValue ? c.displayText : c.placeholder}
58
65
  aria-label=${c.label || c.placeholder || 'Search'}
59
66
  .value=${c.hasValue && !c.search ? c.displayText : c.search}
@@ -89,6 +96,12 @@ function renderMultiValue(c) {
89
96
  <input
90
97
  class="ml-autocomplete__input"
91
98
  type="text"
99
+ role="combobox"
100
+ aria-expanded=${c.isOpen}
101
+ aria-controls=${c.listboxId}
102
+ aria-autocomplete="list"
103
+ aria-haspopup="listbox"
104
+ aria-activedescendant=${c.activeDescendant}
92
105
  placeholder=${c.values.length ? '' : c.placeholder}
93
106
  aria-label=${c.label || c.placeholder || 'Search'}
94
107
  .value=${c.search}
@@ -105,6 +118,7 @@ function renderOption(c, option, index) {
105
118
  const isFocused = c.focusedIndex === index;
106
119
  return html `
107
120
  <div
121
+ id=${c.optionId(index)}
108
122
  class=${classMap({
109
123
  'ml-autocomplete__option': true,
110
124
  'ml-autocomplete__option--selected': isSelected,
@@ -1,4 +1,4 @@
1
- import type { IElementRef, OnInit } from '@melodicdev/core';
1
+ import type { IElementRef } from '@melodicdev/core';
2
2
  import type { Size } from '../../../types/index.js';
3
3
  import type { ButtonVariant, ButtonType } from './button.types.js';
4
4
  import '../../feedback/spinner/spinner.component.js';
@@ -19,8 +19,16 @@ import '../../feedback/spinner/spinner.component.js';
19
19
  * @slot icon-end - Icon after the label
20
20
  *
21
21
  * @fires ml:click - Emitted when button is clicked (not disabled/loading)
22
+ *
23
+ * Form participation: when `type="submit"` (or `type="reset"`) and the element
24
+ * is placed inside a `<form>`, clicking it submits (or resets) that form. The
25
+ * shadow-internal native button cannot associate with the outer form, and the
26
+ * component decorator does not currently support define-time
27
+ * `static formAssociated = true`, so ElementInternals' `.form` is unavailable;
28
+ * the component feature-detects it and otherwise finds the form by walking the
29
+ * ancestor tree (crossing shadow boundaries) and calls `form.requestSubmit()`.
22
30
  */
23
- export declare class ButtonComponent implements IElementRef, OnInit {
31
+ export declare class ButtonComponent implements IElementRef {
24
32
  elementRef: HTMLElement;
25
33
  /** Button variant style */
26
34
  variant: ButtonVariant;
@@ -42,10 +50,27 @@ export declare class ButtonComponent implements IElementRef, OnInit {
42
50
  rel: string | null;
43
51
  /** Anchor download (only used when href is set) */
44
52
  download: string | null;
45
- onInit(): void;
53
+ private _internals;
54
+ private _internalsAttached;
46
55
  /** Whether the button is effectively disabled */
47
56
  get isDisabled(): boolean;
57
+ /**
58
+ * Variant with the canonical 'error' name resolved to this component's
59
+ * historical 'danger' style class. The two are interchangeable aliases;
60
+ * the stylesheet keys off `ml-button--danger`.
61
+ */
62
+ get resolvedVariant(): ButtonVariant;
48
63
  /** Handle click events */
49
64
  handleClick: (event: MouseEvent) => void;
65
+ private submitForm;
66
+ /**
67
+ * Find the owning form. Prefers ElementInternals (`internals.form`), which
68
+ * only works if the custom element was defined with
69
+ * `static formAssociated = true` — the component decorator does not expose
70
+ * that yet, so this typically falls through to walking the ancestor tree
71
+ * (crossing shadow boundaries).
72
+ */
73
+ private findForm;
74
+ private getInternalsForm;
50
75
  }
51
76
  //# sourceMappingURL=button.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/button/button.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,6CAA6C,CAAC;AAIrD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAMa,eAAgB,YAAW,WAAW,EAAE,MAAM;IACnD,UAAU,EAAG,WAAW,CAAC;IAEhC,2BAA2B;IACpB,OAAO,EAAE,aAAa,CAAa;IAE1C,kBAAkB;IACX,IAAI,EAAE,IAAI,CAAQ;IAEzB,uBAAuB;IAChB,IAAI,EAAE,UAAU,CAAY;IAEnC,yBAAyB;IAClB,QAAQ,UAAS;IAExB,yBAAyB;IAClB,OAAO,UAAS;IAEvB,6BAA6B;IACtB,SAAS,UAAS;IAEzB,2DAA2D;IACpD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAQ;IAElC,iDAAiD;IAC1C,MAAM,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEpC,8CAA8C;IACvC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEjC,mDAAmD;IAC5C,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B,MAAM,IAAI,IAAI;IAOrB,iDAAiD;IACjD,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED,0BAA0B;IACnB,WAAW,GAAI,OAAO,UAAU,KAAG,IAAI,CAe5C;CACF"}
1
+ {"version":3,"file":"button.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/button/button.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,6CAA6C,CAAC;AAIrD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAMa,eAAgB,YAAW,WAAW;IAC3C,UAAU,EAAG,WAAW,CAAC;IAEhC,2BAA2B;IACpB,OAAO,EAAE,aAAa,CAAa;IAE1C,kBAAkB;IACX,IAAI,EAAE,IAAI,CAAQ;IAEzB,uBAAuB;IAChB,IAAI,EAAE,UAAU,CAAY;IAEnC,yBAAyB;IAClB,QAAQ,UAAS;IAExB,yBAAyB;IAClB,OAAO,UAAS;IAEvB,6BAA6B;IACtB,SAAS,UAAS;IAEzB,2DAA2D;IACpD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAQ;IAElC,iDAAiD;IAC1C,MAAM,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEpC,8CAA8C;IACvC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEjC,mDAAmD;IAC5C,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEtC,OAAO,CAAC,UAAU,CAAiC;IACnD,OAAO,CAAC,kBAAkB,CAAS;IAEnC,iDAAiD;IACjD,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;;;OAIG;IACH,IAAW,eAAe,IAAI,aAAa,CAE1C;IAED,0BAA0B;IACnB,WAAW,GAAI,OAAO,UAAU,KAAG,IAAI,CAyB5C;IAEF,OAAO,CAAC,UAAU;IAYlB;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,gBAAgB;CAmBxB"}
@@ -26,6 +26,14 @@ import { buttonStyles } from './button.styles.js';
26
26
  * @slot icon-end - Icon after the label
27
27
  *
28
28
  * @fires ml:click - Emitted when button is clicked (not disabled/loading)
29
+ *
30
+ * Form participation: when `type="submit"` (or `type="reset"`) and the element
31
+ * is placed inside a `<form>`, clicking it submits (or resets) that form. The
32
+ * shadow-internal native button cannot associate with the outer form, and the
33
+ * component decorator does not currently support define-time
34
+ * `static formAssociated = true`, so ElementInternals' `.form` is unavailable;
35
+ * the component feature-detects it and otherwise finds the form by walking the
36
+ * ancestor tree (crossing shadow boundaries) and calls `form.requestSubmit()`.
29
37
  */
30
38
  let ButtonComponent = class ButtonComponent {
31
39
  constructor() {
@@ -49,6 +57,8 @@ let ButtonComponent = class ButtonComponent {
49
57
  this.rel = null;
50
58
  /** Anchor download (only used when href is set) */
51
59
  this.download = null;
60
+ this._internals = null;
61
+ this._internalsAttached = false;
52
62
  /** Handle click events */
53
63
  this.handleClick = (event) => {
54
64
  if (this.isDisabled) {
@@ -62,18 +72,83 @@ let ButtonComponent = class ButtonComponent {
62
72
  composed: true,
63
73
  detail: { originalEvent: event }
64
74
  }));
75
+ // Mirror native button form behavior. Skip when the consumer prevented
76
+ // the click's default action (matches native submit-button semantics).
77
+ if (this.href == null && !event.defaultPrevented) {
78
+ if (this.type === 'submit') {
79
+ this.submitForm();
80
+ }
81
+ else if (this.type === 'reset') {
82
+ this.findForm()?.reset();
83
+ }
84
+ }
65
85
  };
66
86
  }
67
- onInit() {
68
- // Ensure proper ARIA role
69
- if (!this.elementRef.hasAttribute('role')) {
70
- this.elementRef.setAttribute('role', 'button');
71
- }
72
- }
73
87
  /** Whether the button is effectively disabled */
74
88
  get isDisabled() {
75
89
  return this.disabled || this.loading;
76
90
  }
91
+ /**
92
+ * Variant with the canonical 'error' name resolved to this component's
93
+ * historical 'danger' style class. The two are interchangeable aliases;
94
+ * the stylesheet keys off `ml-button--danger`.
95
+ */
96
+ get resolvedVariant() {
97
+ return this.variant === 'error' ? 'danger' : this.variant;
98
+ }
99
+ submitForm() {
100
+ const form = this.findForm();
101
+ if (!form)
102
+ return;
103
+ if (typeof form.requestSubmit === 'function') {
104
+ form.requestSubmit();
105
+ }
106
+ else {
107
+ // Very old environments: submit without constraint validation
108
+ form.submit();
109
+ }
110
+ }
111
+ /**
112
+ * Find the owning form. Prefers ElementInternals (`internals.form`), which
113
+ * only works if the custom element was defined with
114
+ * `static formAssociated = true` — the component decorator does not expose
115
+ * that yet, so this typically falls through to walking the ancestor tree
116
+ * (crossing shadow boundaries).
117
+ */
118
+ findForm() {
119
+ const viaInternals = this.getInternalsForm();
120
+ if (viaInternals)
121
+ return viaInternals;
122
+ let el = this.elementRef;
123
+ while (el) {
124
+ const form = el.closest('form');
125
+ if (form)
126
+ return form;
127
+ const root = el.getRootNode();
128
+ el = root instanceof ShadowRoot ? root.host : null;
129
+ }
130
+ return null;
131
+ }
132
+ getInternalsForm() {
133
+ if (this._internals === null && !this._internalsAttached) {
134
+ this._internalsAttached = true;
135
+ try {
136
+ if (typeof this.elementRef.attachInternals === 'function') {
137
+ this._internals = this.elementRef.attachInternals();
138
+ }
139
+ }
140
+ catch {
141
+ this._internals = null;
142
+ }
143
+ }
144
+ try {
145
+ // Throws NotSupportedError when the element is not form-associated
146
+ return this._internals?.form ?? null;
147
+ }
148
+ catch {
149
+ return null;
150
+ }
151
+ }
77
152
  };
78
153
  ButtonComponent = __decorate([
79
154
  MelodicComponent({
@@ -2,7 +2,7 @@ import { html, classMap, when } from '@melodicdev/core';
2
2
  export function buttonTemplate(c) {
3
3
  const classes = classMap({
4
4
  'ml-button': true,
5
- [`ml-button--${c.variant}`]: true,
5
+ [`ml-button--${c.resolvedVariant}`]: true,
6
6
  [`ml-button--${c.size}`]: true,
7
7
  'ml-button--disabled': c.isDisabled,
8
8
  'ml-button--loading': c.loading,
@@ -1,3 +1,10 @@
1
- export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' | 'link';
1
+ /**
2
+ * Button visual variant.
3
+ *
4
+ * 'error' is the library-wide canonical name for the destructive/failure
5
+ * variant (matching alert/toast/badge/progress); 'danger' is a deprecated
6
+ * alias kept for backwards compatibility and renders identically.
7
+ */
8
+ export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' | 'error' | 'link';
2
9
  export type ButtonType = 'button' | 'submit' | 'reset';
3
10
  //# sourceMappingURL=button.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.types.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/button/button.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC9F,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"button.types.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/button/button.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AACxG,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { IElementRef } from '@melodicdev/core';
2
- import type { Size } from '../../../types/index.js';
2
+ import type { ControlSize } from '../../../types/index.js';
3
3
  /**
4
4
  * ml-button-group-item - Individual item within a button group
5
5
  *
@@ -23,7 +23,7 @@ export declare class ButtonGroupItemComponent implements IElementRef {
23
23
  /** Disabled state from parent group */
24
24
  groupDisabled: boolean;
25
25
  /** Size from parent group */
26
- groupSize: Size;
26
+ groupSize: ControlSize;
27
27
  get isDisabled(): boolean;
28
28
  handleClick: () => void;
29
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"button-group-item.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/button-group/button-group-item.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAIpD;;;;;;;;;GASG;AACH,qBAMa,wBAAyB,YAAW,WAAW;IACpD,UAAU,EAAG,WAAW,CAAC;IAEhC,4BAA4B;IACrB,KAAK,SAAM;IAElB,yBAAyB;IAClB,IAAI,SAAM;IAEjB,wBAAwB;IACjB,QAAQ,UAAS;IAExB,qDAAqD;IAC9C,MAAM,UAAS;IAEtB,uCAAuC;IAChC,aAAa,UAAS;IAE7B,6BAA6B;IACtB,SAAS,EAAE,IAAI,CAAQ;IAE9B,IAAW,UAAU,IAAI,OAAO,CAE/B;IAEM,WAAW,QAAO,IAAI,CAS3B;CACF"}
1
+ {"version":3,"file":"button-group-item.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/button-group/button-group-item.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAI3D;;;;;;;;;GASG;AACH,qBAMa,wBAAyB,YAAW,WAAW;IACpD,UAAU,EAAG,WAAW,CAAC;IAEhC,4BAA4B;IACrB,KAAK,SAAM;IAElB,yBAAyB;IAClB,IAAI,SAAM;IAEjB,wBAAwB;IACjB,QAAQ,UAAS;IAExB,qDAAqD;IAC9C,MAAM,UAAS;IAEtB,uCAAuC;IAChC,aAAa,UAAS;IAE7B,6BAA6B;IACtB,SAAS,EAAE,WAAW,CAAQ;IAErC,IAAW,UAAU,IAAI,OAAO,CAE/B;IAEM,WAAW,QAAO,IAAI,CAS3B;CACF"}