@helixui/library 3.8.0 → 3.9.0-next.149

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 (250) hide show
  1. package/README.md +41 -0
  2. package/aaa-verdicts.json +2036 -0
  3. package/custom-elements.json +532 -569
  4. package/dist/components/hx-accordion/hx-accordion-item.d.ts.map +1 -1
  5. package/dist/components/hx-accordion/hx-accordion-item.styles.d.ts.map +1 -1
  6. package/dist/components/hx-accordion/index.js +1 -1
  7. package/dist/components/hx-alert/hx-alert.d.ts +0 -8
  8. package/dist/components/hx-alert/hx-alert.d.ts.map +1 -1
  9. package/dist/components/hx-alert/hx-alert.styles.d.ts.map +1 -1
  10. package/dist/components/hx-alert/index.js +1 -1
  11. package/dist/components/hx-avatar/hx-avatar.d.ts +4 -1
  12. package/dist/components/hx-avatar/hx-avatar.d.ts.map +1 -1
  13. package/dist/components/hx-avatar/hx-avatar.styles.d.ts.map +1 -1
  14. package/dist/components/hx-avatar/index.js +1 -1
  15. package/dist/components/hx-badge/hx-badge.d.ts.map +1 -1
  16. package/dist/components/hx-badge/hx-badge.styles.d.ts.map +1 -1
  17. package/dist/components/hx-badge/index.js +1 -1
  18. package/dist/components/hx-banner/hx-banner.d.ts +0 -8
  19. package/dist/components/hx-banner/hx-banner.d.ts.map +1 -1
  20. package/dist/components/hx-banner/hx-banner.styles.d.ts.map +1 -1
  21. package/dist/components/hx-banner/index.js +1 -1
  22. package/dist/components/hx-carousel/hx-carousel.d.ts.map +1 -1
  23. package/dist/components/hx-carousel/hx-carousel.styles.d.ts.map +1 -1
  24. package/dist/components/hx-carousel/index.js +1 -1
  25. package/dist/components/hx-checkbox/hx-checkbox.d.ts.map +1 -1
  26. package/dist/components/hx-checkbox/hx-checkbox.styles.d.ts.map +1 -1
  27. package/dist/components/hx-checkbox/index.js +1 -1
  28. package/dist/components/hx-clinical-status/hx-clinical-status.d.ts +7 -9
  29. package/dist/components/hx-clinical-status/hx-clinical-status.d.ts.map +1 -1
  30. package/dist/components/hx-clinical-status/hx-clinical-status.styles.d.ts.map +1 -1
  31. package/dist/components/hx-clinical-status/index.js +1 -1
  32. package/dist/components/hx-combobox/hx-combobox.d.ts.map +1 -1
  33. package/dist/components/hx-combobox/hx-combobox.styles.d.ts.map +1 -1
  34. package/dist/components/hx-combobox/index.js +1 -1
  35. package/dist/components/hx-date-picker/hx-date-picker.d.ts.map +1 -1
  36. package/dist/components/hx-date-picker/hx-date-picker.styles.d.ts.map +1 -1
  37. package/dist/components/hx-date-picker/index.js +1 -1
  38. package/dist/components/hx-drawer/hx-drawer.d.ts.map +1 -1
  39. package/dist/components/hx-drawer/hx-drawer.styles.d.ts.map +1 -1
  40. package/dist/components/hx-drawer/index.js +1 -1
  41. package/dist/components/hx-dropdown/hx-dropdown.styles.d.ts.map +1 -1
  42. package/dist/components/hx-dropdown/index.js +1 -1
  43. package/dist/components/hx-file-upload/hx-file-upload.d.ts +28 -0
  44. package/dist/components/hx-file-upload/hx-file-upload.d.ts.map +1 -1
  45. package/dist/components/hx-file-upload/hx-file-upload.styles.d.ts.map +1 -1
  46. package/dist/components/hx-file-upload/index.js +1 -1
  47. package/dist/components/hx-help-text/hx-help-text.d.ts.map +1 -1
  48. package/dist/components/hx-help-text/hx-help-text.styles.d.ts.map +1 -1
  49. package/dist/components/hx-help-text/index.js +1 -1
  50. package/dist/components/hx-icon/hx-icon.d.ts +108 -12
  51. package/dist/components/hx-icon/hx-icon.d.ts.map +1 -1
  52. package/dist/components/hx-icon/hx-icon.styles.d.ts.map +1 -1
  53. package/dist/components/hx-icon/index.js +1 -1
  54. package/dist/components/hx-link/hx-link.d.ts.map +1 -1
  55. package/dist/components/hx-link/hx-link.styles.d.ts.map +1 -1
  56. package/dist/components/hx-link/index.js +1 -1
  57. package/dist/components/hx-menu/hx-menu-item.d.ts.map +1 -1
  58. package/dist/components/hx-menu/hx-menu-item.styles.d.ts.map +1 -1
  59. package/dist/components/hx-menu/index.js +1 -1
  60. package/dist/components/hx-nav/hx-nav.d.ts.map +1 -1
  61. package/dist/components/hx-nav/hx-nav.styles.d.ts.map +1 -1
  62. package/dist/components/hx-nav/index.js +1 -1
  63. package/dist/components/hx-number-input/hx-number-input.d.ts.map +1 -1
  64. package/dist/components/hx-number-input/hx-number-input.styles.d.ts.map +1 -1
  65. package/dist/components/hx-number-input/index.js +1 -1
  66. package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts +5 -1
  67. package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts.map +1 -1
  68. package/dist/components/hx-overflow-menu/hx-overflow-menu.styles.d.ts.map +1 -1
  69. package/dist/components/hx-overflow-menu/index.js +1 -1
  70. package/dist/components/hx-phi-field/hx-phi-field.d.ts.map +1 -1
  71. package/dist/components/hx-phi-field/hx-phi-field.styles.d.ts.map +1 -1
  72. package/dist/components/hx-phi-field/index.js +1 -1
  73. package/dist/components/hx-radio-group/hx-radio-group.d.ts.map +1 -1
  74. package/dist/components/hx-radio-group/index.js +1 -1
  75. package/dist/components/hx-rating/hx-rating.d.ts.map +1 -1
  76. package/dist/components/hx-rating/hx-rating.styles.d.ts.map +1 -1
  77. package/dist/components/hx-rating/index.js +1 -1
  78. package/dist/components/hx-side-nav/hx-nav-item.d.ts.map +1 -1
  79. package/dist/components/hx-side-nav/hx-nav-item.styles.d.ts.map +1 -1
  80. package/dist/components/hx-side-nav/hx-side-nav.d.ts.map +1 -1
  81. package/dist/components/hx-side-nav/hx-side-nav.styles.d.ts.map +1 -1
  82. package/dist/components/hx-side-nav/index.js +1 -1
  83. package/dist/components/hx-slider/hx-slider.d.ts +28 -0
  84. package/dist/components/hx-slider/hx-slider.d.ts.map +1 -1
  85. package/dist/components/hx-slider/index.js +1 -1
  86. package/dist/components/hx-split-button/hx-split-button.d.ts.map +1 -1
  87. package/dist/components/hx-split-button/hx-split-button.styles.d.ts.map +1 -1
  88. package/dist/components/hx-split-button/index.js +1 -1
  89. package/dist/components/hx-stat/hx-stat.d.ts.map +1 -1
  90. package/dist/components/hx-stat/hx-stat.styles.d.ts.map +1 -1
  91. package/dist/components/hx-stat/index.js +1 -1
  92. package/dist/components/hx-steps/hx-step.d.ts.map +1 -1
  93. package/dist/components/hx-steps/hx-step.styles.d.ts.map +1 -1
  94. package/dist/components/hx-steps/index.js +1 -1
  95. package/dist/components/hx-tag/hx-tag.d.ts.map +1 -1
  96. package/dist/components/hx-tag/hx-tag.styles.d.ts.map +1 -1
  97. package/dist/components/hx-tag/index.js +1 -1
  98. package/dist/components/hx-time-picker/hx-time-picker.d.ts.map +1 -1
  99. package/dist/components/hx-time-picker/hx-time-picker.styles.d.ts.map +1 -1
  100. package/dist/components/hx-time-picker/index.js +1 -1
  101. package/dist/components/hx-toast/hx-toast.d.ts +0 -8
  102. package/dist/components/hx-toast/hx-toast.d.ts.map +1 -1
  103. package/dist/components/hx-toast/hx-toast.styles.d.ts.map +1 -1
  104. package/dist/components/hx-toast/index.js +1 -1
  105. package/dist/components/hx-top-nav/hx-top-nav.d.ts.map +1 -1
  106. package/dist/components/hx-top-nav/hx-top-nav.styles.d.ts.map +1 -1
  107. package/dist/components/hx-top-nav/index.js +1 -1
  108. package/dist/components/hx-tree-view/hx-tree-item.d.ts.map +1 -1
  109. package/dist/components/hx-tree-view/hx-tree-item.styles.d.ts.map +1 -1
  110. package/dist/components/hx-tree-view/index.js +1 -1
  111. package/dist/css/helix-all.css +116 -54
  112. package/dist/css/helix-core.css +19 -4
  113. package/dist/css/helix-feedback.css +15 -18
  114. package/dist/css/helix-forms.css +39 -12
  115. package/dist/css/helix-media.css +6 -3
  116. package/dist/css/helix-navigation.css +16 -7
  117. package/dist/css/helix-overlay.css +10 -0
  118. package/dist/css/helix-tokens.css +3 -2
  119. package/dist/css/helix-utility.css +5 -0
  120. package/dist/css/hx-alert.css +4 -8
  121. package/dist/css/hx-avatar.css +1 -2
  122. package/dist/css/hx-badge.css +5 -0
  123. package/dist/css/hx-banner.css +4 -8
  124. package/dist/css/hx-carousel.css +6 -3
  125. package/dist/css/hx-checkbox.css +4 -9
  126. package/dist/css/hx-clinical-status.css +4 -7
  127. package/dist/css/hx-combobox.css +8 -0
  128. package/dist/css/hx-date-picker.css +5 -0
  129. package/dist/css/hx-drawer.css +5 -0
  130. package/dist/css/hx-dropdown.css +5 -0
  131. package/dist/css/hx-file-upload.css +4 -0
  132. package/dist/css/hx-help-text.css +5 -0
  133. package/dist/css/hx-icon.css +7 -0
  134. package/dist/css/hx-link.css +1 -2
  135. package/dist/css/hx-nav.css +7 -0
  136. package/dist/css/hx-number-input.css +2 -3
  137. package/dist/css/hx-overflow-menu.css +5 -0
  138. package/dist/css/hx-phi-field.css +2 -3
  139. package/dist/css/hx-rating.css +6 -0
  140. package/dist/css/hx-side-nav.css +3 -5
  141. package/dist/css/hx-split-button.css +5 -0
  142. package/dist/css/hx-stat.css +1 -2
  143. package/dist/css/hx-tag.css +5 -0
  144. package/dist/css/hx-time-picker.css +5 -0
  145. package/dist/css/hx-toast.css +6 -0
  146. package/dist/css/hx-top-nav.css +1 -2
  147. package/dist/css/index.css +1 -1
  148. package/dist/css/manifest.json +4 -1
  149. package/dist/index.js +33 -33
  150. package/dist/shared/{hx-accordion-ZVzgDzTG.js → hx-accordion-DR--Ev4t.js} +48 -54
  151. package/dist/shared/hx-accordion-DR--Ev4t.js.map +1 -0
  152. package/dist/shared/{hx-alert-Bto8-TIi.js → hx-alert-C0axS32J.js} +40 -79
  153. package/dist/shared/hx-alert-C0axS32J.js.map +1 -0
  154. package/dist/shared/{hx-avatar-C9hOmlAb.js → hx-avatar-ChAYWnK8.js} +22 -24
  155. package/dist/shared/hx-avatar-ChAYWnK8.js.map +1 -0
  156. package/dist/shared/{hx-badge-DFL35nzi.js → hx-badge-vX-1cuLA.js} +16 -11
  157. package/dist/shared/hx-badge-vX-1cuLA.js.map +1 -0
  158. package/dist/shared/{hx-banner-fpRnciIO.js → hx-banner-PbHwFNSb.js} +51 -90
  159. package/dist/shared/hx-banner-PbHwFNSb.js.map +1 -0
  160. package/dist/shared/{hx-carousel-item-z1Lc24op.js → hx-carousel-item-BVIKgQ4i.js} +72 -102
  161. package/dist/shared/hx-carousel-item-BVIKgQ4i.js.map +1 -0
  162. package/dist/shared/{hx-checkbox-DcgyGS9V.js → hx-checkbox-DDSXXhps.js} +31 -38
  163. package/dist/shared/hx-checkbox-DDSXXhps.js.map +1 -0
  164. package/dist/shared/{hx-clinical-status-D3XQIOqX.js → hx-clinical-status-ZSVEc3Qg.js} +68 -87
  165. package/dist/shared/hx-clinical-status-ZSVEc3Qg.js.map +1 -0
  166. package/dist/shared/{hx-combobox-NgJaLbs2.js → hx-combobox-Be-mqOv4.js} +35 -45
  167. package/dist/shared/hx-combobox-Be-mqOv4.js.map +1 -0
  168. package/dist/shared/{hx-date-picker-0PtEav0K.js → hx-date-picker-CziP3Hm1.js} +15 -22
  169. package/dist/shared/hx-date-picker-CziP3Hm1.js.map +1 -0
  170. package/dist/shared/{hx-drawer-CM_upadk.js → hx-drawer-BlU2oX8-.js} +32 -36
  171. package/dist/shared/hx-drawer-BlU2oX8-.js.map +1 -0
  172. package/dist/shared/{hx-dropdown-xHwTJecv.js → hx-dropdown-DREqpIpm.js} +16 -11
  173. package/dist/shared/hx-dropdown-DREqpIpm.js.map +1 -0
  174. package/dist/shared/{hx-file-upload-D3rKROK5.js → hx-file-upload-CU5QGZSP.js} +137 -80
  175. package/dist/shared/hx-file-upload-CU5QGZSP.js.map +1 -0
  176. package/dist/shared/hx-help-text-CNaZ82LT.js +137 -0
  177. package/dist/shared/hx-help-text-CNaZ82LT.js.map +1 -0
  178. package/dist/shared/hx-icon-bxz9eB9a.js +386 -0
  179. package/dist/shared/hx-icon-bxz9eB9a.js.map +1 -0
  180. package/dist/shared/{hx-link-CMnZRUtQ.js → hx-link-BURSdYLp.js} +19 -26
  181. package/dist/shared/hx-link-BURSdYLp.js.map +1 -0
  182. package/dist/shared/{hx-menu-divider-A6Guuzi_.js → hx-menu-divider-g0grbWV9.js} +19 -31
  183. package/dist/shared/hx-menu-divider-g0grbWV9.js.map +1 -0
  184. package/dist/shared/{hx-nav-ChMTfn7o.js → hx-nav-GTsAZGOx.js} +46 -59
  185. package/dist/shared/hx-nav-GTsAZGOx.js.map +1 -0
  186. package/dist/shared/{hx-nav-item-ClN17f1y.js → hx-nav-item-CxE7Mp3M.js} +62 -64
  187. package/dist/shared/hx-nav-item-CxE7Mp3M.js.map +1 -0
  188. package/dist/shared/{hx-number-input-MggsT7F0.js → hx-number-input-Bvyc9kOi.js} +48 -53
  189. package/dist/shared/hx-number-input-Bvyc9kOi.js.map +1 -0
  190. package/dist/shared/{hx-overflow-menu-DFjJAziP.js → hx-overflow-menu-LrTteeR1.js} +32 -39
  191. package/dist/shared/hx-overflow-menu-LrTteeR1.js.map +1 -0
  192. package/dist/shared/{hx-phi-field-C19oxlrr.js → hx-phi-field-sZt_rYIL.js} +46 -66
  193. package/dist/shared/hx-phi-field-sZt_rYIL.js.map +1 -0
  194. package/dist/shared/{hx-radio-BY4zpwdh.js → hx-radio-BD_c9NJy.js} +51 -56
  195. package/dist/shared/{hx-radio-BY4zpwdh.js.map → hx-radio-BD_c9NJy.js.map} +1 -1
  196. package/dist/shared/{hx-rating-C3QP53k9.js → hx-rating-BGK4AxvI.js} +45 -71
  197. package/dist/shared/hx-rating-BGK4AxvI.js.map +1 -0
  198. package/dist/shared/{hx-slider-Blmv_rwS.js → hx-slider-CkOk5BCY.js} +83 -23
  199. package/dist/shared/{hx-slider-Blmv_rwS.js.map → hx-slider-CkOk5BCY.js.map} +1 -1
  200. package/dist/shared/{hx-split-button-CdNz1XAu.js → hx-split-button-Bg9FHrFK.js} +12 -16
  201. package/dist/shared/hx-split-button-Bg9FHrFK.js.map +1 -0
  202. package/dist/shared/{hx-stat-Gtw_SpK8.js → hx-stat-wKxbyep6.js} +22 -55
  203. package/dist/shared/hx-stat-wKxbyep6.js.map +1 -0
  204. package/dist/shared/{hx-step-CUzliIK_.js → hx-step-CyGQAuiB.js} +5 -25
  205. package/dist/shared/hx-step-CyGQAuiB.js.map +1 -0
  206. package/dist/shared/{hx-tag-C5aCUpVi.js → hx-tag-BqO6HY6V.js} +26 -21
  207. package/dist/shared/hx-tag-BqO6HY6V.js.map +1 -0
  208. package/dist/shared/{hx-time-picker-DfJkBwcX.js → hx-time-picker-if5Cl0Ei.js} +32 -38
  209. package/dist/shared/hx-time-picker-if5Cl0Ei.js.map +1 -0
  210. package/dist/shared/{hx-top-nav-CsTxOtVI.js → hx-top-nav-vP6oDWMV.js} +24 -38
  211. package/dist/shared/hx-top-nav-vP6oDWMV.js.map +1 -0
  212. package/dist/shared/{hx-tree-item-CXyspGxI.js → hx-tree-item-D8hwKd5m.js} +54 -57
  213. package/dist/shared/hx-tree-item-D8hwKd5m.js.map +1 -0
  214. package/dist/shared/{toast-factory-Dht3pVsw.js → toast-factory-DgnbFxVs.js} +127 -153
  215. package/dist/shared/toast-factory-DgnbFxVs.js.map +1 -0
  216. package/figma-inventory.json +283 -304
  217. package/package.json +8 -4
  218. package/dist/shared/hx-accordion-ZVzgDzTG.js.map +0 -1
  219. package/dist/shared/hx-alert-Bto8-TIi.js.map +0 -1
  220. package/dist/shared/hx-avatar-C9hOmlAb.js.map +0 -1
  221. package/dist/shared/hx-badge-DFL35nzi.js.map +0 -1
  222. package/dist/shared/hx-banner-fpRnciIO.js.map +0 -1
  223. package/dist/shared/hx-carousel-item-z1Lc24op.js.map +0 -1
  224. package/dist/shared/hx-checkbox-DcgyGS9V.js.map +0 -1
  225. package/dist/shared/hx-clinical-status-D3XQIOqX.js.map +0 -1
  226. package/dist/shared/hx-combobox-NgJaLbs2.js.map +0 -1
  227. package/dist/shared/hx-date-picker-0PtEav0K.js.map +0 -1
  228. package/dist/shared/hx-drawer-CM_upadk.js.map +0 -1
  229. package/dist/shared/hx-dropdown-xHwTJecv.js.map +0 -1
  230. package/dist/shared/hx-file-upload-D3rKROK5.js.map +0 -1
  231. package/dist/shared/hx-help-text-Xb2Yr8x2.js +0 -156
  232. package/dist/shared/hx-help-text-Xb2Yr8x2.js.map +0 -1
  233. package/dist/shared/hx-icon-fuVm4-bk.js +0 -283
  234. package/dist/shared/hx-icon-fuVm4-bk.js.map +0 -1
  235. package/dist/shared/hx-link-CMnZRUtQ.js.map +0 -1
  236. package/dist/shared/hx-menu-divider-A6Guuzi_.js.map +0 -1
  237. package/dist/shared/hx-nav-ChMTfn7o.js.map +0 -1
  238. package/dist/shared/hx-nav-item-ClN17f1y.js.map +0 -1
  239. package/dist/shared/hx-number-input-MggsT7F0.js.map +0 -1
  240. package/dist/shared/hx-overflow-menu-DFjJAziP.js.map +0 -1
  241. package/dist/shared/hx-phi-field-C19oxlrr.js.map +0 -1
  242. package/dist/shared/hx-rating-C3QP53k9.js.map +0 -1
  243. package/dist/shared/hx-split-button-CdNz1XAu.js.map +0 -1
  244. package/dist/shared/hx-stat-Gtw_SpK8.js.map +0 -1
  245. package/dist/shared/hx-step-CUzliIK_.js.map +0 -1
  246. package/dist/shared/hx-tag-C5aCUpVi.js.map +0 -1
  247. package/dist/shared/hx-time-picker-DfJkBwcX.js.map +0 -1
  248. package/dist/shared/hx-top-nav-CsTxOtVI.js.map +0 -1
  249. package/dist/shared/hx-tree-item-CXyspGxI.js.map +0 -1
  250. package/dist/shared/toast-factory-Dht3pVsw.js.map +0 -1
@@ -81,9 +81,9 @@ function R(e) {
81
81
  return null;
82
82
  }
83
83
  var H = Object.defineProperty, T = Object.getOwnPropertyDescriptor, b = (e, t, s, i) => {
84
- for (var r = i > 1 ? void 0 : i ? T(t, s) : t, n = e.length - 1, l; n >= 0; n--)
85
- (l = e[n]) && (r = (i ? l(t, s, r) : l(r)) || r);
86
- return i && r && H(t, s, r), r;
84
+ for (var a = i > 1 ? void 0 : i ? T(t, s) : t, n = e.length - 1, l; n >= 0; n--)
85
+ (l = e[n]) && (a = (i ? l(t, s, a) : l(a)) || a);
86
+ return i && a && H(t, s, a), a;
87
87
  };
88
88
  let d = class extends A {
89
89
  constructor() {
@@ -154,8 +154,8 @@ let d = class extends A {
154
154
  if (this.selection !== "none") {
155
155
  if (this.selection === "single") {
156
156
  const i = s.selected;
157
- this._getSelectedItems().forEach((r) => {
158
- r.selected = !1;
157
+ this._getSelectedItems().forEach((a) => {
158
+ a.selected = !1;
159
159
  }), s.selected = !i;
160
160
  } else this.selection === "multiple" && (s.selected = !s.selected);
161
161
  this.dispatchEvent(
@@ -169,37 +169,37 @@ let d = class extends A {
169
169
  }
170
170
  /** @internal */
171
171
  _handleKeyDown(e) {
172
- var r, n, l;
172
+ var a, n, l;
173
173
  const t = this._getVisibleItems();
174
174
  if (t.length === 0) return;
175
175
  let s = this._currentIndex;
176
176
  const i = document.activeElement;
177
- for (let a = 0; a < t.length; a++)
178
- if (t[a] === i || (n = (r = t[a]) == null ? void 0 : r.shadowRoot) != null && n.activeElement) {
179
- s = a;
177
+ for (let r = 0; r < t.length; r++)
178
+ if (t[r] === i || (n = (a = t[r]) == null ? void 0 : a.shadowRoot) != null && n.activeElement) {
179
+ s = r;
180
180
  break;
181
181
  }
182
182
  switch (e.key) {
183
183
  case "ArrowDown": {
184
184
  e.preventDefault();
185
- const a = s < t.length - 1 ? s + 1 : 0;
186
- this._focusItem(a);
185
+ const r = s < t.length - 1 ? s + 1 : 0;
186
+ this._focusItem(r);
187
187
  break;
188
188
  }
189
189
  case "ArrowUp": {
190
190
  e.preventDefault();
191
- const a = s > 0 ? s - 1 : t.length - 1;
192
- this._focusItem(a);
191
+ const r = s > 0 ? s - 1 : t.length - 1;
192
+ this._focusItem(r);
193
193
  break;
194
194
  }
195
195
  case "ArrowLeft": {
196
196
  e.preventDefault();
197
- const a = t[s];
198
- if (!a || a.disabled) break;
199
- if (a.expanded && a.hasChildItems)
200
- a.expanded = !1, this._invalidateVisibleItemsCache();
197
+ const r = t[s];
198
+ if (!r || r.disabled) break;
199
+ if (r.expanded && r.hasChildItems)
200
+ r.expanded = !1, this._invalidateVisibleItemsCache();
201
201
  else {
202
- const p = (l = a.parentElement) == null ? void 0 : l.closest("hx-tree-item");
202
+ const p = (l = r.parentElement) == null ? void 0 : l.closest("hx-tree-item");
203
203
  if (p) {
204
204
  const _ = t.indexOf(p);
205
205
  _ >= 0 && this._focusItem(_);
@@ -209,9 +209,9 @@ let d = class extends A {
209
209
  }
210
210
  case "ArrowRight": {
211
211
  e.preventDefault();
212
- const a = t[s];
213
- if (!a || a.disabled) break;
214
- a.hasChildItems && (a.expanded ? this._focusItem(s + 1) : (a.expanded = !0, this._invalidateVisibleItemsCache()));
212
+ const r = t[s];
213
+ if (!r || r.disabled) break;
214
+ r.hasChildItems && (r.expanded ? this._focusItem(s + 1) : (r.expanded = !0, this._invalidateVisibleItemsCache()));
215
215
  break;
216
216
  }
217
217
  case "Home": {
@@ -225,8 +225,8 @@ let d = class extends A {
225
225
  default: {
226
226
  if (e.key.length === 1) {
227
227
  e.preventDefault();
228
- const a = this._findTypeaheadMatch(e.key.toLowerCase(), s);
229
- a !== -1 && this._focusItem(a);
228
+ const r = this._findTypeaheadMatch(e.key.toLowerCase(), s);
229
+ r !== -1 && this._focusItem(r);
230
230
  }
231
231
  break;
232
232
  }
@@ -241,9 +241,9 @@ let d = class extends A {
241
241
  const s = this._getVisibleItems();
242
242
  if (s.length === 0) return -1;
243
243
  for (let i = 1; i <= s.length; i++) {
244
- const r = (t + i) % s.length, n = s[r];
244
+ const a = (t + i) % s.length, n = s[a];
245
245
  if (n && n.labelText.toLowerCase().startsWith(e))
246
- return r;
246
+ return a;
247
247
  }
248
248
  return -1;
249
249
  }
@@ -260,9 +260,9 @@ let d = class extends A {
260
260
  _updateAriaMetadataForContainer(e, t) {
261
261
  const s = this.selection === "single" || this.selection === "multiple", i = Array.from(e.children).filter(
262
262
  (n) => n.tagName.toLowerCase() === "hx-tree-item"
263
- ), r = i.length;
263
+ ), a = i.length;
264
264
  i.forEach((n, l) => {
265
- n.setAriaMetadata(t, l + 1, r, s), this._updateAriaMetadataForContainer(n, t + 1);
265
+ n.setAriaMetadata(t, l + 1, a, s), this._updateAriaMetadataForContainer(n, t + 1);
266
266
  });
267
267
  }
268
268
  /**
@@ -318,13 +318,13 @@ let d = class extends A {
318
318
  var l;
319
319
  const e = this._internals;
320
320
  this._supportsIdrefRefs ? (e.role = "tree", e.ariaMultiSelectable = this.selection === "none" ? null : this.selection === "multiple" ? "true" : "false") : (e.role = null, e.ariaLabel = null, e.ariaMultiSelectable = null);
321
- const t = ((l = this.getAttribute("aria-label")) == null ? void 0 : l.trim()) || "", s = this.getAttribute("aria-labelledby"), i = S(this, s), r = i.length > 0;
321
+ const t = ((l = this.getAttribute("aria-label")) == null ? void 0 : l.trim()) || "", s = this.getAttribute("aria-labelledby"), i = S(this, s), a = i.length > 0;
322
322
  if (this._supportsIdrefRefs) {
323
- const a = e;
324
- a.ariaLabelledByElements = r ? i : null;
323
+ const r = e;
324
+ r.ariaLabelledByElements = a ? i : null;
325
325
  }
326
326
  let n = "";
327
- r ? (n = i.map((p) => C(p)).filter(Boolean).join(" ") || t || this.label || "Tree", this._supportsIdrefRefs && (e.ariaLabel = null)) : t ? (n = t, this._supportsIdrefRefs && (e.ariaLabel = t)) : (n = this.label || "Tree", this._supportsIdrefRefs && (e.ariaLabel = n)), this._resolvedAccessibleName !== n && (this._resolvedAccessibleName = n, this._supportsIdrefRefs || this.requestUpdate());
327
+ a ? (n = i.map((p) => C(p)).filter(Boolean).join(" ") || t || this.label || "Tree", this._supportsIdrefRefs && (e.ariaLabel = null)) : t ? (n = t, this._supportsIdrefRefs && (e.ariaLabel = t)) : (n = this.label || "Tree", this._supportsIdrefRefs && (e.ariaLabel = n)), this._resolvedAccessibleName !== n && (this._resolvedAccessibleName = n, this._supportsIdrefRefs || this.requestUpdate());
328
328
  }
329
329
  // ─── Render ───
330
330
  render() {
@@ -477,18 +477,12 @@ const $ = x`
477
477
  outline-offset: var(--hx-focus-ring-offset, 2px);
478
478
  }
479
479
 
480
- .expand-btn svg {
481
- width: var(--hx-space-3, 0.75rem);
482
- height: var(--hx-space-3, 0.75rem);
483
- stroke: currentColor;
484
- fill: none;
485
- stroke-width: 2;
486
- stroke-linecap: round;
487
- stroke-linejoin: round;
480
+ .expand-btn .expand-glyph {
481
+ --hx-icon-size: var(--hx-space-3, 0.75rem);
488
482
  transition: transform var(--hx-transition-fast, 150ms ease);
489
483
  }
490
484
 
491
- :host([expanded]) .expand-btn svg {
485
+ :host([expanded]) .expand-btn .expand-glyph {
492
486
  transform: rotate(90deg);
493
487
  }
494
488
 
@@ -566,9 +560,9 @@ const $ = x`
566
560
  }
567
561
  `;
568
562
  var M = Object.defineProperty, D = Object.getOwnPropertyDescriptor, h = (e, t, s, i) => {
569
- for (var r = i > 1 ? void 0 : i ? D(t, s) : t, n = e.length - 1, l; n >= 0; n--)
570
- (l = e[n]) && (r = (i ? l(t, s, r) : l(r)) || r);
571
- return i && r && M(t, s, r), r;
563
+ for (var a = i > 1 ? void 0 : i ? D(t, s) : t, n = e.length - 1, l; n >= 0; n--)
564
+ (l = e[n]) && (a = (i ? l(t, s, a) : l(a)) || a);
565
+ return i && a && M(t, s, a), a;
572
566
  };
573
567
  let o = class extends A {
574
568
  constructor() {
@@ -628,16 +622,16 @@ let o = class extends A {
628
622
  this._level = e;
629
623
  const s = this.parentElement;
630
624
  if (s) {
631
- const r = Array.from(s.children).filter(
625
+ const a = Array.from(s.children).filter(
632
626
  (n) => n.tagName.toLowerCase() === "hx-tree-item"
633
627
  );
634
- this._posInSet = r.indexOf(this) + 1, this._setSize = r.length;
628
+ this._posInSet = a.indexOf(this) + 1, this._setSize = a.length;
635
629
  } else
636
630
  this._posInSet = 1, this._setSize = 1;
637
631
  const i = this.closest("hx-tree-view");
638
632
  if (i) {
639
- const r = i.getAttribute("selection");
640
- this._selectable = r === "single" || r === "multiple";
633
+ const a = i.getAttribute("selection");
634
+ this._selectable = a === "single" || a === "multiple";
641
635
  } else
642
636
  this._selectable = !1;
643
637
  }
@@ -700,15 +694,15 @@ let o = class extends A {
700
694
  var l;
701
695
  const e = this._internals;
702
696
  this._supportsIdrefRefs ? (e.role = "treeitem", e.ariaDisabled = this.disabled ? "true" : null, e.ariaSelected = this._selectable ? this.selected ? "true" : "false" : null, e.ariaExpanded = this._hasChildren ? this.expanded ? "true" : "false" : null, e.ariaLevel = String(this._level), e.ariaPosInSet = String(this._posInSet), e.ariaSetSize = String(this._setSize)) : (e.role = null, e.ariaLabel = null, e.ariaDisabled = null, e.ariaSelected = null, e.ariaExpanded = null, e.ariaLevel = null, e.ariaPosInSet = null, e.ariaSetSize = null);
703
- const t = ((l = this.getAttribute("aria-label")) == null ? void 0 : l.trim()) || "", s = this.getAttribute("aria-labelledby"), i = S(this, s), r = i.length > 0;
697
+ const t = ((l = this.getAttribute("aria-label")) == null ? void 0 : l.trim()) || "", s = this.getAttribute("aria-labelledby"), i = S(this, s), a = i.length > 0;
704
698
  if (this._supportsIdrefRefs) {
705
- const a = e;
706
- a.ariaLabelledByElements = r ? i : null;
699
+ const r = e;
700
+ r.ariaLabelledByElements = a ? i : null;
707
701
  }
708
702
  let n = "";
709
- if (r) {
710
- const a = i.map((p) => C(p)).filter(Boolean).join(" ") || t || "";
711
- n = a, this._supportsIdrefRefs ? e.ariaLabel = null : e.ariaLabel = a || null;
703
+ if (a) {
704
+ const r = i.map((p) => C(p)).filter(Boolean).join(" ") || t || "";
705
+ n = r, this._supportsIdrefRefs ? e.ariaLabel = null : e.ariaLabel = r || null;
712
706
  } else t ? (n = t, e.ariaLabel = t) : e.ariaLabel = null;
713
707
  this._resolvedAccessibleName !== n && (this._resolvedAccessibleName = n, this._supportsIdrefRefs || this.requestUpdate());
714
708
  }
@@ -816,9 +810,12 @@ let o = class extends A {
816
810
  aria-label="${this.expanded ? "Collapse" : "Expand"}"
817
811
  @click=${this._handleExpandClick}
818
812
  >
819
- <svg viewBox="0 0 16 16" aria-hidden="true">
820
- <polyline points="6 4 10 8 6 12" />
821
- </svg>
813
+ <hx-icon
814
+ class="expand-glyph"
815
+ library="helix"
816
+ name="chevron-right"
817
+ aria-hidden="true"
818
+ ></hx-icon>
822
819
  </button>
823
820
  ` : f`<span class="expand-placeholder" aria-hidden="true"></span>`;
824
821
  }
@@ -922,4 +919,4 @@ export {
922
919
  o as H,
923
920
  d as a
924
921
  };
925
- //# sourceMappingURL=hx-tree-item-CXyspGxI.js.map
922
+ //# sourceMappingURL=hx-tree-item-D8hwKd5m.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hx-tree-item-D8hwKd5m.js","sources":["../../src/components/hx-tree-view/hx-tree-view.styles.ts","../../src/utils/tree-walk.ts","../../src/components/hx-tree-view/hx-tree-view.ts","../../src/components/hx-tree-view/hx-tree-item.styles.ts","../../src/components/hx-tree-view/hx-tree-item.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixTreeViewStyles = css`\n :host {\n display: block;\n contain: layout style;\n font-family: var(--hx-tree-font-family, var(--hx-font-family-sans, sans-serif));\n }\n\n * {\n box-sizing: border-box;\n }\n\n .tree {\n display: block;\n outline: none;\n }\n\n .tree:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid var(--hx-focus-ring-color, #0f7078);\n outline-offset: var(--hx-focus-ring-offset, 2px);\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n }\n\n /* ─── High Contrast Mode (forced-colors) ─── */\n\n @media (forced-colors: active) {\n .tree:focus-visible {\n outline: 3px solid Highlight;\n outline-offset: 2px;\n }\n }\n`;\n","/**\n * Composed-tree walkers for the `hx-tree-view` family.\n *\n * Mirrors the `menu-tree.ts` utilities (codex push-gate round-9 extraction\n * for the menu family), but specialized for `hx-tree-view` / `hx-tree-item`\n * where nesting is structural rather than slot-based — child items live in a\n * named `slot=\"children\"` projected into the parent item's shadow root,\n * and any number of nesting levels are legal.\n *\n * Group 5c (codex push-gate round-1 lift): `hx-tree-view`'s host-bound\n * keydown / select handlers receive bubbled events from EVERY descendant\n * tree-item, including ones that legitimately belong to an inner\n * `hx-tree-view`. The same guard pattern that `hx-menu` uses (act only when\n * THIS host is the closest enclosing surface of the dispatching item) is\n * required for trees too. `hx-tree-item._handleClick` /\n * `_handleKeyDown` need to ignore bubbled events from a CHILD `hx-tree-item`\n * — otherwise selecting Child also activates Parent and Enter on Child\n * re-fires Parent's handler.\n *\n * @module\n */\n\n/**\n * Walks the composed tree from `start` outward and returns the closest\n * enclosing `<hx-tree-view>` element, or `null` if none exists. Crosses\n * shadow boundaries (`getRootNode().host`) and slot boundaries\n * (`assignedSlot`) so that an item nested inside a child tree-item — which\n * lives in the parent item's `slot=\"children\"`, projected into the parent's\n * shadow root — resolves to the correct enclosing tree.\n *\n * Returned as `Element` to avoid a circular import between `hx-tree-view`\n * and this util; callers narrow with `instanceof HelixTreeView` if needed.\n *\n * @internal\n */\nexport function findClosestTreeView(start: Element): Element | null {\n let node: Node | null = start;\n while (node) {\n if (node instanceof Element && node.tagName.toLowerCase() === 'hx-tree-view') {\n return node;\n }\n if (node instanceof Element && node.assignedSlot) {\n node = node.assignedSlot;\n continue;\n }\n const parentNode: Node | null = node.parentNode;\n if (parentNode) {\n node = parentNode;\n continue;\n }\n if (node instanceof ShadowRoot) {\n node = node.host;\n continue;\n }\n break;\n }\n return null;\n}\n\n/**\n * Walks the composed tree from `start` outward and returns the closest\n * enclosing `<hx-tree-item>` element, or `null` if none exists. Includes\n * `start` itself when it is an `hx-tree-item`.\n *\n * Used by `hx-tree-item`'s `_isOwnEvent` origin guard: a click or keydown\n * is \"ours\" iff the closest `hx-tree-item` ancestor of the original event\n * target is THIS item (not a child item slotted into our `children` slot).\n * The walk crosses shadow + slot boundaries so a deeply nested child item\n * resolves correctly.\n *\n * Returned as `Element` to avoid a circular import; callers narrow with\n * `instanceof HelixTreeItem` if needed.\n *\n * @internal\n */\nexport function findClosestTreeItem(start: Element): Element | null {\n let node: Node | null = start;\n while (node) {\n if (node instanceof Element && node.tagName.toLowerCase() === 'hx-tree-item') {\n return node;\n }\n if (node instanceof Element && node.assignedSlot) {\n node = node.assignedSlot;\n continue;\n }\n const parentNode: Node | null = node.parentNode;\n if (parentNode) {\n node = parentNode;\n continue;\n }\n if (node instanceof ShadowRoot) {\n node = node.host;\n continue;\n }\n break;\n }\n return null;\n}\n","import { html, nothing, type PropertyValues } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { HelixElement } from '../../base/index.js';\nimport { helixTreeViewStyles } from './hx-tree-view.styles.js';\nimport { forcedColorsSurface } from '../../styles/forced-colors.js';\nimport type { HelixTreeItem, HxTreeItemSelectDetail } from './hx-tree-item.js';\nimport { devWarn } from '../../utils/dev-warn.js';\nimport {\n installAriaIdrefMirror,\n resolveIdrefTokens,\n supportsIdrefElementReferences,\n type AriaIdrefMirrorHandle,\n} from '../../utils/aria-idref.js';\nimport { flattenAccName } from '../../utils/aria-flatten.js';\nimport { findClosestTreeView } from '../../utils/tree-walk.js';\n\n/** Selection mode for the tree. */\nexport type TreeSelection = 'none' | 'single' | 'multiple';\n\n/** Detail type for the `hx-select` event. */\nexport interface HxSelectDetail {\n /** The tree item that was selected or deselected. */\n item: HelixTreeItem;\n /** Whether the item is now selected. */\n selected: boolean;\n}\n\n/**\n * A hierarchical tree component for navigating nested data structures.\n * Used in healthcare applications for org charts, ICD-10 code hierarchies, and department navigation.\n *\n * Group 5c host-canonical: `role=\"tree\"` lives on the **host** via\n * `_internals.role` on the modern path. The host carries the announced\n * surface so AT walks `<hx-tree-view>` (role=tree) → slotted\n * `<hx-tree-item>` (role=treeitem on host) directly without two layers of\n * indirection. Consumer-supplied `aria-label` / `aria-labelledby` on the\n * host are resolved via the shared IDREF mirror; cross-shadow naming uses\n * `ariaLabelledByElements` (modern) with a flattened-string fallback\n * (legacy). On the legacy fallback path the inner `[role=\"tree\"]` carries\n * the role + accessible name and the host role is suppressed so AT only\n * sees one tree per logical surface (mirrors `hx-menu` round-8).\n *\n * Full keyboard navigation: Arrow keys for movement, Enter/Space for\n * selection, Home/End for first/last item, ArrowRight/Left for\n * expand/collapse + parent/child traversal, typeahead.\n *\n * ## Scale Limits\n *\n * This component renders all tree items simultaneously in the DOM. It is suitable for\n * trees with up to ~500 visible items. For large taxonomies (e.g., ICD-10 with 70,000+\n * codes), use async/lazy loading: only render top-level nodes initially and populate\n * child nodes on `hx-select` or expand events. The component exposes the `expanded`\n * property on `hx-tree-item` for programmatic control of subtrees, enabling consumer-level\n * virtualization strategies without requiring changes to this component.\n *\n * @summary Hierarchical tree view with expand/collapse and keyboard navigation.\n *\n * @tag hx-tree-view\n *\n * @slot - Default slot for hx-tree-item elements.\n *\n * @fires {CustomEvent<HxSelectDetail>} hx-select - Dispatched when a tree item is selected or deselected.\n *\n * @csspart tree - The tree container element with role=\"tree\" (legacy fallback path) or the inner shadow surface (modern path; role lives on the host).\n *\n * @cssprop [--hx-tree-font-family=var(--hx-font-family-sans)] - Tree font family.\n * @cssprop [--hx-font-family-sans] - Font family.\n * @cssprop [--hx-focus-ring-width] - Width.\n * @cssprop [--hx-focus-ring-color] - Color.\n * @cssprop [--hx-color-primary-400] - Color.\n * @cssprop [--hx-focus-ring-offset] - CSS custom property.\n * @cssprop [--hx-border-radius-sm] - CSS custom property.\n */\n@customElement('hx-tree-view')\nexport class HelixTreeView extends HelixElement {\n static override styles = [helixTreeViewStyles, forcedColorsSurface];\n\n // ─── Properties ───\n\n /**\n * Accessible label for the tree. Used as a fallback when no\n * consumer-supplied `aria-label` / `aria-labelledby` is present on the\n * host. On the modern host-canonical path this projects onto\n * `internals.ariaLabel`; on the legacy fallback path it appears as\n * `aria-label` on the inner `[role=\"tree\"]` element.\n * @attr label\n */\n @property({ type: String, reflect: true })\n label = '';\n\n /**\n * Selection mode for the tree.\n * - `none` — items cannot be selected\n * - `single` — only one item can be selected at a time\n * - `multiple` — multiple items can be selected\n * @attr selection\n */\n @property({ type: String, reflect: true })\n selection: 'none' | 'single' | 'multiple' = 'none';\n\n // ─── Internal State ───\n\n /** @internal */\n @state() private _currentIndex = 0;\n\n /** Tracks whether the tree has any visible items, to decide the container tabindex. */\n /** @internal */\n @state() private _hasVisibleItems = false;\n\n // ─── Host-canonical ARIA bookkeeping ───\n\n /**\n * Test seam (codex push-gate round-1 lift from group 5b): when set to\n * `true` or `false`, overrides the platform `supportsIdrefElementReferences`\n * probe before `connectedCallback` seeds `_supportsIdrefRefs`. Mirrors the\n * hx-menu / hx-menu-item / hx-select seam — required so tests can\n * deterministically exercise the legacy fallback render branch.\n *\n * Production code MUST NOT touch this field. It is `static` so the test\n * stub cleanup is global and obvious.\n * @internal\n */\n static __testSupportsIdrefRefsOverride: boolean | null = null;\n\n /** @internal */\n private _supportsIdrefRefs = true;\n\n /** @internal */\n private _ariaMirror: AriaIdrefMirrorHandle | null = null;\n\n /**\n * Resolved accessible name for the tree — the single source of truth read\n * by `_syncHostAriaSemantics()` (modern path: writes to\n * `internals.ariaLabel`) and the fallback `render()` branch (legacy path:\n * writes to inner `div[role=\"tree\"]` `aria-label`). AccName 1.2 §4.3.1\n * precedence: consumer host `aria-labelledby` (resolved + flattened) >\n * consumer host `aria-label` > `label` property > literal \"Tree\".\n * @internal\n */\n private _resolvedAccessibleName = '';\n\n // ─── Visible items cache ───\n\n /**\n * Cached flat list of visible items (depth-first, respects collapsed nodes).\n * Set to null to invalidate; rebuilt on next access.\n * @internal\n */\n private _cachedVisibleItems: HelixTreeItem[] | null = null;\n\n /**\n * Invalidate the visible-items cache. Call after any expand/collapse or structural change.\n * @internal\n */\n private _invalidateVisibleItemsCache(): void {\n this._cachedVisibleItems = null;\n }\n\n // ─── Internal Helpers ───\n\n /**\n * Returns a flat ordered list of all visible (not inside a collapsed item) hx-tree-items\n * in depth-first order. Result is cached; invalidated on expand/collapse/slotchange.\n */\n /** @internal */\n private _getVisibleItems(): HelixTreeItem[] {\n if (!this._cachedVisibleItems) {\n this._cachedVisibleItems = this._collectVisibleItems(this);\n }\n return this._cachedVisibleItems;\n }\n\n /** @internal */\n private _collectVisibleItems(container: Element): HelixTreeItem[] {\n const items: HelixTreeItem[] = [];\n for (const child of Array.from(container.children)) {\n if (child.tagName.toLowerCase() === 'hx-tree-item') {\n const item = child as HelixTreeItem;\n items.push(item);\n if (item.expanded) {\n items.push(...this._collectVisibleItems(item));\n }\n } else {\n items.push(...this._collectVisibleItems(child));\n }\n }\n return items;\n }\n\n /** @internal */\n private _getSelectedItems(): HelixTreeItem[] {\n return Array.from(this.querySelectorAll<HelixTreeItem>('hx-tree-item[selected]'));\n }\n\n /**\n * Updates the roving tabindex across all visible items so that only the\n * item at `activeIndex` has `tabindex=\"0\"`. All others receive `tabindex=\"-1\"`.\n * This is called whenever the active item changes (navigation, initial render).\n */\n /** @internal */\n private _updateRovingTabindex(items: HelixTreeItem[], activeIndex: number): void {\n items.forEach((item, i) => {\n item.setRovingActive(i === activeIndex);\n });\n }\n\n /** @internal */\n private _focusItem(index: number): void {\n const items = this._getVisibleItems();\n if (items.length === 0) return;\n const clamped = Math.max(0, Math.min(index, items.length - 1));\n this._currentIndex = clamped;\n this._updateRovingTabindex(items, clamped);\n items[clamped]?.focus();\n }\n\n // ─── Event Handling ───\n\n /** @internal */\n private _handleTreeItemSelect(e: Event): void {\n if (!(e instanceof CustomEvent)) return;\n const event = e as CustomEvent<HxTreeItemSelectDetail>;\n const item = event.detail.item;\n\n if (this.selection === 'none') return;\n\n if (this.selection === 'single') {\n const wasSelected = item.selected;\n this._getSelectedItems().forEach((i) => {\n i.selected = false;\n });\n item.selected = !wasSelected;\n } else if (this.selection === 'multiple') {\n item.selected = !item.selected;\n }\n\n this.dispatchEvent(\n new CustomEvent<HxSelectDetail>('hx-select', {\n bubbles: true,\n composed: true,\n detail: { item, selected: item.selected },\n }),\n );\n }\n\n /**\n * Codex push-gate round-1 lift (mirrors hx-menu round-7 finding 2):\n * `hx-tree-item-select` bubbles composed through every enclosing\n * `hx-tree-view`. The outer tree would otherwise corrupt `_currentIndex`\n * to `-1` (the bubbled item is not in its top-level list) and re-emit a\n * duplicate `hx-select`. Only act when THIS tree is the closest\n * enclosing tree of the dispatching item.\n * @internal\n */\n private _handleItemSelectHost = (e: Event): void => {\n if (!(e instanceof CustomEvent)) return;\n const detail = (e as CustomEvent<HxTreeItemSelectDetail>).detail;\n const item = detail?.item;\n if (item && findClosestTreeView(item) !== this) {\n return;\n }\n this._handleTreeItemSelect(e);\n };\n\n /** @internal */\n private _handleKeyDown(e: KeyboardEvent): void {\n const items = this._getVisibleItems();\n if (items.length === 0) return;\n\n let currentIndex = this._currentIndex;\n const focused = document.activeElement;\n\n for (let i = 0; i < items.length; i++) {\n if (items[i] === focused || items[i]?.shadowRoot?.activeElement) {\n currentIndex = i;\n break;\n }\n }\n\n switch (e.key) {\n case 'ArrowDown': {\n e.preventDefault();\n // Intentional design: wrap-around from last to first item provides\n // a continuous navigation loop, consistent with the component's\n // circular keyboard navigation model.\n const next = currentIndex < items.length - 1 ? currentIndex + 1 : 0;\n this._focusItem(next);\n break;\n }\n case 'ArrowUp': {\n e.preventDefault();\n // Intentional design: wrap-around from first to last item (see ArrowDown note).\n const prev = currentIndex > 0 ? currentIndex - 1 : items.length - 1;\n this._focusItem(prev);\n break;\n }\n case 'ArrowLeft': {\n e.preventDefault();\n const currentItem = items[currentIndex];\n if (!currentItem) break;\n if (currentItem.disabled) break;\n if (currentItem.expanded && currentItem.hasChildItems) {\n currentItem.expanded = false;\n this._invalidateVisibleItemsCache();\n } else {\n const parentItem = currentItem.parentElement?.closest('hx-tree-item') as\n | HelixTreeItem\n | undefined;\n if (parentItem) {\n const parentIndex = items.indexOf(parentItem);\n if (parentIndex >= 0) {\n this._focusItem(parentIndex);\n }\n }\n }\n break;\n }\n case 'ArrowRight': {\n e.preventDefault();\n const currentItem = items[currentIndex];\n if (!currentItem) break;\n if (currentItem.disabled) break;\n if (currentItem.hasChildItems) {\n if (!currentItem.expanded) {\n currentItem.expanded = true;\n this._invalidateVisibleItemsCache();\n } else {\n this._focusItem(currentIndex + 1);\n }\n }\n break;\n }\n case 'Home': {\n e.preventDefault();\n this._focusItem(0);\n break;\n }\n case 'End': {\n e.preventDefault();\n this._focusItem(items.length - 1);\n break;\n }\n default: {\n // WAI-ARIA APG typeahead: a printable character moves focus to the next visible\n // item whose label starts with that character (case-insensitive).\n if (e.key.length === 1) {\n e.preventDefault();\n const matchIndex = this._findTypeaheadMatch(e.key.toLowerCase(), currentIndex);\n if (matchIndex !== -1) {\n this._focusItem(matchIndex);\n }\n }\n break;\n }\n }\n }\n\n /**\n * Codex push-gate round-1 lift (mirrors hx-menu round-7 finding 1):\n * keydown bound on the host receives events bubbled out of nested\n * tree-views. Without this guard the outer tree would run `_focusItem`\n * over its own top-level items and steal focus back out of the inner\n * tree. Only act when THIS tree is the closest enclosing tree of the\n * keydown target.\n * @internal\n */\n private _handleHostKeyDown = (e: KeyboardEvent): void => {\n const target = e.target;\n if (target instanceof Element && findClosestTreeView(target) !== this) {\n return;\n }\n this._handleKeyDown(e);\n };\n\n /**\n * Finds the next visible item (starting after `currentIndex`, wrapping around) whose\n * label text begins with the given lowercase character. Returns -1 if no match.\n * @internal\n */\n private _findTypeaheadMatch(char: string, currentIndex: number): number {\n const items = this._getVisibleItems();\n if (items.length === 0) return -1;\n for (let i = 1; i <= items.length; i++) {\n const index = (currentIndex + i) % items.length;\n const item = items[index];\n if (item && item.labelText.toLowerCase().startsWith(char)) {\n return index;\n }\n }\n return -1;\n }\n\n /** @internal */\n private _handleFocusIn(e: FocusEvent): void {\n // With roving tabindex, the tree container (tabindex=\"-1\") should only receive\n // focus when the tree is empty. If focus does land on the container (e.g. the\n // tree is empty or programmatic focus), redirect to the active item if present.\n if (e.target === e.currentTarget) {\n const items = this._getVisibleItems();\n if (items.length > 0) {\n this._focusItem(this._currentIndex);\n }\n }\n }\n\n /**\n * Compute and push ARIA position metadata (level, posInSet, setSize, selectable) to all\n * direct hx-tree-item children of a container in a single O(n) pass.\n * Each item also recurses for its own children, building the full tree in O(total-items) total.\n * @internal\n */\n private _updateAriaMetadataForContainer(container: Element, level: number): void {\n const selectable = this.selection === 'single' || this.selection === 'multiple';\n const children = Array.from(container.children).filter(\n (c) => c.tagName.toLowerCase() === 'hx-tree-item',\n ) as HelixTreeItem[];\n const setSize = children.length;\n children.forEach((item, index) => {\n item.setAriaMetadata(level, index + 1, setSize, selectable);\n // Recurse into child items so the full tree is updated in one traversal\n this._updateAriaMetadataForContainer(item, level + 1);\n });\n }\n\n /**\n * Initializes the roving tabindex after items are first slotted in.\n * Ensures the active item (index 0 by default) has tabindex=\"0\" from the start,\n * so a Tab into the tree lands directly on the first item without a redirect.\n * Also updates `_hasVisibleItems` so the container tabindex re-renders correctly.\n * Pushes O(n) ARIA metadata to all items to replace the O(n^2) per-item ancestor walk.\n */\n /** @internal */\n private _handleSlotChange(): void {\n this._invalidateVisibleItemsCache();\n // Push ARIA metadata from parent in a single O(n) traversal\n this._updateAriaMetadataForContainer(this, 1);\n const items = this._getVisibleItems();\n this._hasVisibleItems = items.length > 0;\n if (items.length === 0) return;\n // Clamp _currentIndex in case items were removed.\n const clamped = Math.min(this._currentIndex, items.length - 1);\n this._currentIndex = clamped;\n this._updateRovingTabindex(items, clamped);\n }\n\n // ─── Lifecycle ───\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Honour the static test override so synthetic environments choose the\n // path BEFORE connect runs — the fallback render branch needs to be\n // selected at first paint so the inner `[role=\"tree\"]` carries the\n // resolved accessible name without a mid-life flag flip.\n const ctor = this.constructor as typeof HelixTreeView;\n this._supportsIdrefRefs =\n ctor.__testSupportsIdrefRefsOverride !== null\n ? ctor.__testSupportsIdrefRefsOverride\n : supportsIdrefElementReferences(this._internals);\n // Keydown + select are bound on the HOST so events from focused\n // host-canonical tree-items (which keep keydown out of this tree's\n // shadow DOM on the modern path) still reach the navigation handler.\n // Both handlers carry composed-tree origin guards that ignore events\n // bubbled out of a NESTED `<hx-tree-view>`.\n this.addEventListener('keydown', this._handleHostKeyDown);\n this.addEventListener('hx-tree-item-select', this._handleItemSelectHost);\n // Seed host-canonical semantics so role/label appear before first paint.\n this._syncHostAriaSemantics();\n this._ariaMirror = installAriaIdrefMirror(this, () => {\n this._syncHostAriaSemantics();\n });\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('keydown', this._handleHostKeyDown);\n this.removeEventListener('hx-tree-item-select', this._handleItemSelectHost);\n this._ariaMirror?.disconnect();\n this._ariaMirror = null;\n }\n\n override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n // CodeRabbit MUST-FIX: `selection` change must re-sync host\n // semantics so `aria-multiselectable` reflects the new mode\n // (single → false, multiple → true, none → unset). Previously only\n // `label` triggered the resync, leaving stale aria-multiselectable.\n if (changedProperties.has('label') || changedProperties.has('selection')) {\n this._syncHostAriaSemantics();\n }\n if (changedProperties.has('selection')) {\n // Per-item _selectable flag also depends on the parent's selection\n // mode — recompute the descendants so each hx-tree-item host's\n // `aria-selected` matches the new container contract.\n this._updateAriaMetadataForContainer(this, 1);\n }\n }\n\n override firstUpdated(): void {\n const hasEffectiveLabel =\n this.hasAttribute('aria-label') ||\n this.hasAttribute('aria-labelledby') ||\n Boolean(this.label);\n if (!hasEffectiveLabel) {\n devWarn(\n 'hx-tree-view',\n 'No accessible label provided. Set the `label` attribute, or supply `aria-label` / `aria-labelledby` on hx-tree-view so screen readers can identify this tree (WCAG 4.1.2).',\n );\n }\n }\n\n /**\n * Mirror tree semantics onto the host via ElementInternals so consumer-\n * supplied `aria-label`, `aria-labelledby`, and the `label` property all\n * reach the announced control. Falls back to a flattened-string label on\n * engines that do not implement `ariaLabelledByElements`.\n *\n * Codex push-gate round-1 lift (mirrors hx-menu round-8 finding 1): on\n * the legacy fallback path the inner `<div role=\"tree\" aria-label=\"…\">`\n * is the announced surface. If we ALSO write `internals.role = 'tree'`\n * onto the host, AT sees TWO trees for one logical surface — the\n * duplicate-surface problem host-canonical migration is meant to\n * eliminate. Suppress host role + label writes on the fallback path; the\n * inner element is the canonical announced surface there. Modern path\n * keeps the host as the canonical surface and clears the inner role.\n * @internal\n */\n private _syncHostAriaSemantics(): void {\n const internals = this._internals;\n\n if (!this._supportsIdrefRefs) {\n internals.role = null;\n internals.ariaLabel = null;\n internals.ariaMultiSelectable = null;\n } else {\n internals.role = 'tree';\n internals.ariaMultiSelectable =\n this.selection === 'none' ? null : this.selection === 'multiple' ? 'true' : 'false';\n }\n\n const hostAriaLabel = this.getAttribute('aria-label')?.trim() || '';\n const consumerLabelledBy = this.getAttribute('aria-labelledby');\n const labelEls = resolveIdrefTokens(this, consumerLabelledBy);\n const hasEffectiveLabelledBy = labelEls.length > 0;\n\n type InternalsWithRefs = ElementInternals & {\n ariaLabelledByElements: Element[] | null;\n };\n\n if (this._supportsIdrefRefs) {\n const refsInternals = internals as InternalsWithRefs;\n refsInternals.ariaLabelledByElements = hasEffectiveLabelledBy ? labelEls : null;\n }\n\n // AccName 1.2 §4.3.1 precedence: consumer aria-labelledby (resolved) >\n // consumer aria-label > `label` property > literal \"Tree\" (last-resort).\n let resolved = '';\n if (hasEffectiveLabelledBy) {\n const flattened =\n labelEls\n .map((el) => flattenAccName(el))\n .filter(Boolean)\n .join(' ') ||\n hostAriaLabel ||\n this.label ||\n 'Tree';\n resolved = flattened;\n if (this._supportsIdrefRefs) {\n // Modern path: element refs win; clear ariaLabel so they aren't\n // shadowed by a stale string. Fallback branch reads\n // `_resolvedAccessibleName` for its inner-div mirror — host\n // ariaLabel is already cleared above on the fallback path.\n internals.ariaLabel = null;\n }\n } else if (hostAriaLabel) {\n resolved = hostAriaLabel;\n if (this._supportsIdrefRefs) {\n internals.ariaLabel = hostAriaLabel;\n }\n } else {\n resolved = this.label || 'Tree';\n if (this._supportsIdrefRefs) {\n internals.ariaLabel = resolved;\n }\n }\n\n if (this._resolvedAccessibleName !== resolved) {\n this._resolvedAccessibleName = resolved;\n if (!this._supportsIdrefRefs) {\n this.requestUpdate();\n }\n }\n }\n\n // ─── Render ───\n\n override render() {\n // Roving tabindex pattern (WCAG 2.4.3 Fix):\n // The tree container is NOT a Tab stop (tabindex=\"-1\"). Tab focus goes\n // directly to the active item, which carries tabindex=\"0\". The container\n // is only a landing target (tabindex=\"0\") when the tree is empty.\n const containerTabindex = this._hasVisibleItems ? '-1' : '0';\n\n // Modern host-canonical path: role + aria-label live on the host via\n // `_internals`. The inner div is roleless on the modern path so AT\n // does not see a duplicated container role nested inside the host.\n if (this._supportsIdrefRefs) {\n return html`\n <div part=\"tree\" class=\"tree\" tabindex=${containerTabindex} @focusin=${this._handleFocusIn}>\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n `;\n }\n\n // Legacy fallback: keep role + aria-label on inner div for AT without\n // IDL element-references on ElementInternals. Mirror the resolved\n // accessible name (consumer aria-label / aria-labelledby flatten /\n // `label` property cascade) so menus named via the new host API still\n // announce on legacy engines.\n const fallbackLabel = this._resolvedAccessibleName || this.label || 'Tree';\n return html`\n <div\n part=\"tree\"\n class=\"tree\"\n role=\"tree\"\n tabindex=${containerTabindex}\n aria-label=${fallbackLabel}\n aria-multiselectable=${this.selection === 'none'\n ? nothing\n : this.selection === 'multiple'\n ? 'true'\n : 'false'}\n @focusin=${this._handleFocusIn}\n >\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-tree-view': HelixTreeView;\n }\n}\n\n/** Canonical type alias for HelixTreeView. Use this when typing hx-tree-view element references. */\nexport type HxTreeView = HelixTreeView;\n","import { css } from 'lit';\n\nexport const helixTreeItemStyles = css`\n :host {\n display: block;\n contain: layout style;\n }\n\n * {\n box-sizing: border-box;\n }\n\n /* ─── Item Container ─── */\n\n .item {\n display: block;\n }\n\n /* ─── Item Row ─── */\n\n .item-row {\n display: flex;\n align-items: center;\n min-height: var(--hx-touch-target-min, 44px);\n gap: var(--hx-tree-item-gap, var(--hx-space-2, 0.5rem));\n padding: var(--hx-tree-item-padding-y, var(--hx-space-2, 0.5rem))\n var(--hx-tree-item-padding-x, var(--hx-space-2, 0.5rem));\n padding-inline-start: calc(\n var(--hx-tree-item-padding-x, var(--hx-space-2, 0.5rem)) + var(--_indent-level, 0) *\n var(--hx-tree-indent-size, 1.5rem)\n );\n border-radius: var(--hx-tree-item-border-radius, var(--hx-border-radius-sm, 0.25rem));\n cursor: pointer;\n outline: none;\n color: var(--hx-tree-item-color, var(--hx-color-neutral-900, #0d1825));\n font-family: var(--hx-tree-item-font-family, var(--hx-font-family-sans, sans-serif));\n font-size: var(--hx-tree-item-font-size, var(--hx-font-size-sm, 0.875rem));\n line-height: var(--hx-line-height-normal, 1.5);\n transition: background-color var(--hx-transition-fast, 150ms ease);\n user-select: none;\n }\n\n .item-row:hover {\n background-color: var(--hx-tree-item-hover-bg, var(--hx-color-neutral-100, #ebeee9));\n }\n\n .item-row:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-tree-item-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, -2px);\n }\n\n /* ─── Selected State ─── */\n\n :host([selected]) .item-row {\n background-color: var(--hx-tree-item-selected-bg, var(--hx-color-primary-100, #dbf0f0));\n color: var(--hx-tree-item-selected-color, var(--hx-color-primary-800, #07494a));\n }\n\n :host([selected]) .item-row:hover {\n background-color: var(--hx-tree-item-selected-hover-bg, var(--hx-color-primary-200, #bce1e1));\n }\n\n /* ─── Disabled State ─── */\n\n :host([disabled]) .item-row {\n opacity: var(--hx-opacity-disabled, 0.5);\n cursor: not-allowed;\n pointer-events: none;\n }\n\n /* ─── Expand Icon ─── */\n\n .expand-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--hx-space-4, 1rem);\n height: var(--hx-space-4, 1rem);\n }\n\n .expand-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--hx-space-4, 1rem);\n height: var(--hx-space-4, 1rem);\n padding: 0;\n border: none;\n background: transparent;\n color: var(--hx-tree-item-expand-icon-color, var(--hx-color-neutral-500, #66787b));\n cursor: pointer;\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n transition: transform var(--hx-transition-fast, 150ms ease);\n pointer-events: auto;\n }\n\n .expand-btn:hover {\n background-color: var(\n --hx-tree-item-expand-hover-bg,\n var(--hx-overlay-black-6, rgba(0, 0, 0, 0.06))\n );\n }\n\n .expand-btn:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-tree-item-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n .expand-btn .expand-glyph {\n --hx-icon-size: var(--hx-space-3, 0.75rem);\n transition: transform var(--hx-transition-fast, 150ms ease);\n }\n\n :host([expanded]) .expand-btn .expand-glyph {\n transform: rotate(90deg);\n }\n\n .expand-placeholder {\n display: block;\n width: var(--hx-space-4, 1rem);\n flex-shrink: 0;\n }\n\n /* ─── Icon Slot ─── */\n\n .item-icon {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n color: var(--hx-tree-item-icon-color, var(--hx-color-neutral-500, #66787b));\n }\n\n .item-icon:empty {\n display: none;\n }\n\n /* ─── Label ─── */\n\n .item-label {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n /* ─── Children (animated) ─── */\n\n .children {\n display: grid;\n grid-template-rows: 0fr;\n transition: grid-template-rows var(--hx-transition-base, 200ms ease);\n --_indent-level: calc(var(--_indent-level, 0) + 1);\n }\n\n .children--expanded {\n grid-template-rows: 1fr;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .item-row,\n .expand-btn,\n .expand-btn svg,\n .children {\n transition: none;\n }\n }\n\n /* ─── Forced Colors (Windows High Contrast) ─── */\n\n @media (forced-colors: active) {\n .item-row:focus-visible {\n outline: 3px solid Highlight;\n outline-offset: -2px;\n }\n\n .expand-btn:focus-visible {\n outline: 3px solid Highlight;\n outline-offset: 2px;\n }\n\n :host([selected]) .item-row {\n outline: 2px solid Highlight;\n }\n }\n\n .children-inner {\n overflow: hidden;\n }\n`;\n","import { html, nothing, type PropertyValues } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport '../hx-icon/hx-icon.js';\nimport { HelixElement } from '../../base/index.js';\nimport { helixTreeItemStyles } from './hx-tree-item.styles.js';\nimport { forcedColorsSurface } from '../../styles/forced-colors.js';\nimport {\n installAriaIdrefMirror,\n resolveIdrefTokens,\n supportsIdrefElementReferences,\n type AriaIdrefMirrorHandle,\n} from '../../utils/aria-idref.js';\nimport { flattenAccName } from '../../utils/aria-flatten.js';\nimport { findClosestTreeItem } from '../../utils/tree-walk.js';\n\n/** Detail type for the `hx-tree-item-select` event. */\nexport interface HxTreeItemSelectDetail {\n /** The tree item that was selected or activated. */\n item: HelixTreeItem;\n}\n\n/**\n * A tree item used within an hx-tree-view component.\n * Supports expand/collapse, selection, keyboard navigation, and icon/children slots.\n *\n * Group 5c host-canonical: `role=\"treeitem\"` lives on the **host** via\n * `_internals.role`. The roving tabindex is written to the host on the\n * modern path so the host is the focusable surface and lands directly\n * under the parent `<hx-tree-view>` (which carries `role=\"tree\"`) in the\n * AT-walked tree. The inner `.item-row` is presentational on the modern\n * path — no role, no aria-* attributes — and carries only click/keyboard\n * event handlers. Keyboard activation (Enter/Space) and expand/collapse\n * (ArrowLeft/Right at the leaf level) are owned by the host's `keydown`\n * handler; ArrowUp/Down/Home/End and typeahead bubble to the parent\n * `<hx-tree-view>` for navigation.\n *\n * The nested `[role=\"group\"]` element that wraps the `slot=\"children\"`\n * stays in the inner shadow DOM regardless of path — that group is a\n * separate sub-surface for the children, not a duplicate of the\n * treeitem role.\n *\n * On the legacy fallback path the inner `.item-row` carries\n * `role=\"treeitem\"` + aria-* state, the host role is suppressed, and the\n * roving tabindex is written to the inner element so there is only ONE\n * focusable surface per item (mirrors hx-menu-item round-8).\n *\n * @summary Individual item within an hx-tree-view hierarchical tree.\n *\n * @tag hx-tree-item\n *\n * @slot - Default slot for the item label content. This text is also used to label the children group.\n * @slot icon - Custom icon shown before the label.\n * @slot children - Nested hx-tree-item elements for sub-tree.\n *\n * @csspart item - The outer item container.\n * @csspart row - The interactive item row (presentational on the modern path; carries role=\"treeitem\" + aria-* on the legacy fallback).\n * @csspart expand-icon - The expand/collapse toggle button.\n * @csspart label - The label text content area.\n * @csspart children - The children container (always carries role=\"group\").\n *\n * @cssprop [--hx-tree-item-color=var(--hx-color-neutral-900)] - Item text color.\n * @cssprop [--hx-tree-item-hover-bg=var(--hx-color-neutral-100)] - Hover background color.\n * @cssprop [--hx-tree-item-selected-bg=var(--hx-color-primary-100)] - Selected background color.\n * @cssprop [--hx-tree-item-selected-color=var(--hx-color-primary-800)] - Selected text color.\n * @cssprop [--hx-tree-item-padding-x=var(--hx-space-2)] - Horizontal padding.\n * @cssprop [--hx-tree-item-padding-y=var(--hx-space-1)] - Vertical padding.\n * @cssprop [--hx-tree-indent-size=1.5rem] - Indentation size per level.\n *\n * @fires {CustomEvent<HxTreeItemSelectDetail>} hx-tree-item-select - Dispatched when this item is clicked or activated via keyboard.\n */\n@customElement('hx-tree-item')\nexport class HelixTreeItem extends HelixElement {\n static override styles = [helixTreeItemStyles, forcedColorsSurface];\n\n /**\n * Test seam (codex push-gate round-1 lift from group 5b): when set to\n * `true` or `false`, overrides the platform `supportsIdrefElementReferences`\n * probe before `connectedCallback` seeds `_supportsIdrefRefs`. Mirrors the\n * hx-menu-item / hx-select seam — required so tests can deterministically\n * exercise the legacy fallback render branch.\n *\n * Production code MUST NOT touch this field. It is `static` so the test\n * stub cleanup is global and obvious.\n * @internal\n */\n static __testSupportsIdrefRefsOverride: boolean | null = null;\n\n // ─── Properties ───\n\n /**\n * Whether the item is expanded (showing children).\n * @attr expanded\n */\n @property({ type: Boolean, reflect: true })\n expanded = false;\n\n /**\n * Whether the item is selected.\n * @attr selected\n */\n @property({ type: Boolean, reflect: true })\n selected = false;\n\n /**\n * Whether the item is disabled (non-interactive).\n * @attr disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n // ─── Internal State ───\n\n /**\n * Tracks whether any elements are assigned to the children slot, controlling expand icon visibility.\n * @internal\n */\n @state() private _hasChildren = false;\n\n /**\n * Whether this item is the roving-tabindex active item in the tree.\n * @internal\n */\n @state() private _rovingActive = false;\n\n /**\n * Text content from the default slot, used to label the children group for screen readers.\n * @internal\n */\n @state() private _labelText = '';\n\n /**\n * Cached ARIA position metadata. Computed once on connect and on slotchange\n * of the parent container, avoiding repeated DOM traversal on every render.\n * @internal\n */\n @state() private _level = 1;\n /**\n * One-based position of this item within its sibling set, set as aria-posinset.\n * @internal\n */\n @state() private _posInSet = 1;\n /**\n * Total count of sibling hx-tree-item elements at the same level, set as aria-setsize.\n * @internal\n */\n @state() private _setSize = 1;\n /**\n * Whether the owning hx-tree-view supports item selection (single or multiple mode).\n * @internal\n */\n @state() private _selectable = false;\n\n /** @internal */\n @query('.item-row') private _itemRowEl!: HTMLElement | null;\n\n // ─── Host-canonical ARIA bookkeeping ───\n\n /** @internal */\n private _supportsIdrefRefs = true;\n\n /** @internal */\n private _ariaMirror: AriaIdrefMirrorHandle | null = null;\n\n /**\n * Resolved accessible name override for the tree item — read by both\n * `_syncHostAriaSemantics()` (modern path: host `internals.ariaLabel`)\n * and the fallback `render()` branch (legacy path: inner\n * `div[role=\"treeitem\"]` `aria-label`). Empty string means \"no override\"\n * — slotted text content provides the implicit name through the\n * announced surface (host on modern; inner row on fallback). AccName 1.2\n * §4.3.1 precedence: consumer host `aria-labelledby` (flattened) >\n * consumer host `aria-label` > implicit slotted text.\n * @internal\n */\n private _resolvedAccessibleName = '';\n\n // ─── Computed ARIA ───\n\n /**\n * Whether this item has slotted children.\n * @returns True if one or more elements are assigned to the children slot.\n */\n get hasChildItems(): boolean {\n return this._hasChildren;\n }\n\n /**\n * The text content of the item's label slot, used for typeahead keyboard navigation.\n * Returns an empty string until the label slot has been assigned.\n */\n get labelText(): string {\n return this._labelText;\n }\n\n /**\n * Recompute all cached ARIA metadata in a single DOM pass.\n * Called on connect, slotchange, and whenever structural context may change.\n * @internal\n */\n private _updateAriaMetadata(): void {\n // Compute nesting level by counting ancestor hx-tree-item elements.\n let level = 1;\n let el: Element | null = this.parentElement;\n while (el) {\n if (el.tagName.toLowerCase() === 'hx-tree-item') level++;\n el = el.parentElement;\n }\n this._level = level;\n\n // Compute position-in-set and set-size from sibling hx-tree-item elements.\n const parent = this.parentElement;\n if (parent) {\n const siblings = Array.from(parent.children).filter(\n (c) => c.tagName.toLowerCase() === 'hx-tree-item',\n );\n this._posInSet = siblings.indexOf(this) + 1;\n this._setSize = siblings.length;\n } else {\n this._posInSet = 1;\n this._setSize = 1;\n }\n\n // Determine if the owning tree supports selection.\n const tree = this.closest('hx-tree-view');\n if (tree) {\n const selection = tree.getAttribute('selection');\n this._selectable = selection === 'single' || selection === 'multiple';\n } else {\n this._selectable = false;\n }\n }\n\n /**\n * Set ARIA position metadata from the parent hx-tree-view in a single O(n) pass.\n * Calling this avoids the O(n^2) ancestor-walk + sibling-iteration in _updateAriaMetadata\n * when the parent already knows the layout.\n * @internal\n */\n setAriaMetadata(level: number, posInSet: number, setSize: number, selectable: boolean): void {\n this._level = level;\n this._posInSet = posInSet;\n this._setSize = setSize;\n this._selectable = selectable;\n }\n\n // ─── Lifecycle ───\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Honour the static test override so synthetic environments choose the\n // path BEFORE connect runs — the fallback render branch needs to be\n // selected at first paint so role + roving tabindex placement matches a\n // legacy engine for the entire lifecycle.\n const ctor = this.constructor as typeof HelixTreeItem;\n this._supportsIdrefRefs =\n ctor.__testSupportsIdrefRefsOverride !== null\n ? ctor.__testSupportsIdrefRefsOverride\n : supportsIdrefElementReferences(this._internals);\n this._updateAriaMetadata();\n // Click + keydown live on the HOST so the active surface (the host on\n // the modern path; either the host or the inner div in delegating\n // engines) receives events. Origin guards (`_isOwnEvent`) reject events\n // bubbled from a CHILD `hx-tree-item` slotted into our `children`\n // slot — without that, selecting Child also activates Parent.\n this.addEventListener('click', this._handleClick);\n this.addEventListener('keydown', this._handleKeyDown);\n this._syncHostAriaSemantics();\n this._applyHostTabIndex();\n this._ariaMirror = installAriaIdrefMirror(this, () => {\n this._syncHostAriaSemantics();\n });\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('click', this._handleClick);\n this.removeEventListener('keydown', this._handleKeyDown);\n this._ariaMirror?.disconnect();\n this._ariaMirror = null;\n }\n\n override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (\n changedProperties.has('disabled') ||\n changedProperties.has('selected') ||\n changedProperties.has('expanded') ||\n (changedProperties as Map<PropertyKey, unknown>).has('_hasChildren') ||\n (changedProperties as Map<PropertyKey, unknown>).has('_selectable') ||\n (changedProperties as Map<PropertyKey, unknown>).has('_level') ||\n (changedProperties as Map<PropertyKey, unknown>).has('_posInSet') ||\n (changedProperties as Map<PropertyKey, unknown>).has('_setSize')\n ) {\n this._syncHostAriaSemantics();\n }\n if (\n (changedProperties as Map<PropertyKey, unknown>).has('_rovingActive') ||\n changedProperties.has('disabled')\n ) {\n this._applyHostTabIndex();\n }\n }\n\n /**\n * Apply the roving tabindex through the right surface for the active\n * path. On the modern host-canonical path the host carries the role +\n * tabindex; on the legacy fallback path the inner `.item-row` carries\n * both via the template, so the host MUST stay out of the tab order to\n * avoid a double-focusable per item (mirrors hx-menu-item round-1\n * finding 3).\n * @internal\n */\n private _applyHostTabIndex(): void {\n if (!this._supportsIdrefRefs) {\n // Fallback path: inner `.item-row` is the focusable surface. Keep\n // the host out of the sequential focus order entirely.\n this.tabIndex = -1;\n return;\n }\n if (this.disabled) {\n this.tabIndex = -1;\n } else {\n this.tabIndex = this._rovingActive ? 0 : -1;\n }\n }\n\n /**\n * Mirror treeitem semantics onto the host via ElementInternals so\n * consumer-supplied `aria-label`, `aria-labelledby`, expand/select state,\n * and tree position all reach the announced control.\n *\n * Codex push-gate round-1 lift (mirrors hx-menu-item round-6 finding 2):\n * on the legacy fallback path the inner `.item-row` already exposes\n * role=\"treeitem\" + aria-* via the template. If we ALSO write those onto\n * the host's ElementInternals, AT sees TWO treeitems for one logical\n * option — the duplicate-surface problem host-canonical migration is\n * meant to eliminate. Suppress all of these state writes on the host\n * when the fallback path is in effect; the inner element is the\n * canonical announced surface.\n * @internal\n */\n private _syncHostAriaSemantics(): void {\n const internals = this._internals;\n\n if (!this._supportsIdrefRefs) {\n internals.role = null;\n internals.ariaLabel = null;\n internals.ariaDisabled = null;\n internals.ariaSelected = null;\n internals.ariaExpanded = null;\n internals.ariaLevel = null;\n internals.ariaPosInSet = null;\n internals.ariaSetSize = null;\n } else {\n internals.role = 'treeitem';\n internals.ariaDisabled = this.disabled ? 'true' : null;\n internals.ariaSelected = this._selectable ? (this.selected ? 'true' : 'false') : null;\n internals.ariaExpanded = this._hasChildren ? (this.expanded ? 'true' : 'false') : null;\n internals.ariaLevel = String(this._level);\n internals.ariaPosInSet = String(this._posInSet);\n internals.ariaSetSize = String(this._setSize);\n }\n\n const hostAriaLabel = this.getAttribute('aria-label')?.trim() || '';\n const consumerLabelledBy = this.getAttribute('aria-labelledby');\n const labelEls = resolveIdrefTokens(this, consumerLabelledBy);\n const hasEffectiveLabelledBy = labelEls.length > 0;\n\n type InternalsWithRefs = ElementInternals & {\n ariaLabelledByElements: Element[] | null;\n };\n\n if (this._supportsIdrefRefs) {\n const refsInternals = internals as InternalsWithRefs;\n refsInternals.ariaLabelledByElements = hasEffectiveLabelledBy ? labelEls : null;\n }\n\n // AccName 1.2 §4.3.1 precedence: consumer aria-labelledby (resolved) >\n // consumer aria-label > implicit slotted text (left to AccName\n // computation through the host's role). When neither override is\n // supplied, ariaLabel is cleared so AT walks slotted children for the\n // accessible name.\n let resolved = '';\n if (hasEffectiveLabelledBy) {\n const flattened =\n labelEls\n .map((el) => flattenAccName(el))\n .filter(Boolean)\n .join(' ') ||\n hostAriaLabel ||\n '';\n resolved = flattened;\n if (this._supportsIdrefRefs) {\n // Modern path: element refs win; clear ariaLabel so they aren't\n // shadowed by a stale string.\n internals.ariaLabel = null;\n } else {\n internals.ariaLabel = flattened || null;\n }\n } else if (hostAriaLabel) {\n resolved = hostAriaLabel;\n internals.ariaLabel = hostAriaLabel;\n } else {\n internals.ariaLabel = null;\n }\n\n if (this._resolvedAccessibleName !== resolved) {\n this._resolvedAccessibleName = resolved;\n if (!this._supportsIdrefRefs) {\n this.requestUpdate();\n }\n }\n }\n\n // ─── Children Detection ───\n\n /**\n * Updates _hasChildren and recomputes ARIA metadata when the children slot assignment changes.\n * @internal\n */\n private _handleChildrenSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasChildren = slot.assignedElements().length > 0;\n this._updateAriaMetadata();\n this._syncHostAriaSemantics();\n }\n\n /**\n * Captures the text content from the default (label) slot for use on the children group label.\n * @internal\n */\n private _handleLabelSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n const nodes = slot.assignedNodes({ flatten: true });\n this._labelText = nodes\n .map((n) => n.textContent ?? '')\n .join('')\n .trim();\n }\n\n // ─── Event Handlers ───\n\n /**\n * Origin guard for host-bound click/keydown handlers. Returns `true` only\n * when the event originated on THIS host's surface (its shadow tree or\n * itself) and not on a nested `hx-tree-item` projected into the\n * `children` slot.\n *\n * Codex push-gate round-1 lift (mirrors hx-menu-item round-5 P1):\n * children are slotted descendants in the parent's light DOM. Click/\n * keydown events from a Child item bubble through the parent host's\n * listeners — without this guard, selecting Child also activates\n * Parent (double `hx-tree-item-select`) and Enter/Space on Child\n * re-trigger Parent's handlers.\n *\n * Uses the shared `findClosestTreeItem` walker (composed-tree, crosses\n * shadow + slot boundaries) so the test bed is reused across the\n * tree family. The event is \"ours\" iff the closest `hx-tree-item`\n * ancestor of the original target is `this`.\n * @internal\n */\n private _isOwnEvent(e: Event): boolean {\n const path = e.composedPath();\n for (const node of path) {\n if (!(node instanceof Element)) continue;\n const closest = findClosestTreeItem(node);\n if (closest) {\n return closest === this;\n }\n }\n return false;\n }\n\n /**\n * Toggles the expanded state when the expand/collapse button is clicked, stopping event propagation.\n * @internal\n */\n private _handleExpandClick(e: Event): void {\n e.stopPropagation();\n if (this.disabled) return;\n this.expanded = !this.expanded;\n }\n\n /**\n * Dispatches the hx-tree-item-select event when the item is activated via\n * click or keyboard. The host listens for click; this method is also\n * invoked from the Enter/Space keydown branch.\n * @internal\n */\n private _activate(): void {\n if (this.disabled) return;\n this.dispatchEvent(\n new CustomEvent<HxTreeItemSelectDetail>('hx-tree-item-select', {\n bubbles: true,\n composed: true,\n detail: { item: this },\n }),\n );\n }\n\n /** @internal */\n private _handleClick = (e: MouseEvent): void => {\n // Codex push-gate round-1 lift (mirrors hx-menu-item round-5 P1):\n // clicks on a nested CHILD tree-item bubble through this host. Without\n // an origin guard, both Child and Parent activate.\n if (!this._isOwnEvent(e)) return;\n // CodeRabbit MUST-FIX: a click landing inside our own children\n // container (the `[role=\"group\"]` wrapper around `<slot name=\"children\">`)\n // — i.e. on padding, between child items, on the group itself — also\n // walks back up to THIS host through `_isOwnEvent`. Treat any click\n // sourced from the children group as NOT a row activation.\n const path = e.composedPath();\n for (const node of path) {\n if (!(node instanceof Element)) continue;\n if (node === this) break;\n if (node.getAttribute && node.getAttribute('part') === 'children') return;\n }\n if (this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n this._activate();\n };\n\n /** @internal */\n private _handleKeyDown = (e: KeyboardEvent): void => {\n // Codex push-gate round-1 lift (mirrors hx-menu-item round-5 P1):\n // Enter / Space / ArrowLeft / ArrowRight at a focused CHILD bubble\n // through this host. Without an origin guard, Parent treats them as\n // its own — double activation, wrong-level expand/collapse.\n if (!this._isOwnEvent(e)) return;\n if (this.disabled) return;\n\n switch (e.key) {\n case 'ArrowRight':\n e.preventDefault();\n if (this._hasChildren && !this.expanded) {\n this.expanded = true;\n }\n break;\n case 'ArrowLeft':\n e.preventDefault();\n if (this._hasChildren && this.expanded) {\n this.expanded = false;\n }\n break;\n case 'Enter':\n case ' ':\n e.preventDefault();\n this._activate();\n break;\n case 'ArrowDown':\n case 'ArrowUp':\n case 'Home':\n case 'End':\n // Bubble up to hx-tree-view for navigation\n break;\n }\n };\n\n // ─── Public API ───\n\n /**\n * Sets the roving tabindex state for this item.\n * When `active` is true, the host (modern) or inner row (fallback) gets\n * `tabindex=\"0\"` making it the Tab-reachable surface in the tree. All\n * other items should be set to false. Called by the parent hx-tree-view\n * to manage the roving tabindex pattern.\n */\n setRovingActive(active: boolean): void {\n this._rovingActive = active;\n this._applyHostTabIndex();\n }\n\n /**\n * Focus this item. On the modern host-canonical path, focus lands on the\n * host (which carries the roving tabindex and announced role). On the\n * legacy fallback path, focus delegates to the inner `.item-row` which\n * still carries the role.\n */\n override focus(options?: FocusOptions): void {\n if (this._supportsIdrefRefs) {\n HTMLElement.prototype.focus.call(this, options);\n } else {\n this._itemRowEl?.focus(options);\n }\n }\n\n // ─── Render ───\n\n /**\n * Renders the expand/collapse chevron button, or a placeholder span when the item has no children.\n * @internal\n */\n private _renderExpandIcon() {\n if (!this._hasChildren) {\n return html`<span class=\"expand-placeholder\" aria-hidden=\"true\"></span>`;\n }\n return html`\n <button\n part=\"expand-icon\"\n class=\"expand-btn\"\n tabindex=\"-1\"\n aria-label=\"${this.expanded ? 'Collapse' : 'Expand'}\"\n @click=${this._handleExpandClick}\n >\n <hx-icon\n class=\"expand-glyph\"\n library=\"helix\"\n name=\"chevron-right\"\n aria-hidden=\"true\"\n ></hx-icon>\n </button>\n `;\n }\n\n override render() {\n // The nested children container always carries role=\"group\" — that is\n // a separate sub-surface for the children, not a duplicate of the\n // treeitem role, and is correct on both the modern and fallback paths.\n const childrenGroup = html`\n <div\n part=\"children\"\n class=${classMap({ children: true, 'children--expanded': this.expanded })}\n role=\"group\"\n aria-label=${this._labelText ? `${this._labelText} children` : 'children'}\n aria-hidden=${!this.expanded || nothing}\n >\n <div class=\"children-inner\">\n <slot name=\"children\" @slotchange=${this._handleChildrenSlotChange}></slot>\n </div>\n </div>\n `;\n\n // Modern host-canonical path: role/aria-* and tabindex live on the\n // host via `_internals` and the `_applyHostTabIndex()` helper. The\n // inner `.item-row` is presentational (no role, no aria-*) and carries\n // only the visual treatment + slot composition. Click + keydown\n // handlers stay on the host (see connectedCallback) so keyboard\n // activation works regardless of which surface is focused.\n if (this._supportsIdrefRefs) {\n return html`\n <div part=\"item\" class=\"item\">\n <div part=\"row\" class=\"item-row\">\n ${this._renderExpandIcon()}\n <span class=\"item-icon\">\n <slot name=\"icon\"></slot>\n </span>\n <span part=\"label\" class=\"item-label\">\n <slot @slotchange=${this._handleLabelSlotChange}></slot>\n </span>\n </div>\n ${childrenGroup}\n </div>\n `;\n }\n\n // Legacy fallback: keep role/aria-* on the inner `.item-row` for AT\n // without IDL element-references on ElementInternals. Click + keydown\n // still listen on the host (see connectedCallback) so behaviour is\n // uniform across paths. The inner element MUST mirror the same\n // accessible name resolved by `_syncHostAriaSemantics()`.\n const fallbackAriaLabel = this._resolvedAccessibleName || nothing;\n const ariaExpanded = this._hasChildren ? String(this.expanded) : nothing;\n const ariaSelected = this._selectable ? String(this.selected) : nothing;\n\n return html`\n <div part=\"item\" class=\"item\">\n <div\n part=\"row\"\n class=\"item-row\"\n role=\"treeitem\"\n tabindex=${this._rovingActive ? '0' : '-1'}\n aria-label=${fallbackAriaLabel}\n aria-expanded=${ariaExpanded}\n aria-selected=${ariaSelected}\n aria-disabled=${this.disabled ? 'true' : nothing}\n aria-level=${this._level}\n aria-posinset=${this._posInSet}\n aria-setsize=${this._setSize}\n >\n ${this._renderExpandIcon()}\n <span class=\"item-icon\">\n <slot name=\"icon\"></slot>\n </span>\n <span part=\"label\" class=\"item-label\">\n <slot @slotchange=${this._handleLabelSlotChange}></slot>\n </span>\n </div>\n ${childrenGroup}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-tree-item': HelixTreeItem;\n }\n}\n\n/** Canonical type alias for HelixTreeItem. Use this when typing hx-tree-item element references. */\nexport type HxTreeItem = HelixTreeItem;\n"],"names":["helixTreeViewStyles","css","findClosestTreeView","start","node","parentNode","findClosestTreeItem","HelixTreeView","HelixElement","detail","item","target","container","items","child","activeIndex","index","clamped","_a","wasSelected","i","currentIndex","focused","_b","next","prev","currentItem","parentItem","_c","parentIndex","matchIndex","char","level","selectable","children","c","setSize","ctor","supportsIdrefElementReferences","installAriaIdrefMirror","changedProperties","internals","hostAriaLabel","consumerLabelledBy","labelEls","resolveIdrefTokens","hasEffectiveLabelledBy","refsInternals","resolved","el","flattenAccName","containerTabindex","html","fallbackLabel","nothing","forcedColorsSurface","__decorateClass","property","state","customElement","helixTreeItemStyles","HelixTreeItem","path","parent","siblings","tree","selection","posInSet","flattened","slot","nodes","n","closest","active","options","childrenGroup","classMap","fallbackAriaLabel","ariaExpanded","ariaSelected","query"],"mappings":";;;;;;;AAEO,MAAMA,IAAsBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACiC5B,SAASC,EAAoBC,GAAgC;AAClE,MAAIC,IAAoBD;AACxB,SAAOC,KAAM;AACX,QAAIA,aAAgB,WAAWA,EAAK,QAAQ,YAAA,MAAkB;AAC5D,aAAOA;AAET,QAAIA,aAAgB,WAAWA,EAAK,cAAc;AAChD,MAAAA,IAAOA,EAAK;AACZ;AAAA,IACF;AACA,UAAMC,IAA0BD,EAAK;AACrC,QAAIC,GAAY;AACd,MAAAD,IAAOC;AACP;AAAA,IACF;AACA,QAAID,aAAgB,YAAY;AAC9B,MAAAA,IAAOA,EAAK;AACZ;AAAA,IACF;AACA;AAAA,EACF;AACA,SAAO;AACT;AAkBO,SAASE,EAAoBH,GAAgC;AAClE,MAAIC,IAAoBD;AACxB,SAAOC,KAAM;AACX,QAAIA,aAAgB,WAAWA,EAAK,QAAQ,YAAA,MAAkB;AAC5D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