@melodicdev/components 4.0.1 → 4.2.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 (210) 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 +5374 -4233
  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 +1808 -26662
  8. package/lib/components/data-display/calendar-view/calendar-view.styles.d.ts.map +1 -1
  9. package/lib/components/data-display/calendar-view/calendar-view.styles.js +14 -0
  10. package/lib/components/data-display/data-grid/data-grid.component.d.ts +43 -2
  11. package/lib/components/data-display/data-grid/data-grid.component.d.ts.map +1 -1
  12. package/lib/components/data-display/data-grid/data-grid.component.js +94 -8
  13. package/lib/components/data-display/data-grid/data-grid.styles.d.ts.map +1 -1
  14. package/lib/components/data-display/data-grid/data-grid.styles.js +17 -0
  15. package/lib/components/data-display/data-grid/data-grid.template.d.ts.map +1 -1
  16. package/lib/components/data-display/data-grid/data-grid.template.js +19 -10
  17. package/lib/components/data-display/data-grid/index.d.ts +1 -0
  18. package/lib/components/data-display/data-grid/index.d.ts.map +1 -1
  19. package/lib/components/data-display/list/list-item.styles.js +1 -1
  20. package/lib/components/data-display/table/index.d.ts +1 -0
  21. package/lib/components/data-display/table/index.d.ts.map +1 -1
  22. package/lib/components/data-display/table/table.component.d.ts +16 -0
  23. package/lib/components/data-display/table/table.component.d.ts.map +1 -1
  24. package/lib/components/data-display/table/table.component.js +28 -3
  25. package/lib/components/data-display/table/table.styles.d.ts.map +1 -1
  26. package/lib/components/data-display/table/table.styles.js +7 -1
  27. package/lib/components/data-display/table/table.template.d.ts.map +1 -1
  28. package/lib/components/data-display/table/table.template.js +8 -6
  29. package/lib/components/data-display/table-core/index.d.ts +2 -2
  30. package/lib/components/data-display/table-core/index.d.ts.map +1 -1
  31. package/lib/components/data-display/table-core/index.js +1 -1
  32. package/lib/components/data-display/table-core/table-core.d.ts +16 -2
  33. package/lib/components/data-display/table-core/table-core.d.ts.map +1 -1
  34. package/lib/components/data-display/table-core/table-core.js +32 -5
  35. package/lib/components/data-display/tag/tag.styles.d.ts.map +1 -1
  36. package/lib/components/data-display/tag/tag.styles.js +11 -4
  37. package/lib/components/feedback/alert/alert.styles.d.ts.map +1 -1
  38. package/lib/components/feedback/alert/alert.styles.js +11 -0
  39. package/lib/components/feedback/toast/index.d.ts +1 -0
  40. package/lib/components/feedback/toast/index.d.ts.map +1 -1
  41. package/lib/components/feedback/toast/toast-container.styles.d.ts.map +1 -1
  42. package/lib/components/feedback/toast/toast-container.styles.js +20 -0
  43. package/lib/components/feedback/toast/toast.component.d.ts +16 -0
  44. package/lib/components/feedback/toast/toast.component.d.ts.map +1 -1
  45. package/lib/components/feedback/toast/toast.component.js +63 -5
  46. package/lib/components/feedback/toast/toast.service.d.ts +14 -0
  47. package/lib/components/feedback/toast/toast.service.d.ts.map +1 -1
  48. package/lib/components/feedback/toast/toast.service.js +41 -0
  49. package/lib/components/feedback/toast/toast.styles.d.ts.map +1 -1
  50. package/lib/components/feedback/toast/toast.styles.js +6 -0
  51. package/lib/components/feedback/toast/toast.template.js +1 -1
  52. package/lib/components/forms/autocomplete/autocomplete.component.d.ts +14 -4
  53. package/lib/components/forms/autocomplete/autocomplete.component.d.ts.map +1 -1
  54. package/lib/components/forms/autocomplete/autocomplete.component.js +40 -96
  55. package/lib/components/forms/autocomplete/autocomplete.styles.d.ts.map +1 -1
  56. package/lib/components/forms/autocomplete/autocomplete.styles.js +22 -6
  57. package/lib/components/forms/autocomplete/autocomplete.template.js +7 -1
  58. package/lib/components/forms/button/button.styles.d.ts.map +1 -1
  59. package/lib/components/forms/button/button.styles.js +11 -0
  60. package/lib/components/forms/button-group/button-group-item.styles.d.ts.map +1 -1
  61. package/lib/components/forms/button-group/button-group-item.styles.js +11 -0
  62. package/lib/components/forms/button-group/button-group.styles.js +2 -2
  63. package/lib/components/forms/checkbox/checkbox.styles.d.ts.map +1 -1
  64. package/lib/components/forms/checkbox/checkbox.styles.js +13 -2
  65. package/lib/components/forms/date-picker/calendar.component.d.ts +20 -7
  66. package/lib/components/forms/date-picker/calendar.component.d.ts.map +1 -1
  67. package/lib/components/forms/date-picker/calendar.component.js +88 -13
  68. package/lib/components/forms/date-picker/calendar.styles.d.ts.map +1 -1
  69. package/lib/components/forms/date-picker/calendar.styles.js +19 -0
  70. package/lib/components/forms/date-picker/date-picker.component.d.ts +2 -3
  71. package/lib/components/forms/date-picker/date-picker.component.d.ts.map +1 -1
  72. package/lib/components/forms/date-picker/date-picker.component.js +70 -18
  73. package/lib/components/forms/date-picker/date-picker.styles.d.ts.map +1 -1
  74. package/lib/components/forms/date-picker/date-picker.styles.js +12 -1
  75. package/lib/components/forms/date-time-picker/date-time-picker.styles.d.ts.map +1 -1
  76. package/lib/components/forms/date-time-picker/date-time-picker.styles.js +12 -1
  77. package/lib/components/forms/date-time-picker/tz-utils.d.ts.map +1 -1
  78. package/lib/components/forms/date-time-picker/tz-utils.js +24 -3
  79. package/lib/components/forms/file-upload/file-upload-item.styles.d.ts.map +1 -1
  80. package/lib/components/forms/file-upload/file-upload-item.styles.js +13 -1
  81. package/lib/components/forms/file-upload/file-upload.styles.d.ts.map +1 -1
  82. package/lib/components/forms/file-upload/file-upload.styles.js +11 -0
  83. package/lib/components/forms/form-field/form-field.component.d.ts +18 -1
  84. package/lib/components/forms/form-field/form-field.component.d.ts.map +1 -1
  85. package/lib/components/forms/form-field/form-field.component.js +55 -16
  86. package/lib/components/forms/form-field/form-field.styles.d.ts.map +1 -1
  87. package/lib/components/forms/form-field/form-field.styles.js +15 -2
  88. package/lib/components/forms/input/input.styles.d.ts.map +1 -1
  89. package/lib/components/forms/input/input.styles.js +16 -1
  90. package/lib/components/forms/listbox-core/index.d.ts +3 -0
  91. package/lib/components/forms/listbox-core/index.d.ts.map +1 -0
  92. package/lib/components/forms/listbox-core/index.js +2 -0
  93. package/lib/components/forms/listbox-core/listbox-core.d.ts +57 -0
  94. package/lib/components/forms/listbox-core/listbox-core.d.ts.map +1 -0
  95. package/lib/components/forms/listbox-core/listbox-core.js +168 -0
  96. package/lib/components/forms/radio/radio-group.styles.js +1 -1
  97. package/lib/components/forms/radio/radio.styles.d.ts.map +1 -1
  98. package/lib/components/forms/radio/radio.styles.js +12 -1
  99. package/lib/components/forms/radio-card-group/radio-card-group.styles.js +1 -1
  100. package/lib/components/forms/radio-card-group/radio-card.styles.d.ts.map +1 -1
  101. package/lib/components/forms/radio-card-group/radio-card.styles.js +11 -0
  102. package/lib/components/forms/select/select.component.d.ts +12 -4
  103. package/lib/components/forms/select/select.component.d.ts.map +1 -1
  104. package/lib/components/forms/select/select.component.js +41 -110
  105. package/lib/components/forms/select/select.styles.d.ts.map +1 -1
  106. package/lib/components/forms/select/select.styles.js +23 -6
  107. package/lib/components/forms/select/select.template.d.ts.map +1 -1
  108. package/lib/components/forms/select/select.template.js +25 -9
  109. package/lib/components/forms/slider/slider.component.js +1 -1
  110. package/lib/components/forms/slider/slider.styles.d.ts.map +1 -1
  111. package/lib/components/forms/slider/slider.styles.js +11 -0
  112. package/lib/components/forms/slider/slider.template.d.ts.map +1 -1
  113. package/lib/components/forms/slider/slider.template.js +5 -1
  114. package/lib/components/forms/textarea/textarea.styles.d.ts.map +1 -1
  115. package/lib/components/forms/textarea/textarea.styles.js +13 -2
  116. package/lib/components/forms/time-picker/time-picker.component.d.ts +1 -2
  117. package/lib/components/forms/time-picker/time-picker.component.d.ts.map +1 -1
  118. package/lib/components/forms/time-picker/time-picker.component.js +8 -17
  119. package/lib/components/forms/time-picker/time-picker.styles.d.ts.map +1 -1
  120. package/lib/components/forms/time-picker/time-picker.styles.js +23 -3
  121. package/lib/components/forms/toggle/toggle.styles.d.ts.map +1 -1
  122. package/lib/components/forms/toggle/toggle.styles.js +13 -2
  123. package/lib/components/foundation/card/card.styles.d.ts.map +1 -1
  124. package/lib/components/foundation/card/card.styles.js +11 -0
  125. package/lib/components/foundation/container/container.styles.js +4 -4
  126. package/lib/components/navigation/breadcrumb/breadcrumb-item.template.d.ts.map +1 -1
  127. package/lib/components/navigation/breadcrumb/breadcrumb-item.template.js +5 -3
  128. package/lib/components/navigation/sidebar/sidebar-item.styles.js +4 -4
  129. package/lib/components/navigation/sidebar/sidebar-item.template.js +2 -2
  130. package/lib/components/navigation/sidebar/sidebar.styles.js +5 -5
  131. package/lib/components/navigation/sidebar/sidebar.template.js +2 -2
  132. package/lib/components/navigation/steps/step.styles.js +3 -3
  133. package/lib/components/navigation/steps/steps.styles.js +3 -3
  134. package/lib/components/navigation/tabs/tabs.component.d.ts.map +1 -1
  135. package/lib/components/navigation/tabs/tabs.component.js +4 -1
  136. package/lib/components/navigation/tabs/tabs.styles.js +8 -8
  137. package/lib/components/overlays/dialog/dialog.component.d.ts +15 -2
  138. package/lib/components/overlays/dialog/dialog.component.d.ts.map +1 -1
  139. package/lib/components/overlays/dialog/dialog.component.js +33 -1
  140. package/lib/components/overlays/dialog/dialog.service.d.ts +8 -2
  141. package/lib/components/overlays/dialog/dialog.service.d.ts.map +1 -1
  142. package/lib/components/overlays/dialog/dialog.service.js +1 -0
  143. package/lib/components/overlays/dialog/index.d.ts +1 -0
  144. package/lib/components/overlays/dialog/index.d.ts.map +1 -1
  145. package/lib/components/overlays/drawer/drawer.component.d.ts +18 -3
  146. package/lib/components/overlays/drawer/drawer.component.d.ts.map +1 -1
  147. package/lib/components/overlays/drawer/drawer.component.js +59 -16
  148. package/lib/components/overlays/dropdown/dropdown-item.styles.d.ts.map +1 -1
  149. package/lib/components/overlays/dropdown/dropdown-item.styles.js +12 -0
  150. package/lib/components/overlays/popover/popover.component.d.ts +12 -0
  151. package/lib/components/overlays/popover/popover.component.d.ts.map +1 -1
  152. package/lib/components/overlays/popover/popover.component.js +28 -1
  153. package/lib/components/overlays/popover/popover.template.d.ts.map +1 -1
  154. package/lib/components/overlays/popover/popover.template.js +2 -0
  155. package/lib/components/overlays/tooltip/tooltip.component.d.ts +8 -5
  156. package/lib/components/overlays/tooltip/tooltip.component.d.ts.map +1 -1
  157. package/lib/components/overlays/tooltip/tooltip.component.js +10 -3
  158. package/lib/components/sections/app-shell/app-shell.styles.js +1 -1
  159. package/lib/directives/tooltip.directive.d.ts.map +1 -1
  160. package/lib/directives/tooltip.directive.js +22 -3
  161. package/lib/theme/presets/base.preset.d.ts.map +1 -1
  162. package/lib/theme/presets/base.preset.js +17 -0
  163. package/lib/theme/presets/dark.preset.d.ts +8 -0
  164. package/lib/theme/presets/dark.preset.d.ts.map +1 -1
  165. package/lib/theme/presets/dark.preset.js +9 -0
  166. package/lib/theme/presets/light.preset.d.ts +6 -0
  167. package/lib/theme/presets/light.preset.d.ts.map +1 -1
  168. package/lib/theme/presets/light.preset.js +7 -0
  169. package/lib/theme/tokens/all-tokens.d.ts +10 -0
  170. package/lib/theme/tokens/all-tokens.d.ts.map +1 -1
  171. package/lib/theme/tokens/colors.tokens.d.ts +8 -0
  172. package/lib/theme/tokens/colors.tokens.d.ts.map +1 -1
  173. package/lib/theme/tokens/colors.tokens.js +11 -0
  174. package/lib/theme/tokens/transitions.tokens.d.ts +1 -0
  175. package/lib/theme/tokens/transitions.tokens.d.ts.map +1 -1
  176. package/lib/theme/tokens/transitions.tokens.js +3 -0
  177. package/lib/theme/tokens/typography.tokens.d.ts +1 -0
  178. package/lib/theme/tokens/typography.tokens.d.ts.map +1 -1
  179. package/lib/theme/tokens/typography.tokens.js +1 -0
  180. package/lib/utils/accessibility/cross-root-aria.d.ts +16 -8
  181. package/lib/utils/accessibility/cross-root-aria.d.ts.map +1 -1
  182. package/lib/utils/accessibility/cross-root-aria.js +58 -22
  183. package/lib/utils/accessibility/focus-trap.d.ts.map +1 -1
  184. package/lib/utils/accessibility/focus-trap.js +9 -19
  185. package/lib/utils/accessibility/focus-utils.d.ts +10 -1
  186. package/lib/utils/accessibility/focus-utils.d.ts.map +1 -1
  187. package/lib/utils/accessibility/focus-utils.js +48 -14
  188. package/lib/utils/accessibility/index.d.ts +2 -1
  189. package/lib/utils/accessibility/index.d.ts.map +1 -1
  190. package/lib/utils/accessibility/index.js +1 -1
  191. package/lib/utils/positioning/compute-position.d.ts +6 -1
  192. package/lib/utils/positioning/compute-position.d.ts.map +1 -1
  193. package/lib/utils/positioning/compute-position.js +3 -2
  194. package/lib/utils/positioning/middlewares/flip.middleware.js +2 -51
  195. package/package.json +8 -5
  196. package/assets/fonts/phosphor/Phosphor-Bold.svg +0 -3057
  197. package/assets/fonts/phosphor/Phosphor-Bold.ttf +0 -0
  198. package/assets/fonts/phosphor/Phosphor-Bold.woff +0 -0
  199. package/assets/fonts/phosphor/Phosphor-Fill.svg +0 -3057
  200. package/assets/fonts/phosphor/Phosphor-Fill.ttf +0 -0
  201. package/assets/fonts/phosphor/Phosphor-Fill.woff +0 -0
  202. package/assets/fonts/phosphor/Phosphor-Light.svg +0 -3057
  203. package/assets/fonts/phosphor/Phosphor-Light.ttf +0 -0
  204. package/assets/fonts/phosphor/Phosphor-Light.woff +0 -0
  205. package/assets/fonts/phosphor/Phosphor-Thin.svg +0 -3057
  206. package/assets/fonts/phosphor/Phosphor-Thin.ttf +0 -0
  207. package/assets/fonts/phosphor/Phosphor-Thin.woff +0 -0
  208. package/assets/fonts/phosphor/Phosphor.svg +0 -3056
  209. package/assets/fonts/phosphor/Phosphor.ttf +0 -0
  210. package/assets/fonts/phosphor/Phosphor.woff +0 -0
@@ -7,10 +7,16 @@ export declare const darkTheme: {
7
7
  readonly '--ml-color-surface-raised': "var(--ml-gray-800)";
8
8
  readonly '--ml-color-surface-overlay': "var(--ml-gray-800)";
9
9
  readonly '--ml-color-surface-sunken': "var(--ml-gray-950)";
10
+ readonly '--ml-color-surface-hover': "var(--ml-color-surface-raised)";
11
+ readonly '--ml-color-surface-secondary': "var(--ml-color-surface-raised)";
12
+ readonly '--ml-color-surface-tertiary': "var(--ml-color-surface-sunken)";
13
+ readonly '--ml-color-bg-secondary': "var(--ml-color-surface-raised)";
10
14
  readonly '--ml-color-text': "var(--ml-gray-50)";
11
15
  readonly '--ml-color-text-secondary': "var(--ml-gray-300)";
12
16
  readonly '--ml-color-text-muted': "var(--ml-gray-400)";
13
17
  readonly '--ml-color-text-subtle': "var(--ml-gray-500)";
18
+ readonly '--ml-color-text-tertiary': "var(--ml-color-text-muted)";
19
+ readonly '--ml-color-text-disabled': "var(--ml-color-text-subtle)";
14
20
  readonly '--ml-color-text-inverse': "var(--ml-gray-900)";
15
21
  readonly '--ml-color-border': "var(--ml-gray-700)";
16
22
  readonly '--ml-color-border-strong': "var(--ml-gray-600)";
@@ -25,6 +31,8 @@ export declare const darkTheme: {
25
31
  readonly '--ml-color-warning-subtle': "var(--ml-amber-950)";
26
32
  readonly '--ml-color-danger': "var(--ml-red-500)";
27
33
  readonly '--ml-color-danger-subtle': "var(--ml-red-950)";
34
+ readonly '--ml-color-error': "var(--ml-color-danger)";
35
+ readonly '--ml-color-error-subtle': "var(--ml-color-danger-subtle)";
28
36
  readonly '--ml-color-info': "var(--ml-cyan-400)";
29
37
  readonly '--ml-color-info-subtle': "var(--ml-cyan-950)";
30
38
  readonly '--ml-color-input-bg': "var(--ml-gray-900)";
@@ -1 +1 @@
1
- {"version":3,"file":"dark.preset.d.ts","sourceRoot":"","sources":["../../../src/theme/presets/dark.preset.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiGZ,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,YAAY,QAgBvB,CAAC"}
1
+ {"version":3,"file":"dark.preset.d.ts","sourceRoot":"","sources":["../../../src/theme/presets/dark.preset.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0GZ,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,YAAY,QAgBvB,CAAC"}
@@ -8,11 +8,18 @@ export const darkTheme = {
8
8
  '--ml-color-surface-raised': 'var(--ml-gray-800)',
9
9
  '--ml-color-surface-overlay': 'var(--ml-gray-800)',
10
10
  '--ml-color-surface-sunken': 'var(--ml-gray-950)',
11
+ // Aliases, restated so they follow this theme when it is set on a subtree
12
+ '--ml-color-surface-hover': 'var(--ml-color-surface-raised)',
13
+ '--ml-color-surface-secondary': 'var(--ml-color-surface-raised)',
14
+ '--ml-color-surface-tertiary': 'var(--ml-color-surface-sunken)',
15
+ '--ml-color-bg-secondary': 'var(--ml-color-surface-raised)',
11
16
  // Text colors - lighter text for dark backgrounds
12
17
  '--ml-color-text': 'var(--ml-gray-50)',
13
18
  '--ml-color-text-secondary': 'var(--ml-gray-300)',
14
19
  '--ml-color-text-muted': 'var(--ml-gray-400)',
15
20
  '--ml-color-text-subtle': 'var(--ml-gray-500)',
21
+ '--ml-color-text-tertiary': 'var(--ml-color-text-muted)',
22
+ '--ml-color-text-disabled': 'var(--ml-color-text-subtle)',
16
23
  '--ml-color-text-inverse': 'var(--ml-gray-900)',
17
24
  // Border colors - more visible on dark
18
25
  '--ml-color-border': 'var(--ml-gray-700)',
@@ -30,6 +37,8 @@ export const darkTheme = {
30
37
  '--ml-color-warning-subtle': 'var(--ml-amber-950)',
31
38
  '--ml-color-danger': 'var(--ml-red-500)',
32
39
  '--ml-color-danger-subtle': 'var(--ml-red-950)',
40
+ '--ml-color-error': 'var(--ml-color-danger)',
41
+ '--ml-color-error-subtle': 'var(--ml-color-danger-subtle)',
33
42
  '--ml-color-info': 'var(--ml-cyan-400)',
34
43
  '--ml-color-info-subtle': 'var(--ml-cyan-950)',
35
44
  // Input colors for dark mode
@@ -8,10 +8,16 @@ export declare const lightTheme: {
8
8
  readonly '--ml-color-surface-raised': "var(--ml-gray-50)";
9
9
  readonly '--ml-color-surface-overlay': "var(--ml-white)";
10
10
  readonly '--ml-color-surface-sunken': "var(--ml-gray-100)";
11
+ readonly '--ml-color-surface-hover': "var(--ml-color-surface-raised)";
12
+ readonly '--ml-color-surface-secondary': "var(--ml-color-surface-raised)";
13
+ readonly '--ml-color-surface-tertiary': "var(--ml-color-surface-sunken)";
14
+ readonly '--ml-color-bg-secondary': "var(--ml-color-surface-raised)";
11
15
  readonly '--ml-color-text': "var(--ml-gray-900)";
12
16
  readonly '--ml-color-text-secondary': "var(--ml-gray-700)";
13
17
  readonly '--ml-color-text-muted': "var(--ml-gray-500)";
14
18
  readonly '--ml-color-text-subtle': "var(--ml-gray-400)";
19
+ readonly '--ml-color-text-tertiary': "var(--ml-color-text-muted)";
20
+ readonly '--ml-color-text-disabled': "var(--ml-color-text-subtle)";
15
21
  readonly '--ml-color-text-inverse': "var(--ml-white)";
16
22
  readonly '--ml-color-border': "var(--ml-gray-200)";
17
23
  readonly '--ml-color-border-strong': "var(--ml-gray-300)";
@@ -1 +1 @@
1
- {"version":3,"file":"light.preset.d.ts","sourceRoot":"","sources":["../../../src/theme/presets/light.preset.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;CAmBb,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa,QAMxB,CAAC"}
1
+ {"version":3,"file":"light.preset.d.ts","sourceRoot":"","sources":["../../../src/theme/presets/light.preset.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;CA0Bb,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa,QAMxB,CAAC"}
@@ -9,11 +9,18 @@ export const lightTheme = {
9
9
  '--ml-color-surface-raised': 'var(--ml-gray-50)',
10
10
  '--ml-color-surface-overlay': 'var(--ml-white)',
11
11
  '--ml-color-surface-sunken': 'var(--ml-gray-100)',
12
+ // Aliases, restated so they follow this theme when it is set on a subtree
13
+ '--ml-color-surface-hover': 'var(--ml-color-surface-raised)',
14
+ '--ml-color-surface-secondary': 'var(--ml-color-surface-raised)',
15
+ '--ml-color-surface-tertiary': 'var(--ml-color-surface-sunken)',
16
+ '--ml-color-bg-secondary': 'var(--ml-color-surface-raised)',
12
17
  // Text colors
13
18
  '--ml-color-text': 'var(--ml-gray-900)',
14
19
  '--ml-color-text-secondary': 'var(--ml-gray-700)',
15
20
  '--ml-color-text-muted': 'var(--ml-gray-500)',
16
21
  '--ml-color-text-subtle': 'var(--ml-gray-400)',
22
+ '--ml-color-text-tertiary': 'var(--ml-color-text-muted)',
23
+ '--ml-color-text-disabled': 'var(--ml-color-text-subtle)',
17
24
  '--ml-color-text-inverse': 'var(--ml-white)',
18
25
  // Border colors
19
26
  '--ml-color-border': 'var(--ml-gray-200)',
@@ -22,6 +22,7 @@ export declare const allTokens: {
22
22
  readonly '--ml-ease-out': "cubic-bezier(0, 0, 0.2, 1)";
23
23
  readonly '--ml-ease-in-out': "cubic-bezier(0.4, 0, 0.2, 1)";
24
24
  readonly '--ml-ease-bounce': "cubic-bezier(0.68, -0.55, 0.265, 1.55)";
25
+ readonly '--ml-transition-normal': "var(--ml-duration-200) var(--ml-ease-in-out)";
25
26
  readonly '--ml-transition-none': "none";
26
27
  readonly '--ml-transition-all': "all var(--ml-duration-150) var(--ml-ease-in-out)";
27
28
  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)";
@@ -89,6 +90,7 @@ export declare const allTokens: {
89
90
  readonly '--ml-font-extralight': "200";
90
91
  readonly '--ml-font-light': "300";
91
92
  readonly '--ml-font-normal': "400";
93
+ readonly '--ml-font-regular': "var(--ml-font-normal)";
92
94
  readonly '--ml-font-medium': "500";
93
95
  readonly '--ml-font-semibold': "600";
94
96
  readonly '--ml-font-bold': "700";
@@ -158,6 +160,8 @@ export declare const allTokens: {
158
160
  readonly '--ml-color-danger': "var(--ml-red-600)";
159
161
  readonly '--ml-color-danger-hover': "var(--ml-red-700)";
160
162
  readonly '--ml-color-danger-subtle': "var(--ml-red-50)";
163
+ readonly '--ml-color-error': "var(--ml-color-danger)";
164
+ readonly '--ml-color-error-subtle': "var(--ml-color-danger-subtle)";
161
165
  readonly '--ml-color-info': "var(--ml-cyan-600)";
162
166
  readonly '--ml-color-info-hover': "var(--ml-cyan-700)";
163
167
  readonly '--ml-color-info-subtle': "var(--ml-cyan-50)";
@@ -166,10 +170,16 @@ export declare const allTokens: {
166
170
  readonly '--ml-color-surface-raised': "var(--ml-gray-50)";
167
171
  readonly '--ml-color-surface-overlay': "var(--ml-white)";
168
172
  readonly '--ml-color-surface-sunken': "var(--ml-gray-100)";
173
+ readonly '--ml-color-surface-hover': "var(--ml-color-surface-raised)";
174
+ readonly '--ml-color-surface-secondary': "var(--ml-color-surface-raised)";
175
+ readonly '--ml-color-surface-tertiary': "var(--ml-color-surface-sunken)";
176
+ readonly '--ml-color-bg-secondary': "var(--ml-color-surface-raised)";
169
177
  readonly '--ml-color-text': "var(--ml-gray-900)";
170
178
  readonly '--ml-color-text-secondary': "var(--ml-gray-700)";
171
179
  readonly '--ml-color-text-muted': "var(--ml-gray-500)";
172
180
  readonly '--ml-color-text-subtle': "var(--ml-gray-400)";
181
+ readonly '--ml-color-text-tertiary': "var(--ml-color-text-muted)";
182
+ readonly '--ml-color-text-disabled': "var(--ml-color-text-subtle)";
173
183
  readonly '--ml-color-text-inverse': "var(--ml-white)";
174
184
  readonly '--ml-color-text-link': "var(--ml-blue-600)";
175
185
  readonly '--ml-color-text-link-hover': "var(--ml-blue-700)";
@@ -1 +1 @@
1
- {"version":3,"file":"all-tokens.d.ts","sourceRoot":"","sources":["../../../src/theme/tokens/all-tokens.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASZ,CAAC;AAEX;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAIlE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"}
1
+ {"version":3,"file":"all-tokens.d.ts","sourceRoot":"","sources":["../../../src/theme/tokens/all-tokens.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASZ,CAAC;AAEX;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAIlE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"}
@@ -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"}