@melodicdev/components 4.0.0 → 4.1.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 (276) hide show
  1. package/README.md +4 -4
  2. package/assets/fonts/phosphor/phosphor.css +5 -25
  3. package/assets/melodic-components.css +50 -25
  4. package/assets/melodic-components.js +9230 -7814
  5. package/assets/melodic-components.js.map +1 -1
  6. package/assets/melodic-components.min.css +1 -21
  7. package/assets/melodic-components.min.js +1895 -26471
  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 +83 -78
  10. package/lib/components/data-display/activity-feed/activity-feed.styles.d.ts.map +1 -1
  11. package/lib/components/data-display/activity-feed/activity-feed.styles.js +10 -5
  12. package/lib/components/data-display/avatar/avatar.styles.d.ts.map +1 -1
  13. package/lib/components/data-display/avatar/avatar.styles.js +23 -18
  14. package/lib/components/data-display/badge/badge.styles.d.ts.map +1 -1
  15. package/lib/components/data-display/badge/badge.styles.js +54 -48
  16. package/lib/components/data-display/badge-group/badge-group.styles.d.ts.map +1 -1
  17. package/lib/components/data-display/badge-group/badge-group.styles.js +34 -29
  18. package/lib/components/data-display/calendar-view/calendar-view.styles.d.ts.map +1 -1
  19. package/lib/components/data-display/calendar-view/calendar-view.styles.js +174 -155
  20. package/lib/components/data-display/data-grid/data-grid.component.d.ts +43 -2
  21. package/lib/components/data-display/data-grid/data-grid.component.d.ts.map +1 -1
  22. package/lib/components/data-display/data-grid/data-grid.component.js +94 -8
  23. package/lib/components/data-display/data-grid/data-grid.styles.d.ts.map +1 -1
  24. package/lib/components/data-display/data-grid/data-grid.styles.js +139 -117
  25. package/lib/components/data-display/data-grid/data-grid.template.d.ts.map +1 -1
  26. package/lib/components/data-display/data-grid/data-grid.template.js +19 -10
  27. package/lib/components/data-display/data-grid/index.d.ts +1 -0
  28. package/lib/components/data-display/data-grid/index.d.ts.map +1 -1
  29. package/lib/components/data-display/list/list-item.styles.d.ts.map +1 -1
  30. package/lib/components/data-display/list/list-item.styles.js +40 -35
  31. package/lib/components/data-display/list/list.styles.d.ts.map +1 -1
  32. package/lib/components/data-display/list/list.styles.js +10 -5
  33. package/lib/components/data-display/profile-card/profile-card.styles.d.ts.map +1 -1
  34. package/lib/components/data-display/profile-card/profile-card.styles.js +71 -66
  35. package/lib/components/data-display/stat-card/stat-card.styles.d.ts.map +1 -1
  36. package/lib/components/data-display/stat-card/stat-card.styles.js +67 -63
  37. package/lib/components/data-display/table/index.d.ts +1 -0
  38. package/lib/components/data-display/table/index.d.ts.map +1 -1
  39. package/lib/components/data-display/table/table.component.d.ts +16 -0
  40. package/lib/components/data-display/table/table.component.d.ts.map +1 -1
  41. package/lib/components/data-display/table/table.component.js +28 -3
  42. package/lib/components/data-display/table/table.styles.d.ts.map +1 -1
  43. package/lib/components/data-display/table/table.styles.js +101 -90
  44. package/lib/components/data-display/table/table.template.d.ts.map +1 -1
  45. package/lib/components/data-display/table/table.template.js +8 -6
  46. package/lib/components/data-display/table-core/index.d.ts +2 -2
  47. package/lib/components/data-display/table-core/index.d.ts.map +1 -1
  48. package/lib/components/data-display/table-core/index.js +1 -1
  49. package/lib/components/data-display/table-core/table-core.d.ts +16 -2
  50. package/lib/components/data-display/table-core/table-core.d.ts.map +1 -1
  51. package/lib/components/data-display/table-core/table-core.js +32 -5
  52. package/lib/components/data-display/tag/tag.styles.d.ts.map +1 -1
  53. package/lib/components/data-display/tag/tag.styles.js +78 -66
  54. package/lib/components/feedback/alert/alert.styles.d.ts.map +1 -1
  55. package/lib/components/feedback/alert/alert.styles.js +89 -76
  56. package/lib/components/feedback/progress/progress.styles.d.ts.map +1 -1
  57. package/lib/components/feedback/progress/progress.styles.js +110 -106
  58. package/lib/components/feedback/spinner/spinner.styles.d.ts.map +1 -1
  59. package/lib/components/feedback/spinner/spinner.styles.js +18 -13
  60. package/lib/components/feedback/toast/index.d.ts +1 -0
  61. package/lib/components/feedback/toast/index.d.ts.map +1 -1
  62. package/lib/components/feedback/toast/toast-container.styles.d.ts.map +1 -1
  63. package/lib/components/feedback/toast/toast-container.styles.js +20 -0
  64. package/lib/components/feedback/toast/toast.component.d.ts +16 -0
  65. package/lib/components/feedback/toast/toast.component.d.ts.map +1 -1
  66. package/lib/components/feedback/toast/toast.component.js +63 -5
  67. package/lib/components/feedback/toast/toast.service.d.ts +14 -0
  68. package/lib/components/feedback/toast/toast.service.d.ts.map +1 -1
  69. package/lib/components/feedback/toast/toast.service.js +41 -0
  70. package/lib/components/feedback/toast/toast.styles.d.ts.map +1 -1
  71. package/lib/components/feedback/toast/toast.styles.js +80 -69
  72. package/lib/components/feedback/toast/toast.template.js +1 -1
  73. package/lib/components/forms/autocomplete/autocomplete.component.d.ts +14 -4
  74. package/lib/components/forms/autocomplete/autocomplete.component.d.ts.map +1 -1
  75. package/lib/components/forms/autocomplete/autocomplete.component.js +40 -96
  76. package/lib/components/forms/autocomplete/autocomplete.styles.d.ts.map +1 -1
  77. package/lib/components/forms/autocomplete/autocomplete.styles.js +191 -170
  78. package/lib/components/forms/autocomplete/autocomplete.template.js +7 -1
  79. package/lib/components/forms/button/button.styles.d.ts.map +1 -1
  80. package/lib/components/forms/button/button.styles.js +73 -57
  81. package/lib/components/forms/button-group/button-group-item.styles.d.ts.map +1 -1
  82. package/lib/components/forms/button-group/button-group-item.styles.js +11 -0
  83. package/lib/components/forms/button-group/button-group.styles.d.ts.map +1 -1
  84. package/lib/components/forms/button-group/button-group.styles.js +24 -19
  85. package/lib/components/forms/checkbox/checkbox.styles.d.ts.map +1 -1
  86. package/lib/components/forms/checkbox/checkbox.styles.js +94 -78
  87. package/lib/components/forms/date-picker/calendar.component.d.ts +20 -7
  88. package/lib/components/forms/date-picker/calendar.component.d.ts.map +1 -1
  89. package/lib/components/forms/date-picker/calendar.component.js +88 -13
  90. package/lib/components/forms/date-picker/calendar.styles.d.ts.map +1 -1
  91. package/lib/components/forms/date-picker/calendar.styles.js +171 -147
  92. package/lib/components/forms/date-picker/date-picker.component.d.ts +2 -3
  93. package/lib/components/forms/date-picker/date-picker.component.d.ts.map +1 -1
  94. package/lib/components/forms/date-picker/date-picker.component.js +70 -18
  95. package/lib/components/forms/date-picker/date-picker.styles.d.ts.map +1 -1
  96. package/lib/components/forms/date-picker/date-picker.styles.js +109 -92
  97. package/lib/components/forms/date-time-picker/date-time-picker.styles.d.ts.map +1 -1
  98. package/lib/components/forms/date-time-picker/date-time-picker.styles.js +99 -83
  99. package/lib/components/forms/date-time-picker/tz-utils.d.ts.map +1 -1
  100. package/lib/components/forms/date-time-picker/tz-utils.js +24 -3
  101. package/lib/components/forms/file-upload/file-upload-item.styles.d.ts.map +1 -1
  102. package/lib/components/forms/file-upload/file-upload-item.styles.js +13 -1
  103. package/lib/components/forms/file-upload/file-upload.styles.d.ts.map +1 -1
  104. package/lib/components/forms/file-upload/file-upload.styles.js +108 -92
  105. package/lib/components/forms/form-field/form-field.component.d.ts +18 -1
  106. package/lib/components/forms/form-field/form-field.component.d.ts.map +1 -1
  107. package/lib/components/forms/form-field/form-field.component.js +55 -16
  108. package/lib/components/forms/form-field/form-field.styles.d.ts.map +1 -1
  109. package/lib/components/forms/form-field/form-field.styles.js +92 -74
  110. package/lib/components/forms/input/input.styles.d.ts.map +1 -1
  111. package/lib/components/forms/input/input.styles.js +98 -82
  112. package/lib/components/forms/listbox-core/index.d.ts +3 -0
  113. package/lib/components/forms/listbox-core/index.d.ts.map +1 -0
  114. package/lib/components/forms/listbox-core/index.js +2 -0
  115. package/lib/components/forms/listbox-core/listbox-core.d.ts +57 -0
  116. package/lib/components/forms/listbox-core/listbox-core.d.ts.map +1 -0
  117. package/lib/components/forms/listbox-core/listbox-core.js +168 -0
  118. package/lib/components/forms/radio/radio-group.styles.js +1 -1
  119. package/lib/components/forms/radio/radio.styles.d.ts.map +1 -1
  120. package/lib/components/forms/radio/radio.styles.js +89 -73
  121. package/lib/components/forms/radio-card-group/radio-card-group.styles.d.ts.map +1 -1
  122. package/lib/components/forms/radio-card-group/radio-card-group.styles.js +40 -35
  123. package/lib/components/forms/radio-card-group/radio-card.styles.d.ts.map +1 -1
  124. package/lib/components/forms/radio-card-group/radio-card.styles.js +124 -108
  125. package/lib/components/forms/select/select.component.d.ts +12 -4
  126. package/lib/components/forms/select/select.component.d.ts.map +1 -1
  127. package/lib/components/forms/select/select.component.js +41 -110
  128. package/lib/components/forms/select/select.styles.d.ts.map +1 -1
  129. package/lib/components/forms/select/select.styles.js +181 -159
  130. package/lib/components/forms/select/select.template.d.ts.map +1 -1
  131. package/lib/components/forms/select/select.template.js +25 -9
  132. package/lib/components/forms/slider/slider.component.js +1 -1
  133. package/lib/components/forms/slider/slider.styles.d.ts.map +1 -1
  134. package/lib/components/forms/slider/slider.styles.js +93 -77
  135. package/lib/components/forms/slider/slider.template.d.ts.map +1 -1
  136. package/lib/components/forms/slider/slider.template.js +5 -1
  137. package/lib/components/forms/textarea/textarea.styles.d.ts.map +1 -1
  138. package/lib/components/forms/textarea/textarea.styles.js +97 -81
  139. package/lib/components/forms/time-picker/time-picker.component.d.ts +1 -2
  140. package/lib/components/forms/time-picker/time-picker.component.d.ts.map +1 -1
  141. package/lib/components/forms/time-picker/time-picker.component.js +8 -17
  142. package/lib/components/forms/time-picker/time-picker.styles.d.ts.map +1 -1
  143. package/lib/components/forms/time-picker/time-picker.styles.js +220 -194
  144. package/lib/components/forms/toggle/toggle.styles.d.ts.map +1 -1
  145. package/lib/components/forms/toggle/toggle.styles.js +95 -79
  146. package/lib/components/foundation/card/card.styles.d.ts.map +1 -1
  147. package/lib/components/foundation/card/card.styles.js +62 -46
  148. package/lib/components/foundation/container/container.styles.d.ts.map +1 -1
  149. package/lib/components/foundation/container/container.styles.js +15 -10
  150. package/lib/components/foundation/divider/divider.styles.d.ts.map +1 -1
  151. package/lib/components/foundation/divider/divider.styles.js +29 -24
  152. package/lib/components/foundation/stack/stack.styles.d.ts.map +1 -1
  153. package/lib/components/foundation/stack/stack.styles.js +16 -10
  154. package/lib/components/general/icon/icon.styles.d.ts.map +1 -1
  155. package/lib/components/general/icon/icon.styles.js +12 -8
  156. package/lib/components/navigation/breadcrumb/breadcrumb-item.template.d.ts.map +1 -1
  157. package/lib/components/navigation/breadcrumb/breadcrumb-item.template.js +5 -3
  158. package/lib/components/navigation/breadcrumb/breadcrumb.styles.d.ts.map +1 -1
  159. package/lib/components/navigation/breadcrumb/breadcrumb.styles.js +9 -4
  160. package/lib/components/navigation/pagination/pagination.styles.d.ts.map +1 -1
  161. package/lib/components/navigation/pagination/pagination.styles.js +74 -69
  162. package/lib/components/navigation/sidebar/sidebar-group.styles.d.ts.map +1 -1
  163. package/lib/components/navigation/sidebar/sidebar-group.styles.js +23 -18
  164. package/lib/components/navigation/sidebar/sidebar-item.styles.d.ts.map +1 -1
  165. package/lib/components/navigation/sidebar/sidebar-item.styles.js +105 -100
  166. package/lib/components/navigation/sidebar/sidebar-item.template.js +2 -2
  167. package/lib/components/navigation/sidebar/sidebar.styles.d.ts.map +1 -1
  168. package/lib/components/navigation/sidebar/sidebar.styles.js +180 -175
  169. package/lib/components/navigation/sidebar/sidebar.template.js +2 -2
  170. package/lib/components/navigation/steps/step.styles.d.ts.map +1 -1
  171. package/lib/components/navigation/steps/step.styles.js +155 -150
  172. package/lib/components/navigation/steps/steps.styles.d.ts.map +1 -1
  173. package/lib/components/navigation/steps/steps.styles.js +175 -170
  174. package/lib/components/navigation/tabs/tab-panel.styles.d.ts.map +1 -1
  175. package/lib/components/navigation/tabs/tab-panel.styles.js +12 -7
  176. package/lib/components/navigation/tabs/tab.styles.d.ts.map +1 -1
  177. package/lib/components/navigation/tabs/tab.styles.js +41 -36
  178. package/lib/components/navigation/tabs/tabs.component.d.ts.map +1 -1
  179. package/lib/components/navigation/tabs/tabs.component.js +4 -1
  180. package/lib/components/navigation/tabs/tabs.styles.d.ts.map +1 -1
  181. package/lib/components/navigation/tabs/tabs.styles.js +134 -129
  182. package/lib/components/overlays/dialog/dialog.component.d.ts +15 -2
  183. package/lib/components/overlays/dialog/dialog.component.d.ts.map +1 -1
  184. package/lib/components/overlays/dialog/dialog.component.js +33 -1
  185. package/lib/components/overlays/dialog/dialog.service.d.ts +8 -2
  186. package/lib/components/overlays/dialog/dialog.service.d.ts.map +1 -1
  187. package/lib/components/overlays/dialog/dialog.service.js +1 -0
  188. package/lib/components/overlays/dialog/dialog.styles.d.ts.map +1 -1
  189. package/lib/components/overlays/dialog/dialog.styles.js +78 -73
  190. package/lib/components/overlays/dialog/index.d.ts +1 -0
  191. package/lib/components/overlays/dialog/index.d.ts.map +1 -1
  192. package/lib/components/overlays/drawer/drawer.component.d.ts +18 -3
  193. package/lib/components/overlays/drawer/drawer.component.d.ts.map +1 -1
  194. package/lib/components/overlays/drawer/drawer.component.js +59 -16
  195. package/lib/components/overlays/drawer/drawer.styles.d.ts.map +1 -1
  196. package/lib/components/overlays/drawer/drawer.styles.js +82 -77
  197. package/lib/components/overlays/dropdown/dropdown-item.styles.d.ts.map +1 -1
  198. package/lib/components/overlays/dropdown/dropdown-item.styles.js +60 -43
  199. package/lib/components/overlays/dropdown/dropdown.styles.d.ts.map +1 -1
  200. package/lib/components/overlays/dropdown/dropdown.styles.js +35 -30
  201. package/lib/components/overlays/popover/popover.component.d.ts +12 -0
  202. package/lib/components/overlays/popover/popover.component.d.ts.map +1 -1
  203. package/lib/components/overlays/popover/popover.component.js +28 -1
  204. package/lib/components/overlays/popover/popover.styles.d.ts.map +1 -1
  205. package/lib/components/overlays/popover/popover.styles.js +36 -31
  206. package/lib/components/overlays/popover/popover.template.d.ts.map +1 -1
  207. package/lib/components/overlays/popover/popover.template.js +2 -0
  208. package/lib/components/overlays/tooltip/tooltip.component.d.ts +8 -5
  209. package/lib/components/overlays/tooltip/tooltip.component.d.ts.map +1 -1
  210. package/lib/components/overlays/tooltip/tooltip.component.js +10 -3
  211. package/lib/components/overlays/tooltip/tooltip.styles.d.ts.map +1 -1
  212. package/lib/components/overlays/tooltip/tooltip.styles.js +34 -28
  213. package/lib/components/pages/auth/auth-layout.styles.d.ts +1 -1
  214. package/lib/components/pages/auth/auth-layout.styles.d.ts.map +1 -1
  215. package/lib/components/pages/auth/auth-layout.styles.js +86 -81
  216. package/lib/components/pages/dashboard/dashboard-page.styles.d.ts.map +1 -1
  217. package/lib/components/pages/dashboard/dashboard-page.styles.js +39 -34
  218. package/lib/components/sections/app-shell/app-shell.styles.d.ts.map +1 -1
  219. package/lib/components/sections/app-shell/app-shell.styles.js +63 -57
  220. package/lib/components/sections/hero/hero-section.styles.js +97 -97
  221. package/lib/components/sections/page-header/page-header.styles.d.ts.map +1 -1
  222. package/lib/components/sections/page-header/page-header.styles.js +69 -64
  223. package/lib/components/sections/page-section/page-section.styles.d.ts.map +1 -1
  224. package/lib/components/sections/page-section/page-section.styles.js +56 -51
  225. package/lib/directives/tooltip.directive.d.ts.map +1 -1
  226. package/lib/directives/tooltip.directive.js +22 -3
  227. package/lib/theme/presets/base.preset.d.ts.map +1 -1
  228. package/lib/theme/presets/base.preset.js +17 -0
  229. package/lib/theme/presets/dark.preset.d.ts +8 -0
  230. package/lib/theme/presets/dark.preset.d.ts.map +1 -1
  231. package/lib/theme/presets/dark.preset.js +9 -0
  232. package/lib/theme/presets/light.preset.d.ts +6 -0
  233. package/lib/theme/presets/light.preset.d.ts.map +1 -1
  234. package/lib/theme/presets/light.preset.js +7 -0
  235. package/lib/theme/tokens/all-tokens.d.ts +10 -0
  236. package/lib/theme/tokens/all-tokens.d.ts.map +1 -1
  237. package/lib/theme/tokens/colors.tokens.d.ts +8 -0
  238. package/lib/theme/tokens/colors.tokens.d.ts.map +1 -1
  239. package/lib/theme/tokens/colors.tokens.js +11 -0
  240. package/lib/theme/tokens/transitions.tokens.d.ts +1 -0
  241. package/lib/theme/tokens/transitions.tokens.d.ts.map +1 -1
  242. package/lib/theme/tokens/transitions.tokens.js +3 -0
  243. package/lib/theme/tokens/typography.tokens.d.ts +1 -0
  244. package/lib/theme/tokens/typography.tokens.d.ts.map +1 -1
  245. package/lib/theme/tokens/typography.tokens.js +1 -0
  246. package/lib/utils/accessibility/cross-root-aria.d.ts +16 -8
  247. package/lib/utils/accessibility/cross-root-aria.d.ts.map +1 -1
  248. package/lib/utils/accessibility/cross-root-aria.js +58 -22
  249. package/lib/utils/accessibility/focus-trap.d.ts.map +1 -1
  250. package/lib/utils/accessibility/focus-trap.js +9 -19
  251. package/lib/utils/accessibility/focus-utils.d.ts +10 -1
  252. package/lib/utils/accessibility/focus-utils.d.ts.map +1 -1
  253. package/lib/utils/accessibility/focus-utils.js +48 -14
  254. package/lib/utils/accessibility/index.d.ts +2 -1
  255. package/lib/utils/accessibility/index.d.ts.map +1 -1
  256. package/lib/utils/accessibility/index.js +1 -1
  257. package/lib/utils/positioning/compute-position.d.ts +6 -1
  258. package/lib/utils/positioning/compute-position.d.ts.map +1 -1
  259. package/lib/utils/positioning/compute-position.js +3 -2
  260. package/lib/utils/positioning/middlewares/flip.middleware.js +2 -51
  261. package/package.json +8 -5
  262. package/assets/fonts/phosphor/Phosphor-Bold.svg +0 -3057
  263. package/assets/fonts/phosphor/Phosphor-Bold.ttf +0 -0
  264. package/assets/fonts/phosphor/Phosphor-Bold.woff +0 -0
  265. package/assets/fonts/phosphor/Phosphor-Fill.svg +0 -3057
  266. package/assets/fonts/phosphor/Phosphor-Fill.ttf +0 -0
  267. package/assets/fonts/phosphor/Phosphor-Fill.woff +0 -0
  268. package/assets/fonts/phosphor/Phosphor-Light.svg +0 -3057
  269. package/assets/fonts/phosphor/Phosphor-Light.ttf +0 -0
  270. package/assets/fonts/phosphor/Phosphor-Light.woff +0 -0
  271. package/assets/fonts/phosphor/Phosphor-Thin.svg +0 -3057
  272. package/assets/fonts/phosphor/Phosphor-Thin.ttf +0 -0
  273. package/assets/fonts/phosphor/Phosphor-Thin.woff +0 -0
  274. package/assets/fonts/phosphor/Phosphor.svg +0 -3056
  275. package/assets/fonts/phosphor/Phosphor.ttf +0 -0
  276. package/assets/fonts/phosphor/Phosphor.woff +0 -0
@@ -111,6 +111,8 @@ export declare const colorTokens: {
111
111
  readonly '--ml-color-danger': "var(--ml-red-600)";
112
112
  readonly '--ml-color-danger-hover': "var(--ml-red-700)";
113
113
  readonly '--ml-color-danger-subtle': "var(--ml-red-50)";
114
+ readonly '--ml-color-error': "var(--ml-color-danger)";
115
+ readonly '--ml-color-error-subtle': "var(--ml-color-danger-subtle)";
114
116
  readonly '--ml-color-info': "var(--ml-cyan-600)";
115
117
  readonly '--ml-color-info-hover': "var(--ml-cyan-700)";
116
118
  readonly '--ml-color-info-subtle': "var(--ml-cyan-50)";
@@ -119,10 +121,16 @@ export declare const colorTokens: {
119
121
  readonly '--ml-color-surface-raised': "var(--ml-gray-50)";
120
122
  readonly '--ml-color-surface-overlay': "var(--ml-white)";
121
123
  readonly '--ml-color-surface-sunken': "var(--ml-gray-100)";
124
+ readonly '--ml-color-surface-hover': "var(--ml-color-surface-raised)";
125
+ readonly '--ml-color-surface-secondary': "var(--ml-color-surface-raised)";
126
+ readonly '--ml-color-surface-tertiary': "var(--ml-color-surface-sunken)";
127
+ readonly '--ml-color-bg-secondary': "var(--ml-color-surface-raised)";
122
128
  readonly '--ml-color-text': "var(--ml-gray-900)";
123
129
  readonly '--ml-color-text-secondary': "var(--ml-gray-700)";
124
130
  readonly '--ml-color-text-muted': "var(--ml-gray-500)";
125
131
  readonly '--ml-color-text-subtle': "var(--ml-gray-400)";
132
+ readonly '--ml-color-text-tertiary': "var(--ml-color-text-muted)";
133
+ readonly '--ml-color-text-disabled': "var(--ml-color-text-subtle)";
126
134
  readonly '--ml-color-text-inverse': "var(--ml-white)";
127
135
  readonly '--ml-color-text-link': "var(--ml-blue-600)";
128
136
  readonly '--ml-color-text-link-hover': "var(--ml-blue-700)";
@@ -1 +1 @@
1
- {"version":3,"file":"colors.tokens.d.ts","sourceRoot":"","sources":["../../../src/theme/tokens/colors.tokens.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsGlB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkHd,CAAC"}
1
+ {"version":3,"file":"colors.tokens.d.ts","sourceRoot":"","sources":["../../../src/theme/tokens/colors.tokens.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsGlB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Hd,CAAC"}
@@ -124,6 +124,9 @@ export const colorTokens = {
124
124
  '--ml-color-danger': 'var(--ml-red-600)',
125
125
  '--ml-color-danger-hover': 'var(--ml-red-700)',
126
126
  '--ml-color-danger-subtle': 'var(--ml-red-50)',
127
+ // Aliases of danger: the names several components and apps use for it
128
+ '--ml-color-error': 'var(--ml-color-danger)',
129
+ '--ml-color-error-subtle': 'var(--ml-color-danger-subtle)',
127
130
  // Info
128
131
  '--ml-color-info': 'var(--ml-cyan-600)',
129
132
  '--ml-color-info-hover': 'var(--ml-cyan-700)',
@@ -134,11 +137,19 @@ export const colorTokens = {
134
137
  '--ml-color-surface-raised': 'var(--ml-gray-50)',
135
138
  '--ml-color-surface-overlay': 'var(--ml-white)',
136
139
  '--ml-color-surface-sunken': 'var(--ml-gray-100)',
140
+ // Aliases: hover / secondary / bg-secondary follow surface-raised, tertiary follows surface-sunken
141
+ '--ml-color-surface-hover': 'var(--ml-color-surface-raised)',
142
+ '--ml-color-surface-secondary': 'var(--ml-color-surface-raised)',
143
+ '--ml-color-surface-tertiary': 'var(--ml-color-surface-sunken)',
144
+ '--ml-color-bg-secondary': 'var(--ml-color-surface-raised)',
137
145
  // Text colors
138
146
  '--ml-color-text': 'var(--ml-gray-900)',
139
147
  '--ml-color-text-secondary': 'var(--ml-gray-700)',
140
148
  '--ml-color-text-muted': 'var(--ml-gray-500)',
141
149
  '--ml-color-text-subtle': 'var(--ml-gray-400)',
150
+ // Aliases: tertiary follows text-muted, disabled follows text-subtle
151
+ '--ml-color-text-tertiary': 'var(--ml-color-text-muted)',
152
+ '--ml-color-text-disabled': 'var(--ml-color-text-subtle)',
142
153
  '--ml-color-text-inverse': 'var(--ml-white)',
143
154
  '--ml-color-text-link': 'var(--ml-blue-600)',
144
155
  '--ml-color-text-link-hover': 'var(--ml-blue-700)',
@@ -16,6 +16,7 @@ export declare const transitionTokens: {
16
16
  readonly '--ml-ease-out': "cubic-bezier(0, 0, 0.2, 1)";
17
17
  readonly '--ml-ease-in-out': "cubic-bezier(0.4, 0, 0.2, 1)";
18
18
  readonly '--ml-ease-bounce': "cubic-bezier(0.68, -0.55, 0.265, 1.55)";
19
+ readonly '--ml-transition-normal': "var(--ml-duration-200) var(--ml-ease-in-out)";
19
20
  readonly '--ml-transition-none': "none";
20
21
  readonly '--ml-transition-all': "all var(--ml-duration-150) var(--ml-ease-in-out)";
21
22
  readonly '--ml-transition-colors': "color var(--ml-duration-150) var(--ml-ease-in-out), background-color var(--ml-duration-150) var(--ml-ease-in-out), border-color var(--ml-duration-150) var(--ml-ease-in-out)";
@@ -1 +1 @@
1
- {"version":3,"file":"transitions.tokens.d.ts","sourceRoot":"","sources":["../../../src/theme/tokens/transitions.tokens.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;CA2BnB,CAAC"}
1
+ {"version":3,"file":"transitions.tokens.d.ts","sourceRoot":"","sources":["../../../src/theme/tokens/transitions.tokens.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;CA+BnB,CAAC"}
@@ -18,6 +18,9 @@ export const transitionTokens = {
18
18
  '--ml-ease-out': 'cubic-bezier(0, 0, 0.2, 1)',
19
19
  '--ml-ease-in-out': 'cubic-bezier(0.4, 0, 0.2, 1)',
20
20
  '--ml-ease-bounce': 'cubic-bezier(0.68, -0.55, 0.265, 1.55)',
21
+ // Duration + easing with no property, for per-property lists:
22
+ // transition: transform var(--ml-transition-normal), opacity var(--ml-transition-normal)
23
+ '--ml-transition-normal': 'var(--ml-duration-200) var(--ml-ease-in-out)',
21
24
  // Common transition presets
22
25
  '--ml-transition-none': 'none',
23
26
  '--ml-transition-all': 'all var(--ml-duration-150) var(--ml-ease-in-out)',
@@ -22,6 +22,7 @@ export declare const typographyTokens: {
22
22
  readonly '--ml-font-extralight': "200";
23
23
  readonly '--ml-font-light': "300";
24
24
  readonly '--ml-font-normal': "400";
25
+ readonly '--ml-font-regular': "var(--ml-font-normal)";
25
26
  readonly '--ml-font-medium': "500";
26
27
  readonly '--ml-font-semibold': "600";
27
28
  readonly '--ml-font-bold': "700";
@@ -1 +1 @@
1
- {"version":3,"file":"typography.tokens.d.ts","sourceRoot":"","sources":["../../../src/theme/tokens/typography.tokens.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDnB,CAAC"}
1
+ {"version":3,"file":"typography.tokens.d.ts","sourceRoot":"","sources":["../../../src/theme/tokens/typography.tokens.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDnB,CAAC"}
@@ -25,6 +25,7 @@ export const typographyTokens = {
25
25
  '--ml-font-extralight': '200',
26
26
  '--ml-font-light': '300',
27
27
  '--ml-font-normal': '400',
28
+ '--ml-font-regular': 'var(--ml-font-normal)', // alias of normal
28
29
  '--ml-font-medium': '500',
29
30
  '--ml-font-semibold': '600',
30
31
  '--ml-font-bold': '700',
@@ -2,18 +2,26 @@
2
2
  * ARIA relationships that cross a shadow-root boundary.
3
3
  *
4
4
  * `aria-describedby`, `aria-labelledby` and friends are IDREFs, and an IDREF
5
- * only resolves within the same tree. A component whose description lives in
6
- * its shadow root therefore cannot point a light-DOM trigger at it — the
7
- * attribute is set, resolves to nothing, and the content is never announced.
5
+ * only resolves within the same tree. Element-reference properties
6
+ * (`ariaDescribedByElements`, `ariaLabelledByElements`) relax that — but only
7
+ * in ONE direction: the referenced element must live in the same tree as the
8
+ * referencing element or in one of its shadow-including ANCESTOR trees. A
9
+ * control inside a shadow root may point OUT at light-DOM content; a light-DOM
10
+ * element may not point IN at something inside a (sibling or descendant)
11
+ * shadow root — the browser silently drops such a reference.
8
12
  *
9
- * Element-reference properties (`ariaDescribedByElements`,
10
- * `ariaLabelledByElements`) do cross the boundary and are the correct fix
11
- * where they exist. Where they do not, the text itself is copied onto the
12
- * element via `aria-description` / `aria-label`, which is announced even
13
- * though it duplicates the string.
13
+ * That inward case is exactly a slotted trigger described by a tooltip's
14
+ * shadow content, or a slotted control described by a form field's shadow
15
+ * hint. For those the text itself is copied onto the element via
16
+ * `aria-description` / `aria-label`, which is announced.
14
17
  */
15
18
  /** True when this engine supports ARIA element references. */
16
19
  export declare function supportsAriaElementReferences(): boolean;
20
+ /**
21
+ * True when an element reference from `from` to `to` will be honoured: `to`
22
+ * is in `from`'s own tree or in one of its shadow-including ancestor trees.
23
+ */
24
+ export declare function canReferenceElement(from: Element, to: Element): boolean;
17
25
  /**
18
26
  * Describe `target` with `describers`, which may live in another root.
19
27
  * Pass an empty array to clear the relationship.
@@ -1 +1 @@
1
- {"version":3,"file":"cross-root-aria.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility/cross-root-aria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,8DAA8D;AAC9D,wBAAgB,6BAA6B,IAAI,OAAO,CAEvD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAI,CAmBpF;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAkB1E;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAa1F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAWjE;AAED,6DAA6D;AAC7D,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAE/D"}
1
+ {"version":3,"file":"cross-root-aria.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility/cross-root-aria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,8DAA8D;AAC9D,wBAAgB,6BAA6B,IAAI,OAAO,CAEvD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,GAAG,OAAO,CAYvE;AAaD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAI,CAyBpF;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAuB1E;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAa1F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAWjE;AAED,6DAA6D;AAC7D,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAE/D"}
@@ -2,37 +2,69 @@
2
2
  * ARIA relationships that cross a shadow-root boundary.
3
3
  *
4
4
  * `aria-describedby`, `aria-labelledby` and friends are IDREFs, and an IDREF
5
- * only resolves within the same tree. A component whose description lives in
6
- * its shadow root therefore cannot point a light-DOM trigger at it — the
7
- * attribute is set, resolves to nothing, and the content is never announced.
5
+ * only resolves within the same tree. Element-reference properties
6
+ * (`ariaDescribedByElements`, `ariaLabelledByElements`) relax that — but only
7
+ * in ONE direction: the referenced element must live in the same tree as the
8
+ * referencing element or in one of its shadow-including ANCESTOR trees. A
9
+ * control inside a shadow root may point OUT at light-DOM content; a light-DOM
10
+ * element may not point IN at something inside a (sibling or descendant)
11
+ * shadow root — the browser silently drops such a reference.
8
12
  *
9
- * Element-reference properties (`ariaDescribedByElements`,
10
- * `ariaLabelledByElements`) do cross the boundary and are the correct fix
11
- * where they exist. Where they do not, the text itself is copied onto the
12
- * element via `aria-description` / `aria-label`, which is announced even
13
- * though it duplicates the string.
13
+ * That inward case is exactly a slotted trigger described by a tooltip's
14
+ * shadow content, or a slotted control described by a form field's shadow
15
+ * hint. For those the text itself is copied onto the element via
16
+ * `aria-description` / `aria-label`, which is announced.
14
17
  */
15
18
  /** True when this engine supports ARIA element references. */
16
19
  export function supportsAriaElementReferences() {
17
20
  return typeof Element !== 'undefined' && 'ariaDescribedByElements' in Element.prototype;
18
21
  }
22
+ /**
23
+ * True when an element reference from `from` to `to` will be honoured: `to`
24
+ * is in `from`'s own tree or in one of its shadow-including ancestor trees.
25
+ */
26
+ export function canReferenceElement(from, to) {
27
+ const targetRoot = to.getRootNode();
28
+ let root = from.getRootNode();
29
+ while (root) {
30
+ if (root === targetRoot) {
31
+ return true;
32
+ }
33
+ root = root instanceof ShadowRoot ? root.host.getRootNode() : null;
34
+ }
35
+ return false;
36
+ }
37
+ function canReferenceAll(from, elements) {
38
+ return elements.every((element) => canReferenceElement(from, element));
39
+ }
40
+ function joinedText(elements, separator) {
41
+ return elements
42
+ .map((element) => element.textContent?.replace(/\s+/g, ' ').trim() ?? '')
43
+ .filter(Boolean)
44
+ .join(separator);
45
+ }
19
46
  /**
20
47
  * Describe `target` with `describers`, which may live in another root.
21
48
  * Pass an empty array to clear the relationship.
22
49
  */
23
50
  export function setCrossRootDescription(target, describers) {
24
51
  const reflected = target;
25
- if ('ariaDescribedByElements' in reflected) {
26
- reflected.ariaDescribedByElements = describers.length > 0 ? describers : null;
52
+ const supportsReferences = 'ariaDescribedByElements' in reflected;
53
+ if (supportsReferences && describers.length > 0 && canReferenceAll(target, describers)) {
54
+ reflected.ariaDescribedByElements = describers;
27
55
  target.removeAttribute('aria-description');
28
56
  return;
29
57
  }
30
- const text = describers
31
- .map((element) => element.textContent?.trim() ?? '')
32
- .filter(Boolean)
33
- .join('. ');
58
+ // Drop a reference we set earlier (only ours: a consumer's own
59
+ // aria-describedby IDREF list is left alone).
60
+ if (supportsReferences && reflected.ariaDescribedByElements?.length && !target.getAttribute('aria-describedby')) {
61
+ reflected.ariaDescribedByElements = null;
62
+ }
63
+ const text = joinedText(describers, '. ');
34
64
  if (text) {
35
- target.setAttribute('aria-description', text);
65
+ if (target.getAttribute('aria-description') !== text) {
66
+ target.setAttribute('aria-description', text);
67
+ }
36
68
  }
37
69
  else {
38
70
  target.removeAttribute('aria-description');
@@ -41,16 +73,20 @@ export function setCrossRootDescription(target, describers) {
41
73
  /** Label `target` with `labels`, which may live in another root. */
42
74
  export function setCrossRootLabel(target, labels) {
43
75
  const reflected = target;
44
- if ('ariaLabelledByElements' in reflected) {
45
- reflected.ariaLabelledByElements = labels.length > 0 ? labels : null;
76
+ const supportsReferences = 'ariaLabelledByElements' in reflected;
77
+ if (supportsReferences && labels.length > 0 && canReferenceAll(target, labels)) {
78
+ reflected.ariaLabelledByElements = labels;
79
+ target.removeAttribute('aria-label');
46
80
  return;
47
81
  }
48
- const text = labels
49
- .map((element) => element.textContent?.trim() ?? '')
50
- .filter(Boolean)
51
- .join(' ');
82
+ if (supportsReferences && reflected.ariaLabelledByElements?.length && !target.getAttribute('aria-labelledby')) {
83
+ reflected.ariaLabelledByElements = null;
84
+ }
85
+ const text = joinedText(labels, ' ');
52
86
  if (text) {
53
- target.setAttribute('aria-label', text);
87
+ if (target.getAttribute('aria-label') !== text) {
88
+ target.setAttribute('aria-label', text);
89
+ }
54
90
  }
55
91
  else {
56
92
  target.removeAttribute('aria-label');
@@ -1 +1 @@
1
- {"version":3,"file":"focus-trap.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility/focus-trap.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAChC,8CAA8C;IAC9C,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IAC1C,iFAAiF;IACjF,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,IAAI,IAAI,CAAC;IACjB,UAAU,CAAC,OAAO,CAAC,EAAE,0BAA0B,GAAG,IAAI,CAAC;IACvD,QAAQ,IAAI,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,GAAG,IAAI,CAMrD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,IAAI,GAAG,OAAO,CAO1D;AA4BD;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,GAAE,gBAAqB,GAAG,SAAS,CAuFjG;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,MAAM,IAAI,CAIxF"}
1
+ {"version":3,"file":"focus-trap.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility/focus-trap.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAChC,8CAA8C;IAC9C,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IAC1C,iFAAiF;IACjF,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,IAAI,IAAI,CAAC;IACjB,UAAU,CAAC,OAAO,CAAC,EAAE,0BAA0B,GAAG,IAAI,CAAC;IACvD,QAAQ,IAAI,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,GAAG,IAAI,CAMrD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,IAAI,GAAG,OAAO,CAO1D;AAgBD;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,GAAE,gBAAqB,GAAG,SAAS,CAuFjG;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,MAAM,IAAI,CAIxF"}
@@ -28,27 +28,17 @@ export function isDeepFocusWithin(container) {
28
28
  return false;
29
29
  }
30
30
  /**
31
- * Collect focusable elements within a container, expanding `<slot>` elements
32
- * to their assigned (light DOM) content so traps work on shadow containers
33
- * that project slotted content.
31
+ * Collect the focusable elements inside a trap container, in tab order.
32
+ *
33
+ * The walk follows `<slot>`s to their assigned (light DOM) content and
34
+ * descends into nested shadow roots, so slotted content and the controls
35
+ * inside nested components (`<ml-input>`, `<ml-button>`…) are all trapped.
36
+ * A shallow query saw neither — with an `<ml-input>` and a `<button>` in a
37
+ * popover, the button was both "first" and "last" and Tab could never reach
38
+ * the input.
34
39
  */
35
40
  function collectFocusables(container) {
36
- const slots = Array.from(container.querySelectorAll('slot'));
37
- if (slots.length === 0) {
38
- return getFocusableElements(container);
39
- }
40
- const focusables = getFocusableElements(container);
41
- for (const slot of slots) {
42
- for (const assigned of slot.assignedElements({ flatten: true })) {
43
- if (assigned instanceof HTMLElement) {
44
- focusables.push(...getFocusableElements(assigned));
45
- if (assigned.matches('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')) {
46
- focusables.push(assigned);
47
- }
48
- }
49
- }
50
- }
51
- return focusables;
41
+ return getFocusableElements(container, { deep: true });
52
42
  }
53
43
  /**
54
44
  * Create a focus trap within a container element
@@ -1,7 +1,16 @@
1
+ export interface GetFocusableOptions {
2
+ /**
3
+ * Walk the composed (flattened) tree: descend into the shadow roots of
4
+ * nested custom elements and follow `<slot>`s to their assigned content,
5
+ * returning elements in tab order. Default false — only the container's own
6
+ * tree is searched, as before.
7
+ */
8
+ deep?: boolean;
9
+ }
1
10
  /**
2
11
  * Get all focusable elements within a container
3
12
  */
4
- export declare function getFocusableElements(container: HTMLElement): HTMLElement[];
13
+ export declare function getFocusableElements(container: HTMLElement, options?: GetFocusableOptions): HTMLElement[];
5
14
  /**
6
15
  * Get the first focusable element within a container
7
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"focus-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility/focus-utils.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,WAAW,GAAG,WAAW,EAAE,CAiB1E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAG5E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAG3E;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAO1D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAOzD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAEzD"}
1
+ {"version":3,"file":"focus-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility/focus-utils.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,mBAAmB;IACnC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAgDD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,GAAE,mBAAwB,GAAG,WAAW,EAAE,CAQ7G;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAG5E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAG3E;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAO1D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAOzD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAEzD"}
@@ -11,23 +11,57 @@ const FOCUSABLE_SELECTOR = [
11
11
  '[contenteditable]',
12
12
  '[tabindex]:not([tabindex="-1"])'
13
13
  ].join(', ');
14
+ function isVisiblyFocusable(element) {
15
+ // Filter out elements that are hidden or have display: none
16
+ if (element.offsetParent === null && element.style.position !== 'fixed') {
17
+ return false;
18
+ }
19
+ // Filter out elements with visibility: hidden
20
+ return getComputedStyle(element).visibility !== 'hidden';
21
+ }
14
22
  /**
15
- * Get all focusable elements within a container
23
+ * Collect focusable elements under `root` in composed-tree order.
24
+ *
25
+ * `querySelectorAll` stops at shadow boundaries, so a focusable control that
26
+ * lives inside a nested component's shadow root (`<ml-input>`, `<ml-button>`,
27
+ * `<ml-select>`…) was invisible to it.
16
28
  */
17
- export function getFocusableElements(container) {
18
- const elements = Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR));
19
- return elements.filter((element) => {
20
- // Filter out elements that are hidden or have display: none
21
- if (element.offsetParent === null && element.style.position !== 'fixed') {
22
- return false;
23
- }
24
- // Filter out elements with visibility: hidden
25
- const style = getComputedStyle(element);
26
- if (style.visibility === 'hidden') {
27
- return false;
29
+ function collectDeep(root, out) {
30
+ for (const child of Array.from(root.children)) {
31
+ if (child instanceof HTMLSlotElement) {
32
+ const assigned = child.assignedElements({ flatten: true });
33
+ if (assigned.length > 0) {
34
+ for (const element of assigned) {
35
+ visitDeep(element, out);
36
+ }
37
+ }
38
+ else {
39
+ // Fallback content
40
+ collectDeep(child, out);
41
+ }
42
+ continue;
28
43
  }
29
- return true;
30
- });
44
+ visitDeep(child, out);
45
+ }
46
+ }
47
+ function visitDeep(element, out) {
48
+ if (element instanceof HTMLElement && element.matches(FOCUSABLE_SELECTOR) && isVisiblyFocusable(element)) {
49
+ out.push(element);
50
+ }
51
+ // A shadow host renders its shadow tree; its light children only appear
52
+ // where a <slot> projects them, which collectDeep follows.
53
+ collectDeep(element.shadowRoot ?? element, out);
54
+ }
55
+ /**
56
+ * Get all focusable elements within a container
57
+ */
58
+ export function getFocusableElements(container, options = {}) {
59
+ if (options.deep) {
60
+ const focusables = [];
61
+ collectDeep(container.shadowRoot ?? container, focusables);
62
+ return focusables;
63
+ }
64
+ return Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR)).filter(isVisiblyFocusable);
31
65
  }
32
66
  /**
33
67
  * Get the first focusable element within a container
@@ -3,5 +3,6 @@ export type { FocusTrap, FocusTrapOptions, FocusTrapDeactivateOptions } from './
3
3
  export { focusVisible, isFocusVisible } from './focus-visible.js';
4
4
  export { announce, createLiveRegion } from './live-region.js';
5
5
  export { getFirstFocusable, getLastFocusable, getFocusableElements, focusFirst, focusLast } from './focus-utils.js';
6
- export { setCrossRootDescription, setCrossRootLabel, setCrossRootActiveDescendant, clearCrossRootDescription, getFocusableControl, supportsAriaElementReferences } from './cross-root-aria.js';
6
+ export type { GetFocusableOptions } from './focus-utils.js';
7
+ export { setCrossRootDescription, setCrossRootLabel, setCrossRootActiveDescendant, clearCrossRootDescription, getFocusableControl, supportsAriaElementReferences, canReferenceElement } from './cross-root-aria.js';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACtG,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpH,OAAO,EACN,uBAAuB,EACvB,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,6BAA6B,EAC7B,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACtG,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpH,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EACN,uBAAuB,EACvB,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,6BAA6B,EAC7B,mBAAmB,EACnB,MAAM,sBAAsB,CAAC"}
@@ -2,4 +2,4 @@ export { focusTrap, createFocusTrap, getDeepActiveElement, isDeepFocusWithin } f
2
2
  export { focusVisible, isFocusVisible } from './focus-visible.js';
3
3
  export { announce, createLiveRegion } from './live-region.js';
4
4
  export { getFirstFocusable, getLastFocusable, getFocusableElements, focusFirst, focusLast } from './focus-utils.js';
5
- export { setCrossRootDescription, setCrossRootLabel, setCrossRootActiveDescendant, clearCrossRootDescription, getFocusableControl, supportsAriaElementReferences } from './cross-root-aria.js';
5
+ export { setCrossRootDescription, setCrossRootLabel, setCrossRootActiveDescendant, clearCrossRootDescription, getFocusableControl, supportsAriaElementReferences, canReferenceElement } from './cross-root-aria.js';
@@ -1,4 +1,9 @@
1
- import type { Placement, ComputePositionConfig, ComputePositionReturn } from './types.js';
1
+ import type { Placement, Position, ComputePositionConfig, ComputePositionReturn } from './types.js';
2
+ /**
3
+ * Get the base position for a given placement.
4
+ * Shared with flip(), which re-places the element for each fallback.
5
+ */
6
+ export declare function getBasePlacement(reference: DOMRect, floating: DOMRect, placement: Placement): Position;
2
7
  /**
3
8
  * Compute the position of a floating element relative to a reference element
4
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"compute-position.d.ts","sourceRoot":"","sources":["../../../src/utils/positioning/compute-position.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAY,qBAAqB,EAAE,qBAAqB,EAAmB,MAAM,YAAY,CAAC;AA2DrH;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAE,qBAA0B,GAAG,qBAAqB,CAuCpI;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CASpE;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAEjF"}
1
+ {"version":3,"file":"compute-position.d.ts","sourceRoot":"","sources":["../../../src/utils/positioning/compute-position.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,qBAAqB,EAAE,qBAAqB,EAAmB,MAAM,YAAY,CAAC;AAErH;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,QAAQ,CAoDtG;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAE,qBAA0B,GAAG,qBAAqB,CAuCpI;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CASpE;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAEjF"}
@@ -1,7 +1,8 @@
1
1
  /**
2
- * Get the base position for a given placement
2
+ * Get the base position for a given placement.
3
+ * Shared with flip(), which re-places the element for each fallback.
3
4
  */
4
- function getBasePlacement(reference, floating, placement) {
5
+ export function getBasePlacement(reference, floating, placement) {
5
6
  const [side, alignment = 'center'] = placement.split('-');
6
7
  let x = 0;
7
8
  let y = 0;
@@ -1,4 +1,4 @@
1
- import { getOppositePlacement, getSide } from '../compute-position.js';
1
+ import { getBasePlacement, getOppositePlacement, getSide } from '../compute-position.js';
2
2
  import { applyOffsetToPosition } from './offset.middleware.js';
3
3
  /**
4
4
  * Detect overflow relative to viewport
@@ -56,7 +56,7 @@ export function flip(options = {}) {
56
56
  for (const fallback of fallbacks) {
57
57
  // Calculate position for fallback placement
58
58
  const newSide = getSide(fallback);
59
- let newPos = getBasePlacementForFlip(rects.reference, rects.floating, fallback);
59
+ let newPos = getBasePlacement(rects.reference, rects.floating, fallback);
60
60
  if (offsetData) {
61
61
  newPos = applyOffsetToPosition(newPos, newSide, offsetData);
62
62
  }
@@ -74,52 +74,3 @@ export function flip(options = {}) {
74
74
  }
75
75
  };
76
76
  }
77
- /**
78
- * Calculate base position for a placement (used internally by flip)
79
- */
80
- function getBasePlacementForFlip(reference, floating, placement) {
81
- const [side, alignment = 'center'] = placement.split('-');
82
- let x = 0;
83
- let y = 0;
84
- switch (side) {
85
- case 'top':
86
- y = reference.top - floating.height;
87
- break;
88
- case 'bottom':
89
- y = reference.bottom;
90
- break;
91
- case 'left':
92
- x = reference.left - floating.width;
93
- break;
94
- case 'right':
95
- x = reference.right;
96
- break;
97
- default:
98
- break;
99
- }
100
- if (side === 'top' || side === 'bottom') {
101
- switch (alignment) {
102
- case 'start':
103
- x = reference.left;
104
- break;
105
- case 'end':
106
- x = reference.right - floating.width;
107
- break;
108
- default:
109
- x = reference.left + (reference.width - floating.width) / 2;
110
- }
111
- }
112
- else {
113
- switch (alignment) {
114
- case 'start':
115
- y = reference.top;
116
- break;
117
- case 'end':
118
- y = reference.bottom - floating.height;
119
- break;
120
- default:
121
- y = reference.top + (reference.height - floating.height) / 2;
122
- }
123
- }
124
- return { x, y };
125
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melodicdev/components",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Themeable UI component library built on the Melodic Framework",
5
5
  "license": "MIT",
6
6
  "author": "Melodic Development",
@@ -32,6 +32,9 @@
32
32
  "files": [
33
33
  "lib",
34
34
  "assets",
35
+ "!assets/fonts/**/*.svg",
36
+ "!assets/fonts/**/*.ttf",
37
+ "!assets/fonts/**/*.woff",
35
38
  "README.md",
36
39
  "LICENSE"
37
40
  ],
@@ -267,16 +270,16 @@
267
270
  "./tooltip": {
268
271
  "types": "./lib/components/overlays/tooltip/index.d.ts",
269
272
  "default": "./lib/components/overlays/tooltip/index.js"
270
- }
273
+ },
274
+ "./package.json": "./package.json"
271
275
  },
272
276
  "scripts": {
273
- "build": "tsc -p tsconfig.build.json && node scripts/generate-css.mjs && vite build --config vite.config.bundle.ts --mode development && vite build --config vite.config.bundle.ts --mode production",
277
+ "build": "node ../../scripts/clean.mjs lib && tsc -p tsconfig.build.json && node scripts/generate-css.mjs && vite build --config vite.config.bundle.ts --mode development && vite build --config vite.config.bundle.ts --mode production",
274
278
  "build:watch": "tsc -p tsconfig.build.json --watch",
275
279
  "prepublishOnly": "npm run build",
276
280
  "test": "vitest run",
277
281
  "test:watch": "vitest",
278
- "docs": "vite --config vite.config.docs.ts",
279
- "docs:build": "vite build --config vite.config.docs.ts",
282
+ "test:coverage": "vitest run --coverage",
280
283
  "generate:icon-map": "node scripts/generate-icon-map.mjs"
281
284
  },
282
285
  "peerDependencies": {