@melodicdev/components 3.1.0 → 4.0.1

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 (285) hide show
  1. package/assets/melodic-components.js +8081 -5910
  2. package/assets/melodic-components.js.map +1 -1
  3. package/assets/melodic-components.min.js +9250 -7326
  4. package/lib/components/data-display/activity-feed/activity-feed-item.styles.d.ts.map +1 -1
  5. package/lib/components/data-display/activity-feed/activity-feed-item.styles.js +83 -78
  6. package/lib/components/data-display/activity-feed/activity-feed.styles.d.ts.map +1 -1
  7. package/lib/components/data-display/activity-feed/activity-feed.styles.js +10 -5
  8. package/lib/components/data-display/avatar/avatar.styles.d.ts.map +1 -1
  9. package/lib/components/data-display/avatar/avatar.styles.js +23 -18
  10. package/lib/components/data-display/badge/badge.styles.d.ts.map +1 -1
  11. package/lib/components/data-display/badge/badge.styles.js +54 -48
  12. package/lib/components/data-display/badge-group/badge-group.styles.d.ts.map +1 -1
  13. package/lib/components/data-display/badge-group/badge-group.styles.js +34 -29
  14. package/lib/components/data-display/calendar-view/calendar-view-month.template.d.ts.map +1 -1
  15. package/lib/components/data-display/calendar-view/calendar-view-month.template.js +17 -0
  16. package/lib/components/data-display/calendar-view/calendar-view.component.d.ts +23 -3
  17. package/lib/components/data-display/calendar-view/calendar-view.component.d.ts.map +1 -1
  18. package/lib/components/data-display/calendar-view/calendar-view.component.js +76 -21
  19. package/lib/components/data-display/calendar-view/calendar-view.styles.d.ts.map +1 -1
  20. package/lib/components/data-display/calendar-view/calendar-view.styles.js +160 -155
  21. package/lib/components/data-display/calendar-view/calendar-view.utils.d.ts +9 -0
  22. package/lib/components/data-display/calendar-view/calendar-view.utils.d.ts.map +1 -1
  23. package/lib/components/data-display/calendar-view/calendar-view.utils.js +68 -19
  24. package/lib/components/data-display/data-grid/data-grid.component.d.ts +24 -0
  25. package/lib/components/data-display/data-grid/data-grid.component.d.ts.map +1 -1
  26. package/lib/components/data-display/data-grid/data-grid.component.js +104 -31
  27. package/lib/components/data-display/data-grid/data-grid.styles.d.ts.map +1 -1
  28. package/lib/components/data-display/data-grid/data-grid.styles.js +122 -117
  29. package/lib/components/data-display/data-grid/data-grid.template.d.ts.map +1 -1
  30. package/lib/components/data-display/data-grid/data-grid.template.js +3 -0
  31. package/lib/components/data-display/list/list-item.styles.d.ts.map +1 -1
  32. package/lib/components/data-display/list/list-item.styles.js +39 -34
  33. package/lib/components/data-display/list/list.styles.d.ts.map +1 -1
  34. package/lib/components/data-display/list/list.styles.js +10 -5
  35. package/lib/components/data-display/profile-card/profile-card.styles.d.ts.map +1 -1
  36. package/lib/components/data-display/profile-card/profile-card.styles.js +71 -66
  37. package/lib/components/data-display/stat-card/stat-card.styles.d.ts.map +1 -1
  38. package/lib/components/data-display/stat-card/stat-card.styles.js +67 -63
  39. package/lib/components/data-display/table/table.component.d.ts +7 -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 +20 -5
  42. package/lib/components/data-display/table/table.styles.d.ts.map +1 -1
  43. package/lib/components/data-display/table/table.styles.js +94 -89
  44. package/lib/components/data-display/table/table.template.d.ts.map +1 -1
  45. package/lib/components/data-display/table/table.template.js +3 -0
  46. package/lib/components/data-display/table-core/index.d.ts +1 -0
  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 -0
  49. package/lib/components/data-display/table-core/memo.d.ts +10 -0
  50. package/lib/components/data-display/table-core/memo.d.ts.map +1 -0
  51. package/lib/components/data-display/table-core/memo.js +20 -0
  52. package/lib/components/data-display/tag/tag.styles.d.ts.map +1 -1
  53. package/lib/components/data-display/tag/tag.styles.js +67 -62
  54. package/lib/components/feedback/alert/alert.styles.d.ts.map +1 -1
  55. package/lib/components/feedback/alert/alert.styles.js +83 -56
  56. package/lib/components/feedback/progress/progress.styles.d.ts.map +1 -1
  57. package/lib/components/feedback/progress/progress.styles.js +110 -101
  58. package/lib/components/feedback/spinner/spinner.styles.d.ts.map +1 -1
  59. package/lib/components/feedback/spinner/spinner.styles.js +20 -24
  60. package/lib/components/feedback/toast/toast-container.template.d.ts.map +1 -1
  61. package/lib/components/feedback/toast/toast-container.template.js +4 -0
  62. package/lib/components/feedback/toast/toast.component.d.ts +3 -2
  63. package/lib/components/feedback/toast/toast.component.d.ts.map +1 -1
  64. package/lib/components/feedback/toast/toast.component.js +10 -0
  65. package/lib/components/feedback/toast/toast.service.d.ts +26 -6
  66. package/lib/components/feedback/toast/toast.service.d.ts.map +1 -1
  67. package/lib/components/feedback/toast/toast.service.js +53 -18
  68. package/lib/components/feedback/toast/toast.styles.d.ts.map +1 -1
  69. package/lib/components/feedback/toast/toast.styles.js +74 -69
  70. package/lib/components/feedback/toast/toast.template.js +1 -1
  71. package/lib/components/forms/autocomplete/autocomplete.component.d.ts +7 -0
  72. package/lib/components/forms/autocomplete/autocomplete.component.d.ts.map +1 -1
  73. package/lib/components/forms/autocomplete/autocomplete.component.js +39 -0
  74. package/lib/components/forms/autocomplete/autocomplete.styles.d.ts.map +1 -1
  75. package/lib/components/forms/autocomplete/autocomplete.styles.js +169 -164
  76. package/lib/components/forms/autocomplete/autocomplete.template.d.ts.map +1 -1
  77. package/lib/components/forms/autocomplete/autocomplete.template.js +5 -1
  78. package/lib/components/forms/button/button.styles.d.ts.map +1 -1
  79. package/lib/components/forms/button/button.styles.js +62 -57
  80. package/lib/components/forms/button-group/button-group.component.d.ts +3 -2
  81. package/lib/components/forms/button-group/button-group.component.d.ts.map +1 -1
  82. package/lib/components/forms/button-group/button-group.component.js +11 -1
  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 +23 -18
  85. package/lib/components/forms/checkbox/checkbox.component.d.ts +4 -0
  86. package/lib/components/forms/checkbox/checkbox.component.d.ts.map +1 -1
  87. package/lib/components/forms/checkbox/checkbox.component.js +5 -1
  88. package/lib/components/forms/checkbox/checkbox.styles.d.ts.map +1 -1
  89. package/lib/components/forms/checkbox/checkbox.styles.js +83 -78
  90. package/lib/components/forms/checkbox/checkbox.template.d.ts.map +1 -1
  91. package/lib/components/forms/checkbox/checkbox.template.js +2 -0
  92. package/lib/components/forms/date-picker/calendar.component.d.ts +21 -0
  93. package/lib/components/forms/date-picker/calendar.component.d.ts.map +1 -1
  94. package/lib/components/forms/date-picker/calendar.component.js +69 -2
  95. package/lib/components/forms/date-picker/calendar.styles.d.ts.map +1 -1
  96. package/lib/components/forms/date-picker/calendar.styles.js +152 -147
  97. package/lib/components/forms/date-picker/calendar.template.d.ts.map +1 -1
  98. package/lib/components/forms/date-picker/calendar.template.js +6 -3
  99. package/lib/components/forms/date-picker/date-picker.component.d.ts +6 -0
  100. package/lib/components/forms/date-picker/date-picker.component.d.ts.map +1 -1
  101. package/lib/components/forms/date-picker/date-picker.component.js +41 -12
  102. package/lib/components/forms/date-picker/date-picker.styles.d.ts.map +1 -1
  103. package/lib/components/forms/date-picker/date-picker.styles.js +97 -91
  104. package/lib/components/forms/date-time-picker/date-time-picker.styles.d.ts.map +1 -1
  105. package/lib/components/forms/date-time-picker/date-time-picker.styles.js +87 -82
  106. package/lib/components/forms/file-upload/file-upload.component.d.ts.map +1 -1
  107. package/lib/components/forms/file-upload/file-upload.component.js +15 -5
  108. package/lib/components/forms/file-upload/file-upload.styles.d.ts.map +1 -1
  109. package/lib/components/forms/file-upload/file-upload.styles.js +97 -92
  110. package/lib/components/forms/form-field/form-field.component.d.ts +8 -0
  111. package/lib/components/forms/form-field/form-field.component.d.ts.map +1 -1
  112. package/lib/components/forms/form-field/form-field.component.js +41 -6
  113. package/lib/components/forms/form-field/form-field.styles.d.ts.map +1 -1
  114. package/lib/components/forms/form-field/form-field.styles.js +77 -72
  115. package/lib/components/forms/form-field/form-field.template.js +1 -1
  116. package/lib/components/forms/input/input.component.d.ts +26 -3
  117. package/lib/components/forms/input/input.component.d.ts.map +1 -1
  118. package/lib/components/forms/input/input.component.js +46 -6
  119. package/lib/components/forms/input/input.styles.d.ts.map +1 -1
  120. package/lib/components/forms/input/input.styles.js +86 -81
  121. package/lib/components/forms/input/input.template.d.ts.map +1 -1
  122. package/lib/components/forms/input/input.template.js +9 -0
  123. package/lib/components/forms/radio/radio.styles.d.ts.map +1 -1
  124. package/lib/components/forms/radio/radio.styles.js +78 -73
  125. package/lib/components/forms/radio-card-group/radio-card-group.component.d.ts +6 -0
  126. package/lib/components/forms/radio-card-group/radio-card-group.component.d.ts.map +1 -1
  127. package/lib/components/forms/radio-card-group/radio-card-group.component.js +34 -0
  128. package/lib/components/forms/radio-card-group/radio-card-group.styles.d.ts.map +1 -1
  129. package/lib/components/forms/radio-card-group/radio-card-group.styles.js +39 -34
  130. package/lib/components/forms/radio-card-group/radio-card.component.d.ts +6 -0
  131. package/lib/components/forms/radio-card-group/radio-card.component.d.ts.map +1 -1
  132. package/lib/components/forms/radio-card-group/radio-card.component.js +7 -1
  133. package/lib/components/forms/radio-card-group/radio-card.styles.d.ts.map +1 -1
  134. package/lib/components/forms/radio-card-group/radio-card.styles.js +113 -108
  135. package/lib/components/forms/radio-card-group/radio-card.template.js +1 -1
  136. package/lib/components/forms/select/select.component.d.ts.map +1 -1
  137. package/lib/components/forms/select/select.component.js +13 -1
  138. package/lib/components/forms/select/select.styles.d.ts.map +1 -1
  139. package/lib/components/forms/select/select.styles.js +158 -153
  140. package/lib/components/forms/select/select.template.d.ts.map +1 -1
  141. package/lib/components/forms/select/select.template.js +5 -1
  142. package/lib/components/forms/slider/slider.styles.d.ts.map +1 -1
  143. package/lib/components/forms/slider/slider.styles.js +82 -77
  144. package/lib/components/forms/textarea/textarea.component.d.ts +10 -3
  145. package/lib/components/forms/textarea/textarea.component.d.ts.map +1 -1
  146. package/lib/components/forms/textarea/textarea.component.js +10 -5
  147. package/lib/components/forms/textarea/textarea.styles.d.ts.map +1 -1
  148. package/lib/components/forms/textarea/textarea.styles.js +84 -79
  149. package/lib/components/forms/textarea/textarea.template.d.ts.map +1 -1
  150. package/lib/components/forms/textarea/textarea.template.js +2 -0
  151. package/lib/components/forms/time-picker/time-picker.component.d.ts +16 -0
  152. package/lib/components/forms/time-picker/time-picker.component.d.ts.map +1 -1
  153. package/lib/components/forms/time-picker/time-picker.component.js +43 -3
  154. package/lib/components/forms/time-picker/time-picker.styles.d.ts.map +1 -1
  155. package/lib/components/forms/time-picker/time-picker.styles.js +197 -191
  156. package/lib/components/forms/toggle/toggle.styles.d.ts.map +1 -1
  157. package/lib/components/forms/toggle/toggle.styles.js +84 -79
  158. package/lib/components/foundation/card/card.styles.d.ts.map +1 -1
  159. package/lib/components/foundation/card/card.styles.js +51 -46
  160. package/lib/components/foundation/container/container.component.js +5 -5
  161. package/lib/components/foundation/container/container.styles.d.ts.map +1 -1
  162. package/lib/components/foundation/container/container.styles.js +15 -0
  163. package/lib/components/foundation/divider/divider.styles.d.ts.map +1 -1
  164. package/lib/components/foundation/divider/divider.styles.js +29 -24
  165. package/lib/components/foundation/stack/stack.component.d.ts +6 -0
  166. package/lib/components/foundation/stack/stack.component.d.ts.map +1 -1
  167. package/lib/components/foundation/stack/stack.component.js +11 -5
  168. package/lib/components/foundation/stack/stack.styles.d.ts.map +1 -1
  169. package/lib/components/foundation/stack/stack.styles.js +20 -0
  170. package/lib/components/general/icon/icon.styles.d.ts.map +1 -1
  171. package/lib/components/general/icon/icon.styles.js +12 -8
  172. package/lib/components/general/icon/icon.template.d.ts.map +1 -1
  173. package/lib/components/general/icon/icon.template.js +7 -1
  174. package/lib/components/navigation/breadcrumb/breadcrumb-item.template.d.ts.map +1 -1
  175. package/lib/components/navigation/breadcrumb/breadcrumb-item.template.js +2 -1
  176. package/lib/components/navigation/breadcrumb/breadcrumb.styles.d.ts.map +1 -1
  177. package/lib/components/navigation/breadcrumb/breadcrumb.styles.js +9 -4
  178. package/lib/components/navigation/functions/match-by-route.function.d.ts +16 -0
  179. package/lib/components/navigation/functions/match-by-route.function.d.ts.map +1 -0
  180. package/lib/components/navigation/functions/match-by-route.function.js +34 -0
  181. package/lib/components/navigation/functions/route-link.function.d.ts +20 -0
  182. package/lib/components/navigation/functions/route-link.function.d.ts.map +1 -0
  183. package/lib/components/navigation/functions/route-link.function.js +34 -0
  184. package/lib/components/navigation/pagination/pagination.component.d.ts +8 -0
  185. package/lib/components/navigation/pagination/pagination.component.d.ts.map +1 -1
  186. package/lib/components/navigation/pagination/pagination.component.js +12 -2
  187. package/lib/components/navigation/pagination/pagination.styles.d.ts.map +1 -1
  188. package/lib/components/navigation/pagination/pagination.styles.js +77 -62
  189. package/lib/components/navigation/pagination/pagination.template.js +2 -2
  190. package/lib/components/navigation/sidebar/sidebar-group.styles.d.ts.map +1 -1
  191. package/lib/components/navigation/sidebar/sidebar-group.styles.js +23 -18
  192. package/lib/components/navigation/sidebar/sidebar-item.styles.d.ts.map +1 -1
  193. package/lib/components/navigation/sidebar/sidebar-item.styles.js +104 -99
  194. package/lib/components/navigation/sidebar/sidebar-item.template.d.ts.map +1 -1
  195. package/lib/components/navigation/sidebar/sidebar-item.template.js +5 -1
  196. package/lib/components/navigation/sidebar/sidebar.component.d.ts +12 -6
  197. package/lib/components/navigation/sidebar/sidebar.component.d.ts.map +1 -1
  198. package/lib/components/navigation/sidebar/sidebar.component.js +20 -12
  199. package/lib/components/navigation/sidebar/sidebar.styles.d.ts.map +1 -1
  200. package/lib/components/navigation/sidebar/sidebar.styles.js +179 -174
  201. package/lib/components/navigation/sidebar/sidebar.template.d.ts.map +1 -1
  202. package/lib/components/navigation/sidebar/sidebar.template.js +5 -1
  203. package/lib/components/navigation/steps/step.component.d.ts.map +1 -1
  204. package/lib/components/navigation/steps/step.component.js +19 -1
  205. package/lib/components/navigation/steps/step.styles.d.ts.map +1 -1
  206. package/lib/components/navigation/steps/step.styles.js +154 -149
  207. package/lib/components/navigation/steps/step.template.d.ts.map +1 -1
  208. package/lib/components/navigation/steps/step.template.js +6 -0
  209. package/lib/components/navigation/steps/steps.component.d.ts +10 -0
  210. package/lib/components/navigation/steps/steps.component.d.ts.map +1 -1
  211. package/lib/components/navigation/steps/steps.component.js +42 -9
  212. package/lib/components/navigation/steps/steps.styles.d.ts.map +1 -1
  213. package/lib/components/navigation/steps/steps.styles.js +174 -169
  214. package/lib/components/navigation/steps/steps.template.js +9 -0
  215. package/lib/components/navigation/tabs/tab-panel.styles.d.ts.map +1 -1
  216. package/lib/components/navigation/tabs/tab-panel.styles.js +12 -2
  217. package/lib/components/navigation/tabs/tab.styles.d.ts.map +1 -1
  218. package/lib/components/navigation/tabs/tab.styles.js +41 -36
  219. package/lib/components/navigation/tabs/tabs.component.d.ts +10 -0
  220. package/lib/components/navigation/tabs/tabs.component.d.ts.map +1 -1
  221. package/lib/components/navigation/tabs/tabs.component.js +36 -7
  222. package/lib/components/navigation/tabs/tabs.styles.d.ts.map +1 -1
  223. package/lib/components/navigation/tabs/tabs.styles.js +131 -126
  224. package/lib/components/overlays/dialog/dialog-ref.class.d.ts +19 -9
  225. package/lib/components/overlays/dialog/dialog-ref.class.d.ts.map +1 -1
  226. package/lib/components/overlays/dialog/dialog-ref.class.js +37 -5
  227. package/lib/components/overlays/dialog/dialog.styles.d.ts.map +1 -1
  228. package/lib/components/overlays/dialog/dialog.styles.js +78 -73
  229. package/lib/components/overlays/drawer/drawer.styles.d.ts.map +1 -1
  230. package/lib/components/overlays/drawer/drawer.styles.js +82 -77
  231. package/lib/components/overlays/dropdown/dropdown-item.styles.d.ts.map +1 -1
  232. package/lib/components/overlays/dropdown/dropdown-item.styles.js +48 -43
  233. package/lib/components/overlays/dropdown/dropdown.component.d.ts +7 -0
  234. package/lib/components/overlays/dropdown/dropdown.component.d.ts.map +1 -1
  235. package/lib/components/overlays/dropdown/dropdown.component.js +26 -11
  236. package/lib/components/overlays/dropdown/dropdown.styles.d.ts.map +1 -1
  237. package/lib/components/overlays/dropdown/dropdown.styles.js +35 -30
  238. package/lib/components/overlays/popover/popover.component.d.ts +8 -0
  239. package/lib/components/overlays/popover/popover.component.d.ts.map +1 -1
  240. package/lib/components/overlays/popover/popover.component.js +17 -0
  241. package/lib/components/overlays/popover/popover.styles.d.ts.map +1 -1
  242. package/lib/components/overlays/popover/popover.styles.js +36 -31
  243. package/lib/components/overlays/tooltip/tooltip.component.d.ts +6 -5
  244. package/lib/components/overlays/tooltip/tooltip.component.d.ts.map +1 -1
  245. package/lib/components/overlays/tooltip/tooltip.component.js +14 -10
  246. package/lib/components/overlays/tooltip/tooltip.styles.d.ts.map +1 -1
  247. package/lib/components/overlays/tooltip/tooltip.styles.js +34 -28
  248. package/lib/components/pages/auth/auth-layout.styles.d.ts +1 -1
  249. package/lib/components/pages/auth/auth-layout.styles.d.ts.map +1 -1
  250. package/lib/components/pages/auth/auth-layout.styles.js +86 -81
  251. package/lib/components/pages/dashboard/dashboard-page.styles.d.ts.map +1 -1
  252. package/lib/components/pages/dashboard/dashboard-page.styles.js +39 -34
  253. package/lib/components/sections/app-shell/app-shell.component.d.ts +13 -0
  254. package/lib/components/sections/app-shell/app-shell.component.d.ts.map +1 -1
  255. package/lib/components/sections/app-shell/app-shell.component.js +45 -1
  256. package/lib/components/sections/app-shell/app-shell.styles.d.ts.map +1 -1
  257. package/lib/components/sections/app-shell/app-shell.styles.js +74 -53
  258. package/lib/components/sections/app-shell/app-shell.template.d.ts.map +1 -1
  259. package/lib/components/sections/app-shell/app-shell.template.js +5 -0
  260. package/lib/components/sections/hero/hero-section.styles.js +97 -97
  261. package/lib/components/sections/page-header/page-header.styles.d.ts.map +1 -1
  262. package/lib/components/sections/page-header/page-header.styles.js +69 -64
  263. package/lib/components/sections/page-section/page-section.styles.d.ts.map +1 -1
  264. package/lib/components/sections/page-section/page-section.styles.js +56 -51
  265. package/lib/components/sections/page-section/page-section.template.d.ts.map +1 -1
  266. package/lib/components/sections/page-section/page-section.template.js +6 -1
  267. package/lib/directives/tooltip.directive.d.ts.map +1 -1
  268. package/lib/directives/tooltip.directive.js +39 -6
  269. package/lib/theme/functions/apply-theme.function.d.ts +4 -1
  270. package/lib/theme/functions/apply-theme.function.d.ts.map +1 -1
  271. package/lib/theme/functions/apply-theme.function.js +20 -4
  272. package/lib/theme/functions/create-theme.function.js +0 -1
  273. package/lib/utils/accessibility/cross-root-aria.d.ts +40 -0
  274. package/lib/utils/accessibility/cross-root-aria.d.ts.map +1 -0
  275. package/lib/utils/accessibility/cross-root-aria.js +97 -0
  276. package/lib/utils/accessibility/index.d.ts +1 -0
  277. package/lib/utils/accessibility/index.d.ts.map +1 -1
  278. package/lib/utils/accessibility/index.js +1 -0
  279. package/lib/utils/directives/index.d.ts +1 -0
  280. package/lib/utils/directives/index.d.ts.map +1 -1
  281. package/lib/utils/directives/index.js +1 -0
  282. package/lib/utils/directives/watch-light-slots.d.ts +20 -0
  283. package/lib/utils/directives/watch-light-slots.d.ts.map +1 -0
  284. package/lib/utils/directives/watch-light-slots.js +36 -0
  285. package/package.json +2 -2
@@ -1,66 +1,71 @@
1
1
  import { css } from '@melodicdev/core';
2
2
  export const pageHeaderStyles = () => css `
3
+ /*
4
+ * Tokens. Rules read each one with its default as the var() fallback,
5
+ * so a value set on the element or inherited from any ancestor wins.
6
+ *
7
+ * Padding
8
+ * --ml-page-header-padding: var(--ml-space-6) var(--ml-space-6) var(--ml-space-4)
9
+ * --ml-page-header-compact-padding: var(--ml-space-4) var(--ml-space-6) var(--ml-space-3)
10
+ * --ml-page-header-mobile-padding: var(--ml-space-4)
11
+ *
12
+ * Font
13
+ * --ml-page-header-font-family: var(--ml-font-sans)
14
+ * --ml-page-header-color: var(--ml-color-text)
15
+ *
16
+ * Border
17
+ * --ml-page-header-border-width: var(--ml-border)
18
+ * --ml-page-header-border-color: var(--ml-color-border)
19
+ *
20
+ * Title
21
+ * --ml-page-header-title-size: var(--ml-text-2xl)
22
+ * --ml-page-header-title-weight: var(--ml-font-semibold)
23
+ * --ml-page-header-title-line-height: var(--ml-leading-tight)
24
+ * --ml-page-header-title-color: var(--ml-color-text)
25
+ * --ml-page-header-compact-title-size: var(--ml-text-lg)
26
+ *
27
+ * Description
28
+ * --ml-page-header-description-size: var(--ml-text-sm)
29
+ * --ml-page-header-description-line-height: var(--ml-leading-normal)
30
+ * --ml-page-header-description-color: var(--ml-color-text-secondary)
31
+ *
32
+ * Spacing
33
+ * --ml-page-header-breadcrumb-margin: var(--ml-space-3)
34
+ * --ml-page-header-main-gap: var(--ml-space-4)
35
+ * --ml-page-header-content-gap: var(--ml-space-1)
36
+ * --ml-page-header-meta-gap: var(--ml-space-2)
37
+ * --ml-page-header-meta-margin: var(--ml-space-2)
38
+ * --ml-page-header-actions-gap: var(--ml-space-2)
39
+ * --ml-page-header-centered-actions-margin: var(--ml-space-4)
40
+ * --ml-page-header-tabs-margin: var(--ml-space-4)
41
+ */
42
+
3
43
  :host {
4
44
  display: block;
5
-
6
- /* Padding */
7
- --ml-page-header-padding: var(--ml-space-6) var(--ml-space-6) var(--ml-space-4);
8
- --ml-page-header-compact-padding: var(--ml-space-4) var(--ml-space-6) var(--ml-space-3);
9
- --ml-page-header-mobile-padding: var(--ml-space-4);
10
-
11
- /* Font */
12
- --ml-page-header-font-family: var(--ml-font-sans);
13
- --ml-page-header-color: var(--ml-color-text);
14
-
15
- /* Border */
16
- --ml-page-header-border-width: var(--ml-border);
17
- --ml-page-header-border-color: var(--ml-color-border);
18
-
19
- /* Title */
20
- --ml-page-header-title-size: var(--ml-text-2xl);
21
- --ml-page-header-title-weight: var(--ml-font-semibold);
22
- --ml-page-header-title-line-height: var(--ml-leading-tight);
23
- --ml-page-header-title-color: var(--ml-color-text);
24
- --ml-page-header-compact-title-size: var(--ml-text-lg);
25
-
26
- /* Description */
27
- --ml-page-header-description-size: var(--ml-text-sm);
28
- --ml-page-header-description-line-height: var(--ml-leading-normal);
29
- --ml-page-header-description-color: var(--ml-color-text-secondary);
30
-
31
- /* Spacing */
32
- --ml-page-header-breadcrumb-margin: var(--ml-space-3);
33
- --ml-page-header-main-gap: var(--ml-space-4);
34
- --ml-page-header-content-gap: var(--ml-space-1);
35
- --ml-page-header-meta-gap: var(--ml-space-2);
36
- --ml-page-header-meta-margin: var(--ml-space-2);
37
- --ml-page-header-actions-gap: var(--ml-space-2);
38
- --ml-page-header-centered-actions-margin: var(--ml-space-4);
39
- --ml-page-header-tabs-margin: var(--ml-space-4);
40
45
  }
41
46
 
42
47
  /* ============================================
43
48
  PAGE HEADER CONTAINER
44
49
  ============================================ */
45
50
  .ml-page-header {
46
- padding: var(--ml-page-header-padding);
47
- font-family: var(--ml-page-header-font-family);
48
- color: var(--ml-page-header-color);
51
+ padding: var(--ml-page-header-padding, var(--ml-space-6) var(--ml-space-6) var(--ml-space-4));
52
+ font-family: var(--ml-page-header-font-family, var(--ml-font-sans));
53
+ color: var(--ml-page-header-color, var(--ml-color-text));
49
54
  }
50
55
 
51
56
  .ml-page-header--divider {
52
- border-bottom: var(--ml-page-header-border-width) solid var(--ml-page-header-border-color);
57
+ border-bottom: var(--ml-page-header-border-width, var(--ml-border)) solid var(--ml-page-header-border-color, var(--ml-color-border));
53
58
  }
54
59
 
55
60
  /* ============================================
56
61
  COMPACT VARIANT
57
62
  ============================================ */
58
63
  .ml-page-header--compact {
59
- padding: var(--ml-page-header-compact-padding);
64
+ padding: var(--ml-page-header-compact-padding, var(--ml-space-4) var(--ml-space-6) var(--ml-space-3));
60
65
  }
61
66
 
62
67
  .ml-page-header--compact .ml-page-header__title h1 {
63
- font-size: var(--ml-page-header-compact-title-size);
68
+ font-size: var(--ml-page-header-compact-title-size, var(--ml-text-lg));
64
69
  }
65
70
 
66
71
  /* ============================================
@@ -80,7 +85,7 @@ export const pageHeaderStyles = () => css `
80
85
  }
81
86
 
82
87
  .ml-page-header--centered .ml-page-header__actions {
83
- margin-top: var(--ml-page-header-centered-actions-margin);
88
+ margin-top: var(--ml-page-header-centered-actions-margin, var(--ml-space-4));
84
89
  }
85
90
 
86
91
  .ml-page-header--centered .ml-page-header__breadcrumb {
@@ -92,7 +97,7 @@ export const pageHeaderStyles = () => css `
92
97
  ============================================ */
93
98
  .ml-page-header__breadcrumb {
94
99
  display: flex;
95
- margin-bottom: var(--ml-page-header-breadcrumb-margin);
100
+ margin-bottom: var(--ml-page-header-breadcrumb-margin, var(--ml-space-3));
96
101
  }
97
102
 
98
103
  /* ============================================
@@ -102,7 +107,7 @@ export const pageHeaderStyles = () => css `
102
107
  display: flex;
103
108
  align-items: flex-start;
104
109
  justify-content: space-between;
105
- gap: var(--ml-page-header-main-gap);
110
+ gap: var(--ml-page-header-main-gap, var(--ml-space-4));
106
111
  }
107
112
 
108
113
  /* ============================================
@@ -111,7 +116,7 @@ export const pageHeaderStyles = () => css `
111
116
  .ml-page-header__content {
112
117
  display: flex;
113
118
  flex-direction: column;
114
- gap: var(--ml-page-header-content-gap);
119
+ gap: var(--ml-page-header-content-gap, var(--ml-space-1));
115
120
  min-width: 0;
116
121
  flex: 1;
117
122
  }
@@ -121,18 +126,18 @@ export const pageHeaderStyles = () => css `
121
126
  ============================================ */
122
127
  .ml-page-header__title h1 {
123
128
  margin: 0;
124
- font-size: var(--ml-page-header-title-size);
125
- font-weight: var(--ml-page-header-title-weight);
126
- line-height: var(--ml-page-header-title-line-height);
127
- color: var(--ml-page-header-title-color);
129
+ font-size: var(--ml-page-header-title-size, var(--ml-text-2xl));
130
+ font-weight: var(--ml-page-header-title-weight, var(--ml-font-semibold));
131
+ line-height: var(--ml-page-header-title-line-height, var(--ml-leading-tight));
132
+ color: var(--ml-page-header-title-color, var(--ml-color-text));
128
133
  }
129
134
 
130
135
  .ml-page-header__title ::slotted(*) {
131
136
  margin: 0;
132
- font-size: var(--ml-page-header-title-size);
133
- font-weight: var(--ml-page-header-title-weight);
134
- line-height: var(--ml-page-header-title-line-height);
135
- color: var(--ml-page-header-title-color);
137
+ font-size: var(--ml-page-header-title-size, var(--ml-text-2xl));
138
+ font-weight: var(--ml-page-header-title-weight, var(--ml-font-semibold));
139
+ line-height: var(--ml-page-header-title-line-height, var(--ml-leading-tight));
140
+ color: var(--ml-page-header-title-color, var(--ml-color-text));
136
141
  }
137
142
 
138
143
  /* ============================================
@@ -140,16 +145,16 @@ export const pageHeaderStyles = () => css `
140
145
  ============================================ */
141
146
  .ml-page-header__description p {
142
147
  margin: 0;
143
- font-size: var(--ml-page-header-description-size);
144
- line-height: var(--ml-page-header-description-line-height);
145
- color: var(--ml-page-header-description-color);
148
+ font-size: var(--ml-page-header-description-size, var(--ml-text-sm));
149
+ line-height: var(--ml-page-header-description-line-height, var(--ml-leading-normal));
150
+ color: var(--ml-page-header-description-color, var(--ml-color-text-secondary));
146
151
  }
147
152
 
148
153
  .ml-page-header__description ::slotted(*) {
149
154
  margin: 0;
150
- font-size: var(--ml-page-header-description-size);
151
- line-height: var(--ml-page-header-description-line-height);
152
- color: var(--ml-page-header-description-color);
155
+ font-size: var(--ml-page-header-description-size, var(--ml-text-sm));
156
+ line-height: var(--ml-page-header-description-line-height, var(--ml-leading-normal));
157
+ color: var(--ml-page-header-description-color, var(--ml-color-text-secondary));
153
158
  }
154
159
 
155
160
  /* ============================================
@@ -158,8 +163,8 @@ export const pageHeaderStyles = () => css `
158
163
  .ml-page-header__meta {
159
164
  display: flex;
160
165
  align-items: center;
161
- gap: var(--ml-page-header-meta-gap);
162
- margin-top: var(--ml-page-header-meta-margin);
166
+ gap: var(--ml-page-header-meta-gap, var(--ml-space-2));
167
+ margin-top: var(--ml-page-header-meta-margin, var(--ml-space-2));
163
168
  }
164
169
 
165
170
  /* ============================================
@@ -168,7 +173,7 @@ export const pageHeaderStyles = () => css `
168
173
  .ml-page-header__actions {
169
174
  display: flex;
170
175
  align-items: center;
171
- gap: var(--ml-page-header-actions-gap);
176
+ gap: var(--ml-page-header-actions-gap, var(--ml-space-2));
172
177
  flex-shrink: 0;
173
178
  }
174
179
 
@@ -176,7 +181,7 @@ export const pageHeaderStyles = () => css `
176
181
  TABS
177
182
  ============================================ */
178
183
  .ml-page-header__tabs {
179
- margin-top: var(--ml-page-header-tabs-margin);
184
+ margin-top: var(--ml-page-header-tabs-margin, var(--ml-space-4));
180
185
  }
181
186
 
182
187
  /* ============================================
@@ -193,7 +198,7 @@ export const pageHeaderStyles = () => css `
193
198
  ============================================ */
194
199
  @media (max-width: 640px) {
195
200
  .ml-page-header {
196
- padding: var(--ml-page-header-mobile-padding);
201
+ padding: var(--ml-page-header-mobile-padding, var(--ml-space-4));
197
202
  }
198
203
 
199
204
  .ml-page-header__main {
@@ -1 +1 @@
1
- {"version":3,"file":"page-section.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-section/page-section.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,iDA0G7B,CAAC"}
1
+ {"version":3,"file":"page-section.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-section/page-section.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,iDA+G7B,CAAC"}
@@ -1,45 +1,50 @@
1
1
  import { css } from '@melodicdev/core';
2
2
  export const pageSectionStyles = () => css `
3
+ /*
4
+ * Tokens. Rules read each one with its default as the var() fallback,
5
+ * so a value set on the element or inherited from any ancestor wins.
6
+ *
7
+ * Header spacing
8
+ * --ml-page-section-gap: var(--ml-space-4)
9
+ * --ml-page-section-heading-gap: var(--ml-space-1)
10
+ *
11
+ * Title
12
+ * --ml-page-section-title-font: 'Cormorant Garamond', 'Georgia', serif
13
+ * --ml-page-section-title-size: var(--ml-text-2xl)
14
+ * --ml-page-section-title-weight: var(--ml-font-semibold)
15
+ * --ml-page-section-title-color: var(--ml-color-text)
16
+ * --ml-page-section-title-line-height: var(--ml-leading-tight)
17
+ *
18
+ * Subtitle
19
+ * --ml-page-section-subtitle-font: var(--ml-font-sans)
20
+ * --ml-page-section-subtitle-size: var(--ml-text-sm)
21
+ * --ml-page-section-subtitle-color: var(--ml-color-text-muted)
22
+ * --ml-page-section-subtitle-line-height: var(--ml-leading-normal)
23
+ *
24
+ * Action link
25
+ * --ml-page-section-action-font: var(--ml-font-sans)
26
+ * --ml-page-section-action-size: var(--ml-text-sm)
27
+ * --ml-page-section-action-weight: var(--ml-font-medium)
28
+ * --ml-page-section-action-color: var(--ml-color-primary)
29
+ * --ml-page-section-action-hover-color: var(--ml-color-primary-hover)
30
+ * --ml-page-section-action-transition: var(--ml-duration-150)
31
+ *
32
+ * Content padding variants
33
+ * --ml-page-section-pad-sm: var(--ml-space-2) 0
34
+ * --ml-page-section-pad-md: var(--ml-space-4) 0
35
+ * --ml-page-section-pad-lg: var(--ml-space-6) 0
36
+ */
37
+
3
38
  :host {
4
39
  display: block;
5
-
6
- /* Header spacing */
7
- --ml-page-section-gap: var(--ml-space-4);
8
- --ml-page-section-heading-gap: var(--ml-space-1);
9
-
10
- /* Title */
11
- --ml-page-section-title-font: 'Cormorant Garamond', 'Georgia', serif;
12
- --ml-page-section-title-size: var(--ml-text-2xl);
13
- --ml-page-section-title-weight: var(--ml-font-semibold);
14
- --ml-page-section-title-color: var(--ml-color-text);
15
- --ml-page-section-title-line-height: var(--ml-leading-tight);
16
-
17
- /* Subtitle */
18
- --ml-page-section-subtitle-font: var(--ml-font-sans);
19
- --ml-page-section-subtitle-size: var(--ml-text-sm);
20
- --ml-page-section-subtitle-color: var(--ml-color-text-muted);
21
- --ml-page-section-subtitle-line-height: var(--ml-leading-normal);
22
-
23
- /* Action link */
24
- --ml-page-section-action-font: var(--ml-font-sans);
25
- --ml-page-section-action-size: var(--ml-text-sm);
26
- --ml-page-section-action-weight: var(--ml-font-medium);
27
- --ml-page-section-action-color: var(--ml-color-primary);
28
- --ml-page-section-action-hover-color: var(--ml-color-primary-hover);
29
- --ml-page-section-action-transition: var(--ml-duration-150);
30
-
31
- /* Content padding variants */
32
- --ml-page-section-pad-sm: var(--ml-space-2) 0;
33
- --ml-page-section-pad-md: var(--ml-space-4) 0;
34
- --ml-page-section-pad-lg: var(--ml-space-6) 0;
35
40
  }
36
41
 
37
42
  .ml-page-section__header {
38
43
  display: flex;
39
44
  align-items: flex-start;
40
45
  justify-content: space-between;
41
- gap: var(--ml-page-section-gap);
42
- margin-bottom: var(--ml-page-section-gap);
46
+ gap: var(--ml-page-section-gap, var(--ml-space-4));
47
+ margin-bottom: var(--ml-page-section-gap, var(--ml-space-4));
43
48
  }
44
49
 
45
50
  /* Header is always rendered (so the action slot's slotchange can fire);
@@ -51,24 +56,24 @@ export const pageSectionStyles = () => css `
51
56
  .ml-page-section__heading {
52
57
  display: flex;
53
58
  flex-direction: column;
54
- gap: var(--ml-page-section-heading-gap);
59
+ gap: var(--ml-page-section-heading-gap, var(--ml-space-1));
55
60
  }
56
61
 
57
62
  .ml-page-section__title {
58
63
  margin: 0;
59
- font-family: var(--ml-page-section-title-font);
60
- font-size: var(--ml-page-section-title-size);
61
- font-weight: var(--ml-page-section-title-weight);
62
- color: var(--ml-page-section-title-color);
63
- line-height: var(--ml-page-section-title-line-height);
64
+ font-family: var(--ml-page-section-title-font, 'Cormorant Garamond', 'Georgia', serif);
65
+ font-size: var(--ml-page-section-title-size, var(--ml-text-2xl));
66
+ font-weight: var(--ml-page-section-title-weight, var(--ml-font-semibold));
67
+ color: var(--ml-page-section-title-color, var(--ml-color-text));
68
+ line-height: var(--ml-page-section-title-line-height, var(--ml-leading-tight));
64
69
  }
65
70
 
66
71
  .ml-page-section__subtitle {
67
72
  margin: 0;
68
- font-family: var(--ml-page-section-subtitle-font);
69
- font-size: var(--ml-page-section-subtitle-size);
70
- color: var(--ml-page-section-subtitle-color);
71
- line-height: var(--ml-page-section-subtitle-line-height);
73
+ font-family: var(--ml-page-section-subtitle-font, var(--ml-font-sans));
74
+ font-size: var(--ml-page-section-subtitle-size, var(--ml-text-sm));
75
+ color: var(--ml-page-section-subtitle-color, var(--ml-color-text-muted));
76
+ line-height: var(--ml-page-section-subtitle-line-height, var(--ml-leading-normal));
72
77
  }
73
78
 
74
79
  .ml-page-section__action {
@@ -76,16 +81,16 @@ export const pageSectionStyles = () => css `
76
81
  }
77
82
 
78
83
  .ml-page-section__action-link {
79
- font-family: var(--ml-page-section-action-font);
80
- font-size: var(--ml-page-section-action-size);
81
- font-weight: var(--ml-page-section-action-weight);
82
- color: var(--ml-page-section-action-color);
84
+ font-family: var(--ml-page-section-action-font, var(--ml-font-sans));
85
+ font-size: var(--ml-page-section-action-size, var(--ml-text-sm));
86
+ font-weight: var(--ml-page-section-action-weight, var(--ml-font-medium));
87
+ color: var(--ml-page-section-action-color, var(--ml-color-primary));
83
88
  text-decoration: none;
84
- transition: color var(--ml-page-section-action-transition) var(--ml-ease-in-out);
89
+ transition: color var(--ml-page-section-action-transition, var(--ml-duration-150)) var(--ml-ease-in-out);
85
90
  }
86
91
 
87
92
  .ml-page-section__action-link:hover {
88
- color: var(--ml-page-section-action-hover-color);
93
+ color: var(--ml-page-section-action-hover-color, var(--ml-color-primary-hover));
89
94
  text-decoration: underline;
90
95
  }
91
96
 
@@ -95,14 +100,14 @@ export const pageSectionStyles = () => css `
95
100
  }
96
101
 
97
102
  .ml-page-section--pad-sm .ml-page-section__content {
98
- padding: var(--ml-page-section-pad-sm);
103
+ padding: var(--ml-page-section-pad-sm, var(--ml-space-2) 0);
99
104
  }
100
105
 
101
106
  .ml-page-section--pad-md .ml-page-section__content {
102
- padding: var(--ml-page-section-pad-md);
107
+ padding: var(--ml-page-section-pad-md, var(--ml-space-4) 0);
103
108
  }
104
109
 
105
110
  .ml-page-section--pad-lg .ml-page-section__content {
106
- padding: var(--ml-page-section-pad-lg);
111
+ padding: var(--ml-page-section-pad-lg, var(--ml-space-6) 0);
107
112
  }
108
113
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"page-section.template.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-section/page-section.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGxE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,oBAAoB,6CAiC1D"}
1
+ {"version":3,"file":"page-section.template.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-section/page-section.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAIxE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,oBAAoB,6CAqC1D"}
@@ -1,5 +1,6 @@
1
1
  import { html, classMap, when } from '@melodicdev/core';
2
2
  import { sanitizeHref } from './sanitize-href.function.js';
3
+ import { routeAnchorClick } from '../../navigation/functions/route-link.function.js';
3
4
  /**
4
5
  * The header (and its action slot) is always rendered so `slotchange` fires
5
6
  * when action content is added or removed after mount (see
@@ -28,7 +29,11 @@ export function pageSectionTemplate(c) {
28
29
  <div class="ml-page-section__action">
29
30
  <slot name="action">
30
31
  ${when(!!c.actionLabel, () => html `
31
- <a class="ml-page-section__action-link" href=${sanitizeHref(c.actionHref)}>${c.actionLabel}</a>
32
+ <a
33
+ class="ml-page-section__action-link"
34
+ href=${sanitizeHref(c.actionHref)}
35
+ @click=${(event) => routeAnchorClick(event, sanitizeHref(c.actionHref))}
36
+ >${c.actionLabel}</a>
32
37
  `)}
33
38
  </slot>
34
39
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.directive.d.ts","sourceRoot":"","sources":["../../src/directives/tooltip.directive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,2BAA2B,CAAC;AAEnF,OAAO,yCAAyC,CAAC;AAGjD;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WAAW,uBAAuB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AA4GD,iBAAS,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,iCAAiC,GAAG,IAAI,CA0CpG;AAID,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"tooltip.directive.d.ts","sourceRoot":"","sources":["../../src/directives/tooltip.directive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,2BAA2B,CAAC;AAEnF,OAAO,yCAAyC,CAAC;AAIjD;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WAAW,uBAAuB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAiJD,iBAAS,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,iCAAiC,GAAG,IAAI,CA0CpG;AAID,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { registerAttributeDirective } from '@melodicdev/core/template';
2
2
  // Registers the <ml-tooltip> custom element the directive instantiates.
3
3
  import '../components/overlays/tooltip/index.js';
4
+ import { setCrossRootDescription, clearCrossRootDescription } from '../utils/accessibility/cross-root-aria.js';
4
5
  /**
5
6
  * Live tooltip state per decorated element. The template engine always runs
6
7
  * the previous cleanup before re-running a directive with a new value; the
@@ -54,14 +55,45 @@ function createState(element) {
54
55
  element.addEventListener('focusin', show);
55
56
  element.addEventListener('focusout', hide);
56
57
  const state = { tooltip, pendingRemoval: false, ownsDescribedBy: false, show, hide };
57
- // Mirror ml-tooltip's slotted-trigger ARIA wiring: point the element's
58
- // aria-describedby at the tooltip content unless it already has one.
59
- const contentID = component?.tooltipID;
60
- if (contentID && !element.hasAttribute('aria-describedby')) {
61
- element.setAttribute('aria-describedby', contentID);
58
+ // Mirror ml-tooltip's slotted-trigger ARIA wiring. The content lives inside
59
+ // the tooltip's shadow root, so an IDREF would resolve to nothing —
60
+ // describe the element with the content ELEMENT instead.
61
+ //
62
+ // The tooltip has only just been created here, so its shadow content does
63
+ // not exist yet; wiring it synchronously silently described nothing at all.
64
+ describeWhenReady(element, tooltip, state);
65
+ return state;
66
+ }
67
+ /**
68
+ * Attach the description once the tooltip has rendered its content.
69
+ *
70
+ * Melodic renders on a microtask, so the content element appears shortly after
71
+ * the tooltip is constructed. A couple of microtask turns is enough; the
72
+ * fallback timeout covers a tooltip whose first render is deferred further.
73
+ */
74
+ function describeWhenReady(element, tooltip, state) {
75
+ if (element.hasAttribute('aria-describedby')) {
76
+ return; // the consumer wired their own description; never overwrite it
77
+ }
78
+ const attach = () => {
79
+ const content = tooltip.shadowRoot?.querySelector('.ml-tooltip__content');
80
+ if (!content || state.pendingRemoval) {
81
+ return false;
82
+ }
83
+ setCrossRootDescription(element, [content]);
62
84
  state.ownsDescribedBy = true;
85
+ return true;
86
+ };
87
+ if (attach()) {
88
+ return;
63
89
  }
64
- return state;
90
+ void Promise.resolve()
91
+ .then(() => attach())
92
+ .then((done) => {
93
+ if (!done) {
94
+ setTimeout(attach, 0);
95
+ }
96
+ });
65
97
  }
66
98
  function destroyState(element, state) {
67
99
  element.removeEventListener('mouseenter', state.show);
@@ -69,6 +101,7 @@ function destroyState(element, state) {
69
101
  element.removeEventListener('focusin', state.show);
70
102
  element.removeEventListener('focusout', state.hide);
71
103
  if (state.ownsDescribedBy) {
104
+ clearCrossRootDescription(element);
72
105
  element.removeAttribute('aria-describedby');
73
106
  }
74
107
  state.tooltip.anchorEl = null;
@@ -1,7 +1,10 @@
1
1
  import type { ThemeMode } from '../../types/index.js';
2
2
  type ThemeChangeCallback = (theme: ThemeMode, resolvedTheme: 'light' | 'dark') => void;
3
3
  /**
4
- * Get the currently applied theme mode
4
+ * Get the currently applied theme mode.
5
+ *
6
+ * Before `applyTheme()` has been called this reflects the document's own
7
+ * `data-theme`, so a theme applied by an inline script is respected.
5
8
  */
6
9
  export declare function getTheme(): ThemeMode;
7
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"apply-theme.function.d.ts","sourceRoot":"","sources":["../../../src/theme/functions/apply-theme.function.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,KAAK,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;AAMvF;;GAEG;AACH,wBAAgB,QAAQ,IAAI,SAAS,CAEpC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,GAAG,MAAM,CAQnD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAmCjD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,IAAI,CAGvE;AAMD;;;GAGG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAGlC"}
1
+ {"version":3,"file":"apply-theme.function.d.ts","sourceRoot":"","sources":["../../../src/theme/functions/apply-theme.function.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,KAAK,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;AAmBvF;;;;;GAKG;AACH,wBAAgB,QAAQ,IAAI,SAAS,CAGpC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,GAAG,MAAM,CAUnD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAmCjD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,IAAI,CAGvE;AAMD;;;GAGG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAGlC"}
@@ -1,23 +1,39 @@
1
- let currentTheme = 'system';
1
+ // `null` until the first read, which adopts whatever the document already
2
+ // says. An inline anti-FOUC script setting data-theme="dark" before the module
3
+ // loads is the normal case, and assuming 'system' made the first toggleTheme()
4
+ // a no-op (it re-applied the theme that was already showing).
5
+ let currentTheme = null;
2
6
  const themeListeners = new Set();
3
7
  let mediaQueryCleanup = null;
8
+ function readDocumentTheme() {
9
+ if (typeof document === 'undefined') {
10
+ return 'system';
11
+ }
12
+ const attribute = document.documentElement.getAttribute('data-theme');
13
+ return attribute === 'light' || attribute === 'dark' ? attribute : 'system';
14
+ }
4
15
  /**
5
- * Get the currently applied theme mode
16
+ * Get the currently applied theme mode.
17
+ *
18
+ * Before `applyTheme()` has been called this reflects the document's own
19
+ * `data-theme`, so a theme applied by an inline script is respected.
6
20
  */
7
21
  export function getTheme() {
22
+ currentTheme ??= readDocumentTheme();
8
23
  return currentTheme;
9
24
  }
10
25
  /**
11
26
  * Get the resolved theme (light or dark) based on current mode
12
27
  */
13
28
  export function getResolvedTheme() {
14
- if (currentTheme === 'system') {
29
+ const theme = getTheme();
30
+ if (theme === 'system') {
15
31
  if (typeof window === 'undefined' || !window.matchMedia) {
16
32
  return 'light';
17
33
  }
18
34
  return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
19
35
  }
20
- return currentTheme;
36
+ return theme;
21
37
  }
22
38
  /**
23
39
  * Apply a theme mode to the document
@@ -7,7 +7,6 @@ const TOKEN_NAME_PATTERN = /^--[a-zA-Z0-9_-]+$/;
7
7
  * arbitrary CSS rules (`;`, `{`, `}`) or markup when the returned CSS string
8
8
  * is embedded in a page (`<`, `>`), plus control characters.
9
9
  */
10
- // eslint-disable-next-line no-control-regex
11
10
  const UNSAFE_VALUE_PATTERN = /[;{}<>\u0000-\u001f\u007f]/;
12
11
  function assertValidThemeName(name) {
13
12
  if (!THEME_NAME_PATTERN.test(name)) {
@@ -0,0 +1,40 @@
1
+ /**
2
+ * ARIA relationships that cross a shadow-root boundary.
3
+ *
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.
8
+ *
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.
14
+ */
15
+ /** True when this engine supports ARIA element references. */
16
+ export declare function supportsAriaElementReferences(): boolean;
17
+ /**
18
+ * Describe `target` with `describers`, which may live in another root.
19
+ * Pass an empty array to clear the relationship.
20
+ */
21
+ export declare function setCrossRootDescription(target: Element, describers: Element[]): void;
22
+ /** Label `target` with `labels`, which may live in another root. */
23
+ export declare function setCrossRootLabel(target: Element, labels: Element[]): void;
24
+ /**
25
+ * Point `target` at the currently active option, which may live in another
26
+ * root (a composite listbox's options are in the light DOM while the focused
27
+ * control is inside a shadow root).
28
+ */
29
+ export declare function setCrossRootActiveDescendant(target: Element, active: Element | null): void;
30
+ /**
31
+ * The element that actually takes focus for a (possibly composite) control.
32
+ *
33
+ * ARIA state must sit on the focusable node, not on a wrapper: setting
34
+ * `aria-haspopup`/`aria-expanded` on an `<ml-button>` host leaves the real
35
+ * `<button>` inside its shadow root announcing nothing.
36
+ */
37
+ export declare function getFocusableControl(element: Element): HTMLElement;
38
+ /** Remove any cross-root description this module applied. */
39
+ export declare function clearCrossRootDescription(target: Element): void;
40
+ //# sourceMappingURL=cross-root-aria.d.ts.map
@@ -0,0 +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"}