@helixui/library 3.6.0 → 3.8.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 (280) hide show
  1. package/custom-elements.json +2633 -805
  2. package/dist/components/hx-action-bar/hx-action-bar.d.ts +18 -0
  3. package/dist/components/hx-action-bar/hx-action-bar.d.ts.map +1 -1
  4. package/dist/components/hx-action-bar/hx-action-bar.styles.d.ts.map +1 -1
  5. package/dist/components/hx-action-bar/index.js +1 -1
  6. package/dist/components/hx-alert/hx-alert.d.ts +18 -0
  7. package/dist/components/hx-alert/hx-alert.d.ts.map +1 -1
  8. package/dist/components/hx-badge/index.js +1 -1
  9. package/dist/components/hx-banner/hx-banner.d.ts +19 -0
  10. package/dist/components/hx-banner/hx-banner.d.ts.map +1 -1
  11. package/dist/components/hx-breadcrumb/hx-breadcrumb-item.d.ts.map +1 -1
  12. package/dist/components/hx-breadcrumb/hx-breadcrumb-item.styles.d.ts.map +1 -1
  13. package/dist/components/hx-breadcrumb/hx-breadcrumb.d.ts +18 -0
  14. package/dist/components/hx-breadcrumb/hx-breadcrumb.d.ts.map +1 -1
  15. package/dist/components/hx-breadcrumb/index.js +1 -1
  16. package/dist/components/hx-button/hx-button.d.ts +18 -0
  17. package/dist/components/hx-button/hx-button.d.ts.map +1 -1
  18. package/dist/components/hx-button/hx-button.styles.d.ts.map +1 -1
  19. package/dist/components/hx-button/index.js +1 -1
  20. package/dist/components/hx-button-group/hx-button-group.d.ts +47 -0
  21. package/dist/components/hx-button-group/hx-button-group.d.ts.map +1 -1
  22. package/dist/components/hx-button-group/index.js +1 -1
  23. package/dist/components/hx-checkbox/hx-checkbox.d.ts +18 -0
  24. package/dist/components/hx-checkbox/hx-checkbox.d.ts.map +1 -1
  25. package/dist/components/hx-checkbox/hx-checkbox.styles.d.ts.map +1 -1
  26. package/dist/components/hx-checkbox/index.js +1 -1
  27. package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts +36 -0
  28. package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts.map +1 -1
  29. package/dist/components/hx-checkbox-group/hx-checkbox-group.styles.d.ts.map +1 -1
  30. package/dist/components/hx-checkbox-group/index.js +1 -1
  31. package/dist/components/hx-clinical-status/hx-clinical-status.d.ts +19 -0
  32. package/dist/components/hx-clinical-status/hx-clinical-status.d.ts.map +1 -1
  33. package/dist/components/hx-color-picker/hx-color-picker.d.ts +18 -0
  34. package/dist/components/hx-color-picker/hx-color-picker.d.ts.map +1 -1
  35. package/dist/components/hx-color-picker/hx-color-picker.styles.d.ts.map +1 -1
  36. package/dist/components/hx-color-picker/index.js +1 -1
  37. package/dist/components/hx-combobox/hx-combobox.d.ts +18 -0
  38. package/dist/components/hx-combobox/hx-combobox.d.ts.map +1 -1
  39. package/dist/components/hx-copy-button/hx-copy-button.d.ts +18 -0
  40. package/dist/components/hx-copy-button/hx-copy-button.d.ts.map +1 -1
  41. package/dist/components/hx-copy-button/hx-copy-button.styles.d.ts.map +1 -1
  42. package/dist/components/hx-copy-button/index.js +1 -1
  43. package/dist/components/hx-date-picker/hx-date-picker.d.ts +18 -0
  44. package/dist/components/hx-date-picker/hx-date-picker.d.ts.map +1 -1
  45. package/dist/components/hx-date-picker/hx-date-picker.styles.d.ts.map +1 -1
  46. package/dist/components/hx-date-picker/index.js +1 -1
  47. package/dist/components/hx-dialog/hx-dialog.d.ts +18 -0
  48. package/dist/components/hx-dialog/hx-dialog.d.ts.map +1 -1
  49. package/dist/components/hx-drawer/hx-drawer.d.ts +18 -0
  50. package/dist/components/hx-drawer/hx-drawer.d.ts.map +1 -1
  51. package/dist/components/hx-dropdown/hx-dropdown.d.ts +18 -0
  52. package/dist/components/hx-dropdown/hx-dropdown.d.ts.map +1 -1
  53. package/dist/components/hx-dropdown/hx-dropdown.styles.d.ts.map +1 -1
  54. package/dist/components/hx-dropdown/index.js +1 -1
  55. package/dist/components/hx-field/hx-field.d.ts +17 -0
  56. package/dist/components/hx-field/hx-field.d.ts.map +1 -1
  57. package/dist/components/hx-field-label/hx-field-label.d.ts +17 -0
  58. package/dist/components/hx-field-label/hx-field-label.d.ts.map +1 -1
  59. package/dist/components/hx-file-upload/hx-file-upload.d.ts +18 -0
  60. package/dist/components/hx-file-upload/hx-file-upload.d.ts.map +1 -1
  61. package/dist/components/hx-form/hx-form.d.ts +19 -0
  62. package/dist/components/hx-form/hx-form.d.ts.map +1 -1
  63. package/dist/components/hx-help-text/hx-help-text.d.ts +17 -0
  64. package/dist/components/hx-help-text/hx-help-text.d.ts.map +1 -1
  65. package/dist/components/hx-icon-button/hx-icon-button.d.ts +18 -0
  66. package/dist/components/hx-icon-button/hx-icon-button.d.ts.map +1 -1
  67. package/dist/components/hx-icon-button/hx-icon-button.styles.d.ts.map +1 -1
  68. package/dist/components/hx-icon-button/index.js +1 -1
  69. package/dist/components/hx-menu/hx-menu.d.ts +18 -0
  70. package/dist/components/hx-menu/hx-menu.d.ts.map +1 -1
  71. package/dist/components/hx-nav/hx-nav.d.ts +18 -0
  72. package/dist/components/hx-nav/hx-nav.d.ts.map +1 -1
  73. package/dist/components/hx-nav/hx-nav.styles.d.ts.map +1 -1
  74. package/dist/components/hx-nav/index.js +1 -1
  75. package/dist/components/hx-number-input/hx-number-input.d.ts +18 -0
  76. package/dist/components/hx-number-input/hx-number-input.d.ts.map +1 -1
  77. package/dist/components/hx-number-input/index.js +1 -1
  78. package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts +18 -0
  79. package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts.map +1 -1
  80. package/dist/components/hx-pagination/hx-pagination.styles.d.ts.map +1 -1
  81. package/dist/components/hx-pagination/index.js +1 -1
  82. package/dist/components/hx-popover/hx-popover.d.ts +18 -0
  83. package/dist/components/hx-popover/hx-popover.d.ts.map +1 -1
  84. package/dist/components/hx-popover/hx-popover.styles.d.ts.map +1 -1
  85. package/dist/components/hx-popover/index.js +1 -1
  86. package/dist/components/hx-popup/hx-popup.d.ts +18 -0
  87. package/dist/components/hx-popup/hx-popup.d.ts.map +1 -1
  88. package/dist/components/hx-popup/hx-popup.styles.d.ts.map +1 -1
  89. package/dist/components/hx-popup/index.js +1 -1
  90. package/dist/components/hx-radio-group/hx-radio-group.d.ts +18 -0
  91. package/dist/components/hx-radio-group/hx-radio-group.d.ts.map +1 -1
  92. package/dist/components/hx-radio-group/hx-radio-group.styles.d.ts.map +1 -1
  93. package/dist/components/hx-radio-group/hx-radio.styles.d.ts.map +1 -1
  94. package/dist/components/hx-radio-group/index.js +1 -1
  95. package/dist/components/hx-rating/hx-rating.d.ts +19 -0
  96. package/dist/components/hx-rating/hx-rating.d.ts.map +1 -1
  97. package/dist/components/hx-select/hx-select.d.ts +18 -0
  98. package/dist/components/hx-select/hx-select.d.ts.map +1 -1
  99. package/dist/components/hx-side-nav/hx-side-nav.d.ts +18 -0
  100. package/dist/components/hx-side-nav/hx-side-nav.d.ts.map +1 -1
  101. package/dist/components/hx-side-nav/hx-side-nav.styles.d.ts.map +1 -1
  102. package/dist/components/hx-side-nav/index.js +1 -1
  103. package/dist/components/hx-slider/hx-slider.d.ts +19 -0
  104. package/dist/components/hx-slider/hx-slider.d.ts.map +1 -1
  105. package/dist/components/hx-split-button/hx-split-button.d.ts +18 -0
  106. package/dist/components/hx-split-button/hx-split-button.d.ts.map +1 -1
  107. package/dist/components/hx-split-button/hx-split-button.styles.d.ts.map +1 -1
  108. package/dist/components/hx-split-button/index.js +1 -1
  109. package/dist/components/hx-steps/index.js +1 -1
  110. package/dist/components/hx-switch/hx-switch.d.ts +18 -0
  111. package/dist/components/hx-switch/hx-switch.d.ts.map +1 -1
  112. package/dist/components/hx-switch/hx-switch.styles.d.ts.map +1 -1
  113. package/dist/components/hx-switch/index.js +1 -1
  114. package/dist/components/hx-tabs/hx-tab.styles.d.ts.map +1 -1
  115. package/dist/components/hx-tabs/hx-tabs.d.ts +18 -0
  116. package/dist/components/hx-tabs/hx-tabs.d.ts.map +1 -1
  117. package/dist/components/hx-tabs/index.js +1 -1
  118. package/dist/components/hx-text-input/hx-text-input.d.ts +18 -0
  119. package/dist/components/hx-text-input/hx-text-input.d.ts.map +1 -1
  120. package/dist/components/hx-text-input/hx-text-input.styles.d.ts.map +1 -1
  121. package/dist/components/hx-text-input/index.js +1 -1
  122. package/dist/components/hx-textarea/hx-textarea.d.ts +18 -0
  123. package/dist/components/hx-textarea/hx-textarea.d.ts.map +1 -1
  124. package/dist/components/hx-time-picker/hx-time-picker.d.ts +18 -0
  125. package/dist/components/hx-time-picker/hx-time-picker.d.ts.map +1 -1
  126. package/dist/components/hx-time-picker/hx-time-picker.styles.d.ts.map +1 -1
  127. package/dist/components/hx-time-picker/index.js +1 -1
  128. package/dist/components/hx-toast/hx-toast.d.ts +19 -0
  129. package/dist/components/hx-toast/hx-toast.d.ts.map +1 -1
  130. package/dist/components/hx-toggle-button/hx-toggle-button.d.ts +18 -0
  131. package/dist/components/hx-toggle-button/hx-toggle-button.d.ts.map +1 -1
  132. package/dist/components/hx-toggle-button/hx-toggle-button.styles.d.ts.map +1 -1
  133. package/dist/components/hx-toggle-button/index.js +1 -1
  134. package/dist/components/hx-tooltip/hx-tooltip.d.ts +18 -0
  135. package/dist/components/hx-tooltip/hx-tooltip.d.ts.map +1 -1
  136. package/dist/components/hx-tooltip/hx-tooltip.styles.d.ts.map +1 -1
  137. package/dist/components/hx-tooltip/index.js +1 -1
  138. package/dist/components/hx-top-nav/hx-top-nav.d.ts +18 -0
  139. package/dist/components/hx-top-nav/hx-top-nav.d.ts.map +1 -1
  140. package/dist/components/hx-top-nav/hx-top-nav.styles.d.ts.map +1 -1
  141. package/dist/components/hx-top-nav/index.js +1 -1
  142. package/dist/css/helix-all.css +298 -64
  143. package/dist/css/helix-core.css +24 -15
  144. package/dist/css/helix-forms.css +133 -32
  145. package/dist/css/helix-navigation.css +49 -5
  146. package/dist/css/helix-overlay.css +53 -0
  147. package/dist/css/helix-tokens.css +15 -13
  148. package/dist/css/helix-utility.css +39 -12
  149. package/dist/css/hx-action-bar.css +12 -0
  150. package/dist/css/hx-badge.css +5 -5
  151. package/dist/css/hx-button.css +15 -5
  152. package/dist/css/hx-checkbox-group.css +11 -0
  153. package/dist/css/hx-checkbox.css +20 -4
  154. package/dist/css/hx-color-picker.css +14 -1
  155. package/dist/css/hx-copy-button.css +5 -2
  156. package/dist/css/hx-date-picker.css +11 -3
  157. package/dist/css/hx-dropdown.css +13 -0
  158. package/dist/css/hx-icon-button.css +4 -5
  159. package/dist/css/hx-nav.css +24 -2
  160. package/dist/css/hx-number-input.css +8 -8
  161. package/dist/css/hx-pagination.css +6 -3
  162. package/dist/css/hx-popover.css +13 -0
  163. package/dist/css/hx-popup.css +14 -0
  164. package/dist/css/hx-radio-group.css +10 -0
  165. package/dist/css/hx-side-nav.css +7 -0
  166. package/dist/css/hx-split-button.css +22 -10
  167. package/dist/css/hx-switch.css +19 -1
  168. package/dist/css/hx-text-input.css +4 -1
  169. package/dist/css/hx-time-picker.css +7 -2
  170. package/dist/css/hx-toggle-button.css +29 -12
  171. package/dist/css/hx-tooltip.css +13 -0
  172. package/dist/css/hx-top-nav.css +12 -0
  173. package/dist/css/index.css +1 -1
  174. package/dist/css/manifest.json +57 -20
  175. package/dist/index.js +28 -28
  176. package/dist/shared/{hx-action-bar-CitgcpGv.js → hx-action-bar-BlEG4aZv.js} +41 -29
  177. package/dist/shared/hx-action-bar-BlEG4aZv.js.map +1 -0
  178. package/dist/shared/hx-alert-Bto8-TIi.js.map +1 -1
  179. package/dist/shared/{hx-badge-JlFtAdxS.js → hx-badge-DFL35nzi.js} +16 -16
  180. package/dist/shared/hx-badge-DFL35nzi.js.map +1 -0
  181. package/dist/shared/hx-banner-fpRnciIO.js.map +1 -1
  182. package/dist/shared/{hx-breadcrumb-item-3tKppF9h.js → hx-breadcrumb-item-D8xYqe3s.js} +56 -43
  183. package/dist/shared/hx-breadcrumb-item-D8xYqe3s.js.map +1 -0
  184. package/dist/shared/{hx-button-BOwAEcF1.js → hx-button-DOZTZnz-.js} +29 -19
  185. package/dist/shared/hx-button-DOZTZnz-.js.map +1 -0
  186. package/dist/shared/hx-button-group-D3QUmSzl.js +248 -0
  187. package/dist/shared/hx-button-group-D3QUmSzl.js.map +1 -0
  188. package/dist/shared/{hx-checkbox-CYd0YV_u.js → hx-checkbox-DcgyGS9V.js} +27 -11
  189. package/dist/shared/hx-checkbox-DcgyGS9V.js.map +1 -0
  190. package/dist/shared/{hx-checkbox-group-D5piJLY8.js → hx-checkbox-group-C0q6HDqn.js} +101 -58
  191. package/dist/shared/hx-checkbox-group-C0q6HDqn.js.map +1 -0
  192. package/dist/shared/hx-clinical-status-D3XQIOqX.js.map +1 -1
  193. package/dist/shared/{hx-color-picker-DBwJzT5f.js → hx-color-picker-CYjx8i8R.js} +97 -84
  194. package/dist/shared/hx-color-picker-CYjx8i8R.js.map +1 -0
  195. package/dist/shared/hx-combobox-NgJaLbs2.js.map +1 -1
  196. package/dist/shared/{hx-copy-button-sUVuikyH.js → hx-copy-button-DJirFCUL.js} +18 -15
  197. package/dist/shared/hx-copy-button-DJirFCUL.js.map +1 -0
  198. package/dist/shared/{hx-date-picker-B49yo4Vm.js → hx-date-picker-0PtEav0K.js} +71 -63
  199. package/dist/shared/hx-date-picker-0PtEav0K.js.map +1 -0
  200. package/dist/shared/hx-dialog-B4weoj_1.js.map +1 -1
  201. package/dist/shared/hx-drawer-CM_upadk.js.map +1 -1
  202. package/dist/shared/{hx-dropdown-D626S2ZG.js → hx-dropdown-xHwTJecv.js} +44 -31
  203. package/dist/shared/hx-dropdown-xHwTJecv.js.map +1 -0
  204. package/dist/shared/hx-field-label-BVRyyKeh.js.map +1 -1
  205. package/dist/shared/hx-field-zw0U1KVi.js.map +1 -1
  206. package/dist/shared/hx-file-upload-D3rKROK5.js.map +1 -1
  207. package/dist/shared/hx-form-CkChEATa.js.map +1 -1
  208. package/dist/shared/hx-help-text-Xb2Yr8x2.js.map +1 -1
  209. package/dist/shared/{hx-icon-button-a6OpeQz5.js → hx-icon-button-B2BdVdyK.js} +10 -11
  210. package/dist/shared/hx-icon-button-B2BdVdyK.js.map +1 -0
  211. package/dist/shared/hx-menu-divider-A6Guuzi_.js.map +1 -1
  212. package/dist/shared/{hx-nav-ldFM3Fle.js → hx-nav-ChMTfn7o.js} +66 -44
  213. package/dist/shared/hx-nav-ChMTfn7o.js.map +1 -0
  214. package/dist/shared/{hx-nav-item-CODtUlew.js → hx-nav-item-ClN17f1y.js} +62 -55
  215. package/dist/shared/hx-nav-item-ClN17f1y.js.map +1 -0
  216. package/dist/shared/{hx-number-input-yUzFOSC1.js → hx-number-input-MggsT7F0.js} +13 -13
  217. package/dist/shared/hx-number-input-MggsT7F0.js.map +1 -0
  218. package/dist/shared/hx-overflow-menu-DFjJAziP.js.map +1 -1
  219. package/dist/shared/{hx-pagination-C7y8GVyU.js → hx-pagination-D726PyTM.js} +7 -4
  220. package/dist/shared/hx-pagination-D726PyTM.js.map +1 -0
  221. package/dist/shared/{hx-popover-BAlAFOH9.js → hx-popover-BjB0nkcq.js} +51 -38
  222. package/dist/shared/hx-popover-BjB0nkcq.js.map +1 -0
  223. package/dist/shared/{hx-popup-COUXXZ9X.js → hx-popup-BiV_2evC.js} +59 -45
  224. package/dist/shared/hx-popup-BiV_2evC.js.map +1 -0
  225. package/dist/shared/{hx-radio-C7eTj5YI.js → hx-radio-BY4zpwdh.js} +81 -63
  226. package/dist/shared/hx-radio-BY4zpwdh.js.map +1 -0
  227. package/dist/shared/hx-rating-C3QP53k9.js.map +1 -1
  228. package/dist/shared/hx-select-DahFehiZ.js.map +1 -1
  229. package/dist/shared/hx-slider-Blmv_rwS.js.map +1 -1
  230. package/dist/shared/{hx-split-button-Ddle8iVx.js → hx-split-button-CdNz1XAu.js} +62 -50
  231. package/dist/shared/hx-split-button-CdNz1XAu.js.map +1 -0
  232. package/dist/shared/{hx-step-R2rjp1fT.js → hx-step-CUzliIK_.js} +3 -3
  233. package/dist/shared/hx-step-CUzliIK_.js.map +1 -0
  234. package/dist/shared/{hx-switch-TvKGvZJz.js → hx-switch-BCXuNxEH.js} +42 -24
  235. package/dist/shared/hx-switch-BCXuNxEH.js.map +1 -0
  236. package/dist/shared/{hx-tab-panel-DzsX8BHV.js → hx-tab-panel-BfisavKo.js} +47 -32
  237. package/dist/shared/hx-tab-panel-BfisavKo.js.map +1 -0
  238. package/dist/shared/{hx-text-input-D6FlOZM-.js → hx-text-input-V5sQOpDh.js} +5 -2
  239. package/dist/shared/hx-text-input-V5sQOpDh.js.map +1 -0
  240. package/dist/shared/hx-textarea-CNG590KY.js.map +1 -1
  241. package/dist/shared/{hx-time-picker-Bo7FWzmf.js → hx-time-picker-DfJkBwcX.js} +41 -36
  242. package/dist/shared/hx-time-picker-DfJkBwcX.js.map +1 -0
  243. package/dist/shared/{hx-toggle-button-DwBers3A.js → hx-toggle-button-xNVYeA3X.js} +64 -47
  244. package/dist/shared/hx-toggle-button-xNVYeA3X.js.map +1 -0
  245. package/dist/shared/{hx-tooltip-DVqtKPCD.js → hx-tooltip-CamO-9nd.js} +24 -11
  246. package/dist/shared/hx-tooltip-CamO-9nd.js.map +1 -0
  247. package/dist/shared/{hx-top-nav-DP6OFS8C.js → hx-top-nav-CsTxOtVI.js} +26 -14
  248. package/dist/shared/hx-top-nav-CsTxOtVI.js.map +1 -0
  249. package/dist/shared/toast-factory-Dht3pVsw.js.map +1 -1
  250. package/figma-inventory.json +1258 -386
  251. package/package.json +2 -2
  252. package/dist/shared/hx-action-bar-CitgcpGv.js.map +0 -1
  253. package/dist/shared/hx-badge-JlFtAdxS.js.map +0 -1
  254. package/dist/shared/hx-breadcrumb-item-3tKppF9h.js.map +0 -1
  255. package/dist/shared/hx-button-BOwAEcF1.js.map +0 -1
  256. package/dist/shared/hx-button-group-4NUBpkyC.js +0 -181
  257. package/dist/shared/hx-button-group-4NUBpkyC.js.map +0 -1
  258. package/dist/shared/hx-checkbox-CYd0YV_u.js.map +0 -1
  259. package/dist/shared/hx-checkbox-group-D5piJLY8.js.map +0 -1
  260. package/dist/shared/hx-color-picker-DBwJzT5f.js.map +0 -1
  261. package/dist/shared/hx-copy-button-sUVuikyH.js.map +0 -1
  262. package/dist/shared/hx-date-picker-B49yo4Vm.js.map +0 -1
  263. package/dist/shared/hx-dropdown-D626S2ZG.js.map +0 -1
  264. package/dist/shared/hx-icon-button-a6OpeQz5.js.map +0 -1
  265. package/dist/shared/hx-nav-item-CODtUlew.js.map +0 -1
  266. package/dist/shared/hx-nav-ldFM3Fle.js.map +0 -1
  267. package/dist/shared/hx-number-input-yUzFOSC1.js.map +0 -1
  268. package/dist/shared/hx-pagination-C7y8GVyU.js.map +0 -1
  269. package/dist/shared/hx-popover-BAlAFOH9.js.map +0 -1
  270. package/dist/shared/hx-popup-COUXXZ9X.js.map +0 -1
  271. package/dist/shared/hx-radio-C7eTj5YI.js.map +0 -1
  272. package/dist/shared/hx-split-button-Ddle8iVx.js.map +0 -1
  273. package/dist/shared/hx-step-R2rjp1fT.js.map +0 -1
  274. package/dist/shared/hx-switch-TvKGvZJz.js.map +0 -1
  275. package/dist/shared/hx-tab-panel-DzsX8BHV.js.map +0 -1
  276. package/dist/shared/hx-text-input-D6FlOZM-.js.map +0 -1
  277. package/dist/shared/hx-time-picker-Bo7FWzmf.js.map +0 -1
  278. package/dist/shared/hx-toggle-button-DwBers3A.js.map +0 -1
  279. package/dist/shared/hx-tooltip-DVqtKPCD.js.map +0 -1
  280. package/dist/shared/hx-top-nav-DP6OFS8C.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"hx-radio-C7eTj5YI.js","sources":["../../src/components/hx-radio-group/hx-radio-group.styles.ts","../../src/components/hx-radio-group/hx-radio-group.ts","../../src/components/hx-radio-group/hx-radio.styles.ts","../../src/components/hx-radio-group/hx-radio.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixRadioGroupStyles = css`\n :host {\n display: block;\n }\n\n :host([disabled]) {\n opacity: var(--hx-opacity-disabled, 0.5);\n pointer-events: none;\n }\n\n * {\n box-sizing: border-box;\n }\n\n /* ─── Fieldset ─── */\n\n .fieldset {\n border: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: var(--hx-space-2, 0.5rem);\n font-family: var(--hx-radio-group-font-family, var(--hx-font-family-sans, sans-serif));\n }\n\n /* ─── Legend ─── */\n\n .fieldset__legend {\n display: flex;\n align-items: baseline;\n gap: var(--hx-space-1, 0.25rem);\n font-size: var(--hx-font-size-sm, 0.875rem);\n font-weight: var(--hx-font-weight-medium, 500);\n color: var(--hx-radio-group-label-color, var(--hx-color-text-strong, #202b39));\n line-height: var(--hx-line-height-normal, 1.5);\n padding: 0;\n margin-bottom: var(--hx-space-1, 0.25rem);\n }\n\n .fieldset__required-marker {\n color: var(--hx-radio-group-error-color, var(--hx-color-error-text, #c92a2a));\n font-weight: var(--hx-font-weight-bold, 700);\n }\n\n /* ─── Group Container ─── */\n\n .fieldset__group {\n display: flex;\n flex-direction: column;\n gap: var(--hx-radio-group-gap, var(--hx-space-3, 0.75rem));\n }\n\n :host([orientation='horizontal']) .fieldset__group {\n flex-direction: row;\n flex-wrap: wrap;\n }\n\n /* ─── Error State ─── */\n\n .fieldset--error .fieldset__legend {\n color: var(--hx-radio-group-error-color, var(--hx-color-error-text, #c92a2a));\n }\n\n /* ─── Help Text & Error Messages ─── */\n\n .fieldset__help-text {\n font-size: var(--hx-font-size-xs, 0.75rem);\n color: var(--hx-radio-group-help-text-color, var(--hx-color-text-muted, #66787b));\n line-height: var(--hx-line-height-normal, 1.5);\n }\n\n .fieldset__error {\n font-size: var(--hx-font-size-xs, 0.75rem);\n color: var(--hx-radio-group-error-color, var(--hx-color-error-text, #c92a2a));\n line-height: var(--hx-line-height-normal, 1.5);\n }\n\n /* ─── High Contrast Mode (forced-colors) ─── */\n\n @media (forced-colors: active) {\n .fieldset {\n border: none;\n }\n\n .fieldset__legend {\n color: CanvasText;\n }\n\n .fieldset--error .fieldset__legend {\n color: LinkText;\n }\n\n :host([disabled]) {\n opacity: 1;\n }\n\n :host([disabled]) .fieldset__legend {\n color: GrayText;\n }\n\n .fieldset__help-text {\n color: GrayText;\n }\n\n .fieldset__error {\n color: LinkText;\n }\n }\n`;\n","import { html, nothing, type PropertyValues } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { devWarn } from '../../utils/dev-warn.js';\nimport { HelixElement, createIdCounter } from '../../base/index.js';\nimport { FormMixin } from '../../mixins/FormMixin.js';\nimport { helixRadioGroupStyles } from './hx-radio-group.styles.js';\nimport { forcedColorsField } from '../../styles/forced-colors.js';\nimport type { HelixRadio } from './hx-radio.js';\nimport {\n installAriaIdrefMirror,\n resolveIdrefTokens,\n supportsIdrefElementReferences,\n type AriaIdrefMirrorHandle,\n} from '../../utils/aria-idref.js';\n\nconst _nextRadioGroupId = createIdCounter('hx-radio-group');\n\n/**\n * Reads visible text from a shadow wrapper that contains a `<slot>`. Prefers\n * the slot's flattened assigned-nodes text when light DOM is projected,\n * otherwise falls back to the wrapper's own `textContent` (so property-driven\n * fallback content rendered inside the slot is still readable). Codex\n * round-23 P2 (Finding C): a wrapper-element `textContent` read does NOT\n * cross the shadow → light-DOM slot boundary, so the previous direct\n * `textContent` mirror returned empty when a consumer slotted help/error\n * content instead of using the property.\n */\nfunction readSlottedOrShadowText(wrapper: Element): string {\n const slot = wrapper.querySelector('slot');\n if (slot) {\n const assigned = (slot as HTMLSlotElement).assignedNodes({ flatten: true });\n if (assigned.length > 0) {\n return assigned\n .map((node) => node.textContent ?? '')\n .join('')\n .trim();\n }\n }\n return (wrapper.textContent ?? '').trim();\n}\n\n/** Detail for the hx-change event dispatched by hx-radio-group. */\nexport interface HxRadioGroupChangeDetail {\n value: string;\n checked: boolean;\n}\n\n/**\n * A form-associated radio group that manages a set of `<hx-radio>` children.\n *\n * @summary Form-associated radio group with label, validation, help text, and keyboard navigation.\n *\n * @tag hx-radio-group\n *\n * @slot - `<hx-radio>` elements.\n * @slot error - Custom error content (overrides the error property).\n * @slot help-text - Custom help text content (overrides the helpText property).\n *\n * @fires {CustomEvent<{value: string, checked: boolean}>} hx-change - Dispatched when the selected radio changes.\n * @fires {CustomEvent<{value: string}>} hx-radio-select - Internal event dispatched by `hx-radio` when selected; consumed by the group.\n *\n * @csspart fieldset - The fieldset wrapper.\n * @csspart legend - The legend/label.\n * @csspart group - The container for radio items.\n * @csspart error - The error message.\n * @csspart help-text - The help text.\n *\n * @cssprop [--hx-radio-group-gap=var(--hx-space-3, 0.75rem)] - Gap between radio items.\n * @cssprop [--hx-radio-group-label-color=var(--hx-color-neutral-700, #313E4B)] - Label text color.\n * @cssprop [--hx-radio-group-error-color=var(--hx-color-error-500, #E5493E)] - Error message color.\n * @cssprop [--hx-radio-group-help-text-color=var(--hx-color-neutral-500, #66787B)] - Help text color.\n * @cssprop [--hx-opacity-disabled] - Opacity.\n * @cssprop [--hx-space-2] - Spacing token.\n * @cssprop [--hx-radio-group-font-family=var(--hx-font-family-sans)] - CSS custom property.\n * @cssprop [--hx-font-family-sans] - Font family.\n * @cssprop [--hx-space-1] - Spacing token.\n * @cssprop [--hx-font-size-sm] - Font size.\n * @cssprop [--hx-font-weight-medium] - Font weight.\n * @cssprop [--hx-color-neutral-700] - Color.\n * @cssprop [--hx-line-height-normal] - Line height.\n * @cssprop [--hx-color-error-text] - Color.\n * @cssprop [--hx-font-weight-bold] - Font weight.\n * @cssprop [--hx-space-3] - Spacing token.\n * @cssprop [--hx-font-size-xs] - Font size.\n * @cssprop [--hx-color-neutral-500] - Color.\n */\n@customElement('hx-radio-group')\nexport class HelixRadioGroup extends FormMixin(HelixElement) {\n static override styles = [helixRadioGroupStyles, forcedColorsField];\n\n // ─── Form Association ───\n\n /**\n * Enables ElementInternals form association for this component.\n * @internal\n */\n static override formAssociated = true;\n\n // ─── Properties ───\n\n /**\n * The selected radio's value.\n * @attr value\n */\n @property({ type: String, reflect: true })\n value = '';\n\n /**\n * The name used for form submission.\n * @attr name\n */\n @property({ type: String, reflect: true })\n name = '';\n\n /**\n * The fieldset legend/label text.\n * @attr label\n */\n @property({ type: String })\n label = '';\n\n /**\n * Whether a selection is required for form submission.\n * @attr required\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Whether the entire group is disabled.\n * @attr disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Error message to display. When set, the group enters an error state.\n * @attr error\n */\n @property({ type: String })\n error = '';\n\n /**\n * Help text displayed below the group for guidance.\n * @attr help-text\n */\n @property({ type: String, attribute: 'help-text' })\n helpText = '';\n\n /**\n * Layout orientation of the radio items.\n * @attr orientation\n */\n @property({ type: String, reflect: true })\n orientation: 'vertical' | 'horizontal' = 'vertical';\n\n /**\n * Queries the rendered group container element within the shadow root.\n * @internal\n */\n private get _groupEl(): HTMLElement | null {\n return this.renderRoot?.querySelector('.fieldset__group') ?? null;\n }\n\n /**\n * Tracks whether the error slot has assigned content.\n * @internal\n */\n @state() private _hasErrorSlot = false;\n\n /**\n * Tracks whether the help-text slot has assigned content.\n * @internal\n */\n @state() private _hasHelpSlot = false;\n\n /**\n * Whether the platform supports IDL element references on `ElementInternals`.\n * Drives the render-time branch between modern (host-canonical via\n * internals) and fallback (inner fieldset is the announced surface).\n * Codex round-17 P1.\n * @internal\n */\n @state() private _supportsIdrefRefs = true;\n\n // ─── Internal IDs ───\n\n /**\n * Unique identifier for this radio group instance used in ARIA attributes.\n * @internal\n */\n private _groupId = _nextRadioGroupId();\n /**\n * Unique identifier for the help text element, used in aria-describedby.\n * @internal\n */\n private _helpTextId = `${this._groupId}-help`;\n /**\n * Unique identifier for the error element, used in aria-describedby.\n * @internal\n */\n private _errorId = `${this._groupId}-error`;\n\n // ─── Slot Handlers ───\n\n /**\n * Handles slotchange events on the error slot to detect assigned content.\n * @internal\n */\n private _handleErrorSlotChange(e: Event): void {\n if (!(e.target instanceof HTMLSlotElement)) return;\n this._hasErrorSlot = e.target.assignedNodes({ flatten: true }).length > 0;\n // Codex round-23 P2 (Finding C): re-tune the in-place text observer over\n // the new assigned-node set so in-place `textContent` rewrites of slotted\n // error nodes resync `internals.ariaDescription` on the no-IDL-ref\n // fallback path. `slotchange` only fires when the *node set* changes;\n // mutating an already-assigned node's text does not, so a separate\n // observer is required. Mirrors the round-21 P3 label-slot observer in\n // hx-checkbox-group.\n this._installErrorSlotTextObserver(e.target);\n this._syncHostAriaSemantics();\n }\n\n /**\n * Handles slotchange events on the help-text slot to detect assigned content.\n * Codex aria-group-2 finding: slot-only help text was not contributing to\n * `aria-describedby` because the wrapper was conditionally rendered on the\n * `helpText` property alone.\n * @internal\n */\n private _handleHelpSlotChange(e: Event): void {\n if (!(e.target instanceof HTMLSlotElement)) return;\n this._hasHelpSlot = e.target.assignedNodes({ flatten: true }).length > 0;\n // Codex round-23 P2 (Finding C): same pattern as the error slot — keep\n // `internals.ariaDescription` in sync with in-place text edits on already\n // assigned help-text nodes.\n this._installHelpSlotTextObserver(e.target);\n this._syncHostAriaSemantics();\n }\n\n /**\n * Watches assigned `<slot name=\"help-text\">` nodes for in-place text\n * mutations so the no-IDL-ref fallback `internals.ariaDescription` stays in\n * sync when a framework rewrites `textContent` of an already-assigned node\n * without replacing it. `slotchange` does NOT fire for those mutations, so\n * a separate observer is required. Codex round-23 P2 (Finding C).\n * @internal\n */\n private _helpSlotTextObserver: MutationObserver | null = null;\n\n /**\n * Watches assigned `<slot name=\"error\">` nodes for in-place text mutations\n * so the no-IDL-ref fallback `internals.ariaDescription` stays in sync when\n * a framework rewrites `textContent` of an already-assigned node without\n * replacing it. Codex round-23 P2 (Finding C).\n * @internal\n */\n private _errorSlotTextObserver: MutationObserver | null = null;\n\n /**\n * (Re-)installs the mutation observer over the current set of assigned\n * help-text-slot nodes. Codex round-23 P2 (Finding C).\n * @internal\n */\n private _installHelpSlotTextObserver(slot: HTMLSlotElement | null): void {\n this._helpSlotTextObserver?.disconnect();\n if (!slot) {\n this._helpSlotTextObserver = null;\n return;\n }\n const observer = new MutationObserver(() => {\n this._syncHostAriaSemantics();\n });\n slot.assignedNodes().forEach((node) => {\n observer.observe(node, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n });\n this._helpSlotTextObserver = observer;\n }\n\n /**\n * (Re-)installs the mutation observer over the current set of assigned\n * error-slot nodes. Codex round-23 P2 (Finding C).\n * @internal\n */\n private _installErrorSlotTextObserver(slot: HTMLSlotElement | null): void {\n this._errorSlotTextObserver?.disconnect();\n if (!slot) {\n this._errorSlotTextObserver = null;\n return;\n }\n const observer = new MutationObserver(() => {\n this._syncHostAriaSemantics();\n });\n slot.assignedNodes().forEach((node) => {\n observer.observe(node, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n });\n this._errorSlotTextObserver = observer;\n }\n\n /**\n * Handle for the shared IDREF observer. See `installAriaIdrefMirror()`.\n * @internal\n */\n private _ariaMirror: AriaIdrefMirrorHandle | null = null;\n\n /**\n * Deferred copy of `error` driven through reactive state so the persistent\n * live region can re-announce on transitions without direct DOM mutation.\n * Codex round-1 finding #10.\n * @internal\n */\n @state() private _announcedError = '';\n\n /**\n * Tracks group-suppressed child radios so detached children can have the\n * flag cleared. Defense-in-depth symmetry with `hx-checkbox-group` —\n * `hx-radio` is not form-associated today, so the flag is inert, but the\n * parity keeps the contract identical between the two group/child families\n * for any future form-association on `hx-radio`. Codex round-3 finding #1.\n * @internal\n */\n private _suppressedChildren = new WeakSet<HelixRadio>();\n\n /**\n * Snapshot of children captured before each `slotchange` so removed\n * children can be released from suppression (WeakSet is non-enumerable).\n * @internal\n */\n private _previousRadios: HelixRadio[] = [];\n\n /**\n * Last value of `aria-labelledby` we wrote to the host. Used to distinguish\n * external (consumer) attribute mutations from our own internal augmentation\n * writes when refreshing the host-attribute fallback. Codex round-10 P2:\n * without this guard, an internal mutation observer fire would re-read the\n * already-augmented host attribute as if it were consumer-supplied, causing\n * legend/help/error ids to leak forward as \"consumer tokens\" forever.\n * @internal\n */\n private _lastWrittenLabelledBy: string | null = null;\n /** @internal — see `_lastWrittenLabelledBy`. */\n private _lastWrittenDescribedBy: string | null = null;\n /**\n * Most recently observed *consumer-supplied* `aria-labelledby` baseline (the\n * set of tokens the consumer themselves wrote on the host). Refreshed only\n * when the host attribute changes via an external write — internal writes\n * leave the baseline untouched.\n * @internal\n */\n private _consumerLabelledBy: string | null = null;\n /** @internal — see `_consumerLabelledBy`. */\n private _consumerDescribedBy: string | null = null;\n\n // ─── Lifecycle ───\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Codex round-17 P1: detect IDL element-references API support so\n // render() can branch the fieldset between presentational (modern) and\n // group-with-aria (fallback) treatments.\n this._supportsIdrefRefs = supportsIdrefElementReferences(this._internals);\n this.addEventListener('hx-radio-select', this._handleRadioSelect);\n this.addEventListener('keydown', this._handleKeydown);\n // Seed root-independent semantics from connect so the host announces the\n // radiogroup role before first paint.\n this._syncHostAriaSemantics();\n this._ariaMirror = installAriaIdrefMirror(this, () => {\n this._syncHostAriaSemantics();\n });\n // Codex round-10 P2 (parity with hx-checkbox-group): re-apply child\n // suppression on reattach so a detached-then-reinserted group with the\n // same `<hx-radio>` children still claims them. `_groupedSuppress` is\n // currently inert on `hx-radio`, but the lifecycle parity keeps the\n // contract identical for any future form-association on the radio child.\n const existing = this._getRadios();\n if (existing.length > 0) {\n existing.forEach((radio) => {\n radio._groupedSuppress = true;\n this._suppressedChildren.add(radio);\n });\n this._previousRadios = existing;\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('hx-radio-select', this._handleRadioSelect);\n this.removeEventListener('keydown', this._handleKeydown);\n this._ariaMirror?.disconnect();\n this._ariaMirror = null;\n // Codex round-7 finding #6: tear down the per-child disabled observer so\n // detached radios don't keep a strong reference back into a group whose\n // host is being torn down.\n this._childDisabledObserver?.disconnect();\n this._childDisabledObserver = null;\n // Codex round-23 P2 (Finding C): tear down the help/error slot text\n // observers so detached assigned nodes stop firing into a torn-down host.\n this._helpSlotTextObserver?.disconnect();\n this._helpSlotTextObserver = null;\n this._errorSlotTextObserver?.disconnect();\n this._errorSlotTextObserver = null;\n // Release suppression on every previously-tracked child so they regain\n // stand-alone behaviour if re-parented or kept in the document after the\n // group is removed. Codex round-3 finding #1 (defense-in-depth).\n this._previousRadios.forEach((radio) => {\n if (this._suppressedChildren.has(radio)) {\n radio._groupedSuppress = false;\n this._suppressedChildren.delete(radio);\n }\n });\n this._previousRadios = [];\n }\n\n override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (changedProperties.has('value')) {\n this._internals.setFormValue(this.value || null);\n this._syncRadios();\n }\n if (changedProperties.has('disabled')) {\n this._syncRadios();\n }\n // Host-elevated ARIA semantics — see _syncHostAriaSemantics.\n this._syncHostAriaSemantics();\n // Codex round-1 finding #10: drive re-announcement from reactive state\n // so the persistent live region stays in the shadow tree across error\n // transitions. Direct `textContent` mutation would delete the slot\n // subtree the renderer just produced.\n if (changedProperties.has('error')) {\n const previousError = changedProperties.get('error') as string;\n if (previousError && this.error) {\n // Error→error: clear then re-set after rAF so AT re-announces.\n this._announcedError = '';\n requestAnimationFrame(() => {\n this._announcedError = this.error;\n });\n } else {\n this._announcedError = this.error;\n }\n }\n }\n\n /**\n * Mirrors radiogroup semantics onto the host via ElementInternals so that\n * consumer-supplied `aria-label`, `aria-labelledby`, and `aria-describedby`\n * on `<hx-radio-group>` reach the announced control. The codex aria-group-2\n * finding identified that the inner `<fieldset>` was the announced node and\n * the host's external IDREF tokens could not cross the shadow boundary.\n * @internal\n */\n private _syncHostAriaSemantics(): void {\n const internals = this._internals;\n internals.role = 'radiogroup';\n internals.ariaRequired = this.required ? 'true' : 'false';\n internals.ariaInvalid = !internals.validity.valid ? 'true' : 'false';\n internals.ariaDisabled = this.disabled ? 'true' : 'false';\n internals.ariaOrientation = this.orientation === 'horizontal' ? 'horizontal' : 'vertical';\n\n const hostAriaLabel = this.getAttribute('aria-label')?.trim() || '';\n\n // Resolve the candidate label/desc element references once — the IDL-ref\n // path consumes them as `Element[]`, the fallback path mirrors their `id`\n // tokens onto the host's `aria-labelledby` / `aria-describedby` attributes\n // so that AT can still locate the shadow help/error wrappers via the\n // stable shadow-internal ids.\n const internalLegend = this.shadowRoot?.getElementById(`${this._groupId}-legend`);\n const helpEl = this.shadowRoot?.getElementById(this._helpTextId);\n const errorEl = this.shadowRoot?.getElementById(this._errorId);\n\n // Codex round-10 P2: refresh the consumer baseline only when the host\n // attribute moved due to an *external* write. Compare the live attribute\n // against our last-written snapshot — if it differs, the consumer wrote.\n // This prevents internally-augmented values (containing legend/help/error\n // ids we appended) from being re-read as if they were consumer tokens.\n const liveLabelledBy = this.getAttribute('aria-labelledby');\n if (liveLabelledBy !== this._lastWrittenLabelledBy) {\n this._consumerLabelledBy = liveLabelledBy;\n }\n const liveDescribedBy = this.getAttribute('aria-describedby');\n if (liveDescribedBy !== this._lastWrittenDescribedBy) {\n this._consumerDescribedBy = liveDescribedBy;\n }\n const externalLabelTokens = this._consumerLabelledBy;\n const externalDescTokens = this._consumerDescribedBy;\n\n const labelEls = resolveIdrefTokens(this, externalLabelTokens);\n // Codex round-35 finding (CR major + codex follow-up): `aria-labelledby`\n // is only \"effective\" when at least one IDREF resolves. A typo or\n // transiently-missing target must NOT erase the visible label — fall back\n // to `label` so the radiogroup keeps a name on both paths.\n const hasEffectiveLabelledBy = labelEls.length > 0;\n if (hostAriaLabel) {\n internals.ariaLabel = hostAriaLabel;\n } else if (!hasEffectiveLabelledBy) {\n internals.ariaLabel = this.label || null;\n } else {\n internals.ariaLabel = null;\n }\n if (labelEls.length === 0 && !hostAriaLabel && this.label && internalLegend) {\n labelEls.push(internalLegend);\n }\n\n const descEls = resolveIdrefTokens(this, externalDescTokens);\n const hasError = !!(this.error || this._hasErrorSlot);\n // Codex round-16 P2: drop help text from the describedby chain while an\n // error is active. The render path hides the help wrapper in that state\n // (`?hidden=${!hasHelp || hasError}`); appending the hidden node to host\n // semantics would have AT announce stale guidance ahead of the\n // validation error. Mirrors hx-checkbox-group, hx-switch, hx-checkbox.\n if (helpEl && !hasError && (this.helpText || this._hasHelpSlot)) {\n descEls.push(helpEl);\n }\n if (errorEl && hasError) {\n descEls.push(errorEl);\n }\n\n // Branch off the cached `_supportsIdrefRefs` (seeded at connect by the\n // platform probe) so tests can force the fallback branch by flipping the\n // flag. TODO(codex round-19 follow-up): re-probe on `adoptedCallback` if\n // we ever support cross-document moves; today the cached value is set\n // once at connect.\n if (this._supportsIdrefRefs) {\n type InternalsWithRefs = ElementInternals & {\n ariaLabelledByElements: Element[] | null;\n ariaDescribedByElements: Element[] | null;\n };\n const refsInternals = internals as InternalsWithRefs;\n refsInternals.ariaLabelledByElements = labelEls.length > 0 ? labelEls : null;\n refsInternals.ariaDescribedByElements = descEls.length > 0 ? descEls : null;\n // Clear any stale fallback `ariaDescription` string in case a prior sync\n // ran on the fallback path (e.g. tests flipping `_supportsIdrefRefs`).\n // The modern path uses element references exclusively; coexisting strings\n // would cause AT to announce the description twice.\n internals.ariaDescription = null;\n } else {\n // ─── No-IDL-ref fallback (codex round-19 P1) ───\n // The IDL element-references API is unavailable, so internal shadow\n // help/error/legend wrappers cannot be projected onto the host\n // accessibility node via `internals.aria*Elements`.\n //\n // Codex round-19 P1: keep the host as the canonical accessible-container\n // surface on BOTH modern and fallback paths. Earlier rounds promoted the\n // inner fieldset to `role=\"group\"` here and tried to splice consumer\n // light-DOM ids together with shadow-internal ids on the fieldset's\n // `aria-labelledby` / `aria-describedby`. That created two nested\n // accessible containers (host radiogroup → inner group → controls) AND\n // the spliced shadow IDREFs could never resolve to consumer light-DOM\n // targets, so the inner fieldset's \"external label\" was silently broken.\n //\n // The correct trade-off on legacy engines (notably Firefox today): the\n // host owns the role + ARIA strings (via `internals.role`,\n // `internals.ariaLabel`, and the host attribute mirror below); we accept\n // a documented loss of *internal* legend/help/error references and rely\n // on consumer-supplied light-DOM tokens, which resolve correctly in the\n // host's containing root. The inner fieldset stays presentational on\n // both paths so AT announces a single accessible container.\n const consumerLabelIds = new Set((externalLabelTokens?.split(/\\s+/) ?? []).filter(Boolean));\n const consumerDescIds = new Set((externalDescTokens?.split(/\\s+/) ?? []).filter(Boolean));\n\n // Host attributes: ONLY consumer tokens (never shadow-internal ids —\n // those cannot resolve across the shadow boundary).\n //\n // Codex round-35 (medium): mirror consumer tokens to the host attribute\n // ONLY when at least one token resolves to a real element. A broken\n // `aria-labelledby` (typo, target not yet attached) would otherwise\n // erase the accessible name on legacy engines per ARIA priority\n // (aria-labelledby > aria-label > internals.ariaLabel). When tokens\n // don't resolve, clear the host attribute so the `internals.ariaLabel`\n // fallback the modern path set above (`this.label`) wins.\n const hostLabel = hasEffectiveLabelledBy\n ? [...consumerLabelIds].filter(Boolean).join(' ')\n : '';\n const liveLabel = this.getAttribute('aria-labelledby');\n if (hostLabel) {\n if (liveLabel !== hostLabel) {\n this.setAttribute('aria-labelledby', hostLabel);\n }\n this._lastWrittenLabelledBy = hostLabel;\n } else if (liveLabel !== null) {\n // Codex round-36 (medium): when consumer-supplied tokens don't\n // resolve (`!hasEffectiveLabelledBy`), actively clear the host\n // attribute even if WE didn't write it. Per ARIA priority\n // (aria-labelledby > aria-label > internals.ariaLabel), a broken\n // consumer-authored attribute on the announced surface erases the\n // legend on legacy engines. The original tokens remain cached in\n // `_consumerLabelledBy` so they replay on a future sync if the\n // target later attaches and `hasEffectiveLabelledBy` flips back to\n // true.\n this.removeAttribute('aria-labelledby');\n this._lastWrittenLabelledBy = null;\n }\n\n const hostDesc = [...consumerDescIds].filter(Boolean).join(' ') || '';\n const liveDesc = this.getAttribute('aria-describedby');\n if (hostDesc) {\n if (liveDesc !== hostDesc) {\n this.setAttribute('aria-describedby', hostDesc);\n }\n this._lastWrittenDescribedBy = hostDesc;\n } else if (liveDesc !== null && this._lastWrittenDescribedBy !== null) {\n this.removeAttribute('aria-describedby');\n this._lastWrittenDescribedBy = null;\n }\n\n // Codex round-22 P1 #2: on the no-IDL-ref fallback path, consumer-supplied\n // describedby tokens reach the host (above) but the *internal* shadow\n // help/error wrappers cannot be referenced from light-DOM IDREFs. Mirror\n // their `textContent` into `internals.ariaDescription` so the host's\n // accessible description still surfaces the live help/error strings on\n // legacy engines (Firefox today). The string-form description hook is\n // independent of element references and survives the shadow boundary.\n // Empty strings are normalized to `null` so AT does not announce an\n // empty description.\n // Codex round-23 P2 (Finding C): use a slot-aware text read so slotted\n // help/error content surfaces into `internals.ariaDescription` —\n // wrapper `textContent` does NOT cross the shadow → light-DOM slot\n // boundary. The new help/error slot text observers (above) keep this\n // in sync when a framework rewrites the slotted node's textContent in\n // place.\n const helpText =\n helpEl && !hasError && (this.helpText || this._hasHelpSlot)\n ? readSlottedOrShadowText(helpEl)\n : '';\n const errorText = errorEl && hasError ? readSlottedOrShadowText(errorEl) : '';\n const internalDescriptionText = [helpText, errorText].filter(Boolean).join(' ');\n internals.ariaDescription = internalDescriptionText || null;\n }\n }\n\n override firstUpdated(changedProperties: PropertyValues<this>): void {\n super.firstUpdated(changedProperties);\n this._syncRadios();\n this._previousRadios = this._getRadios();\n // Codex round-7 finding #6: observe in-place `disabled` mutations on the\n // initial child set. The slotchange handler refreshes this on every slot\n // pass, but firstUpdated covers the case where the initial children are\n // never re-slotted (e.g. static markup mounted once).\n this._installChildDisabledObservers();\n // WCAG 4.1.2: warn when no accessible name is available for the radio group.\n // The fieldset needs either a label prop (rendered as <legend>) or an aria-label\n // attribute on the host element so screen readers can identify the group.\n if (!this.label && !this.getAttribute('aria-label')) {\n devWarn(\n 'hx-radio-group',\n 'No accessible label provided. Set the `label` attribute or add `aria-label` to the host element. An unlabeled radio group violates WCAG 2.1 AA (4.1.2 Name, Role, Value).',\n );\n }\n }\n\n // ─── Radio Management ───\n\n /**\n * Cached list of child hx-radio elements; invalidated on slot change.\n * @internal\n */\n private _cachedRadios: HelixRadio[] | null = null;\n /**\n * Stores each radio's individual disabled state before group-level disabling overrides it.\n * @internal\n */\n private _individualDisabledStates = new WeakMap<HelixRadio, boolean>();\n\n /**\n * Returns all child hx-radio elements, using the cache when available.\n * @internal\n */\n private _getRadios(): HelixRadio[] {\n if (!this._cachedRadios) {\n this._cachedRadios = Array.from(this.querySelectorAll('hx-radio')) as HelixRadio[];\n }\n return this._cachedRadios;\n }\n\n /**\n * Returns only the child hx-radio elements that are not disabled.\n * @internal\n */\n private _getEnabledRadios(): HelixRadio[] {\n return this._getRadios().filter((radio) => !radio.disabled && !this.disabled);\n }\n\n /**\n * Synchronizes checked state, disabled state, and roving tabindex across all child radios.\n * @internal\n */\n private _syncRadios(): void {\n const radios = this._getRadios();\n const enabledRadios = this._getEnabledRadios();\n\n radios.forEach((radio) => {\n // Codex round-3 finding #1 (defense-in-depth symmetry with hx-checkbox):\n // mark every group-managed child so any future form-association change\n // on `hx-radio` is automatically suppressed inside the group. The flag\n // is currently inert on `hx-radio` (which is not form-associated).\n radio._groupedSuppress = true;\n this._suppressedChildren.add(radio);\n\n const isChecked = radio.value === this.value && this.value !== '';\n radio.checked = isChecked;\n\n if (this.disabled) {\n // Store individual disabled state before overriding with group disabled\n if (!this._individualDisabledStates.has(radio)) {\n this._individualDisabledStates.set(radio, radio.disabled);\n }\n radio.disabled = true;\n } else {\n // Restore individual disabled state when group is re-enabled\n const originalDisabled = this._individualDisabledStates.get(radio);\n if (originalDisabled !== undefined) {\n radio.disabled = originalDisabled;\n this._individualDisabledStates.delete(radio);\n }\n }\n });\n\n // Roving tabindex management\n const checkedRadio = enabledRadios.find((r) => r.checked);\n radios.forEach((radio) => {\n radio.tabIndex = -1;\n });\n\n if (checkedRadio) {\n checkedRadio.tabIndex = 0;\n } else if (enabledRadios.length > 0) {\n const firstRadio = enabledRadios[0];\n if (firstRadio) {\n firstRadio.tabIndex = 0;\n }\n }\n }\n\n // ─── Event Handling ───\n\n /**\n * Handles the internal hx-radio-select event to update the group's selected value.\n * @internal\n */\n private _handleRadioSelect = (e: Event): void => {\n if (!(e instanceof CustomEvent)) return;\n e.stopPropagation();\n\n const newValue = (e.detail as { value: string }).value;\n if (newValue === this.value) {\n return;\n }\n\n this.value = newValue;\n this._handleInteractionInput();\n // Reactive update in updated() will call setFormValue, _syncRadios, _updateValidity\n\n /**\n * Dispatched when the selected radio changes.\n * @event hx-change\n */\n this.dispatchEvent(\n new CustomEvent<{ value: string; checked: boolean }>('hx-change', {\n bubbles: true,\n composed: true,\n detail: { value: this.value, checked: true },\n }),\n );\n };\n\n /**\n * Handles keyboard navigation (arrow keys, Home, End, Space) within the radio group.\n * @internal\n */\n private _handleKeydown = (e: KeyboardEvent): void => {\n const enabledRadios = this._getEnabledRadios();\n if (enabledRadios.length === 0) {\n return;\n }\n\n const isHandledKey = [\n 'ArrowUp',\n 'ArrowDown',\n 'ArrowLeft',\n 'ArrowRight',\n ' ',\n 'Home',\n 'End',\n ].includes(e.key);\n if (!isHandledKey) {\n return;\n }\n\n e.preventDefault();\n\n // Space: select the currently focused radio without moving focus\n if (e.key === ' ') {\n const targetRadio = (e.target as Element)?.closest?.('hx-radio') as HelixRadio | null;\n if (targetRadio && !targetRadio.disabled) {\n targetRadio.dispatchEvent(\n new CustomEvent<{ value: string }>('hx-radio-select', {\n bubbles: true,\n composed: true,\n detail: { value: targetRadio.value },\n }),\n );\n }\n return;\n }\n\n const targetRadio = (e.target as Element)?.closest?.('hx-radio') as HelixRadio | null;\n const currentIndex = targetRadio\n ? enabledRadios.indexOf(targetRadio)\n : enabledRadios.findIndex((radio) => radio.checked);\n\n let nextIndex: number;\n if (e.key === 'Home') {\n nextIndex = 0;\n } else if (e.key === 'End') {\n nextIndex = enabledRadios.length - 1;\n } else if (e.key === 'ArrowDown' || e.key === 'ArrowRight') {\n nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % enabledRadios.length;\n } else {\n nextIndex = currentIndex <= 0 ? enabledRadios.length - 1 : currentIndex - 1;\n }\n\n const nextRadio = enabledRadios[nextIndex];\n if (nextRadio) {\n nextRadio.focus();\n nextRadio.dispatchEvent(\n new CustomEvent<{ value: string }>('hx-radio-select', {\n bubbles: true,\n composed: true,\n detail: { value: nextRadio.value },\n }),\n );\n }\n };\n\n /**\n * Handles slotchange events on the default slot. Refreshes the cached\n * radio list, reconciles `value`/`setFormValue`/validity against the new\n * children, then re-tunes the per-child disabled observer so in-place\n * `radio.disabled = true` mutations trigger the same reconcile pass.\n *\n * Codex round-2 finding #3: previously this handler only invalidated the\n * cache and re-synced child state, so removing the currently-selected\n * radio (or disabling it, or adding a new `checked` radio) left\n * `this.value` and the submitted form value pointing at stale state and\n * `_updateValidity` was never re-run.\n *\n * Codex round-7 finding #6: an in-place `selectedRadio.disabled = true`\n * never re-entered this reconciler (the radio remained slotted), so the\n * group could keep submitting a disabled value and stay valid until some\n * unrelated slot mutation kicked things over. The per-child observer\n * installed at the end of this method re-runs the same reconcile logic on\n * every `disabled` attribute mutation.\n * @internal\n */\n private _handleSlotChange(): void {\n this._cachedRadios = null;\n this._reconcileChildren();\n this._installChildDisabledObservers();\n }\n\n /**\n * Per-child `disabled` attribute observer. Mirrors the slotchange\n * reconcile pipeline so an in-place `radio.disabled = true` collapses the\n * group's `value`/form participation/validity. Round-7 finding #6.\n *\n * One observer is shared across all currently-slotted radios; it is\n * disconnected and re-attached on every slotchange so children that have\n * left the group stop firing reconcile passes.\n * @internal\n */\n private _childDisabledObserver: MutationObserver | null = null;\n\n /**\n * Re-runs the slotchange reconcile pass without touching the disabled\n * observer wiring. Called from the slotchange handler and from the\n * per-child disabled observer; factored out so both entry points share\n * the same value/formValue/validity reconciliation path. Round-7 #6.\n * @internal\n */\n private _reconcileChildren(): void {\n // Snapshot of the previous slot pass so we can release `_groupedSuppress`\n // on any radio that has left this group. Codex round-3 finding #1\n // (defense-in-depth symmetry).\n const previous = this._previousRadios;\n\n // Reconcile against currently-slotted children BEFORE _syncRadios runs.\n // _syncRadios() unconditionally overwrites `radio.checked` from `this.value`,\n // which would clobber an externally-set `checked=true` on a newly-added\n // radio when the group's current value is empty. We therefore peek at the\n // raw children first to detect \"pre-checked\" adoption, then commit through\n // the normal sync pipeline.\n //\n // Codex round-12 P2: prefer a checked radio whose value differs from the\n // current group value — that is the \"newly externally checked\" candidate.\n // The naive `.find(r.checked && !r.disabled)` returned the first checked\n // radio in DOM order, which is typically the previously-selected one whose\n // value already matches `this.value`, so an appended `<hx-radio checked>`\n // with a different value would be rejected by the next `_syncRadios()`\n // pass. Falling back to \"any checked radio\" still handles the\n // empty-group / first-mount case.\n const candidates = this._getRadios().filter((r) => r.checked && !r.disabled);\n const externallyChecked = candidates.find((r) => r.value !== this.value) ?? candidates[0];\n if (externallyChecked && externallyChecked.value !== this.value) {\n this.value = externallyChecked.value;\n }\n\n this._syncRadios();\n\n // After sync, the group's `value` and the children's `checked` flags are\n // canonical. If the previously-selected radio was removed or disabled,\n // `selected` becomes undefined and `reconciled` collapses to '', clearing\n // form participation.\n //\n // Codex round-10 P1: when the group itself is disabled, every radio is\n // force-disabled by `_syncRadios`. The post-sync `selected` lookup excludes\n // disabled radios, so it would always collapse to '' and wipe the user's\n // selection across a disable→enable cycle. Group-level disable is a\n // visual/interaction lock — it must preserve `value` and form participation\n // (matching native `<fieldset disabled>` semantics where the form value is\n // simply omitted from submission while disabled). When `this.disabled` is\n // true we leave `value` and form state untouched; the next disabled→false\n // pass through `updated()` runs `_syncRadios` again, which restores each\n // radio's individual disabled flag and re-checks the matching value.\n if (this.disabled) {\n // Codex round-18 P2: even while disabled, if the previously-selected\n // radio has been *removed* from the DOM (vs merely disabled by the\n // group), `this.value` references a value that no slotted child\n // carries, so the group would resubmit a stale option after re-enable.\n // We must clear `value` in that case while still preserving selection\n // across pure disable→enable cycles where the radio still exists.\n // Detect \"selected option still in DOM\" by membership lookup on the\n // raw children, ignoring their disabled flag (since group-level\n // disable forces them all disabled by _syncRadios).\n const presentValues = this._getRadios().map((r) => r.value);\n if (this.value && !presentValues.includes(this.value)) {\n this.value = '';\n }\n // Validity reflects the (possibly-cleared) value; setFormValue is\n // omitted because a disabled control shouldn't contribute to form\n // submission.\n this._updateValidity();\n } else {\n const selected = this._getRadios().find((r) => r.checked && !r.disabled);\n const reconciled = selected?.value ?? '';\n if (reconciled !== this.value) {\n this.value = reconciled;\n }\n // Always re-run setFormValue + validity. `value` may be stable while\n // membership/disabled-state changed, and a freshly-adopted pre-checked\n // radio still needs its value pushed to the form.\n this._internals.setFormValue(this.value || null);\n this._updateValidity();\n }\n\n // Release suppression on any radio that left the group. Then refresh the\n // snapshot for the next slotchange. Codex round-3 finding #1.\n const current = new Set(this._getRadios());\n previous.forEach((radio) => {\n if (!current.has(radio) && this._suppressedChildren.has(radio)) {\n radio._groupedSuppress = false;\n this._suppressedChildren.delete(radio);\n }\n });\n this._previousRadios = this._getRadios();\n }\n\n /**\n * Installs (or re-installs) a single MutationObserver across the current\n * set of slotted `<hx-radio>` children, listening for `disabled` attribute\n * mutations. Round-7 finding #6: in-place `disabled = true` never reaches\n * the slotchange-driven reconciler otherwise.\n * @internal\n */\n private _installChildDisabledObservers(): void {\n this._childDisabledObserver?.disconnect();\n const radios = this._getRadios();\n if (radios.length === 0) {\n this._childDisabledObserver = null;\n return;\n }\n const observer = new MutationObserver((mutations) => {\n // Filter to disabled-attribute mutations only — the observer is scoped\n // to attributeFilter:['disabled'] but the callback still fires per\n // mutation record, so guard cheaply against noise.\n if (!mutations.some((m) => m.attributeName === 'disabled')) return;\n this._reconcileChildren();\n });\n radios.forEach((radio) => {\n observer.observe(radio, {\n attributes: true,\n attributeFilter: ['disabled'],\n });\n });\n this._childDisabledObserver = observer;\n }\n\n // ─── Form Integration ───\n\n /**\n * Updates the ElementInternals validity state based on the required constraint and current value.\n * @internal\n */\n override _updateValidity(): void {\n if (this.required && !this.value) {\n // Codex round-35 finding (CR major): anchor `setValidity()` to an actual\n // radio. The presentational `.fieldset__group` div is `role=\"none\"` and\n // not focusable, so anchoring there leaves UA validation UI / error\n // recovery disconnected from the interactive surface.\n //\n // Codex round-35 follow-up (Low #4): drop the unconditional `radios[0]`\n // tier — a disabled radio is not focusable and cannot host UA validation\n // UI either. Prefer checked-enabled, then any enabled, then the\n // presentational group as a last resort (still better than `undefined`\n // because it pins UA error positioning to the visible group bounds).\n const anchor =\n this._getRadios().find((radio) => radio.checked && !radio.disabled) ??\n this._getEnabledRadios()[0] ??\n this._groupEl ??\n undefined;\n this._internals.setValidity(\n { valueMissing: true },\n this.error || 'Please select an option.',\n anchor,\n );\n } else {\n this._internals.setValidity({});\n }\n // Codex round-1 finding #6: re-sync host ARIA after every setValidity().\n this._syncHostAriaSemantics();\n }\n\n /** @internal */\n protected override _onFormReset(): void {\n this.value = '';\n this._internals.setFormValue(null);\n this._syncRadios();\n this._resetInteractionState();\n }\n\n /** @internal */\n protected override _onFormStateRestore(\n state: File | string | FormData | null,\n _mode: 'restore' | 'autocomplete',\n ): void {\n if (typeof state === 'string') {\n this.value = state;\n }\n }\n\n /** @internal */\n protected override _onFormDisabled(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n // ─── Render ───\n\n override render() {\n const hasError = !!this.error || this._hasErrorSlot;\n const hasHelp = !!this.helpText || this._hasHelpSlot;\n const legendId = `${this._groupId}-legend`;\n\n const fieldsetClasses = {\n fieldset: true,\n 'fieldset--error': hasError,\n 'fieldset--disabled': this.disabled,\n 'fieldset--required': this.required,\n };\n\n // Codex round-19 P1: inner fieldset is presentational on BOTH the modern\n // and no-IDL-ref fallback paths so AT announces exactly one accessible\n // container (the host). Earlier rounds promoted the fieldset to\n // `role=\"group\"` on the fallback branch and spliced shadow-internal ids\n // into its aria-* attributes; that produced nested host→fieldset groups\n // and broke external IDREFs (shadow ids cannot resolve across the\n // boundary). The host carries the radiogroup role via ElementInternals\n // on both paths.\n return html`\n <fieldset\n part=\"fieldset\"\n class=${classMap(fieldsetClasses)}\n role=\"presentation\"\n aria-orientation=${this.orientation === 'horizontal' ? 'horizontal' : nothing}\n >\n ${this.label\n ? html`\n <legend part=\"legend\" class=\"fieldset__legend\" id=${legendId}>\n ${this.label}\n ${this.required\n ? html`<span class=\"fieldset__required-marker\" aria-hidden=\"true\">*</span>`\n : nothing}\n </legend>\n `\n : nothing}\n\n <div part=\"group\" class=\"fieldset__group\" role=\"none\">\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n\n <!--\n Persistent error live region. role=\"alert\" is set from first paint\n so the WAI-ARIA contract for live updates is honoured: content\n changes in place rather than the container being toggled.\n -->\n <div\n part=\"error\"\n class=\"fieldset__error\"\n id=${this._errorId}\n role=\"alert\"\n ?hidden=${!hasError}\n >\n <slot name=\"error\" @slotchange=${this._handleErrorSlotChange}\n >${this._announcedError}</slot\n >\n </div>\n\n <!--\n Persistent help-text container. Rendered whenever the property OR\n the slot has content; hidden when an error is present so guidance\n does not compete with validation feedback. Always in the shadow\n tree so the host's aria-describedby chain is stable.\n -->\n <div\n part=\"help-text\"\n class=\"fieldset__help-text\"\n id=${this._helpTextId}\n ?hidden=${!hasHelp || hasError}\n >\n <slot name=\"help-text\" @slotchange=${this._handleHelpSlotChange}>${this.helpText}</slot>\n </div>\n </fieldset>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-radio-group': HelixRadioGroup;\n }\n}\n\n/** Canonical type alias for the hx-radio-group component. */\nexport type HxRadioGroup = HelixRadioGroup;\n","import { css } from 'lit';\n\nexport const helixRadioStyles = css`\n :host {\n display: block;\n }\n\n :host([disabled]) {\n opacity: var(--hx-opacity-disabled, 0.5);\n pointer-events: none;\n }\n\n * {\n box-sizing: border-box;\n }\n\n .radio {\n display: inline-flex;\n align-items: center;\n gap: var(--hx-space-2, 0.5rem);\n /* WCAG 2.5.5 (healthcare mandate): minimum 44px touch target height */\n min-height: var(--hx-touch-target-min, 2.75rem);\n cursor: pointer;\n position: relative;\n font-family: var(--hx-radio-font-family, var(--hx-font-family-sans, sans-serif));\n }\n\n .radio--disabled {\n cursor: not-allowed;\n }\n\n /* ─── Hidden Native Input ─── */\n\n .radio__input {\n position: absolute;\n width: var(--hx-space-px);\n height: var(--hx-space-px);\n padding: 0;\n margin: calc(var(--hx-space-px) * -1);\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n\n /* ─── Visual Radio Circle ─── */\n\n .radio__control {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--hx-radio-size, var(--hx-size-5, 1.25rem));\n height: var(--hx-radio-size, var(--hx-size-5, 1.25rem));\n border: var(--hx-border-width-medium, 2px) solid\n var(--hx-radio-border-color, var(--hx-color-border-strong, #66787b));\n border-radius: var(--hx-border-radius-full, 9999px);\n background-color: var(--hx-radio-bg, var(--hx-color-surface-default, #ffffff));\n transition:\n border-color var(--hx-transition-fast, 150ms ease),\n background-color var(--hx-transition-fast, 150ms ease),\n box-shadow var(--hx-transition-fast, 150ms ease);\n flex-shrink: 0;\n }\n\n /* ─── Inner Dot ─── */\n\n .radio__dot {\n width: calc(var(--hx-radio-size, var(--hx-size-5, 1.25rem)) * 0.4);\n height: calc(var(--hx-radio-size, var(--hx-size-5, 1.25rem)) * 0.4);\n border-radius: var(--hx-border-radius-full, 9999px);\n background-color: var(--hx-radio-dot-color, var(--hx-color-text-on-primary, #ffffff));\n transform: scale(0);\n transition: transform var(--hx-transition-fast, 150ms ease);\n }\n\n /* ─── Checked State ─── */\n\n .radio--checked .radio__control {\n border-color: var(--hx-radio-checked-border-color, var(--hx-color-primary-500, #429797));\n background-color: var(--hx-radio-checked-bg, var(--hx-color-primary-500, #429797));\n }\n\n .radio--checked .radio__dot {\n transform: scale(1);\n }\n\n /* ─── Focus State ─── */\n\n :host(:focus-visible) .radio__control {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-radio-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n /* ─── Hover State ─── */\n\n .radio:not(.radio--disabled):not(.radio--checked):hover .radio__control {\n border-color: var(--hx-radio-hover-border-color, var(--hx-color-border-strong, #66787b));\n }\n\n /* ─── Label ─── */\n\n .radio__label {\n font-size: var(--hx-font-size-md, 1rem);\n color: var(--hx-radio-label-color, var(--hx-color-text-strong, #202b39));\n line-height: var(--hx-line-height-normal, 1.5);\n user-select: none;\n -webkit-user-select: none;\n }\n\n /* ─── Reduced Motion ─── */\n\n @media (prefers-reduced-motion: reduce) {\n .radio__control,\n .radio__dot {\n transition: none;\n }\n }\n\n /* ─── High Contrast Mode (forced-colors) ─── */\n\n @media (forced-colors: active) {\n .radio__control {\n forced-color-adjust: none;\n background-color: ButtonFace;\n border: 2px solid ButtonText;\n }\n\n :host(:focus-visible) .radio__control {\n outline: 3px solid Highlight;\n outline-offset: 2px;\n }\n\n .radio--checked .radio__control {\n background-color: Highlight;\n border-color: Highlight;\n }\n\n .radio--checked .radio__dot {\n background-color: HighlightText;\n }\n\n :host([disabled]) {\n opacity: 1;\n }\n\n :host([disabled]) .radio__control {\n border-color: GrayText;\n background-color: ButtonFace;\n }\n\n :host([disabled]) .radio--checked .radio__control {\n background-color: GrayText;\n border-color: GrayText;\n }\n\n :host([disabled]) .radio__label {\n color: GrayText;\n }\n\n .radio__label {\n color: CanvasText;\n }\n }\n`;\n","import { html, type PropertyValues } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HelixElement, createIdCounter } from '../../base/index.js';\nimport { helixRadioStyles } from './hx-radio.styles.js';\nimport { forcedColorsField } from '../../styles/forced-colors.js';\n\nconst _nextRadioId = createIdCounter('hx-radio');\n\n/**\n * An individual radio button, designed to be used inside a `<hx-radio-group>`.\n *\n * @summary Presentational radio button managed by its parent radio group.\n *\n * @tag hx-radio\n *\n * @slot - Custom label content (overrides the label property).\n *\n * @csspart radio - The visual radio circle.\n * @csspart label - The label text.\n *\n * @cssprop [--hx-radio-size=var(--hx-size-5, 1.25rem)] - Radio circle size.\n * @cssprop [--hx-radio-border-color=var(--hx-color-neutral-300, #B6BFB9)] - Radio border color.\n * @cssprop [--hx-radio-checked-bg=var(--hx-color-primary-500, #429797)] - Checked background color.\n * @cssprop [--hx-radio-checked-border-color=var(--hx-color-primary-500, #429797)] - Checked border color.\n * @cssprop [--hx-radio-dot-color=var(--hx-color-neutral-0, #ffffff)] - Inner dot color when checked.\n * @cssprop [--hx-radio-focus-ring-color=var(--hx-focus-ring-color, #6AB1B1)] - Focus ring color.\n * @cssprop [--hx-radio-label-color=var(--hx-color-neutral-700, #313E4B)] - Label text color.\n */\n@customElement('hx-radio')\nexport class HelixRadio extends HelixElement {\n static override styles = [helixRadioStyles, forcedColorsField];\n\n // ─── Properties ───\n\n /**\n * The value this radio represents.\n * @attr value\n */\n @property({ type: String })\n value = '';\n\n /**\n * Visible label text for the radio.\n * @attr label\n */\n @property({ type: String })\n label = '';\n\n /**\n * Whether this radio is disabled.\n * @attr disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Whether this radio is checked. Managed by the parent group.\n * @attr checked\n */\n @property({ type: Boolean, reflect: true })\n checked = false;\n\n /**\n * Set by `hx-radio-group` to mark this child as group-managed. `hx-radio` is\n * not form-associated (the group is the sole form participant), so this\n * flag is currently inert on this element. It exists for symmetry with\n * `hx-checkbox._groupedSuppress` so the group/child contract is identical\n * across both selection-control families and any future form-association\n * change on `hx-radio` is automatically suppressed inside a group. Codex\n * round-3 finding #1 (defense-in-depth).\n * @internal\n */\n set _groupedSuppress(value: boolean) {\n this.__groupedSuppress = value;\n }\n get _groupedSuppress(): boolean {\n return this.__groupedSuppress;\n }\n /** @internal */\n private __groupedSuppress = false;\n\n // ─── Lifecycle ───\n\n override connectedCallback(): void {\n super.connectedCallback();\n // ARIA role and state are projected to the accessibility tree via\n // ElementInternals rather than imperative setAttribute calls. This keeps\n // the host element's attribute surface clean — consumers cannot accidentally\n // override role/aria-* — and aligns with the standards pattern for\n // custom elements. See https://wicg.github.io/aom/spec/aria-reflection.html.\n this._internals.role = 'radio';\n this._syncAriaState();\n }\n\n override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (\n changedProperties.has('checked') ||\n changedProperties.has('label') ||\n changedProperties.has('disabled')\n ) {\n this._syncAriaState();\n }\n }\n\n /**\n * Mirror reactive ARIA state onto ElementInternals. Setting a value to `null`\n * removes it from the accessibility tree (matching the previous\n * removeAttribute behavior).\n *\n * WCAG 4.1.2: expose the label text as ariaLabel on the host so assistive\n * technology can associate the visible label with the radio role. The label\n * span lives inside Shadow DOM and aria-labelledby cannot cross shadow\n * boundaries, so ariaLabel on the host is the correct pattern here.\n *\n * WCAG 4.1.2: omit ariaDisabled entirely when not disabled. Setting\n * aria-disabled=\"false\" is verbose and unnecessary — omission is preferred.\n *\n * @internal\n */\n private _syncAriaState(): void {\n this._internals.ariaChecked = String(this.checked);\n this._internals.ariaLabel = this.label || null;\n this._internals.ariaDisabled = this.disabled ? 'true' : null;\n }\n\n // ─── Internal IDs ───\n\n /** @internal */\n private _inputId = _nextRadioId();\n\n // ─── Event Handling ───\n\n /** @internal */\n private _handleClick(): void {\n if (this.disabled) {\n return;\n }\n\n /**\n * Internal event dispatched to signal selection to the parent group.\n * Not part of the public API.\n * @internal\n */\n this.dispatchEvent(\n new CustomEvent<{ value: string }>('hx-radio-select', {\n bubbles: true,\n composed: true,\n detail: { value: this.value },\n }),\n );\n }\n\n // ─── Render ───\n\n override render() {\n const classes = {\n radio: true,\n 'radio--checked': this.checked,\n 'radio--disabled': this.disabled,\n };\n\n return html`\n <div class=${classMap(classes)} @click=${this._handleClick}>\n <input\n class=\"radio__input\"\n type=\"radio\"\n id=${this._inputId}\n .checked=${this.checked}\n ?disabled=${this.disabled}\n tabindex=\"-1\"\n aria-hidden=\"true\"\n />\n <span part=\"radio\" class=\"radio__control\" aria-hidden=\"true\">\n <span class=\"radio__dot\"></span>\n </span>\n <span part=\"label\" class=\"radio__label\">\n <slot>${this.label}</slot>\n </span>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-radio': HelixRadio;\n }\n}\n\n/** Canonical type alias for the hx-radio component. */\nexport type HxRadio = HelixRadio;\n"],"names":["helixRadioGroupStyles","css","_nextRadioGroupId","createIdCounter","readSlottedOrShadowText","wrapper","slot","assigned","node","HelixRadioGroup","FormMixin","HelixElement","newValue","enabledRadios","targetRadio","_b","_a","_d","_c","currentIndex","radio","nextIndex","nextRadio","observer","supportsIdrefElementReferences","installAriaIdrefMirror","existing","changedProperties","internals","hostAriaLabel","internalLegend","helpEl","errorEl","liveLabelledBy","liveDescribedBy","externalLabelTokens","externalDescTokens","labelEls","resolveIdrefTokens","hasEffectiveLabelledBy","descEls","hasError","refsInternals","consumerLabelIds","consumerDescIds","hostLabel","liveLabel","hostDesc","liveDesc","helpText","errorText","internalDescriptionText","radios","isChecked","originalDisabled","checkedRadio","firstRadio","previous","candidates","r","externallyChecked","presentValues","selected","reconciled","current","mutations","m","anchor","state","_mode","disabled","hasHelp","legendId","fieldsetClasses","html","classMap","nothing","forcedColorsField","__decorateClass","property","customElement","helixRadioStyles","_nextRadioId","HelixRadio","value","classes"],"mappings":";;;;;;;;AAEO,MAAMA,IAAwBC;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;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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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A,IAANL,EAAA;AAAA,EADNE,EAAc,UAAU;AAAA,GACZG,CAAA;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hx-split-button-Ddle8iVx.js","sources":["../../src/components/hx-split-button/hx-split-button.styles.ts","../../src/components/hx-split-button/hx-split-button.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixSplitButtonStyles = css`\n :host {\n display: inline-block;\n position: relative;\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: var(--hx-opacity-disabled, 0.5);\n }\n\n /* ─── Container ─── */\n\n .split-button {\n display: inline-flex;\n align-items: stretch;\n position: relative;\n }\n\n /* ─── Primary Button ─── */\n\n .split-button__primary {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--hx-space-2, 0.5rem);\n border: var(--hx-border-width-thin, 1px) solid var(--hx-split-button-border-color, transparent);\n border-inline-end: none;\n border-radius: var(--hx-split-button-border-radius, var(--hx-border-radius-md, 0.375rem)) 0 0\n var(--hx-split-button-border-radius, var(--hx-border-radius-md, 0.375rem));\n background-color: var(--hx-split-button-bg, var(--hx-color-primary-500, #429797));\n color: var(--hx-split-button-color, var(--hx-color-text-on-primary, #ffffff));\n font-family: var(--hx-split-button-font-family, var(--hx-font-family-sans, sans-serif));\n font-weight: var(--hx-split-button-font-weight, var(--hx-font-weight-semibold, 600));\n line-height: var(--hx-line-height-tight, 1.25);\n cursor: pointer;\n transition:\n background-color var(--hx-transition-fast, 150ms ease),\n color var(--hx-transition-fast, 150ms ease),\n border-color var(--hx-transition-fast, 150ms ease),\n box-shadow var(--hx-transition-fast, 150ms ease);\n text-decoration: none;\n white-space: nowrap;\n user-select: none;\n -webkit-user-select: none;\n flex: 1 1 auto;\n }\n\n .split-button__primary:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-split-button-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n z-index: 1;\n position: relative;\n }\n\n .split-button__primary:hover {\n filter: brightness(var(--hx-filter-brightness-hover, 0.9));\n }\n\n .split-button__primary:active {\n filter: brightness(var(--hx-filter-brightness-active, 0.8));\n }\n\n .split-button__primary[disabled] {\n cursor: not-allowed;\n }\n\n /* ─── Trigger Button ─── */\n\n .split-button__trigger {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n border: var(--hx-border-width-thin, 1px) solid var(--hx-split-button-border-color, transparent);\n border-inline-start: var(--hx-border-width-thin, 1px) solid\n var(--hx-split-button-divider-color, var(--hx-color-primary-900, #0b3232));\n border-radius: 0 var(--hx-split-button-border-radius, var(--hx-border-radius-md, 0.375rem))\n var(--hx-split-button-border-radius, var(--hx-border-radius-md, 0.375rem)) 0;\n background-color: var(--hx-split-button-bg, var(--hx-color-primary-500, #429797));\n color: var(--hx-split-button-color, var(--hx-color-text-on-primary, #ffffff));\n cursor: pointer;\n transition:\n background-color var(--hx-transition-fast, 150ms ease),\n box-shadow var(--hx-transition-fast, 150ms ease);\n user-select: none;\n -webkit-user-select: none;\n }\n\n .split-button__trigger:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-split-button-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n z-index: 1;\n position: relative;\n }\n\n .split-button__trigger:hover {\n filter: brightness(var(--hx-filter-brightness-hover, 0.9));\n }\n\n .split-button__trigger:active {\n filter: brightness(var(--hx-filter-brightness-active, 0.8));\n }\n\n .split-button__trigger[disabled] {\n cursor: not-allowed;\n }\n\n /* ─── Trigger Icon ─── */\n\n .split-button__chevron {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: transform var(--hx-transition-fast, 150ms ease);\n }\n\n .split-button__chevron--open {\n transform: rotate(180deg);\n }\n\n /* ─── Size Variants ─── */\n\n /* sm */\n .split-button--sm .split-button__primary {\n padding: var(--hx-space-1, 0.25rem) var(--hx-space-3, 0.75rem);\n font-size: var(--hx-font-size-sm, 0.875rem);\n min-height: var(--hx-size-8, 2rem);\n }\n\n .split-button--sm .split-button__trigger {\n padding: var(--hx-space-1, 0.25rem) var(--hx-space-2, 0.5rem);\n min-height: var(--hx-size-8, 2rem);\n }\n\n /* md */\n .split-button--md .split-button__primary {\n padding: var(--hx-space-2, 0.5rem) var(--hx-space-4, 1rem);\n font-size: var(--hx-font-size-md, 1rem);\n min-height: var(--hx-size-10, 2.5rem);\n }\n\n .split-button--md .split-button__trigger {\n padding: var(--hx-space-2, 0.5rem) var(--hx-space-3, 0.75rem);\n min-height: var(--hx-size-10, 2.5rem);\n }\n\n /* lg */\n .split-button--lg .split-button__primary {\n padding: var(--hx-space-3, 0.75rem) var(--hx-space-6, 1.5rem);\n font-size: var(--hx-font-size-lg, 1.125rem);\n min-height: var(--hx-size-12, 3rem);\n }\n\n .split-button--lg .split-button__trigger {\n padding: var(--hx-space-3, 0.75rem) var(--hx-space-4, 1rem);\n min-height: var(--hx-size-12, 3rem);\n }\n\n /* ─── Variant: primary ─── */\n\n .split-button--primary .split-button__primary,\n .split-button--primary .split-button__trigger {\n --hx-split-button-bg: var(--hx-color-primary-500, #429797);\n --hx-split-button-color: var(--hx-color-text-on-primary, #ffffff);\n --hx-split-button-border-color: transparent;\n --hx-split-button-divider-color: var(--hx-color-primary-900, #0b3232);\n }\n\n /* primary:hover — replace the universal brightness(0.9) filter (which would\n drop primary-500 + on-primary contrast to ~4.4:1) with an explicit swap\n to primary-600 and a neutral-0 foreground. Mirrors hx-button precedent. */\n .split-button--primary .split-button__primary:hover,\n .split-button--primary .split-button__trigger:hover {\n --hx-split-button-bg: var(--hx-color-primary-600, #0f7078);\n --hx-split-button-color: var(--hx-color-neutral-0, #ffffff);\n filter: none;\n }\n\n /* ─── Variant: secondary ─── */\n\n .split-button--secondary .split-button__primary,\n .split-button--secondary .split-button__trigger {\n --hx-split-button-bg: transparent;\n --hx-split-button-color: var(--hx-color-primary-500, #429797);\n --hx-split-button-border-color: var(--hx-color-primary-500, #429797);\n --hx-split-button-divider-color: var(--hx-color-primary-300, #97cdcc);\n }\n\n .split-button--secondary .split-button__primary:hover,\n .split-button--secondary .split-button__trigger:hover {\n --hx-split-button-bg: var(--hx-color-primary-50, #ebf8f8);\n filter: none;\n }\n\n /* ─── Variant: tertiary ─── */\n\n .split-button--tertiary .split-button__primary,\n .split-button--tertiary .split-button__trigger {\n --hx-split-button-bg: var(--hx-color-surface-sunken, #ebeee9);\n --hx-split-button-color: var(--hx-color-text-primary, #0d1825);\n --hx-split-button-border-color: transparent;\n --hx-split-button-divider-color: var(--hx-color-border-default, #d6dbd5);\n }\n\n .split-button--tertiary .split-button__primary:hover,\n .split-button--tertiary .split-button__trigger:hover {\n --hx-split-button-bg: var(--hx-color-surface-raised, #f5f8f3);\n filter: none;\n }\n\n /* ─── Variant: danger ─── */\n\n .split-button--danger .split-button__primary,\n .split-button--danger .split-button__trigger {\n --hx-split-button-bg: var(--hx-color-error-500, #e5493e);\n --hx-split-button-color: var(--hx-color-text-on-error, #ffffff);\n --hx-split-button-border-color: transparent;\n --hx-split-button-divider-color: var(--hx-color-error-400, #fc7264);\n }\n\n /* danger:hover — on-error tokens are tuned for error-500. error-600 drops\n the pair to 2.25:1 (AA fail). Pin fg at neutral-0 to keep the darker\n hover fill legible. Mirrors hx-toast precedent (commit 300e21ab0). */\n .split-button--danger .split-button__primary:hover,\n .split-button--danger .split-button__trigger:hover {\n --hx-split-button-bg: var(--hx-color-error-600, #c92a2a);\n --hx-split-button-color: var(--hx-color-neutral-0, #ffffff);\n filter: none;\n }\n\n /* ─── Variant: ghost ─── */\n\n .split-button--ghost .split-button__primary,\n .split-button--ghost .split-button__trigger {\n --hx-split-button-bg: transparent;\n --hx-split-button-color: var(--hx-color-primary-500, #429797);\n --hx-split-button-border-color: transparent;\n --hx-split-button-divider-color: var(--hx-color-primary-200, #bce1e1);\n }\n\n .split-button--ghost .split-button__primary:hover,\n .split-button--ghost .split-button__trigger:hover {\n --hx-split-button-bg: var(--hx-color-surface-raised, #f5f8f3);\n filter: none;\n }\n\n /* ─── Variant: outline ─── */\n\n .split-button--outline .split-button__primary,\n .split-button--outline .split-button__trigger {\n --hx-split-button-bg: transparent;\n --hx-split-button-color: var(--hx-color-text-primary, #0d1825);\n --hx-split-button-border-color: var(--hx-color-border-strong, #66787b);\n --hx-split-button-divider-color: var(--hx-color-border-default, #d6dbd5);\n }\n\n .split-button--outline .split-button__primary:hover,\n .split-button--outline .split-button__trigger:hover {\n --hx-split-button-bg: var(--hx-color-surface-raised, #f5f8f3);\n filter: none;\n }\n\n /* ─── Dropdown Menu Panel ─── */\n\n @keyframes hx-split-button-menu-open {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n .split-button__menu {\n display: none;\n position: absolute;\n top: calc(100% + var(--hx-space-1, 0.25rem));\n inset-inline-end: 0;\n min-width: 100%;\n max-height: var(--hx-split-button-menu-max-height, 18rem);\n overflow-y: auto;\n background-color: var(--hx-split-button-menu-bg, var(--hx-color-surface-default, #ffffff));\n border: var(--hx-border-width-thin, 1px) solid\n var(--hx-split-button-menu-border-color, var(--hx-color-border-default, #d6dbd5));\n border-radius: var(--hx-split-button-menu-border-radius, var(--hx-border-radius-md, 0.375rem));\n box-shadow: var(\n --hx-split-button-menu-shadow,\n 0 4px 6px -1px var(--hx-overlay-black-10, rgba(0, 0, 0, 0.1)),\n 0 2px 4px -2px var(--hx-overlay-black-10, rgba(0, 0, 0, 0.1))\n );\n padding: var(--hx-space-1, 0.25rem);\n z-index: var(--hx-z-index-dropdown, 1000);\n }\n\n .split-button__menu--open {\n display: block;\n animation: hx-split-button-menu-open var(--hx-transition-fast, 150ms ease);\n }\n\n /* ─── Reduced Motion ─── */\n\n @media (prefers-reduced-motion: reduce) {\n .split-button__primary,\n .split-button__trigger,\n .split-button__chevron {\n transition: none;\n }\n\n .split-button__menu--open {\n animation: none;\n }\n }\n\n /* ─── High Contrast Mode (forced-colors) ─── */\n\n @media (forced-colors: active) {\n .split-button__primary,\n .split-button__trigger {\n forced-color-adjust: none;\n background-color: ButtonFace;\n color: ButtonText;\n border: 2px solid ButtonText;\n }\n\n .split-button__primary:focus-visible,\n .split-button__trigger:focus-visible {\n outline: 3px solid Highlight;\n outline-offset: 2px;\n }\n\n .split-button__primary[disabled],\n .split-button__trigger[disabled] {\n background-color: ButtonFace;\n color: GrayText;\n border-color: GrayText;\n opacity: 1;\n }\n\n :host([disabled]) {\n opacity: 1;\n }\n\n .split-button__menu {\n background-color: Canvas;\n border: 2px solid CanvasText;\n }\n }\n`;\n","import { html, nothing, type PropertyValues } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property, state, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HelixElement, createIdCounter } from '../../base/index.js';\nimport { helixSplitButtonStyles } from './hx-split-button.styles.js';\nimport { forcedColorsInteractive } from '../../styles/forced-colors.js';\nimport type { HelixMenuItem } from '../hx-menu/hx-menu-item.js';\nimport { devWarn } from '../../utils/dev-warn.js';\nimport { flattenAccName } from '../../utils/aria-flatten.js';\nimport { getMenuItemTypeaheadLabel } from '../../utils/menu-label.js';\nimport { findClosestMenuAncestor } from '../../utils/menu-tree.js';\nimport {\n installAriaIdrefMirror,\n resolveIdrefTokens,\n type AriaIdrefMirrorHandle,\n} from '../../utils/aria-idref.js';\n\nconst _nextSplitButtonId = createIdCounter('hx-split-button');\n\n/**\n * A split button combining a primary action button with an attached dropdown\n * menu for secondary actions. Implements the ARIA menu button pattern for\n * full keyboard and screen reader support.\n *\n * ## Architecture Note: Composite host with two interactive children (Group 5b)\n *\n * The host wraps a primary `<button>`, a dropdown trigger `<button>`, and a\n * panel `<div role=\"menu\">` — three ARIA-bearing surfaces that cannot all\n * collapse onto the host. Group 5b keeps role placement on the inner\n * elements (consistent with `hx-overflow-menu`). The host carries no role.\n *\n * What Group 5b adds:\n * - **Host-attribute label mirror** via `installAriaIdrefMirror`: consumer\n * `aria-label` / `aria-labelledby` on the host flow to the inner primary\n * button's `aria-label`. Replaces the legacy `accessible-label` shim,\n * which was a workaround for ARIAMixin shadowing on the host. The shim\n * is preserved with a one-time devWarn for one minor version of back-\n * compat; new code should use the standard `aria-label` attribute.\n * - **Roving tabindex** on slotted `hx-menu-item` children inside the\n * panel. Only the focused item carries `tabindex=0`; arrow key\n * navigation rewrites the tabindex map via `_applyRovingTabIndex()`.\n * `setRovingTabIndex` is the same setter used by `hx-menu` for cross-\n * family pattern alignment.\n * - **First-character typeahead** with 500ms timeout matching `hx-menu`.\n *\n * @summary Primary action button with attached dropdown menu for secondary actions.\n *\n * @tag hx-split-button\n *\n * @slot - Primary button label text.\n * @slot menu - `hx-menu-item` children rendered in the dropdown panel.\n *\n * @fires {CustomEvent<{originalEvent: MouseEvent}>} hx-click - Dispatched when\n * the primary button is clicked and is not disabled.\n * @fires {CustomEvent<{value: string; label: string}>} hx-select - Dispatched when\n * a menu item is selected from the dropdown.\n *\n * @csspart button - The primary action button element.\n * @csspart trigger - The dropdown trigger button element.\n * @csspart menu - The dropdown menu panel.\n *\n * @cssprop [--hx-split-button-menu-max-height=18rem] - Maximum height of the dropdown menu panel before scrolling.\n * @cssprop [--hx-split-button-bg=var(--hx-color-primary-500)] - Background color for both buttons.\n * @cssprop [--hx-split-button-color=var(--hx-color-neutral-0)] - Text/icon color for both buttons.\n * @cssprop [--hx-split-button-border-color=transparent] - Border color.\n * @cssprop [--hx-split-button-border-radius=var(--hx-border-radius-md)] - Border radius.\n * @cssprop [--hx-split-button-divider-color=var(--hx-color-primary-900)] - Color of the divider between primary and trigger.\n * @cssprop [--hx-split-button-font-family=var(--hx-font-family-sans)] - Font family.\n * @cssprop [--hx-split-button-font-weight=var(--hx-font-weight-semibold)] - Font weight.\n * @cssprop [--hx-split-button-focus-ring-color=var(--hx-focus-ring-color)] - Focus ring color.\n * @cssprop [--hx-split-button-menu-bg=var(--hx-color-neutral-0)] - Dropdown menu background.\n * @cssprop [--hx-split-button-menu-border-color=var(--hx-color-neutral-200)] - Dropdown menu border color.\n * @cssprop [--hx-split-button-menu-border-radius=var(--hx-border-radius-md)] - Dropdown menu border radius.\n * @cssprop [--hx-split-button-menu-shadow] - Dropdown menu box shadow.\n * @cssprop [--hx-opacity-disabled] - Opacity.\n * @cssprop [--hx-space-2] - Spacing token.\n * @cssprop [--hx-border-width-thin] - Width.\n * @cssprop [--hx-border-radius-md] - CSS custom property.\n * @cssprop [--hx-color-primary-500] - Color.\n * @cssprop [--hx-color-neutral-0] - Color.\n * @cssprop [--hx-font-family-sans] - Font family.\n * @cssprop [--hx-font-weight-semibold] - Font weight.\n * @cssprop [--hx-line-height-tight] - Line height.\n * @cssprop [--hx-transition-fast] - Transition timing.\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-filter-brightness-hover] - CSS filter.\n * @cssprop [--hx-filter-brightness-active] - CSS filter.\n * @cssprop [--hx-space-1] - Spacing token.\n * @cssprop [--hx-space-3] - Spacing token.\n * @cssprop [--hx-font-size-sm] - Font size.\n * @cssprop [--hx-size-8] - Size token.\n * @cssprop [--hx-space-4] - Spacing token.\n * @cssprop [--hx-font-size-md] - Font size.\n * @cssprop [--hx-size-10] - Size token.\n * @cssprop [--hx-space-6] - Spacing token.\n * @cssprop [--hx-font-size-lg] - Font size.\n * @cssprop [--hx-size-12] - Size token.\n * @cssprop [--hx-color-primary-300] - Color.\n * @cssprop [--hx-color-primary-50] - Color.\n * @cssprop [--hx-color-neutral-100] - Color.\n * @cssprop [--hx-color-neutral-900] - Color.\n * @cssprop [--hx-color-neutral-300] - Color.\n * @cssprop [--hx-color-neutral-200] - Color.\n * @cssprop [--hx-color-error-500] - Color.\n * @cssprop [--hx-color-error-400] - Color.\n * @cssprop [--hx-color-error-600] - Color.\n * @cssprop [--hx-color-primary-200] - Color.\n * @cssprop [--hx-color-neutral-50] - Color.\n * @cssprop [--hx-overlay-black-10] - Overlay color.\n * @cssprop [--hx-z-index-dropdown] - Z-index layer.\n */\n@customElement('hx-split-button')\nexport class HelixSplitButton extends HelixElement {\n static override styles = [helixSplitButtonStyles, forcedColorsInteractive];\n\n // ─── Internal References ───\n\n /**\n * Reference to the dropdown menu panel element, used for positioning and focus management.\n * @internal\n */\n @query('.split-button__menu')\n private _menuPanel: HTMLElement | undefined;\n\n /**\n * Reference to the dropdown trigger button element, used to return focus after menu closes.\n * @internal\n */\n @query('.split-button__trigger')\n private _triggerButton: HTMLButtonElement | undefined;\n\n // ─── Internal State ───\n\n /**\n * Tracks whether the dropdown menu is currently open.\n * @internal\n */\n @state() private _open = false;\n\n // ─── Public Properties ───\n\n /**\n * Visual style variant of the split button.\n * @attr variant\n */\n @property({ type: String, reflect: true })\n variant: 'primary' | 'secondary' | 'tertiary' | 'danger' | 'ghost' | 'outline' = 'primary';\n\n /**\n * Size of the split button.\n * @attr hx-size\n */\n @property({ type: String, reflect: true, attribute: 'hx-size' })\n size: 'sm' | 'md' | 'lg' = 'md';\n\n /**\n * Whether the split button is disabled. Both the primary button and the\n * trigger are disabled when this is true.\n * @attr disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Primary button label text. When set, overrides the default slot content.\n * @attr label\n */\n @property({ type: String })\n label: string | undefined = undefined;\n\n /**\n * @deprecated Use the standard host `aria-label` attribute instead. Group\n * 5b replaces the `accessible-label` shim with a host-attribute mirror\n * driven by `installAriaIdrefMirror` — consumer host `aria-label` /\n * `aria-labelledby` flow to the inner primary button's `aria-label`,\n * which is the same composed-tree result as the legacy shim without\n * the ARIAMixin shadowing concern.\n *\n * The attribute remains observed for one minor version so existing\n * consumers do not regress; setting it logs a devWarn pointing them to\n * the standard `aria-label` path.\n * @attr accessible-label\n */\n @property({ type: String, attribute: 'accessible-label' })\n accessibleLabel = '';\n\n /**\n * Accessible label for the dropdown trigger button. Override for localization.\n * @attr label-trigger\n */\n @property({ type: String, attribute: 'label-trigger' })\n labelTrigger = 'More actions';\n\n /**\n * Accessible label for the dropdown menu panel. Override for localization.\n * @attr label-menu\n */\n @property({ type: String, attribute: 'label-menu' })\n labelMenu = 'Secondary actions';\n\n // ─── Unique IDs ───\n\n /**\n * Stable unique ID for the dropdown menu panel element, used to wire aria-controls on the trigger button.\n * @internal\n */\n private readonly _menuId = `${_nextSplitButtonId()}-menu`;\n\n // ─── Host-attribute label mirror state ───\n\n /**\n * Resolved accessible name for the primary action button — written to\n * the inner primary button's `aria-label` on render. AccName 1.2 §4.3.1\n * precedence: host `aria-labelledby` (resolved IDREFs, flattened) >\n * host `aria-label` > deprecated `accessible-label` (with devWarn) >\n * `label` property > slotted text content (no aria-label set when this\n * branch is taken so AT walks the inner content for the name).\n * @internal\n */\n @state() private _resolvedPrimaryLabel: string | null = null;\n\n /** @internal */\n private _ariaMirror: AriaIdrefMirrorHandle | null = null;\n\n // ─── Roving tabindex + typeahead state ───\n\n /** @internal */\n private _rovingIndex = -1;\n\n /** @internal */\n private _typeaheadBuffer = '';\n\n /** @internal */\n private _typeaheadTimer: ReturnType<typeof setTimeout> | null = null;\n\n // ─── Lifecycle ───\n\n override connectedCallback(): void {\n super.connectedCallback();\n document.addEventListener('click', this._handleOutsideClick);\n document.addEventListener('keydown', this._handleDocumentKeydown);\n this._syncResolvedPrimaryLabel();\n this._ariaMirror = installAriaIdrefMirror(this, () => {\n this._syncResolvedPrimaryLabel();\n });\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n document.removeEventListener('click', this._handleOutsideClick);\n document.removeEventListener('keydown', this._handleDocumentKeydown);\n if (this._typeaheadTimer !== null) {\n clearTimeout(this._typeaheadTimer);\n this._typeaheadTimer = null;\n }\n this._ariaMirror?.disconnect();\n this._ariaMirror = null;\n }\n\n override willUpdate(changedProperties: PropertyValues<this>): void {\n super.willUpdate(changedProperties);\n if (changedProperties.has('label') || changedProperties.has('accessibleLabel')) {\n this._syncResolvedPrimaryLabel();\n }\n }\n\n /**\n * Resolve the primary button's accessible name from host attributes\n * and (deprecated) properties. See `_resolvedPrimaryLabel` jsdoc for\n * precedence rules.\n * @internal\n */\n private _syncResolvedPrimaryLabel(): void {\n const liveLabelledBy = this.getAttribute('aria-labelledby');\n const consumerLabelEls = resolveIdrefTokens(this, liveLabelledBy);\n\n // CodeRabbit MUST-FIX: AccName 1.2 §4.3.2 — `aria-labelledby` references\n // their target text content REGARDLESS of visibility. The previous\n // outer visibility filter dropped legitimate accessible names from\n // visually-hidden labels. `flattenAccName` already handles aria-hidden\n // subtree pruning per §4.3.10.\n const flattenedFromIdrefs = consumerLabelEls\n .map((el) => flattenAccName(el))\n .filter((t) => t.length > 0)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n const liveAriaLabel = this.getAttribute('aria-label');\n const hostAriaLabel = liveAriaLabel !== null ? liveAriaLabel.trim() : '';\n\n let resolved: string | null = null;\n if (flattenedFromIdrefs) {\n resolved = flattenedFromIdrefs;\n } else if (hostAriaLabel) {\n resolved = hostAriaLabel;\n } else if (this.accessibleLabel) {\n // Deprecated path — emit a one-time devWarn pointing consumers at\n // the standard aria-label flow.\n if (!this._deprecatedAccessibleLabelWarned) {\n this._deprecatedAccessibleLabelWarned = true;\n devWarn(\n 'hx-split-button',\n '`accessible-label` is deprecated; use the standard `aria-label` attribute on hx-split-button instead. The shim continues to work in this minor version but will be removed in a future release.',\n );\n }\n resolved = this.accessibleLabel;\n } else if (this.label) {\n resolved = this.label;\n } else {\n // No explicit name supplied — leave aria-label off the primary\n // button so AT walks the slotted content for the accessible name.\n resolved = null;\n }\n\n this._resolvedPrimaryLabel = resolved;\n }\n\n /** @internal */\n private _deprecatedAccessibleLabelWarned = false;\n\n // ─── Outside-click / document keydown ───\n\n /** @internal */\n private readonly _handleOutsideClick = (e: MouseEvent): void => {\n if (!this._open) return;\n const target = e.target as Node;\n if (!this.contains(target) && target !== this) {\n this._closeMenu();\n }\n };\n\n /** @internal */\n private readonly _handleDocumentKeydown = (e: KeyboardEvent): void => {\n if (!this._open) return;\n if (e.key === 'Tab') {\n this._closeMenu();\n }\n };\n\n // ─── Primary Button Handlers ───\n\n /** @internal */\n private _handlePrimaryClick(e: MouseEvent): void {\n if (this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n /**\n * Dispatched when the primary button is clicked.\n * @event hx-click\n */\n this.dispatchEvent(\n new CustomEvent<{ originalEvent: MouseEvent }>('hx-click', {\n bubbles: true,\n composed: true,\n detail: { originalEvent: e },\n }),\n );\n }\n\n /** @internal */\n private _handlePrimaryKeydown(e: KeyboardEvent): void {\n if (this.disabled) return;\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n this._openMenu();\n }\n }\n\n // ─── Trigger Button Handlers ───\n\n /** @internal */\n private _handleTriggerClick(e: MouseEvent): void {\n if (this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n // Stop propagation so _handleOutsideClick does not immediately close.\n e.stopPropagation();\n this._toggleMenu();\n }\n\n /** @internal */\n private _handleTriggerKeydown(e: KeyboardEvent): void {\n if (this.disabled) return;\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n this._openMenu();\n }\n }\n\n // ─── Menu Key Navigation ───\n\n /** @internal */\n private _handleMenuKeydown(e: KeyboardEvent): void {\n const items = this._getMenuItems();\n if (items.length === 0) return;\n\n // document.activeElement returns the hx-menu-item host element when\n // host-canonical (post-Group-5b) — matches items[] directly. On the\n // legacy fallback path, focus delegates to the inner div but\n // document.activeElement still resolves to the host so the same\n // index works.\n const currentIndex = items.findIndex((item) => item === document.activeElement);\n\n switch (e.key) {\n case 'ArrowDown': {\n e.preventDefault();\n const next = currentIndex < items.length - 1 ? currentIndex + 1 : 0;\n this._focusMenuItem(items, next);\n break;\n }\n case 'ArrowUp': {\n e.preventDefault();\n const prev = currentIndex > 0 ? currentIndex - 1 : items.length - 1;\n this._focusMenuItem(items, prev);\n break;\n }\n case 'Escape': {\n e.preventDefault();\n this._closeMenu();\n this._triggerButton?.focus();\n break;\n }\n case 'Home': {\n e.preventDefault();\n this._focusMenuItem(items, 0);\n break;\n }\n case 'End': {\n e.preventDefault();\n this._focusMenuItem(items, items.length - 1);\n break;\n }\n default: {\n if (e.key.length === 1 && e.key !== ' ' && !e.ctrlKey && !e.metaKey && !e.altKey) {\n this._handleTypeahead(e.key, items);\n }\n break;\n }\n }\n }\n\n /** @internal */\n private _focusMenuItem(items: HelixMenuItem[], index: number): void {\n this._rovingIndex = index;\n this._applyRovingTabIndex(items);\n items[index]?.focus();\n }\n\n /**\n * Roving tabindex: only the focused item carries tabindex=0; the rest\n * are tabindex=-1. Tab from the panel exits the menu via document\n * keydown (line ~_handleDocumentKeydown), so the closing-Tab path\n * remains correct.\n * @internal\n */\n private _applyRovingTabIndex(items: HelixMenuItem[]): void {\n items.forEach((item, i) => {\n item.setRovingTabIndex(i === this._rovingIndex ? 0 : -1);\n });\n }\n\n /** @internal */\n private _handleTypeahead(char: string, items: HelixMenuItem[]): void {\n if (this._typeaheadTimer !== null) {\n clearTimeout(this._typeaheadTimer);\n }\n this._typeaheadBuffer += char.toLowerCase();\n this._typeaheadTimer = setTimeout(() => {\n this._typeaheadBuffer = '';\n this._typeaheadTimer = null;\n }, 500);\n\n // Codex push-gate round-7 finding 3: shared submenu-aware label\n // extractor — see hx-menu / hx-dropdown for rationale.\n const match = items.findIndex((item) => {\n const text = getMenuItemTypeaheadLabel(item).toLowerCase();\n return text.startsWith(this._typeaheadBuffer);\n });\n\n if (match !== -1) {\n this._focusMenuItem(items, match);\n }\n }\n\n // ─── Menu Item Selection ───\n\n /** @internal */\n private _handleMenuItemSelect(e: Event): void {\n if (!(e instanceof CustomEvent)) return;\n const custom = e as CustomEvent<{ item: HelixMenuItem; value: string }>;\n this._closeMenu();\n this._triggerButton?.focus();\n\n const item = custom.detail.item;\n const label = item?.textContent?.trim() ?? '';\n\n /**\n * Dispatched when a menu item is selected.\n * @event hx-select\n */\n this.dispatchEvent(\n new CustomEvent<{ value: string; label: string }>('hx-select', {\n bubbles: true,\n composed: true,\n detail: { value: custom.detail.value, label },\n }),\n );\n }\n\n /**\n * Bubbled `hx-item-submenu-open` from a slotted `hx-menu-item` host.\n * Codex push-gate round-9 P1: when slotted `hx-menu-item`s open / close\n * a nested submenu inside this menu panel (no enclosing `hx-menu`), the\n * events fly past with no handler. Match the round-4\n * `hx-menu._handleSubmenuOpen` shape so APG behaviour holds. Defer to\n * an inner `hx-menu` when present (it owns the toggle). Otherwise this\n * panel is the enclosing menu surface — call `setSubmenuOpen(true)` on\n * the dispatching item and focus its first nested child.\n * @internal\n */\n private _handleMenuSubmenuOpen = (e: Event): void => {\n if (!(e instanceof CustomEvent)) return;\n const detail = (e as CustomEvent<{ item: HelixMenuItem }>).detail;\n const item = detail?.item;\n if (!item) return;\n if (findClosestMenuAncestor(item) !== null) return;\n queueMicrotask(() => {\n if (e.defaultPrevented) return;\n item.setSubmenuOpen(true);\n void item.updateComplete\n .then(() => {\n const submenuSlot =\n item.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"submenu\"]');\n const nested = submenuSlot\n ?.assignedElements({ flatten: true })\n .find((el) => el.tagName.toLowerCase() === 'hx-menu') as\n | (HTMLElement & { focusFirst?: () => void })\n | undefined;\n nested?.focusFirst?.();\n })\n .catch(() => undefined);\n });\n };\n\n /**\n * Bubbled `hx-item-submenu-close` from a slotted `hx-menu-item` host.\n * Codex push-gate round-9 P1: when an inner `hx-menu` (a nested\n * submenu) handles its own close, the event still bubbles through this\n * panel — defer in that case so the panel stays open. When the\n * dispatching item is top-level inside this panel (no enclosing\n * `hx-menu`), there is no parent submenu to collapse, so close the\n * composite's menu and return focus to the trigger button.\n * @internal\n */\n private _handleMenuSubmenuClose = (e: Event): void => {\n if (!(e instanceof CustomEvent)) return;\n const detail = (e as CustomEvent<{ item: HelixMenuItem }>).detail;\n const item = detail?.item;\n if (!item) return;\n if (findClosestMenuAncestor(item) !== null) return;\n if (e.defaultPrevented) return;\n this._closeMenu();\n this._triggerButton?.focus();\n };\n\n // ─── Menu Helpers ───\n\n /** @internal */\n private _openMenu(): void {\n if (this._open) return;\n this._open = true;\n // Focus the first enabled menu item after the panel renders;\n // initialize roving tabindex so Tab from outside lands on the same\n // item that has visual focus.\n void this.updateComplete\n .then(() => {\n const items = this._getMenuItems();\n this._rovingIndex = items.length > 0 ? 0 : -1;\n this._applyRovingTabIndex(items);\n items[0]?.focus();\n })\n .catch(() => undefined);\n }\n\n /** @internal */\n private _closeMenu(): void {\n this._open = false;\n }\n\n /** @internal */\n private _toggleMenu(): void {\n if (this._open) {\n this._closeMenu();\n } else {\n this._openMenu();\n }\n }\n\n /**\n * Returns the enabled hx-menu-item host elements assigned to the `menu` slot.\n * HelixMenuItem overrides focus() to delegate to its inner element, so calling\n * .focus() on hosts works correctly. document.activeElement returns the host\n * element when the inner shadow element has focus, enabling correct index tracking.\n */\n /** @internal */\n private _getMenuItems(): HelixMenuItem[] {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"menu\"]');\n if (!slot) return [];\n\n return slot\n .assignedElements({ flatten: true })\n .filter(\n (el): el is HelixMenuItem =>\n el.tagName.toLowerCase() === 'hx-menu-item' && !(el as HelixMenuItem).disabled,\n );\n }\n\n // ─── Render ───\n\n override render() {\n const containerClasses = {\n 'split-button': true,\n [`split-button--${this.variant}`]: true,\n [`split-button--${this.size}`]: true,\n };\n\n const menuClasses = {\n 'split-button__menu': true,\n 'split-button__menu--open': this._open,\n };\n\n const chevronClasses = {\n 'split-button__chevron': true,\n 'split-button__chevron--open': this._open,\n };\n\n return html`\n <div class=${classMap(containerClasses)}>\n <!-- Primary action button -->\n <button\n part=\"button\"\n class=\"split-button__primary\"\n ?disabled=${this.disabled}\n type=\"button\"\n aria-label=${this._resolvedPrimaryLabel ?? nothing}\n @click=${this._handlePrimaryClick}\n @keydown=${this._handlePrimaryKeydown}\n >\n ${this.label !== undefined ? this.label : html`<slot></slot>`}\n </button>\n\n <!-- Dropdown trigger button -->\n <button\n part=\"trigger\"\n class=\"split-button__trigger\"\n ?disabled=${this.disabled}\n aria-haspopup=\"menu\"\n aria-expanded=${this._open ? 'true' : 'false'}\n aria-controls=${this._menuId}\n aria-label=${this.labelTrigger}\n type=\"button\"\n @click=${this._handleTriggerClick}\n @keydown=${this._handleTriggerKeydown}\n >\n <span class=${classMap(chevronClasses)} aria-hidden=\"true\">\n <svg\n width=\"12\"\n height=\"8\"\n viewBox=\"0 0 12 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1 1.5L6 6.5L11 1.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </span>\n </button>\n\n <!-- Dropdown menu panel -->\n <div\n part=\"menu\"\n id=${this._menuId}\n class=${classMap(menuClasses)}\n role=\"menu\"\n aria-label=${this.labelMenu}\n @keydown=${this._handleMenuKeydown}\n @hx-item-select=${this._handleMenuItemSelect}\n @hx-item-submenu-open=${this._handleMenuSubmenuOpen}\n @hx-item-submenu-close=${this._handleMenuSubmenuClose}\n >\n <slot name=\"menu\"></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-split-button': HelixSplitButton;\n }\n}\n"],"names":["helixSplitButtonStyles","css","_nextSplitButtonId","createIdCounter","HelixSplitButton","HelixElement","e","target","detail","item","findClosestMenuAncestor","submenuSlot","_a","nested","el","_b","installAriaIdrefMirror","changedProperties","liveLabelledBy","flattenedFromIdrefs","resolveIdrefTokens","flattenAccName","t","liveAriaLabel","hostAriaLabel","resolved","items","currentIndex","next","prev","index","i","char","match","getMenuItemTypeaheadLabel","custom","label","slot","containerClasses","menuClasses","chevronClasses","html","classMap","nothing","forcedColorsInteractive","__decorateClass","query","state","property","customElement"],"mappings":";;;;;;;;;AAEO,MAAMA,IAAyBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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.ts","../../src/components/hx-steps/hx-steps.ts","../../src/components/hx-steps/hx-step.styles.ts","../../src/components/hx-steps/hx-step.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixStepsStyles = css`\n :host {\n display: block;\n\n /* ─── Size defaults (md) ─── */\n --hx-steps-indicator-size: var(--hx-size-8, 2rem);\n --hx-steps-indicator-font-size: var(--hx-font-size-sm, 0.875rem);\n --hx-steps-indicator-icon-size: var(--hx-size-4, 1rem);\n --hx-steps-label-font-size: var(--hx-font-size-sm, 0.875rem);\n --hx-steps-description-font-size: var(--hx-font-size-xs, 0.75rem);\n\n /* ─── Item layout defaults (horizontal) ─── */\n --hx-steps-item-flex: 1;\n --hx-steps-item-width: auto;\n }\n\n .steps {\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n }\n\n /* ─── Orientation: vertical ─── */\n\n :host([orientation='vertical']) {\n --hx-steps-item-flex: initial;\n --hx-steps-item-width: 100%;\n }\n\n :host([orientation='vertical']) .steps {\n flex-direction: column;\n }\n\n /* ─── Size: sm ─── */\n\n :host([size='sm']) {\n --hx-steps-indicator-size: var(--hx-size-6, 1.5rem);\n --hx-steps-indicator-font-size: var(--hx-font-size-xs, 0.75rem);\n --hx-steps-indicator-icon-size: var(--hx-space-3, 0.75rem);\n --hx-steps-label-font-size: var(--hx-font-size-xs, 0.75rem);\n --hx-steps-description-font-size: var(--hx-font-size-xs, 0.75rem);\n }\n\n /* ─── Size: lg ─── */\n\n :host([size='lg']) {\n --hx-steps-indicator-size: var(--hx-size-10, 2.5rem);\n --hx-steps-indicator-font-size: var(--hx-font-size-md, 1rem);\n --hx-steps-indicator-icon-size: var(--hx-size-5, 1.25rem);\n --hx-steps-label-font-size: var(--hx-font-size-md, 1rem);\n --hx-steps-description-font-size: var(--hx-font-size-sm, 0.875rem);\n }\n\n /* ─── High Contrast Mode (forced-colors) ─── */\n\n /*\n * hx-steps is a layout container — forced-colors state is handled\n * by each hx-step child element's own forced-colors block.\n */\n @media (forced-colors: active) {\n :host {\n forced-color-adjust: auto;\n }\n }\n`;\n","import { html, nothing, type PropertyValues } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport { devWarn } from '../../utils/dev-warn.js';\nimport { HelixElement } from '../../base/index.js';\nimport { forcedColorsInteractive } from '../../styles/forced-colors.js';\nimport { helixStepsStyles } from './hx-steps.styles.js';\nimport type { HelixStep } from './hx-step.js';\n\n/**\n * A multi-step wizard / stepper progress indicator. Renders a sequence of\n * `<hx-step>` children as a horizontal or vertical step tracker with connector\n * lines and status-based styling.\n *\n * Provide an `aria-label` on `<hx-steps>` to describe the step process for assistive technology.\n *\n * @summary Multi-step progress indicator container.\n *\n * @tag hx-steps\n *\n * @slot - Default slot for `<hx-step>` elements.\n *\n * @fires {CustomEvent<{step: HelixStep, index: number}>} hx-step-click - Dispatched when\n * a step is clicked. Detail contains the clicked `step` element and its zero-based `index`.\n *\n * @csspart base - The inner wrapper element.\n *\n * @cssprop [--hx-steps-indicator-size=2rem] - Step indicator circle diameter.\n * @cssprop [--hx-steps-connector-color=var(--hx-color-neutral-200)] - Connector line color.\n * @cssprop [--hx-steps-label-color=var(--hx-color-neutral-600)] - Step label text color.\n * @cssprop [--hx-steps-description-color=var(--hx-color-neutral-500)] - Step description color.\n * @cssprop [--hx-steps-indicator-font-size] - Font size for step indicator text.\n * @cssprop [--hx-steps-indicator-icon-size] - Icon size within step indicator.\n * @cssprop [--hx-steps-label-font-size] - Font size for step labels.\n * @cssprop [--hx-steps-description-font-size] - Font size for step description text.\n * @cssprop [--hx-steps-item-flex] - Flex grow/shrink value for step items.\n * @cssprop [--hx-steps-item-width] - Fixed width for step items.\n * @cssprop [--hx-size-8] - Size token.\n * @cssprop [--hx-font-size-sm] - Font size.\n * @cssprop [--hx-size-4] - Size token.\n * @cssprop [--hx-font-size-xs] - Font size.\n * @cssprop [--hx-size-6] - Size token.\n * @cssprop [--hx-space-3] - Spacing token.\n * @cssprop [--hx-size-10] - Size token.\n * @cssprop [--hx-font-size-md] - Font size.\n * @cssprop [--hx-size-5] - Size token.\n */\n@customElement('hx-steps')\nexport class HelixSteps extends HelixElement {\n static override styles = [helixStepsStyles, forcedColorsInteractive];\n\n // ─── Public Properties ───\n\n /**\n * Layout orientation of the steps.\n * @attr orientation\n */\n @property({ type: String, reflect: true })\n orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Size variant of the steps.\n * @attr hx-size\n */\n @property({ type: String, reflect: true, attribute: 'hx-size' })\n size: 'sm' | 'md' | 'lg' = 'md';\n\n /**\n * Accessible label for the list. Forwarded to the inner list element.\n * Uses `accessible-label` attribute instead of `aria-label` to avoid\n * ARIAMixin shadowing on the host element.\n *\n * Note: `mixinDelegatesAria` is not applied to this component because the\n * `accessible-label` attribute approach avoids the ARIAMixin property conflict\n * without requiring mixin overhead.\n * @attr accessible-label\n */\n @property({ type: String, attribute: 'accessible-label' })\n accessibleLabel: string | null = null;\n\n // ─── Lifecycle ───\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Backward compat: accept legacy `size` attribute. When present and `hx-size`\n // is not set, map the value and emit a deprecation warning.\n const legacySize = this.getAttribute('size');\n if (legacySize !== null && !this.hasAttribute('hx-size')) {\n devWarn('hx-steps', 'The \"size\" attribute is deprecated. Use \"hx-size\" instead.');\n this.size = legacySize as 'sm' | 'md' | 'lg';\n }\n // STEPS-002: WCAG 2.1 SC 4.1.2 — the inner list must have an accessible name.\n // Warn developers when aria-label is missing so the list is not anonymous.\n if (!this.accessibleLabel) {\n devWarn(\n 'hx-steps',\n 'An \"aria-label\" attribute is required to provide an accessible name for the steps list (WCAG 2.1 SC 4.1.2).',\n );\n }\n // WCAG 4.1.2: suppress the host element's implicit ARIA role so only the\n // inner div[role=\"list\"] is announced. Mirrors the hx-action-bar pattern.\n // Without this, the consumer's aria-label attribute on the host causes dual\n // announcement — once for the host element and once for the inner list.\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'none');\n }\n this.addEventListener('hx-step-click-internal', this._handleStepClickInternal);\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('hx-step-click-internal', this._handleStepClickInternal);\n }\n\n override firstUpdated(): void {\n this._syncChildren();\n }\n\n override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (changedProperties.has('orientation') || changedProperties.has('size')) {\n this._syncChildren();\n }\n }\n\n // ─── Child Sync ───\n\n /** @internal */\n private _getSteps(): HelixStep[] {\n return Array.from(this.querySelectorAll(':scope > hx-step')) as HelixStep[];\n }\n\n /** @internal */\n private _syncChildren(): void {\n const steps = this._getSteps();\n steps.forEach((step, i) => {\n step.orientation = this.orientation;\n step.size = this.size;\n step.index = i;\n });\n }\n\n // ─── Event Handling ───\n\n /** @internal */\n private _handleSlotChange = (): void => {\n this._syncChildren();\n };\n\n /** @internal */\n private _handleStepClickInternal = (e: Event): void => {\n e.stopPropagation();\n const steps = this._getSteps();\n const step = e\n .composedPath()\n .find(\n (el): el is HelixStep => el instanceof Element && el.tagName.toLowerCase() === 'hx-step',\n );\n if (!step) return;\n const index = steps.indexOf(step);\n\n /**\n * Dispatched when a step is clicked.\n * @event hx-step-click\n */\n this.dispatchEvent(\n new CustomEvent<{ step: HelixStep; index: number }>('hx-step-click', {\n bubbles: true,\n composed: true,\n detail: { step, index },\n }),\n );\n };\n\n // ─── Render ───\n\n override render() {\n return html`\n <div part=\"base\" class=\"steps\" role=\"list\" aria-label=${this.accessibleLabel ?? nothing}>\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-steps': HelixSteps;\n }\n}\n","import { css } from 'lit';\n\nexport const helixStepStyles = css`\n :host {\n display: flex;\n flex: var(--hx-steps-item-flex, 1);\n width: var(--hx-steps-item-width, auto);\n min-width: 0;\n }\n\n /* ─── Visually Hidden (SR only) ─── */\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n }\n\n /* ─── Step Wrapper ─── */\n\n .step {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n cursor: pointer;\n }\n\n /* ─── Focus ─── */\n\n :host(:focus-visible) .step__indicator {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-steps-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n /* ─── Track (indicator + connector) ─── */\n\n .step__track {\n display: flex;\n flex-direction: row;\n align-items: center;\n width: 100%;\n }\n\n /* ─── Indicator ─── */\n\n .step__indicator {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--hx-steps-indicator-size, 2rem);\n height: var(--hx-steps-indicator-size, 2rem);\n border-radius: var(--hx-border-radius-full, 9999px);\n border: var(--hx-border-width-medium, 2px) solid\n var(--hx-steps-indicator-border-color, var(--hx-color-border-strong, #66787b));\n background-color: var(--hx-steps-indicator-bg, var(--hx-color-surface-default, #ffffff));\n color: var(--hx-steps-indicator-color, var(--hx-color-text-muted, #4a5362));\n font-size: var(--hx-steps-indicator-font-size, var(--hx-font-size-sm));\n font-weight: var(--hx-font-weight-semibold);\n font-family: var(--hx-steps-font-family, var(--hx-font-family-sans));\n transition:\n background-color var(--hx-transition-fast, 150ms ease),\n border-color var(--hx-transition-fast, 150ms ease),\n color var(--hx-transition-fast, 150ms ease);\n position: relative;\n z-index: 1;\n }\n\n .step__indicator svg {\n width: var(--hx-steps-indicator-icon-size, 1rem);\n height: var(--hx-steps-indicator-icon-size, 1rem);\n }\n\n /* ─── Connector ─── */\n\n .step__connector {\n flex: 1;\n height: var(--hx-steps-connector-thickness, var(--hx-border-width, 2px));\n min-width: 0;\n background-color: var(--hx-steps-connector-color, var(--hx-color-border-default, #d6dbd5));\n transition: background-color var(--hx-transition-fast, 150ms ease);\n }\n\n :host(:last-child) .step__connector {\n display: none;\n }\n\n /* ─── Label Area ─── */\n\n .step__label-area {\n text-align: center;\n margin-top: var(--hx-space-2, 0.5rem);\n width: 100%;\n padding: 0 var(--hx-space-1, 0.25rem);\n }\n\n .step__label {\n font-family: var(--hx-steps-font-family, var(--hx-font-family-sans));\n font-size: var(--hx-steps-label-font-size, var(--hx-font-size-sm));\n font-weight: var(--hx-font-weight-medium);\n color: var(--hx-steps-label-color, var(--hx-color-text-secondary, #313e4b));\n line-height: var(--hx-line-height-tight, 1.25);\n }\n\n .step__description {\n font-family: var(--hx-steps-font-family, var(--hx-font-family-sans));\n font-size: var(--hx-steps-description-font-size, var(--hx-font-size-xs));\n color: var(--hx-steps-description-color, var(--hx-color-text-muted, #4a5362));\n margin-top: var(--hx-space-1, 0.25rem);\n line-height: var(--hx-line-height-normal, 1.5);\n }\n\n /* ─── Status: active ─── */\n\n /* Active: outlined indicator (in-progress) — visually distinct from complete (filled) */\n :host([status='active']) .step__indicator {\n border-color: var(--hx-steps-active-border-color, var(--hx-color-primary-500, #429797));\n background-color: var(--hx-steps-active-bg, var(--hx-color-primary-500, #429797));\n color: var(--hx-steps-active-color, var(--hx-color-text-on-primary, #ffffff));\n }\n\n :host([status='active']) .step__label {\n color: var(--hx-steps-active-label-color, var(--hx-color-primary-700, #0f6363));\n font-weight: var(--hx-font-weight-semibold);\n }\n\n /* ─── Status: complete ─── */\n\n /* Complete: filled indicator with darker shade — visually distinct from active.\n on-primary tokens are tuned for primary-500. primary-700 + on-primary\n (= neutral-900) drops to 2.54:1 — fails AA for the check icon / step\n number. Pin fg at neutral-0 (7.03:1 on primary-700). Mirrors\n hx-toggle-button pressed treatment. */\n :host([status='complete']) .step__indicator {\n border-color: var(--hx-steps-complete-border-color, var(--hx-color-primary-700, #0f6363));\n background-color: var(--hx-steps-complete-bg, var(--hx-color-primary-700, #0f6363));\n color: var(--hx-steps-complete-color, var(--hx-color-neutral-0, #ffffff));\n }\n\n :host([status='complete']) .step__connector {\n background-color: var(\n --hx-steps-connector-complete-color,\n var(--hx-color-primary-500, #429797)\n );\n }\n\n :host([status='complete']) .step__label {\n color: var(--hx-steps-complete-label-color, var(--hx-color-text-primary, #0d1825));\n }\n\n /* ─── Status: error ─── */\n\n :host([status='error']) .step__indicator {\n border-color: var(--hx-steps-error-border-color, var(--hx-color-error-500, #e5493e));\n background-color: var(--hx-steps-error-bg, var(--hx-color-error-500, #e5493e));\n color: var(--hx-steps-error-color, var(--hx-color-text-on-error, #ffffff));\n }\n\n :host([status='error']) .step__label {\n color: var(--hx-steps-error-label-color, var(--hx-color-error-700, #a21312));\n }\n\n /* ─── Status: disabled ─── */\n\n :host([disabled]) .step {\n cursor: not-allowed;\n opacity: var(--hx-opacity-disabled, 0.5);\n pointer-events: none;\n }\n\n :host([disabled]) .step__indicator {\n border-color: var(--hx-steps-disabled-border-color, var(--hx-color-border-default, #d6dbd5));\n background-color: var(--hx-steps-disabled-bg, var(--hx-color-surface-sunken, #ebeee9));\n color: var(--hx-steps-disabled-color, var(--hx-color-text-placeholder, #8e9c98));\n }\n\n /* ─── Vertical Layout ─── */\n\n :host([orientation='vertical']) {\n flex: initial;\n width: 100%;\n }\n\n :host([orientation='vertical']) .step {\n flex-direction: row;\n align-items: flex-start;\n gap: var(--hx-space-3, 0.75rem);\n }\n\n :host([orientation='vertical']) .step__track {\n flex-direction: column;\n align-items: center;\n width: auto;\n flex-shrink: 0;\n }\n\n :host([orientation='vertical']) .step__connector {\n width: var(--hx-steps-connector-thickness, var(--hx-border-width, 2px));\n height: auto;\n min-height: var(--hx-space-8, 2rem);\n flex: 1;\n }\n\n :host([orientation='vertical']) .step__label-area {\n text-align: start;\n margin-top: 0;\n padding-bottom: var(--hx-space-4, 1rem);\n padding-inline-start: 0;\n }\n\n :host([orientation='vertical']:last-child) .step__label-area {\n padding-bottom: 0;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .step__indicator {\n transition: none;\n }\n\n .step__connector {\n transition: none;\n }\n }\n\n /* ─── Forced Colors (Windows High Contrast) ─── */\n\n @media (forced-colors: active) {\n .step__indicator {\n border-color: CanvasText;\n }\n\n :host([status='active']) .step__indicator {\n border-color: Highlight;\n background-color: Highlight;\n color: HighlightText;\n }\n\n :host([status='complete']) .step__indicator {\n border-color: Highlight;\n background-color: Highlight;\n color: HighlightText;\n }\n\n :host([status='error']) .step__indicator {\n border-color: LinkText;\n background-color: LinkText;\n color: HighlightText;\n }\n\n .step__connector {\n background-color: CanvasText;\n }\n\n :host([status='complete']) .step__connector {\n background-color: Highlight;\n }\n\n :host(:focus-visible) .step__indicator {\n outline: 3px solid Highlight;\n outline-offset: 2px;\n }\n }\n`;\n","import { html, type PropertyValues } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport { HelixElement } from '../../base/index.js';\nimport { forcedColorsInteractive } from '../../styles/forced-colors.js';\nimport { helixStepStyles } from './hx-step.styles.js';\n\n/**\n * An individual step, designed to be used inside an `<hx-steps>` container.\n * Represents a single step in a multi-step wizard or progress indicator.\n *\n * @summary Individual step item within an `<hx-steps>` progress indicator.\n *\n * @tag hx-step\n *\n * @slot icon - Custom icon for the step indicator. Shown when status is `pending` or `active`.\n * @slot label - Step label text. Falls back to the `label` property.\n * @slot description - Step description text. Falls back to the `description` property.\n *\n * @csspart base - The outermost wrapper element.\n * @csspart indicator - The circular step indicator.\n * @csspart connector - The line connecting this step to the next.\n * @csspart label - The step label element.\n * @csspart description - The step description element.\n *\n * @cssprop [--hx-steps-indicator-size=2rem] - Indicator circle diameter.\n * @cssprop [--hx-steps-indicator-font-size=var(--hx-font-size-sm)] - Indicator text size.\n * @cssprop [--hx-steps-indicator-icon-size=1rem] - Indicator icon size.\n * @cssprop [--hx-steps-label-font-size=var(--hx-font-size-sm)] - Label font size.\n * @cssprop [--hx-steps-description-font-size=var(--hx-font-size-xs)] - Description font size.\n * @cssprop [--hx-steps-connector-color=var(--hx-color-neutral-200)] - Connector line color.\n * @cssprop [--hx-steps-connector-complete-color=var(--hx-color-primary-500)] - Connector color when step is complete.\n * @cssprop [--hx-steps-connector-thickness=var(--hx-border-width,2px)] - Connector line thickness.\n * @cssprop [--hx-steps-label-color=var(--hx-color-neutral-600)] - Label text color.\n * @cssprop [--hx-steps-description-color=var(--hx-color-neutral-500)] - Description text color.\n */\n@customElement('hx-step')\nexport class HelixStep extends HelixElement {\n static override styles = [helixStepStyles, forcedColorsInteractive];\n\n // ─── Public Properties ───\n\n /**\n * The step label text.\n * @attr label\n */\n @property({ type: String, reflect: true })\n label = '';\n\n /**\n * Current status of the step.\n * @attr status\n */\n @property({ type: String, reflect: true })\n status: 'pending' | 'active' | 'complete' | 'error' = 'pending';\n\n /**\n * Optional description text shown below the label.\n * @attr description\n */\n @property({ type: String, reflect: true })\n description = '';\n\n /**\n * Whether the step is disabled and non-interactive.\n * @attr disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n // ─── Internal Properties (set by parent hx-steps) ───\n\n /**\n * Layout orientation. Set by the parent `<hx-steps>` container via JS property.\n * Do not set this attribute directly on `<hx-step>` — use the `orientation`\n * property on the parent `<hx-steps>` container instead. The parent will\n * propagate the value to all child steps via `_syncChildren()`.\n * @internal\n */\n @property({ attribute: false })\n orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Size variant. Set by the parent `<hx-steps>` container via JS property.\n * Do not set this attribute directly on `<hx-step>` — use the `size` property\n * on the parent `<hx-steps>` container instead. The parent will propagate the\n * value to all child steps via `_syncChildren()`.\n * @internal\n */\n @property({ attribute: false })\n size: 'sm' | 'md' | 'lg' = 'md';\n\n /**\n * Zero-based index of this step. Set by the parent `<hx-steps>` container.\n * @internal\n */\n @property({ type: Number })\n index = 0;\n\n // ─── Internal State ───\n\n /**\n * Text for the aria-live region, updated on status transitions.\n * Non-reactive: computed in willUpdate() to avoid an extra render cycle.\n * @internal\n */\n private _liveMessage = '';\n\n // ─── Lifecycle ───\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\n this.setAttribute('tabindex', this.disabled ? '-1' : '0');\n this.addEventListener('keydown', this._handleKeydown);\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('keydown', this._handleKeydown);\n }\n\n override willUpdate(changedProperties: PropertyValues<this>): void {\n if (changedProperties.has('status')) {\n // STEPS-003: announce status transitions to screen readers via aria-live region.\n // Only announce on transitions (not initial render) by checking the previous value.\n // Using a non-reactive field here avoids scheduling an extra render cycle.\n const prev = changedProperties.get('status');\n if (prev !== undefined) {\n if (this.status === 'complete') {\n this._liveMessage = 'Complete';\n } else if (this.status === 'error') {\n this._liveMessage = 'Error';\n } else {\n this._liveMessage = '';\n }\n }\n }\n }\n\n override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (changedProperties.has('status')) {\n if (this.status === 'active') {\n this.setAttribute('aria-current', 'step');\n } else {\n this.removeAttribute('aria-current');\n }\n }\n if (changedProperties.has('disabled')) {\n if (this.disabled) {\n this.setAttribute('tabindex', '-1');\n this.setAttribute('aria-disabled', 'true');\n } else {\n this.setAttribute('tabindex', '0');\n this.removeAttribute('aria-disabled');\n }\n }\n if (changedProperties.has('orientation')) {\n this.setAttribute('orientation', this.orientation);\n }\n if (changedProperties.has('size')) {\n this.setAttribute('size', this.size);\n }\n }\n\n // ─── Event Handling ───\n\n /** @internal */\n private _handleKeydown = (event: KeyboardEvent): void => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this._handleClick();\n }\n };\n\n /** @internal */\n private _handleClick(): void {\n if (this.disabled) {\n return;\n }\n\n /**\n * Internal event dispatched to signal step click to the parent container.\n * @internal\n */\n this.dispatchEvent(\n new CustomEvent<void>('hx-step-click-internal', {\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // ─── Render Helpers ───\n\n /** @internal */\n private _renderCheckmark() {\n return html`\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M20 6L9 17l-5-5\" />\n </svg>\n <span class=\"sr-only\">Complete</span>\n `;\n }\n\n /** @internal */\n private _renderXMark() {\n return html`\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n >\n <path d=\"M18 6L6 18M6 6l12 12\" />\n </svg>\n <span class=\"sr-only\">Error</span>\n `;\n }\n\n /** @internal */\n private _renderIndicatorContent() {\n if (this.status === 'complete') {\n return this._renderCheckmark();\n }\n if (this.status === 'error') {\n return this._renderXMark();\n }\n return html`<slot name=\"icon\">${this.index + 1}</slot>`;\n }\n\n // ─── Render ───\n\n override render() {\n return html`\n <div part=\"base\" class=\"step\" @click=${this._handleClick}>\n <div class=\"step__track\">\n <div part=\"indicator\" class=\"step__indicator\">${this._renderIndicatorContent()}</div>\n <div part=\"connector\" class=\"step__connector\" aria-hidden=\"true\"></div>\n </div>\n <div class=\"step__label-area\">\n <div part=\"label\" class=\"step__label\">\n <slot name=\"label\">${this.label}</slot>\n </div>\n <div part=\"description\" class=\"step__description\">\n <slot name=\"description\">${this.description}</slot>\n </div>\n </div>\n </div>\n <div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">${this._liveMessage}</div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-step': HelixStep;\n }\n}\n"],"names":["helixStepsStyles","css","HelixSteps","HelixElement","e","steps","step","el","index","legacySize","changedProperties","i","html","nothing","forcedColorsInteractive","__decorateClass","property","customElement","helixStepStyles","HelixStep","event"],"mappings":";;;;AAEO,MAAMA,IAAmBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAT9BG,EAUX,WAAA,SAAA,CAAA;AAOAJ,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAhB9BG,EAiBX,WAAA,UAAA,CAAA;AAOAJ,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAvB9BG,EAwBX,WAAA,eAAA,CAAA;AAOAJ,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GA9B/BG,EA+BX,WAAA,YAAA,CAAA;AAYAJ,EAAA;AAAA,EADCC,EAAS,EAAE,WAAW,GAAA,CAAO;AAAA,GA1CnBG,EA2CX,WAAA,eAAA,CAAA;AAUAJ,EAAA;AAAA,EADCC,EAAS,EAAE,WAAW,GAAA,CAAO;AAAA,GApDnBG,EAqDX,WAAA,QAAA,CAAA;AAOAJ,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA3DfG,EA4DX,WAAA,SAAA,CAAA;AA5DWA,IAANJ,EAAA;AAAA,EADNE,EAAc,SAAS;AAAA,GACXE,CAAA;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hx-switch-TvKGvZJz.js","sources":["../../src/components/hx-switch/hx-switch.styles.ts","../../src/components/hx-switch/hx-switch.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixSwitchStyles = css`\n :host {\n display: block;\n }\n\n :host([disabled]) {\n opacity: var(--hx-opacity-disabled, 0.5);\n pointer-events: none;\n }\n\n * {\n box-sizing: border-box;\n }\n\n /* --- Layout --- */\n\n .switch {\n display: flex;\n flex-direction: column;\n gap: var(--hx-space-1, 0.25rem);\n font-family: var(--hx-switch-font-family, var(--hx-font-family-sans, sans-serif));\n }\n\n /* WCAG 2.5.5 (healthcare mandate): minimum 44px touch target height.\n The track itself is smaller visually, but the row must meet the\n interactive touch target threshold for all size variants. */\n .switch__control-row {\n display: flex;\n align-items: center;\n gap: var(--hx-space-2, 0.5rem);\n min-height: var(--hx-touch-target-min, 2.75rem);\n }\n\n /* --- Track --- */\n\n .switch__track {\n position: relative;\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n border: none;\n padding: 0;\n border-radius: var(--hx-border-radius-full, 9999px);\n background-color: var(--hx-switch-track-bg, var(--hx-color-border-strong, #66787b));\n cursor: pointer;\n transition: background-color var(--hx-transition-fast, 150ms ease);\n outline: none;\n -webkit-appearance: none;\n appearance: none;\n }\n\n /*\n * Host-focus path: on the modern (IDL element-references) render branch the\n * host is the tabbable surface (tabindex=0) and the inner track button is\n * demoted to tabindex=-1. Drive the focus ring from ':host(:focus-visible)'\n * so keyboard users still see a visible affordance. Codex round-11 P1.\n */\n :host(:focus-visible) .switch__track {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-switch-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n /*\n * Fallback (no-IDL-ref) path: the host carries tabindex=-1 and the inner\n * track button is the tab target. Native :focus-visible drives the ring.\n */\n .switch__track:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-switch-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n .switch--checked .switch__track {\n background-color: var(--hx-switch-track-checked-bg, var(--hx-color-primary-500, #429797));\n }\n\n .switch:not(.switch--checked) .switch__track:hover {\n background-color: var(--hx-switch-track-hover-bg, var(--hx-color-border-strong, #66787b));\n }\n\n .switch--checked .switch__track:hover {\n background-color: var(--hx-switch-track-checked-hover-bg, var(--hx-color-primary-600, #0f7078));\n }\n\n /* --- Thumb --- */\n\n .switch__thumb {\n position: absolute;\n border-radius: var(--hx-border-radius-full, 9999px);\n background-color: var(--hx-switch-thumb-bg, var(--hx-color-surface-default, #ffffff));\n box-shadow: var(--hx-switch-thumb-shadow, var(--hx-shadow-sm, 0 1px 2px 0 rgb(0 0 0 / 0.05)));\n transition: transform var(--hx-transition-fast, 150ms ease);\n }\n\n /* --- Size: sm (track 32x18, thumb 14px) --- */\n\n .switch--sm .switch__track {\n width: var(--hx-switch-track-width-sm, var(--hx-size-8, 2rem));\n height: var(--hx-switch-track-height-sm, var(--hx-size-4-5, 1.125rem));\n }\n\n .switch--sm .switch__thumb {\n width: var(--hx-switch-thumb-size-sm, var(--hx-size-3-5, 0.875rem));\n height: var(--hx-switch-thumb-size-sm, var(--hx-size-3-5, 0.875rem));\n top: 50%;\n left: var(--hx-switch-thumb-offset, var(--hx-space-0-5, 0.125rem));\n transform: translateY(-50%);\n }\n\n .switch--sm.switch--checked .switch__thumb {\n transform: translateY(-50%)\n translateX(var(--hx-switch-thumb-size-sm, var(--hx-size-3-5, 0.875rem)));\n }\n\n /* --- Size: md (track 40x22, thumb 18px) --- */\n\n .switch--md .switch__track {\n width: var(--hx-switch-track-width-md, var(--hx-size-10, 2.5rem));\n height: var(--hx-switch-track-height-md, var(--hx-size-5-5, 1.375rem));\n }\n\n .switch--md .switch__thumb {\n width: var(--hx-switch-thumb-size-md, var(--hx-size-4-5, 1.125rem));\n height: var(--hx-switch-thumb-size-md, var(--hx-size-4-5, 1.125rem));\n top: 50%;\n left: var(--hx-switch-thumb-offset, var(--hx-space-0-5, 0.125rem));\n transform: translateY(-50%);\n }\n\n .switch--md.switch--checked .switch__thumb {\n transform: translateY(-50%)\n translateX(var(--hx-switch-thumb-size-md, var(--hx-size-4-5, 1.125rem)));\n }\n\n /* --- Size: lg (track 48x26, thumb 22px) --- */\n\n .switch--lg .switch__track {\n width: var(--hx-switch-track-width-lg, var(--hx-size-12, 3rem));\n height: var(--hx-switch-track-height-lg, var(--hx-size-6-5, 1.625rem));\n }\n\n .switch--lg .switch__thumb {\n width: var(--hx-switch-thumb-size-lg, var(--hx-size-5-5, 1.375rem));\n height: var(--hx-switch-thumb-size-lg, var(--hx-size-5-5, 1.375rem));\n top: 50%;\n left: var(--hx-switch-thumb-offset, var(--hx-space-0-5, 0.125rem));\n transform: translateY(-50%);\n }\n\n .switch--lg.switch--checked .switch__thumb {\n transform: translateY(-50%)\n translateX(var(--hx-switch-thumb-size-lg, var(--hx-size-5-5, 1.375rem)));\n }\n\n /* --- Label --- */\n\n .switch__label {\n font-size: var(--hx-font-size-sm, 0.875rem);\n font-weight: var(--hx-font-weight-medium, 500);\n color: var(--hx-switch-label-color, var(--hx-color-text-strong, #202b39));\n line-height: var(--hx-line-height-normal, 1.5);\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n }\n\n .switch__required-marker {\n color: var(--hx-switch-error-color, var(--hx-color-error-text, #c92a2a));\n font-weight: var(--hx-font-weight-bold, 700);\n }\n\n /* --- Help Text & Error --- */\n\n .switch__help-text {\n font-size: var(--hx-font-size-xs, 0.75rem);\n color: var(--hx-switch-help-text-color, var(--hx-color-text-muted, #4a5362));\n line-height: var(--hx-line-height-normal, 1.5);\n }\n\n .switch__error {\n font-size: var(--hx-font-size-xs, 0.75rem);\n color: var(--hx-switch-error-color, var(--hx-color-error-text, #c92a2a));\n line-height: var(--hx-line-height-normal, 1.5);\n }\n\n /* --- Reduced Motion --- */\n\n @media (prefers-reduced-motion: reduce) {\n .switch__track,\n .switch__thumb {\n transition: none;\n }\n }\n\n /* ─── High Contrast Mode (forced-colors) ─── */\n\n @media (forced-colors: active) {\n .switch__track {\n forced-color-adjust: none;\n background-color: ButtonFace;\n border: 2px solid ButtonText;\n }\n\n :host(:focus-visible) .switch__track,\n .switch__track:focus-visible {\n outline: 3px solid Highlight;\n outline-offset: 2px;\n }\n\n .switch__thumb {\n background-color: ButtonText;\n box-shadow: none;\n }\n\n .switch--checked .switch__track {\n background-color: Highlight;\n border-color: Highlight;\n }\n\n .switch--checked .switch__thumb {\n background-color: HighlightText;\n }\n\n :host([disabled]) {\n opacity: 1;\n }\n\n :host([disabled]) .switch__track {\n border-color: GrayText;\n background-color: ButtonFace;\n }\n\n :host([disabled]) .switch__thumb {\n background-color: GrayText;\n }\n\n :host([disabled]) .switch__label {\n color: GrayText;\n }\n\n .switch__label {\n color: CanvasText;\n }\n\n .switch__help-text {\n color: GrayText;\n }\n\n .switch__error {\n color: LinkText;\n }\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 { ifDefined } from 'lit/directives/if-defined.js';\nimport { HelixElement, createIdCounter } from '../../base/index.js';\nimport { FormMixin } from '../../mixins/FormMixin.js';\nimport { helixSwitchStyles } from './hx-switch.styles.js';\nimport { forcedColorsField } from '../../styles/forced-colors.js';\nimport {\n installAriaIdrefMirror,\n resolveIdrefTokens,\n supportsIdrefElementReferences,\n type AriaIdrefMirrorHandle,\n} from '../../utils/aria-idref.js';\n\nconst _nextSwitchId = createIdCounter('hx-switch');\n\n/** Detail for the hx-change event dispatched by hx-switch. */\nexport interface HxSwitchChangeDetail {\n checked: boolean;\n value: string;\n}\n\n/**\n * A toggle switch component for on/off states.\n *\n * Uses `role=\"switch\"` with `aria-checked` to convey toggle state.\n * Supports keyboard activation via Space key (per ARIA APG switch pattern).\n * Label association is handled through `aria-labelledby`, and\n * error/help text are linked via `aria-describedby`.\n *\n * @summary Form-associated toggle switch with label, error, and help text.\n *\n * @tag hx-switch\n *\n * @slot - Custom label content (overrides the label property).\n * @slot error - Custom error content (overrides the error property).\n * @slot help-text - Custom help text content (overrides the helpText property).\n *\n * @fires {CustomEvent<{checked: boolean, value: string}>} hx-change - Dispatched when the switch is toggled. Boolean-selection controls (`hx-switch`, `hx-checkbox`) include both `checked` (boolean state) and `value` (form value) in the detail; text-value controls (`hx-text-input`, `hx-combobox`, `hx-select`) emit only `{value}`.\n *\n * @csspart switch - The switch container (track + thumb wrapper).\n * @csspart track - The track background element.\n * @csspart thumb - The sliding thumb element.\n * @csspart label - The label text element.\n * @csspart help-text - The help text container.\n * @csspart error - The error message container.\n *\n * @cssprop [--hx-switch-track-bg=var(--hx-color-neutral-300)] - Track background color.\n * @cssprop [--hx-switch-track-checked-bg=var(--hx-color-primary-500)] - Track background when checked.\n * @cssprop [--hx-switch-thumb-bg=var(--hx-color-neutral-0)] - Thumb background color.\n * @cssprop [--hx-switch-thumb-shadow=var(--hx-shadow-sm)] - Thumb box shadow.\n * @cssprop [--hx-switch-focus-ring-color=var(--hx-focus-ring-color)] - Focus ring color.\n * @cssprop [--hx-switch-label-color=var(--hx-color-neutral-700)] - Label text color.\n * @cssprop [--hx-switch-error-color=var(--hx-color-error-500)] - Error message color.\n * @cssprop [--hx-switch-help-text-color=var(--hx-color-neutral-500)] - Help text color.\n * @cssprop [--hx-opacity-disabled] - Opacity.\n * @cssprop [--hx-space-1] - Spacing token.\n * @cssprop [--hx-switch-font-family=var(--hx-font-family-sans)] - CSS custom property.\n * @cssprop [--hx-font-family-sans] - Font family.\n * @cssprop [--hx-space-2] - Spacing token.\n * @cssprop [--hx-touch-target-min] - Minimum touch target size.\n * @cssprop [--hx-border-radius-full] - CSS custom property.\n * @cssprop [--hx-color-neutral-300] - Color.\n * @cssprop [--hx-transition-fast] - Transition timing.\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-color-primary-500] - Color.\n * @cssprop [--hx-color-neutral-0] - Color.\n * @cssprop [--hx-shadow-sm] - Box shadow.\n * @cssprop [--hx-switch-track-width-sm=var(--hx-size-8)] - Width.\n * @cssprop [--hx-size-8] - Size token.\n * @cssprop [--hx-switch-track-height-sm=var(--hx-size-4-5)] - Height.\n * @cssprop [--hx-size-4-5] - Size token.\n * @cssprop [--hx-switch-thumb-size-sm=var(--hx-size-3-5)] - CSS custom property.\n * @cssprop [--hx-size-3-5] - Size token.\n * @cssprop [--hx-switch-thumb-offset=var(--hx-space-0-5)] - CSS custom property.\n * @cssprop [--hx-space-0-5] - Spacing token.\n * @cssprop [--hx-switch-track-width-md=var(--hx-size-10)] - Width.\n * @cssprop [--hx-size-10] - Size token.\n * @cssprop [--hx-switch-track-height-md=var(--hx-size-5-5)] - Height.\n * @cssprop [--hx-size-5-5] - Size token.\n * @cssprop [--hx-switch-thumb-size-md=var(--hx-size-4-5)] - CSS custom property.\n * @cssprop [--hx-switch-track-width-lg=var(--hx-size-12)] - Width.\n * @cssprop [--hx-size-12] - Size token.\n * @cssprop [--hx-switch-track-height-lg=var(--hx-size-6-5)] - Height.\n * @cssprop [--hx-size-6-5] - Size token.\n * @cssprop [--hx-switch-thumb-size-lg=var(--hx-size-5-5)] - CSS custom property.\n * @cssprop [--hx-font-size-sm] - Font size.\n * @cssprop [--hx-font-weight-medium] - Font weight.\n * @cssprop [--hx-color-neutral-700] - Color.\n * @cssprop [--hx-line-height-normal] - Line height.\n * @cssprop [--hx-color-error-text] - Color.\n * @cssprop [--hx-font-weight-bold] - Font weight.\n * @cssprop [--hx-font-size-xs] - Font size.\n * @cssprop [--hx-color-neutral-500] - Color.\n */\n@customElement('hx-switch')\nexport class HelixSwitch extends FormMixin(HelixElement) {\n static override styles = [helixSwitchStyles, forcedColorsField];\n\n // ─── Form Association ───\n\n /** @internal */\n static override formAssociated = true;\n\n // ─── Properties ───\n\n /**\n * Whether the switch is toggled on.\n * @attr checked\n */\n @property({ type: Boolean, reflect: true })\n checked = false;\n\n /**\n * Whether the switch is disabled.\n * @attr disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Whether the switch is required for form submission.\n * @attr required\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The name of the switch, used for form submission.\n * @attr name\n */\n @property({ type: String, reflect: true })\n name = '';\n\n /**\n * The value submitted when the switch is checked.\n * @attr value\n */\n @property({ type: String, reflect: true })\n value = 'on';\n\n /**\n * The visible label text for the switch.\n * @attr label\n */\n @property({ type: String })\n label = '';\n\n /**\n * Size variant of the switch.\n * @attr hx-size\n */\n @property({ type: String, reflect: true, attribute: 'hx-size' })\n size: 'sm' | 'md' | 'lg' = 'md';\n\n /**\n * Error message to display. When set, the switch enters an error state.\n * @attr error\n */\n @property({ type: String })\n error = '';\n\n /**\n * Help text displayed below the switch for guidance.\n * @attr help-text\n */\n @property({ type: String, attribute: 'help-text' })\n helpText = '';\n\n /**\n * Validation message shown when the field is required but empty.\n * @attr required-message\n */\n @property({ attribute: 'required-message' })\n requiredMessage = 'This field is required.';\n\n /**\n * Handle for the shared IDREF observer. Installed in `connectedCallback()`\n * so late-mutated `aria-labelledby`/`aria-describedby` and late-inserted\n * IDREF targets are picked up. See `installAriaIdrefMirror()`.\n * @internal\n */\n private _ariaMirror: AriaIdrefMirrorHandle | null = null;\n\n /**\n * No-IDL-ref fallback tokens applied to the inner button so consumer\n * labelling resolves through the shadow root. Tracked as reactive state\n * so values flow through the next `render()`.\n * @internal\n */\n @state() private _fallbackAriaLabelledBy: string | null = null;\n /** @internal */\n @state() private _fallbackAriaDescribedBy: string | null = null;\n /** @internal */\n @state() private _fallbackAriaLabel: string | null = null;\n\n /**\n * Whether the platform supports IDL element references on `ElementInternals`.\n * Drives the render-time branch between the modern path (host is the\n * announced surface, inner button is `aria-hidden + tabindex=-1`) and the\n * fallback path (inner button is the announced surface, host is demoted).\n * Codex round-2 finding #2.\n * @internal\n */\n @state() private _supportsIdrefRefs = true;\n\n /**\n * Tracks whether the host's `tabindex` is managed by the component itself\n * (vs. set explicitly by a consumer). Codex round-14 P2: a consumer-supplied\n * `tabindex` (e.g. roving-tabindex toolbar pattern with `tabindex=\"-1\"`)\n * must survive disabled flips and re-renders. Only re-assert tabindex in\n * `updated()` when the component originally claimed it.\n * @internal\n */\n private _internalTabindexManaged = false;\n\n // ─── Lifecycle ───\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Detect platform support for IDL element references. Codex round-2\n // finding #2: drives the render-time branch.\n this._supportsIdrefRefs = supportsIdrefElementReferences(this._internals);\n // Seed root-independent semantics so the host announces the switch role\n // immediately on connect — before the first paint.\n this._syncHostAriaSemantics();\n // Codex round-1 finding #1: host is the canonical announced surface on\n // modern browsers, so the inner `<button role=switch>` is demoted via\n // `aria-hidden + tabindex=-1`.\n // Codex round-2 finding #2: on no-IDL-ref browsers the inner button is\n // the announced surface (it carries native button semantics + ARIA\n // role/state), so the host is demoted to `tabindex=-1`.\n // Codex round-14 P2: only claim ownership of `tabindex` when no consumer\n // value is present. Consumers using roving-tabindex toolbar patterns\n // must be able to set `tabindex=\"-1\"` on the host without it being\n // clobbered on every disabled flip. Note we still claim ownership when\n // disabled — the initial value is `-1` to keep the host out of tab order\n // and `updated()` re-asserts the appropriate value when disabled flips.\n if (!this.hasAttribute('tabindex')) {\n this._internalTabindexManaged = true;\n const enabledTabIndex = this._supportsIdrefRefs ? '0' : '-1';\n this.setAttribute('tabindex', this.disabled ? '-1' : enabledTabIndex);\n }\n this.addEventListener('keydown', this._handleHostKeyDown);\n this.addEventListener('click', this._handleHostClick);\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('click', this._handleHostClick);\n this._ariaMirror?.disconnect();\n this._ariaMirror = null;\n }\n\n /**\n * Host-level keydown handler. Active only on the modern path; on the\n * no-IDL-ref fallback the inner `<button>` owns native activation.\n * Codex round-2 finding #2.\n * @internal\n */\n private _handleHostKeyDown = (e: KeyboardEvent): void => {\n if (this.disabled) return;\n if (!this._supportsIdrefRefs) return;\n if (e.target !== this) return;\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n this._toggle();\n }\n };\n\n /**\n * Host-level click handler. Active only on the modern path; on the\n * fallback path AT activation flows directly to the inner button.\n * Codex round-2 finding #2.\n * @internal\n */\n private _handleHostClick = (e: MouseEvent): void => {\n if (this.disabled) return;\n if (!this._supportsIdrefRefs) return;\n const path = e.composedPath();\n if (path[0] !== this) return;\n this._toggle();\n };\n\n override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (changedProperties.has('checked') || changedProperties.has('value')) {\n this._internals.setFormValue(this.checked ? this.value : null);\n }\n if (\n changedProperties.has('disabled') ||\n (changedProperties as Map<PropertyKey, unknown>).has('_supportsIdrefRefs')\n ) {\n // Codex round-2 finding #2: keep host tabindex aligned with the chosen\n // announced surface. On no-IDL-ref browsers the inner button owns tab\n // order, so re-enabling the host should leave it `tabindex=-1`.\n // Codex round-14 P2: only re-assert when the component owns tabindex.\n // Consumer-managed values (e.g. roving-tabindex toolbar with `-1`) must\n // not be overwritten on disabled flips or supports-flag transitions.\n if (this._internalTabindexManaged) {\n const enabledTabIndex = this._supportsIdrefRefs ? '0' : '-1';\n this.setAttribute('tabindex', this.disabled ? '-1' : enabledTabIndex);\n }\n }\n // Re-resolve element references against the (possibly mutated) shadow\n // tree. `_syncHostAriaSemantics()` is also invoked from `_updateValidity()`\n // and by the IDREF mirror observer.\n this._syncHostAriaSemantics();\n }\n\n /**\n * Mirrors switch semantics onto the host via ElementInternals so that\n * consumer-supplied `aria-label`, `aria-labelledby`, and `aria-describedby`\n * on `<hx-switch>` reach the announced control. The codex aria-group-2\n * finding identified that the inner shadow `<button role=switch>` was the\n * only carrier of switch semantics, leaving host-level IDREF tokens stranded\n * on the wrong side of the shadow boundary.\n * @internal\n */\n private _syncHostAriaSemantics(): void {\n const internals = this._internals;\n const hostAriaLabel = this.getAttribute('aria-label')?.trim() || '';\n const externalLabelTokens = this.getAttribute('aria-labelledby');\n const externalDescTokens = this.getAttribute('aria-describedby');\n const labelEls = resolveIdrefTokens(this, externalLabelTokens);\n // Codex round-35 finding (CR major + codex follow-up): `aria-labelledby`\n // is only \"effective\" when at least one IDREF resolves to an element. A\n // typo or transiently-missing target must NOT erase the visible label —\n // fall back to `label` / slot so a labeled switch never becomes unnamed\n // on either render path.\n const hasEffectiveLabelledBy = labelEls.length > 0;\n\n // Codex round-2 finding #2: branch on platform support. Modern path —\n // host is the announced surface and carries `role=switch` + state via\n // ElementInternals. Fallback path — inner `<button role=switch>` is the\n // announced surface; clear host role/state so AT does not double-announce.\n if (this._supportsIdrefRefs) {\n // ─── Modern path ───\n internals.role = 'switch';\n internals.ariaChecked = this.checked ? 'true' : 'false';\n internals.ariaRequired = this.required ? 'true' : 'false';\n internals.ariaInvalid = !internals.validity.valid ? 'true' : 'false';\n internals.ariaDisabled = this.disabled ? 'true' : 'false';\n\n if (hostAriaLabel) {\n internals.ariaLabel = hostAriaLabel;\n } else if (!hasEffectiveLabelledBy) {\n internals.ariaLabel = this.label || null;\n } else {\n internals.ariaLabel = null;\n }\n\n type InternalsWithRefs = ElementInternals & {\n ariaLabelledByElements: Element[] | null;\n ariaDescribedByElements: Element[] | null;\n };\n const refsInternals = internals as InternalsWithRefs;\n\n const internalLabel = this.shadowRoot?.getElementById(this._labelId);\n const hasLabel = !!this.label || this._hasDefaultSlot;\n if (labelEls.length === 0 && !hostAriaLabel && hasLabel && internalLabel) {\n labelEls.push(internalLabel);\n }\n refsInternals.ariaLabelledByElements = labelEls.length > 0 ? labelEls : null;\n\n const descEls = resolveIdrefTokens(this, externalDescTokens);\n const helpEl = this.shadowRoot?.getElementById(this._helpTextId);\n const errorEl = this.shadowRoot?.getElementById(this._errorId);\n const hasError = !!(this.error || this._hasErrorSlot);\n // Codex round-15 P2: drop help text from the describedby chain while\n // an error is active. The render path hides the help wrapper in that\n // state (`?hidden=${... || hasError}`); appending the hidden node here\n // would have AT announce stale guidance ahead of the validation error.\n if (helpEl && !hasError && (this.helpText || this._hasHelpTextSlot)) {\n descEls.push(helpEl);\n }\n if (errorEl && hasError) {\n descEls.push(errorEl);\n }\n refsInternals.ariaDescribedByElements = descEls.length > 0 ? descEls : null;\n // Clear fallback state when IDL refs are available.\n this._fallbackAriaLabelledBy = null;\n this._fallbackAriaDescribedBy = null;\n this._fallbackAriaLabel = null;\n } else {\n // ─── Fallback path: inner button is the announced surface ───\n // Round-2 finding #2: round-1 set host role/state via internals AND\n // mirrored aria-* onto the `aria-hidden` inner button — making the\n // mirrored attributes inert. The fix is to clear host role/state on\n // internals so AT does not double-announce, and let the inner button\n // (rendered without aria-hidden, with `tabindex=0`, with role=switch\n // and aria-checked) be the announced surface.\n internals.role = null;\n internals.ariaChecked = null;\n internals.ariaRequired = null;\n internals.ariaInvalid = null;\n internals.ariaDisabled = null;\n internals.ariaLabel = null;\n\n // Round-35 codex follow-up: only mirror the consumer's labelledby tokens\n // when at least one resolves; otherwise the inner button must fall back\n // to `aria-label` (label property or slot) so the switch keeps a name\n // when an IDREF is a typo. Same contract as the modern path.\n this._fallbackAriaLabelledBy = hasEffectiveLabelledBy ? externalLabelTokens : null;\n this._fallbackAriaDescribedBy = externalDescTokens || null;\n this._fallbackAriaLabel = hasEffectiveLabelledBy ? null : hostAriaLabel || this.label || null;\n }\n }\n\n // ─── Form Integration ───\n\n /** Recalculates and sets the validity state based on required and checked. */\n /** @internal */\n override _updateValidity(): void {\n if (this.required && !this.checked) {\n // Codex round-17 P2: anchor validity UI to the announced surface. On\n // the modern path the host carries `role=switch` via internals and is\n // the canonical focus target (the inner track button is `aria-hidden +\n // tabindex=-1`), so reportValidity() would otherwise focus a hidden\n // node. On the fallback path the inner button is the announced\n // surface.\n const anchor: HTMLElement | undefined = this._supportsIdrefRefs\n ? this\n : (this._trackEl ?? undefined);\n this._internals.setValidity(\n { valueMissing: true },\n this.error || this.requiredMessage,\n anchor,\n );\n } else {\n this._internals.setValidity({});\n }\n // Codex round-1 finding #6: sync host ARIA semantics immediately after\n // every `setValidity()` call so `internals.ariaInvalid` reflects the\n // current `ValidityState` rather than the previous render snapshot.\n this._syncHostAriaSemantics();\n }\n\n protected override _onFormReset(): void {\n this.checked = false;\n this._internals.setFormValue(null);\n this._resetInteractionState();\n }\n\n protected override _onFormStateRestore(\n state: File | string | FormData | null,\n _mode: 'restore' | 'autocomplete',\n ): void {\n if (typeof state === 'string') {\n this.checked = state === this.value;\n }\n }\n\n protected override _onFormDisabled(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n /** Reference to the native button element acting as the switch track. * @internal\n */\n @query('.switch__track')\n private _trackEl: HTMLButtonElement | null | undefined;\n\n /** Whether the error slot has assigned content. */\n /** @internal */\n @state() private _hasErrorSlot = false;\n\n /** Whether the default slot has assigned content (slotted label). */\n /** @internal */\n @state() private _hasDefaultSlot = false;\n\n /** Whether the help-text slot has assigned content. */\n /** @internal */\n @state() private _hasHelpTextSlot = false;\n\n // ─── Slot Handlers ───\n\n /** Updates _hasErrorSlot when error slot content changes. */\n /** @internal */\n private _handleErrorSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasErrorSlot = slot.assignedNodes({ flatten: true }).length > 0;\n }\n\n /** Updates _hasDefaultSlot when default slot content changes. */\n /** @internal */\n private _handleDefaultSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasDefaultSlot = slot.assignedNodes({ flatten: true }).length > 0;\n }\n\n /** Updates _hasHelpTextSlot when help-text slot content changes. */\n /** @internal */\n private _handleHelpTextSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasHelpTextSlot = slot.assignedNodes({ flatten: true }).length > 0;\n }\n\n // ─── Event Handling ───\n\n /** Toggles checked state and dispatches hx-change event. */\n /** @internal */\n private _toggle(): void {\n if (this.disabled) return;\n this.checked = !this.checked;\n this._handleInteractionInput();\n\n this.dispatchEvent(\n new CustomEvent<{ checked: boolean; value: string }>('hx-change', {\n bubbles: true,\n composed: true,\n detail: { checked: this.checked, value: this.value },\n }),\n );\n }\n\n /** Handles click events on the track. */\n /** @internal */\n private _handleClick(): void {\n this._toggle();\n // Codex round-12 P2: on the modern path the host owns role=\"switch\" and\n // tabindex=0; the inner <button tabindex=\"-1\"> is aria-hidden. Native\n // click activation on a `<button>` still focuses it, which would leave\n // `document.activeElement` and AT focus on a hidden node. Move focus back\n // to the host so the announced surface is also the focus target.\n if (this._supportsIdrefRefs) {\n this.focus();\n }\n }\n\n /** Handles keydown events — Space toggles the switch per ARIA APG. */\n /** @internal */\n private _handleKeyDown(e: KeyboardEvent): void {\n if (e.key === ' ') {\n e.preventDefault();\n this._toggle();\n }\n }\n\n // ─── Public Methods ───\n\n /**\n * Moves focus to the announced switch surface. Codex round-1 finding #1\n * relocated the focus target to the host so AT announces a single widget;\n * the host carries the canonical role/state on modern engines. Round-7\n * finding #7 extends that contract to the no-IDL-ref fallback: when the\n * host is demoted (`tabindex=-1`, role/state cleared on `internals`) the\n * inner `<button role=switch>` owns the announced semantics and tab order,\n * so programmatic `focus()` must redirect there — otherwise scripted focus\n * and error recovery land on the demoted host on unsupported engines.\n */\n override focus(options?: FocusOptions): void {\n if (this._supportsIdrefRefs) {\n super.focus(options);\n return;\n }\n this._trackEl?.focus(options);\n }\n\n // ─── Render ───\n\n /** Unique ID for this switch instance, used for ARIA associations. */\n /** @internal */\n private _switchId = _nextSwitchId();\n /** ID for the label element, referenced by aria-labelledby. */\n /** @internal */\n private _labelId = `${this._switchId}-label`;\n /** ID for the help text element, referenced by aria-describedby. */\n /** @internal */\n private _helpTextId = `${this._switchId}-help`;\n /** ID for the error element, referenced by aria-describedby. */\n /** @internal */\n private _errorId = `${this._switchId}-error`;\n\n override render() {\n const hasError = !!this.error || this._hasErrorSlot;\n const hasHelpText = !!this.helpText || this._hasHelpTextSlot;\n const hasLabel = !!this.label || this._hasDefaultSlot;\n // Validity-driven invalid state: a required-but-unchecked switch is\n // invalid via setValidity() even before any visible error renders.\n const isInvalid = hasError || (this.required && !this.checked);\n\n const containerClasses = {\n switch: true,\n 'switch--checked': this.checked,\n 'switch--disabled': this.disabled,\n 'switch--required': this.required,\n 'switch--error': hasError,\n [`switch--${this.size}`]: true,\n };\n\n // help-text first, error appended — assistive tech announces guidance\n // before validation feedback. Both ids are persistent in the shadow tree.\n // Codex round-15 P2: drop help text from the chain when an error is\n // active. The help wrapper renders hidden in that state, so referencing\n // it would have AT announce stale guidance ahead of the validation\n // error. Mirrors the modern-path host-internals chain.\n const describedBy =\n [!hasError && hasHelpText ? this._helpTextId : null, hasError ? this._errorId : null]\n .filter(Boolean)\n .join(' ') || undefined;\n\n // Codex round-1 finding #8: merge consumer fallback tokens with the\n // shadow-internal describedBy chain on browsers without IDL element\n // references. Internal `_labelId` is preferred when no consumer\n // labelledby tokens are supplied.\n const innerDescribedBy =\n [describedBy ?? null, this._fallbackAriaDescribedBy].filter(Boolean).join(' ') || undefined;\n // Codex round-14 P2: per ARIA spec, `aria-labelledby` overrides\n // `aria-label`. On the no-IDL-ref fallback path the consumer-set\n // `aria-label` was being shadowed because we always assigned the\n // internal `_labelId`. When the consumer supplied an `aria-label` (and\n // did NOT supply an `aria-labelledby`), omit the internal labelledby so\n // AT announces the consumer-supplied name — matching the modern path\n // and the spec. Consumer-supplied `aria-labelledby` (mirrored into\n // `_fallbackAriaLabelledBy`) still wins over the internal label.\n const innerAriaLabel = this._fallbackAriaLabel ?? undefined;\n const innerLabelledBy = this._fallbackAriaLabelledBy\n ? this._fallbackAriaLabelledBy\n : innerAriaLabel\n ? undefined\n : hasLabel\n ? this._labelId\n : undefined;\n\n // Codex round-2 finding #2: branch the inner button on platform support.\n // Modern path — host is announced, inner button is `aria-hidden + tabindex=-1`.\n // Fallback path — inner button is announced (NO aria-hidden, role=switch,\n // tabindex=0) so consumer-mirrored aria-* attributes resolve through a\n // visible accessibility-tree node and AT can name + activate it natively.\n const innerIsAnnounced = !this._supportsIdrefRefs;\n const innerTabIndex = innerIsAnnounced && !this.disabled ? '0' : '-1';\n // On the fallback path the inner button must carry role=switch so AT\n // announces \"switch\", aria-checked for state, and aria-required when set.\n const innerRole = innerIsAnnounced ? 'switch' : nothing;\n\n return html`\n <div part=\"switch\" class=${classMap(containerClasses)}>\n <div class=\"switch__control-row\">\n <button\n part=\"track\"\n class=\"switch__track\"\n id=${this._switchId}\n type=\"button\"\n role=${innerRole}\n tabindex=${innerTabIndex}\n aria-checked=${this.checked ? 'true' : 'false'}\n aria-labelledby=${ifDefined(innerLabelledBy)}\n aria-describedby=${ifDefined(innerDescribedBy)}\n aria-label=${ifDefined(innerAriaLabel)}\n aria-invalid=${isInvalid ? 'true' : nothing}\n aria-required=${this.required ? 'true' : nothing}\n aria-hidden=${innerIsAnnounced ? nothing : 'true'}\n ?disabled=${this.disabled}\n @click=${this._handleClick}\n @keydown=${this._handleKeyDown}\n >\n <span part=\"thumb\" class=\"switch__thumb\"></span>\n </button>\n\n <label part=\"label\" class=\"switch__label\" id=${this._labelId} for=${this._switchId}>\n <slot @slotchange=${this._handleDefaultSlotChange}>${this.label}</slot>${this.required\n ? html`<span class=\"switch__required-marker\" aria-hidden=\"true\">*</span>`\n : nothing}\n </label>\n </div>\n\n <!--\n Persistent error live region. Slot fallback content provides the\n property-driven message; consumers can replace it via slot=\"error\".\n The wrapper carries a stable id so aria-describedby remains valid\n across both code paths and across show/hide transitions.\n -->\n <div\n part=\"error\"\n class=\"switch__error\"\n id=${this._errorId}\n role=\"alert\"\n ?hidden=${!hasError}\n >\n <slot name=\"error\" @slotchange=${this._handleErrorSlotChange}>${this.error}</slot>\n </div>\n\n <!--\n Persistent help-text wrapper. Rendered whenever the property OR the\n slot has content; hidden when an error is present so guidance does\n not compete with validation feedback.\n -->\n <div\n part=\"help-text\"\n class=\"switch__help-text\"\n id=${this._helpTextId}\n ?hidden=${!hasHelpText || hasError}\n >\n <slot name=\"help-text\" @slotchange=${this._handleHelpTextSlotChange}\n >${this.helpText}</slot\n >\n </div>\n </div>\n `;\n }\n}\n\n/**\n * Per-component event map for type-safe addEventListener on hx-switch.\n * The `hx-change` detail always includes both `checked` and `value` for this component.\n */\nexport interface HxSwitchEventMap {\n 'hx-change': CustomEvent<{ checked: boolean; value: string }>;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-switch': HelixSwitch;\n }\n}\n\nexport type HxSwitch = HelixSwitch;\n"],"names":["helixSwitchStyles","css","_nextSwitchId","createIdCounter","HelixSwitch","FormMixin","HelixElement","supportsIdrefElementReferences","enabledTabIndex","installAriaIdrefMirror","_a","changedProperties","internals","hostAriaLabel","externalLabelTokens","externalDescTokens","labelEls","resolveIdrefTokens","hasEffectiveLabelledBy","refsInternals","internalLabel","_b","hasLabel","descEls","helpEl","_c","errorEl","_d","hasError","anchor","state","_mode","disabled","slot","options","hasHelpText","isInvalid","containerClasses","innerDescribedBy","innerAriaLabel","innerLabelledBy","innerIsAnnounced","innerTabIndex","innerRole","nothing","html","classMap","ifDefined","forcedColorsField","__decorateClass","property","query","customElement"],"mappings":";;;;;;;;;AAEO,MAAMA,IAAoBC;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;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;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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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