@helixui/library 3.3.1 → 3.4.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 (321) hide show
  1. package/custom-elements.json +340 -71
  2. package/dist/components/hx-accordion/hx-accordion-item.d.ts +35 -0
  3. package/dist/components/hx-accordion/hx-accordion-item.d.ts.map +1 -1
  4. package/dist/components/hx-alert/hx-alert.d.ts +11 -0
  5. package/dist/components/hx-alert/hx-alert.d.ts.map +1 -1
  6. package/dist/components/hx-alert/hx-alert.styles.d.ts.map +1 -1
  7. package/dist/components/hx-alert/index.js +1 -1
  8. package/dist/components/hx-badge/hx-badge.styles.d.ts.map +1 -1
  9. package/dist/components/hx-badge/index.js +1 -1
  10. package/dist/components/hx-banner/hx-banner.d.ts +9 -1
  11. package/dist/components/hx-banner/hx-banner.d.ts.map +1 -1
  12. package/dist/components/hx-banner/index.js +1 -1
  13. package/dist/components/hx-button/hx-button.d.ts +11 -1
  14. package/dist/components/hx-button/hx-button.d.ts.map +1 -1
  15. package/dist/components/hx-button/index.js +1 -1
  16. package/dist/components/hx-button-group/hx-button-group.d.ts +13 -0
  17. package/dist/components/hx-button-group/hx-button-group.d.ts.map +1 -1
  18. package/dist/components/hx-button-group/index.js +1 -1
  19. package/dist/components/hx-checkbox/hx-checkbox.d.ts +153 -1
  20. package/dist/components/hx-checkbox/hx-checkbox.d.ts.map +1 -1
  21. package/dist/components/hx-checkbox/hx-checkbox.styles.d.ts.map +1 -1
  22. package/dist/components/hx-checkbox/index.js +1 -1
  23. package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts +151 -2
  24. package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts.map +1 -1
  25. package/dist/components/hx-checkbox-group/index.js +1 -1
  26. package/dist/components/hx-color-picker/hx-color-picker.d.ts +163 -1
  27. package/dist/components/hx-color-picker/hx-color-picker.d.ts.map +1 -1
  28. package/dist/components/hx-color-picker/hx-color-picker.styles.d.ts.map +1 -1
  29. package/dist/components/hx-color-picker/index.js +1 -1
  30. package/dist/components/hx-combobox/hx-combobox.d.ts +311 -2
  31. package/dist/components/hx-combobox/hx-combobox.d.ts.map +1 -1
  32. package/dist/components/hx-combobox/index.js +1 -1
  33. package/dist/components/hx-data-table/hx-data-table.d.ts.map +1 -1
  34. package/dist/components/hx-data-table/index.js +1 -1
  35. package/dist/components/hx-date-picker/hx-date-picker.d.ts +182 -56
  36. package/dist/components/hx-date-picker/hx-date-picker.d.ts.map +1 -1
  37. package/dist/components/hx-date-picker/hx-date-picker.styles.d.ts.map +1 -1
  38. package/dist/components/hx-date-picker/index.js +1 -1
  39. package/dist/components/hx-dialog/hx-dialog.d.ts +240 -0
  40. package/dist/components/hx-dialog/hx-dialog.d.ts.map +1 -1
  41. package/dist/components/hx-dialog/index.js +1 -1
  42. package/dist/components/hx-drawer/hx-drawer.d.ts +201 -0
  43. package/dist/components/hx-drawer/hx-drawer.d.ts.map +1 -1
  44. package/dist/components/hx-drawer/hx-drawer.styles.d.ts.map +1 -1
  45. package/dist/components/hx-drawer/index.js +1 -1
  46. package/dist/components/hx-dropdown/hx-dropdown.d.ts +168 -0
  47. package/dist/components/hx-dropdown/hx-dropdown.d.ts.map +1 -1
  48. package/dist/components/hx-dropdown/index.js +1 -1
  49. package/dist/components/hx-field/hx-field.d.ts +109 -0
  50. package/dist/components/hx-field/hx-field.d.ts.map +1 -1
  51. package/dist/components/hx-field/index.js +1 -1
  52. package/dist/components/hx-icon-button/hx-icon-button.d.ts +16 -3
  53. package/dist/components/hx-icon-button/hx-icon-button.d.ts.map +1 -1
  54. package/dist/components/hx-icon-button/hx-icon-button.styles.d.ts.map +1 -1
  55. package/dist/components/hx-icon-button/index.js +1 -1
  56. package/dist/components/hx-link/hx-link.d.ts +10 -1
  57. package/dist/components/hx-link/hx-link.d.ts.map +1 -1
  58. package/dist/components/hx-link/index.js +1 -1
  59. package/dist/components/hx-list/hx-list-item.d.ts +27 -1
  60. package/dist/components/hx-list/hx-list-item.d.ts.map +1 -1
  61. package/dist/components/hx-list/hx-list.d.ts +28 -0
  62. package/dist/components/hx-list/hx-list.d.ts.map +1 -1
  63. package/dist/components/hx-list/index.js +1 -1
  64. package/dist/components/hx-menu/hx-menu-divider.d.ts +10 -0
  65. package/dist/components/hx-menu/hx-menu-divider.d.ts.map +1 -1
  66. package/dist/components/hx-menu/hx-menu-item.d.ts +99 -2
  67. package/dist/components/hx-menu/hx-menu-item.d.ts.map +1 -1
  68. package/dist/components/hx-menu/hx-menu-item.styles.d.ts.map +1 -1
  69. package/dist/components/hx-menu/hx-menu.d.ts +117 -2
  70. package/dist/components/hx-menu/hx-menu.d.ts.map +1 -1
  71. package/dist/components/hx-menu/index.js +1 -1
  72. package/dist/components/hx-meter/hx-meter.d.ts +39 -0
  73. package/dist/components/hx-meter/hx-meter.d.ts.map +1 -1
  74. package/dist/components/hx-meter/hx-meter.styles.d.ts.map +1 -1
  75. package/dist/components/hx-meter/index.js +1 -1
  76. package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts +132 -1
  77. package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts.map +1 -1
  78. package/dist/components/hx-overflow-menu/index.js +1 -1
  79. package/dist/components/hx-phi-field/hx-phi-field.d.ts +0 -1
  80. package/dist/components/hx-phi-field/hx-phi-field.d.ts.map +1 -1
  81. package/dist/components/hx-popover/hx-popover.d.ts +91 -0
  82. package/dist/components/hx-popover/hx-popover.d.ts.map +1 -1
  83. package/dist/components/hx-popover/index.js +1 -1
  84. package/dist/components/hx-progress-bar/hx-progress-bar.d.ts +33 -0
  85. package/dist/components/hx-progress-bar/hx-progress-bar.d.ts.map +1 -1
  86. package/dist/components/hx-progress-bar/index.js +1 -1
  87. package/dist/components/hx-radio-group/hx-radio-group.d.ts +152 -1
  88. package/dist/components/hx-radio-group/hx-radio-group.d.ts.map +1 -1
  89. package/dist/components/hx-radio-group/hx-radio.d.ts +14 -0
  90. package/dist/components/hx-radio-group/hx-radio.d.ts.map +1 -1
  91. package/dist/components/hx-radio-group/index.js +1 -1
  92. package/dist/components/hx-select/hx-select.d.ts +304 -2
  93. package/dist/components/hx-select/hx-select.d.ts.map +1 -1
  94. package/dist/components/hx-select/hx-select.styles.d.ts.map +1 -1
  95. package/dist/components/hx-select/index.js +1 -1
  96. package/dist/components/hx-side-nav/hx-nav-item.styles.d.ts.map +1 -1
  97. package/dist/components/hx-side-nav/index.js +1 -1
  98. package/dist/components/hx-spinner/hx-spinner.d.ts +14 -0
  99. package/dist/components/hx-spinner/hx-spinner.d.ts.map +1 -1
  100. package/dist/components/hx-spinner/index.js +1 -1
  101. package/dist/components/hx-split-button/hx-split-button.d.ts +94 -7
  102. package/dist/components/hx-split-button/hx-split-button.d.ts.map +1 -1
  103. package/dist/components/hx-split-button/index.js +1 -1
  104. package/dist/components/hx-stat/hx-stat.d.ts +28 -0
  105. package/dist/components/hx-stat/hx-stat.d.ts.map +1 -1
  106. package/dist/components/hx-stat/index.js +1 -1
  107. package/dist/components/hx-switch/hx-switch.d.ts +78 -1
  108. package/dist/components/hx-switch/hx-switch.d.ts.map +1 -1
  109. package/dist/components/hx-switch/hx-switch.styles.d.ts.map +1 -1
  110. package/dist/components/hx-switch/index.js +1 -1
  111. package/dist/components/hx-table/hx-td.d.ts +30 -3
  112. package/dist/components/hx-table/hx-td.d.ts.map +1 -1
  113. package/dist/components/hx-table/hx-th.d.ts +39 -3
  114. package/dist/components/hx-table/hx-th.d.ts.map +1 -1
  115. package/dist/components/hx-table/hx-tr.d.ts +26 -0
  116. package/dist/components/hx-table/hx-tr.d.ts.map +1 -1
  117. package/dist/components/hx-table/index.js +1 -1
  118. package/dist/components/hx-tabs/hx-tab-panel.d.ts +34 -0
  119. package/dist/components/hx-tabs/hx-tab-panel.d.ts.map +1 -1
  120. package/dist/components/hx-tabs/hx-tab.d.ts +45 -2
  121. package/dist/components/hx-tabs/hx-tab.d.ts.map +1 -1
  122. package/dist/components/hx-tabs/hx-tab.styles.d.ts.map +1 -1
  123. package/dist/components/hx-tabs/hx-tabs.d.ts +32 -2
  124. package/dist/components/hx-tabs/hx-tabs.d.ts.map +1 -1
  125. package/dist/components/hx-tabs/index.js +1 -1
  126. package/dist/components/hx-tag/hx-tag.styles.d.ts.map +1 -1
  127. package/dist/components/hx-tag/index.js +1 -1
  128. package/dist/components/hx-theme/hx-theme.d.ts +10 -5
  129. package/dist/components/hx-theme/hx-theme.d.ts.map +1 -1
  130. package/dist/components/hx-time-picker/hx-time-picker.d.ts +210 -2
  131. package/dist/components/hx-time-picker/hx-time-picker.d.ts.map +1 -1
  132. package/dist/components/hx-time-picker/hx-time-picker.styles.d.ts.map +1 -1
  133. package/dist/components/hx-time-picker/index.js +1 -1
  134. package/dist/components/hx-toast/hx-toast-stack.d.ts +14 -0
  135. package/dist/components/hx-toast/hx-toast-stack.d.ts.map +1 -1
  136. package/dist/components/hx-toast/hx-toast.d.ts +22 -3
  137. package/dist/components/hx-toast/hx-toast.d.ts.map +1 -1
  138. package/dist/components/hx-toast/index.js +1 -1
  139. package/dist/components/hx-toast/toast-factory.d.ts.map +1 -1
  140. package/dist/components/hx-toggle-button/hx-toggle-button.d.ts +110 -0
  141. package/dist/components/hx-toggle-button/hx-toggle-button.d.ts.map +1 -1
  142. package/dist/components/hx-toggle-button/hx-toggle-button.styles.d.ts.map +1 -1
  143. package/dist/components/hx-toggle-button/index.js +1 -1
  144. package/dist/components/hx-tooltip/hx-tooltip.d.ts +52 -0
  145. package/dist/components/hx-tooltip/hx-tooltip.d.ts.map +1 -1
  146. package/dist/components/hx-tooltip/index.js +1 -1
  147. package/dist/components/hx-tree-view/hx-tree-item.d.ts +117 -12
  148. package/dist/components/hx-tree-view/hx-tree-item.d.ts.map +1 -1
  149. package/dist/components/hx-tree-view/hx-tree-view.d.ts +87 -7
  150. package/dist/components/hx-tree-view/hx-tree-view.d.ts.map +1 -1
  151. package/dist/components/hx-tree-view/index.js +1 -1
  152. package/dist/css/helix-all.css +221 -1
  153. package/dist/css/helix-core.css +81 -0
  154. package/dist/css/helix-feedback.css +14 -0
  155. package/dist/css/helix-forms.css +109 -1
  156. package/dist/css/helix-overlay.css +17 -0
  157. package/dist/css/hx-alert.css +9 -0
  158. package/dist/css/hx-badge.css +28 -0
  159. package/dist/css/hx-checkbox.css +18 -0
  160. package/dist/css/hx-color-picker.css +25 -0
  161. package/dist/css/hx-date-picker.css +2 -1
  162. package/dist/css/hx-drawer.css +17 -0
  163. package/dist/css/hx-icon-button.css +30 -0
  164. package/dist/css/hx-meter.css +5 -0
  165. package/dist/css/hx-select.css +19 -0
  166. package/dist/css/hx-switch.css +17 -0
  167. package/dist/css/hx-tag.css +23 -0
  168. package/dist/css/hx-time-picker.css +11 -0
  169. package/dist/css/hx-toggle-button.css +17 -0
  170. package/dist/css/index.css +1 -1
  171. package/dist/css/manifest.json +4 -1
  172. package/dist/index.js +38 -38
  173. package/dist/shared/aria-flatten-DY6v2vah.js +22 -0
  174. package/dist/shared/aria-flatten-DY6v2vah.js.map +1 -0
  175. package/dist/shared/aria-idref-CxvyzfQS.js +126 -0
  176. package/dist/shared/aria-idref-CxvyzfQS.js.map +1 -0
  177. package/dist/shared/hx-accordion-ZVzgDzTG.js.map +1 -1
  178. package/dist/shared/{hx-alert-CLn7CstP.js → hx-alert-Bto8-TIi.js} +55 -37
  179. package/dist/shared/hx-alert-Bto8-TIi.js.map +1 -0
  180. package/dist/shared/{hx-badge-CQXgOXJM.js → hx-badge-JlFtAdxS.js} +37 -9
  181. package/dist/shared/hx-badge-JlFtAdxS.js.map +1 -0
  182. package/dist/shared/{hx-banner-D3DzpfcP.js → hx-banner-fpRnciIO.js} +13 -5
  183. package/dist/shared/hx-banner-fpRnciIO.js.map +1 -0
  184. package/dist/shared/{hx-button-DPY6SPVT.js → hx-button-BOwAEcF1.js} +108 -85
  185. package/dist/shared/{hx-button-DPY6SPVT.js.map → hx-button-BOwAEcF1.js.map} +1 -1
  186. package/dist/shared/{hx-button-group-BI-QBqmO.js → hx-button-group-DcHP5MBv.js} +15 -16
  187. package/dist/shared/{hx-button-group-BI-QBqmO.js.map → hx-button-group-DcHP5MBv.js.map} +1 -1
  188. package/dist/shared/hx-checkbox-C48KYKFq.js +696 -0
  189. package/dist/shared/hx-checkbox-C48KYKFq.js.map +1 -0
  190. package/dist/shared/hx-checkbox-group-BJIAX3zU.js +496 -0
  191. package/dist/shared/hx-checkbox-group-BJIAX3zU.js.map +1 -0
  192. package/dist/shared/hx-color-picker-Dk4cBwYQ.js +1221 -0
  193. package/dist/shared/hx-color-picker-Dk4cBwYQ.js.map +1 -0
  194. package/dist/shared/hx-combobox-BTLO9qiK.js +1359 -0
  195. package/dist/shared/hx-combobox-BTLO9qiK.js.map +1 -0
  196. package/dist/shared/{hx-data-table-CLqVqdxr.js → hx-data-table-Ct3gQ6ya.js} +3 -2
  197. package/dist/shared/{hx-data-table-CLqVqdxr.js.map → hx-data-table-Ct3gQ6ya.js.map} +1 -1
  198. package/dist/shared/{hx-date-picker-2iRG1p74.js → hx-date-picker-CiR7FVnR.js} +542 -206
  199. package/dist/shared/hx-date-picker-CiR7FVnR.js.map +1 -0
  200. package/dist/shared/hx-dialog-AOZpHSuF.js +717 -0
  201. package/dist/shared/hx-dialog-AOZpHSuF.js.map +1 -0
  202. package/dist/shared/{hx-drawer-Y1Ui2IWJ.js → hx-drawer-DH6CdAN1.js} +300 -98
  203. package/dist/shared/hx-drawer-DH6CdAN1.js.map +1 -0
  204. package/dist/shared/hx-dropdown-DiLd40Lm.js +401 -0
  205. package/dist/shared/hx-dropdown-DiLd40Lm.js.map +1 -0
  206. package/dist/shared/{hx-field-B3Qo8OLS.js → hx-field-zw0U1KVi.js} +99 -38
  207. package/dist/shared/hx-field-zw0U1KVi.js.map +1 -0
  208. package/dist/shared/{hx-icon-button-CGNdQSFM.js → hx-icon-button-a6OpeQz5.js} +149 -68
  209. package/dist/shared/hx-icon-button-a6OpeQz5.js.map +1 -0
  210. package/dist/shared/{hx-link-C-O6vq0Q.js → hx-link-CMnZRUtQ.js} +55 -43
  211. package/dist/shared/hx-link-CMnZRUtQ.js.map +1 -0
  212. package/dist/shared/{hx-list-MyEhh8c7.js → hx-list-De66EtAP.js} +163 -107
  213. package/dist/shared/hx-list-De66EtAP.js.map +1 -0
  214. package/dist/shared/hx-menu-divider-BjiRIWKq.js +797 -0
  215. package/dist/shared/hx-menu-divider-BjiRIWKq.js.map +1 -0
  216. package/dist/shared/{hx-meter-BPscsw5t.js → hx-meter-BJdh6nrF.js} +105 -64
  217. package/dist/shared/hx-meter-BJdh6nrF.js.map +1 -0
  218. package/dist/shared/{hx-nav-item-xqRPOCWX.js → hx-nav-item-CODtUlew.js} +13 -9
  219. package/dist/shared/{hx-nav-item-xqRPOCWX.js.map → hx-nav-item-CODtUlew.js.map} +1 -1
  220. package/dist/shared/hx-overflow-menu-BQ4fiMYu.js +492 -0
  221. package/dist/shared/hx-overflow-menu-BQ4fiMYu.js.map +1 -0
  222. package/dist/shared/hx-phi-field-C19oxlrr.js.map +1 -1
  223. package/dist/shared/{hx-popover-B-FP3-wW.js → hx-popover-B9W8-tC0.js} +123 -66
  224. package/dist/shared/hx-popover-B9W8-tC0.js.map +1 -0
  225. package/dist/shared/hx-progress-bar-C8nDMdYa.js +290 -0
  226. package/dist/shared/hx-progress-bar-C8nDMdYa.js.map +1 -0
  227. package/dist/shared/hx-radio-Z1lV1zTO.js +822 -0
  228. package/dist/shared/hx-radio-Z1lV1zTO.js.map +1 -0
  229. package/dist/shared/hx-select-D18CnJ0e.js +1089 -0
  230. package/dist/shared/hx-select-D18CnJ0e.js.map +1 -0
  231. package/dist/shared/{hx-spinner-DL5AYr16.js → hx-spinner-BB0h2hKZ.js} +62 -34
  232. package/dist/shared/hx-spinner-BB0h2hKZ.js.map +1 -0
  233. package/dist/shared/{hx-split-button-Djnc5Aeg.js → hx-split-button-BoABoEm5.js} +153 -82
  234. package/dist/shared/hx-split-button-BoABoEm5.js.map +1 -0
  235. package/dist/shared/{hx-stat-WOcNV1Ry.js → hx-stat-Dtf9lz-O.js} +77 -47
  236. package/dist/shared/hx-stat-Dtf9lz-O.js.map +1 -0
  237. package/dist/shared/hx-switch-B6kr-EwE.js +540 -0
  238. package/dist/shared/hx-switch-B6kr-EwE.js.map +1 -0
  239. package/dist/shared/{hx-tab-panel-DspCrKqo.js → hx-tab-panel-BQtBXKLD.js} +255 -131
  240. package/dist/shared/hx-tab-panel-BQtBXKLD.js.map +1 -0
  241. package/dist/shared/{hx-tag-CNSmdyaK.js → hx-tag-C5aCUpVi.js} +63 -40
  242. package/dist/shared/hx-tag-C5aCUpVi.js.map +1 -0
  243. package/dist/shared/{hx-td-DnnEMIuA.js → hx-td-BGkFOJEK.js} +267 -123
  244. package/dist/shared/hx-td-BGkFOJEK.js.map +1 -0
  245. package/dist/shared/hx-theme-BsefFWTO.js.map +1 -1
  246. package/dist/shared/hx-time-picker-iwCD7rzW.js +1038 -0
  247. package/dist/shared/hx-time-picker-iwCD7rzW.js.map +1 -0
  248. package/dist/shared/{hx-toggle-button-iLiYrMbD.js → hx-toggle-button-BQ81EDkl.js} +226 -65
  249. package/dist/shared/hx-toggle-button-BQ81EDkl.js.map +1 -0
  250. package/dist/shared/{hx-tooltip-nYOv9OLu.js → hx-tooltip-DVqtKPCD.js} +68 -46
  251. package/dist/shared/hx-tooltip-DVqtKPCD.js.map +1 -0
  252. package/dist/shared/hx-tree-item-CHrUhuZL.js +925 -0
  253. package/dist/shared/hx-tree-item-CHrUhuZL.js.map +1 -0
  254. package/dist/shared/menu-roving-DmMnzJhn.js +14 -0
  255. package/dist/shared/menu-roving-DmMnzJhn.js.map +1 -0
  256. package/dist/shared/menu-tree-BNM0SYYq.js +42 -0
  257. package/dist/shared/menu-tree-BNM0SYYq.js.map +1 -0
  258. package/dist/shared/{toast-factory-YSznocIV.js → toast-factory-CL2BzdSB.js} +128 -77
  259. package/dist/shared/toast-factory-CL2BzdSB.js.map +1 -0
  260. package/dist/utils/aria-flatten.d.ts +56 -0
  261. package/dist/utils/aria-flatten.d.ts.map +1 -0
  262. package/dist/utils/aria-idref.d.ts +127 -0
  263. package/dist/utils/aria-idref.d.ts.map +1 -0
  264. package/dist/utils/menu-label.d.ts +18 -0
  265. package/dist/utils/menu-label.d.ts.map +1 -0
  266. package/dist/utils/menu-roving.d.ts +28 -0
  267. package/dist/utils/menu-roving.d.ts.map +1 -0
  268. package/dist/utils/menu-tree.d.ts +41 -0
  269. package/dist/utils/menu-tree.d.ts.map +1 -0
  270. package/dist/utils/tree-walk.d.ts +53 -0
  271. package/dist/utils/tree-walk.d.ts.map +1 -0
  272. package/figma-inventory.json +132 -20
  273. package/package.json +1 -1
  274. package/dist/shared/hx-alert-CLn7CstP.js.map +0 -1
  275. package/dist/shared/hx-badge-CQXgOXJM.js.map +0 -1
  276. package/dist/shared/hx-banner-D3DzpfcP.js.map +0 -1
  277. package/dist/shared/hx-checkbox-D7xma9YH.js +0 -524
  278. package/dist/shared/hx-checkbox-D7xma9YH.js.map +0 -1
  279. package/dist/shared/hx-checkbox-group-C9n315Ju.js +0 -323
  280. package/dist/shared/hx-checkbox-group-C9n315Ju.js.map +0 -1
  281. package/dist/shared/hx-color-picker-uRc865FJ.js +0 -882
  282. package/dist/shared/hx-color-picker-uRc865FJ.js.map +0 -1
  283. package/dist/shared/hx-combobox-DDzqNKEW.js +0 -924
  284. package/dist/shared/hx-combobox-DDzqNKEW.js.map +0 -1
  285. package/dist/shared/hx-date-picker-2iRG1p74.js.map +0 -1
  286. package/dist/shared/hx-dialog-DRN_1-Y-.js +0 -514
  287. package/dist/shared/hx-dialog-DRN_1-Y-.js.map +0 -1
  288. package/dist/shared/hx-drawer-Y1Ui2IWJ.js.map +0 -1
  289. package/dist/shared/hx-dropdown-LyaRc8Rf.js +0 -263
  290. package/dist/shared/hx-dropdown-LyaRc8Rf.js.map +0 -1
  291. package/dist/shared/hx-field-B3Qo8OLS.js.map +0 -1
  292. package/dist/shared/hx-icon-button-CGNdQSFM.js.map +0 -1
  293. package/dist/shared/hx-link-C-O6vq0Q.js.map +0 -1
  294. package/dist/shared/hx-list-MyEhh8c7.js.map +0 -1
  295. package/dist/shared/hx-menu-divider-C2omnPtj.js +0 -558
  296. package/dist/shared/hx-menu-divider-C2omnPtj.js.map +0 -1
  297. package/dist/shared/hx-meter-BPscsw5t.js.map +0 -1
  298. package/dist/shared/hx-overflow-menu-DCLsdIBy.js +0 -374
  299. package/dist/shared/hx-overflow-menu-DCLsdIBy.js.map +0 -1
  300. package/dist/shared/hx-popover-B-FP3-wW.js.map +0 -1
  301. package/dist/shared/hx-progress-bar-Bn3JEPUf.js +0 -258
  302. package/dist/shared/hx-progress-bar-Bn3JEPUf.js.map +0 -1
  303. package/dist/shared/hx-radio-CJvNU2yP.js +0 -621
  304. package/dist/shared/hx-radio-CJvNU2yP.js.map +0 -1
  305. package/dist/shared/hx-select-C8fEHQhC.js +0 -807
  306. package/dist/shared/hx-select-C8fEHQhC.js.map +0 -1
  307. package/dist/shared/hx-spinner-DL5AYr16.js.map +0 -1
  308. package/dist/shared/hx-split-button-Djnc5Aeg.js.map +0 -1
  309. package/dist/shared/hx-stat-WOcNV1Ry.js.map +0 -1
  310. package/dist/shared/hx-switch-BrZFaRue.js +0 -420
  311. package/dist/shared/hx-switch-BrZFaRue.js.map +0 -1
  312. package/dist/shared/hx-tab-panel-DspCrKqo.js.map +0 -1
  313. package/dist/shared/hx-tag-CNSmdyaK.js.map +0 -1
  314. package/dist/shared/hx-td-DnnEMIuA.js.map +0 -1
  315. package/dist/shared/hx-time-picker-BoEIZwzv.js +0 -688
  316. package/dist/shared/hx-time-picker-BoEIZwzv.js.map +0 -1
  317. package/dist/shared/hx-toggle-button-iLiYrMbD.js.map +0 -1
  318. package/dist/shared/hx-tooltip-nYOv9OLu.js.map +0 -1
  319. package/dist/shared/hx-tree-item-C2CiWuDE.js +0 -703
  320. package/dist/shared/hx-tree-item-C2CiWuDE.js.map +0 -1
  321. package/dist/shared/toast-factory-YSznocIV.js.map +0 -1
@@ -1,11 +1,11 @@
1
- import { css as v, html as d, nothing as s } from "lit";
2
- import { property as a, customElement as f } from "lit/decorators.js";
3
- import { classMap as b } from "lit/directives/class-map.js";
4
- import { ifDefined as u } from "lit/directives/if-defined.js";
5
- import { d as p } from "./dev-warn-YlwPHjtX.js";
6
- import { m as g } from "./aria-delegation-Doq6RRUy.js";
7
- import { H as x } from "./helix-element-BNEYeiys.js";
8
- const m = v`
1
+ import { css as p, html as b, nothing as d } from "lit";
2
+ import { property as l, customElement as f } from "lit/decorators.js";
3
+ import { classMap as v } from "lit/directives/class-map.js";
4
+ import { ifDefined as a } from "lit/directives/if-defined.js";
5
+ import { d as g } from "./dev-warn-YlwPHjtX.js";
6
+ import { m as x } from "./aria-delegation-Doq6RRUy.js";
7
+ import { H as m } from "./helix-element-BNEYeiys.js";
8
+ const y = p`
9
9
  :host {
10
10
  display: inline-block;
11
11
  }
@@ -455,23 +455,33 @@ const m = v`
455
455
  }
456
456
  }
457
457
  `;
458
- var y = Object.defineProperty, k = Object.getOwnPropertyDescriptor, n = (t, r, h, i) => {
459
- for (var o = i > 1 ? void 0 : i ? k(r, h) : r, l = t.length - 1, c; l >= 0; l--)
460
- (c = t[l]) && (o = (i ? c(r, h, o) : c(o)) || o);
461
- return i && o && y(r, h, o), o;
458
+ var k = Object.defineProperty, w = Object.getOwnPropertyDescriptor, s = (t, e, n, i) => {
459
+ for (var o = i > 1 ? void 0 : i ? w(e, n) : e, h = t.length - 1, c; h >= 0; h--)
460
+ (c = t[h]) && (o = (i ? c(e, n, o) : c(o)) || o);
461
+ return i && o && k(e, n, o), o;
462
462
  };
463
- let e = class extends g(x) {
463
+ let r = class extends x(m) {
464
464
  constructor() {
465
465
  super(...arguments), this.variant = "primary", this.size = "md", this.disabled = !1, this.loading = !1, this.type = "button", this.href = void 0, this.target = void 0, this.name = void 0, this.value = void 0, this.full = !1, this.inverted = !1, this.accessibleLabel = "", this._emptySlotWarnEmitted = !1;
466
466
  }
467
467
  /**
468
468
  * Returns the effective label for the button, checking accessible-label first,
469
- * then the aria-label attribute, falling back to empty string.
469
+ * then the consumer-set aria-label attribute (read via data-aria-label which
470
+ * mixinDelegatesAria writes when consumers set the host's `aria-label`),
471
+ * then the still-pending `aria-label` attribute (in case the mixin has not
472
+ * yet processed it), falling back to empty string.
473
+ *
474
+ * HX-015 migration: never read `this.ariaLabel` (the native HTMLElement IDL
475
+ * property). The mixin overrides `ariaLabel` to read `data-aria-label` in
476
+ * modern browsers, but the IDL fallback path breaks in fallback browsers and
477
+ * confuses consumers who follow the v3 upgrade guide. Read the attribute
478
+ * storage directly so the source-of-truth is unambiguous.
479
+ *
470
480
  * @internal
471
481
  */
472
482
  get _effectiveLabel() {
473
- var t, r;
474
- return ((t = this.accessibleLabel) == null ? void 0 : t.trim()) || ((r = this.ariaLabel) == null ? void 0 : r.trim()) || "";
483
+ var t, e, n;
484
+ return ((t = this.accessibleLabel) == null ? void 0 : t.trim()) || ((e = this.getAttribute("data-aria-label")) == null ? void 0 : e.trim()) || ((n = this.getAttribute("aria-label")) == null ? void 0 : n.trim()) || "";
475
485
  }
476
486
  // ─── Form API ───
477
487
  _onFormDisabled(t) {
@@ -480,31 +490,31 @@ let e = class extends g(x) {
480
490
  firstUpdated(t) {
481
491
  var i;
482
492
  super.firstUpdated(t);
483
- const r = (i = this.shadowRoot) == null ? void 0 : i.querySelector("slot:not([name])");
484
- !((r == null ? void 0 : r.assignedNodes({ flatten: !0 })) ?? []).some(
493
+ const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector("slot:not([name])");
494
+ !((e == null ? void 0 : e.assignedNodes({ flatten: !0 })) ?? []).some(
485
495
  (o) => {
486
- var l;
487
- return o.nodeType !== Node.TEXT_NODE || (((l = o.textContent) == null ? void 0 : l.trim().length) ?? 0) > 0;
496
+ var h;
497
+ return o.nodeType !== Node.TEXT_NODE || (((h = o.textContent) == null ? void 0 : h.trim().length) ?? 0) > 0;
488
498
  }
489
499
  ) && !this._effectiveLabel && (this._emptySlotWarnEmitted = !0);
490
500
  }
491
501
  updated(t) {
492
502
  if (super.updated(t), t.has("variant")) {
493
- const r = [...e._VALID_VARIANTS];
494
- r.includes(this.variant) || (p(
503
+ const e = [...r._VALID_VARIANTS];
504
+ e.includes(this.variant) || (g(
495
505
  "hx-button",
496
- `Invalid variant "${this.variant}". Expected one of: ${r.join(", ")}. Clamping to "primary".`
506
+ `Invalid variant "${this.variant}". Expected one of: ${e.join(", ")}. Clamping to "primary".`
497
507
  ), this.variant = "primary");
498
508
  }
499
509
  }
500
510
  // ─── Slot Handlers ───
501
511
  /** @internal */
502
512
  _handleDefaultSlotChange(t) {
503
- const h = t.target.assignedNodes({ flatten: !0 }).some((i) => {
513
+ const n = t.target.assignedNodes({ flatten: !0 }).some((i) => {
504
514
  var o;
505
515
  return i.nodeType !== Node.TEXT_NODE || (((o = i.textContent) == null ? void 0 : o.trim().length) ?? 0) > 0;
506
516
  });
507
- !h && !this._effectiveLabel && this._emptySlotWarnEmitted, h && (this._emptySlotWarnEmitted = !1);
517
+ !n && !this._effectiveLabel && this._emptySlotWarnEmitted, n && (this._emptySlotWarnEmitted = !1);
508
518
  }
509
519
  // ─── Event Handling ───
510
520
  /**
@@ -530,7 +540,7 @@ let e = class extends g(x) {
530
540
  * @internal
531
541
  */
532
542
  _renderSpinner() {
533
- return d`
543
+ return b`
534
544
  <svg
535
545
  class="button__spinner"
536
546
  part="spinner"
@@ -562,8 +572,8 @@ let e = class extends g(x) {
562
572
  * @internal
563
573
  */
564
574
  _renderInner() {
565
- return d`
566
- ${this.loading ? this._renderSpinner() : s}
575
+ return b`
576
+ ${this.loading ? this._renderSpinner() : d}
567
577
  <span part="prefix" class="button__prefix">
568
578
  <slot name="prefix"></slot>
569
579
  </span>
@@ -582,30 +592,43 @@ let e = class extends g(x) {
582
592
  [`button--${this.variant}`]: !0,
583
593
  [`button--${this.size}`]: !0,
584
594
  "button--loading": this.loading
585
- };
586
- return this.href !== void 0 ? d`
595
+ }, e = this.getAttribute("data-aria-pressed"), n = this.getAttribute("data-aria-expanded"), i = this.getAttribute("data-aria-haspopup"), o = this.getAttribute("data-aria-controls"), h = this.getAttribute("data-aria-describedby"), c = this.getAttribute("data-aria-current"), u = this.getAttribute("data-aria-labelledby");
596
+ return this.href !== void 0 ? b`
587
597
  <a
588
598
  part="button"
589
- class=${b(t)}
590
- href=${this.disabled || this.loading ? s : u(this.href)}
591
- target=${u(this.target)}
592
- rel=${this.target === "_blank" ? "noopener noreferrer" : s}
593
- aria-label=${this._effectiveLabel || s}
594
- aria-disabled=${this.disabled ? "true" : s}
595
- aria-busy=${this.loading ? "true" : s}
596
- tabindex=${this.disabled ? "-1" : s}
599
+ class=${v(t)}
600
+ href=${this.disabled || this.loading ? d : a(this.href)}
601
+ target=${a(this.target)}
602
+ rel=${this.target === "_blank" ? "noopener noreferrer" : d}
603
+ aria-label=${this._effectiveLabel || d}
604
+ aria-labelledby=${a(u ?? void 0)}
605
+ aria-disabled=${this.disabled ? "true" : d}
606
+ aria-busy=${this.loading ? "true" : d}
607
+ aria-pressed=${a(e ?? void 0)}
608
+ aria-expanded=${a(n ?? void 0)}
609
+ aria-haspopup=${a(i ?? void 0)}
610
+ aria-controls=${a(o ?? void 0)}
611
+ aria-describedby=${a(h ?? void 0)}
612
+ aria-current=${a(c ?? void 0)}
613
+ tabindex=${this.disabled || this.loading ? "-1" : d}
597
614
  @click=${this._handleClick}
598
615
  >
599
616
  ${this._renderInner()}
600
617
  </a>
601
- ` : d`
618
+ ` : b`
602
619
  <button
603
620
  part="button"
604
- class=${b(t)}
621
+ class=${v(t)}
605
622
  ?disabled=${this.disabled}
606
623
  type=${this.type}
607
- aria-label=${this._effectiveLabel || s}
608
- aria-busy=${this.loading ? "true" : s}
624
+ aria-label=${this._effectiveLabel || d}
625
+ aria-labelledby=${a(u ?? void 0)}
626
+ aria-busy=${this.loading ? "true" : d}
627
+ aria-pressed=${a(e ?? void 0)}
628
+ aria-expanded=${a(n ?? void 0)}
629
+ aria-haspopup=${a(i ?? void 0)}
630
+ aria-controls=${a(o ?? void 0)}
631
+ aria-describedby=${a(h ?? void 0)}
609
632
  @click=${this._handleClick}
610
633
  >
611
634
  ${this._renderInner()}
@@ -613,9 +636,9 @@ let e = class extends g(x) {
613
636
  `;
614
637
  }
615
638
  };
616
- e.styles = [m];
617
- e.formAssociated = !0;
618
- e._VALID_VARIANTS = [
639
+ r.styles = [y];
640
+ r.formAssociated = !0;
641
+ r._VALID_VARIANTS = [
619
642
  "primary",
620
643
  "secondary",
621
644
  "tertiary",
@@ -623,46 +646,46 @@ e._VALID_VARIANTS = [
623
646
  "ghost",
624
647
  "outline"
625
648
  ];
626
- n([
627
- a({ type: String, reflect: !0 })
628
- ], e.prototype, "variant", 2);
629
- n([
630
- a({ type: String, reflect: !0, attribute: "hx-size" })
631
- ], e.prototype, "size", 2);
632
- n([
633
- a({ type: Boolean, reflect: !0 })
634
- ], e.prototype, "disabled", 2);
635
- n([
636
- a({ type: Boolean, reflect: !0 })
637
- ], e.prototype, "loading", 2);
638
- n([
639
- a({ type: String })
640
- ], e.prototype, "type", 2);
641
- n([
642
- a({ type: String })
643
- ], e.prototype, "href", 2);
644
- n([
645
- a({ type: String })
646
- ], e.prototype, "target", 2);
647
- n([
648
- a({ type: String })
649
- ], e.prototype, "name", 2);
650
- n([
651
- a({ type: String })
652
- ], e.prototype, "value", 2);
653
- n([
654
- a({ type: Boolean, reflect: !0 })
655
- ], e.prototype, "full", 2);
656
- n([
657
- a({ type: Boolean, reflect: !0 })
658
- ], e.prototype, "inverted", 2);
659
- n([
660
- a({ type: String, attribute: "accessible-label" })
661
- ], e.prototype, "accessibleLabel", 2);
662
- e = n([
649
+ s([
650
+ l({ type: String, reflect: !0 })
651
+ ], r.prototype, "variant", 2);
652
+ s([
653
+ l({ type: String, reflect: !0, attribute: "hx-size" })
654
+ ], r.prototype, "size", 2);
655
+ s([
656
+ l({ type: Boolean, reflect: !0 })
657
+ ], r.prototype, "disabled", 2);
658
+ s([
659
+ l({ type: Boolean, reflect: !0 })
660
+ ], r.prototype, "loading", 2);
661
+ s([
662
+ l({ type: String })
663
+ ], r.prototype, "type", 2);
664
+ s([
665
+ l({ type: String })
666
+ ], r.prototype, "href", 2);
667
+ s([
668
+ l({ type: String })
669
+ ], r.prototype, "target", 2);
670
+ s([
671
+ l({ type: String })
672
+ ], r.prototype, "name", 2);
673
+ s([
674
+ l({ type: String })
675
+ ], r.prototype, "value", 2);
676
+ s([
677
+ l({ type: Boolean, reflect: !0 })
678
+ ], r.prototype, "full", 2);
679
+ s([
680
+ l({ type: Boolean, reflect: !0 })
681
+ ], r.prototype, "inverted", 2);
682
+ s([
683
+ l({ type: String, attribute: "accessible-label" })
684
+ ], r.prototype, "accessibleLabel", 2);
685
+ r = s([
663
686
  f("hx-button")
664
- ], e);
687
+ ], r);
665
688
  export {
666
- e as H
689
+ r as H
667
690
  };
668
- //# sourceMappingURL=hx-button-DPY6SPVT.js.map
691
+ //# sourceMappingURL=hx-button-BOwAEcF1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hx-button-DPY6SPVT.js","sources":["../../src/components/hx-button/hx-button.styles.ts","../../src/components/hx-button/hx-button.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixButtonStyles = css`\n :host {\n display: inline-block;\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: var(--hx-opacity-disabled, 0.5);\n }\n\n :host([full]) {\n display: block;\n width: 100%;\n }\n\n :host([full]) .button {\n width: 100%;\n justify-content: center;\n }\n\n /* ─── Base Button ─── */\n\n .button {\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-button-border-color, transparent);\n border-radius: var(--hx-button-border-radius, var(--hx-border-radius-md, 0.375rem));\n background-color: var(--hx-button-bg, var(--hx-color-primary-500, #429797));\n color: var(--hx-button-color, var(--hx-color-neutral-0, #ffffff));\n font-family: var(--hx-button-font-family, var(--hx-font-family-sans, sans-serif));\n font-weight: var(--hx-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 }\n\n .button:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-button-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n .button:hover {\n filter: brightness(var(--hx-filter-brightness-hover, 0.9));\n }\n\n .button:active {\n filter: brightness(var(--hx-filter-brightness-active, 0.8));\n }\n\n /* ─── Size Variants ─── */\n\n /* WCAG 2.5.5 (healthcare mandate): minimum 44px touch target for sm variant.\n min-height uses --hx-touch-target-min to guarantee the interactive area\n meets the threshold even though the visual size token is smaller. */\n .button--sm {\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-touch-target-min, 2.75rem);\n }\n\n .button--md {\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 .button--lg {\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 /* ─── Style Variants ─── */\n\n .button--primary {\n --hx-button-bg: var(--hx-color-action-primary-bg, #429797);\n /* Inline #0d1825 matches text.on-primary's resolved primitive (neutral-900);\n cold-start without the semantic still paints AA-tuned dark-on-primary\n rather than white-on-primary (3.43:1 fail). */\n --hx-button-color: var(--hx-color-text-on-primary, #0d1825);\n --hx-button-border-color: transparent;\n }\n\n .button--secondary {\n --hx-button-bg: transparent;\n /* primary-500 (#429797) text on white surface = 3.44:1 — fails AA.\n primary-600 (#0F7078) on white = 5.82:1 — AA pass. */\n --hx-button-color: var(--hx-color-action-secondary-fg, #0f7078);\n --hx-button-border-color: var(--hx-color-action-secondary-border, #0f7078);\n }\n\n .button--secondary:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-action-secondary-bg-hover, #ebf8f8));\n }\n\n .button--tertiary {\n --hx-button-bg: var(--hx-color-surface-sunken, #ebeee9);\n --hx-button-color: var(--hx-color-text-primary, #0d1825);\n --hx-button-border-color: transparent;\n }\n\n .button--tertiary:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-surface-raised, #f5f8f3));\n }\n\n .button--danger {\n --hx-button-bg: var(--hx-color-action-danger-bg, #e5493e);\n /* Inline #0d1825 matches text.on-error's resolved primitive (neutral-900);\n cold-start without the semantic still paints AA-tuned dark-on-error\n rather than white-on-error (3.92:1 fail). */\n --hx-button-color: var(--hx-color-text-on-error, #0d1825);\n --hx-button-border-color: transparent;\n }\n\n /* on-error tokens are tuned for error-500 (neutral-900 on #E5493E ≈ 4.59:1).\n error-600 (#C92A2A) drops that to 3.28:1 — AA fail. text.on-error-strong\n resolves to neutral-0 across modes (no dark flip) so the darker hover fill\n stays legible. Mirrors hx-toast precedent (commit 300e21ab0); routed\n through the semantic tier in 3.2.1 token-cascade remediation. */\n .button--danger:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-action-danger-bg-hover, #c92a2a));\n --hx-button-color: var(--hx-color-text-on-error-strong, #ffffff);\n }\n\n /* Pressed state binds explicitly to action.danger.bg-active (error-700,\n #A21312) + text.on-error-strong (neutral-0) = 7.96:1 AA. Base\n .button:active filter:brightness(0.8) would compound on top of bg-hover\n (#C92A2A) and produce ~3.3:1 sub-AA on the bound colors. Override the\n filter to none. HC override on action.danger.bg-active flips to HC\n error-500 so the on-error-strong (HC = #000) pair is AA in HC too. */\n .button--danger:active {\n --hx-button-bg: var(--hx-button-active-bg, var(--hx-color-action-danger-bg-active, #a21312));\n --hx-button-color: var(--hx-color-text-on-error-strong, #ffffff);\n filter: none;\n }\n\n .button--ghost {\n --hx-button-bg: transparent;\n /* primary-500 (#429797) text on white surface = 3.44:1 — fails AA.\n primary-600 (#0F7078) on white = 5.82:1 — AA pass. */\n --hx-button-color: var(--hx-color-action-ghost-fg, #0f7078);\n --hx-button-border-color: transparent;\n }\n\n .button--ghost:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-action-ghost-bg-hover, #ebf8f8));\n }\n\n .button--outline {\n --hx-button-bg: transparent;\n --hx-button-color: var(--hx-color-text-primary, #0d1825);\n --hx-button-border-color: var(--hx-color-border-strong, #66787b);\n }\n\n .button--outline:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-surface-raised, #f5f8f3));\n }\n\n /* on-primary token resolves to neutral-900 (#0D1825) — tuned for primary-500.\n primary-600 (#0F7078) drops the pair to 3.07:1 — AA fail. text.on-primary-strong\n resolves to neutral-0 across modes (no dark flip) for the darker hover fill.\n Mirrors hx-toast precedent (commit 300e21ab0); routed through the semantic\n tier in 3.2.1 token-cascade remediation. */\n .button--primary:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-action-primary-bg-hover, #0f7078));\n --hx-button-color: var(--hx-color-text-on-primary-strong, #ffffff);\n }\n\n /* Pressed state binds explicitly to action.primary.bg-active (primary-700,\n #0F6363) + text.on-primary-strong (neutral-0) = 7.03:1 AA. The base\n .button:active filter:brightness(0.8) would compound on top of bg-hover\n (#0F7078) and produce ~3.7:1 sub-AA on the bound colors. Override the\n filter to none so the action.*.bg-active token is what actually paints. */\n .button--primary:active {\n --hx-button-bg: var(--hx-button-active-bg, var(--hx-color-action-primary-bg-active, #0f6363));\n --hx-button-color: var(--hx-color-text-on-primary-strong, #ffffff);\n filter: none;\n }\n\n /* ─── Disabled ─── */\n\n /* Note: opacity is applied on :host([disabled]) above — do NOT add opacity here.\n Stacking opacity on both :host and .button[disabled] would multiply to 0.25. */\n .button[disabled] {\n cursor: not-allowed;\n }\n\n /* ─── Loading State ─── */\n\n .button--loading {\n position: relative;\n cursor: wait;\n }\n\n .button__spinner {\n width: 1em;\n height: 1em;\n flex-shrink: 0;\n animation: hx-spin var(--hx-duration-spinner, 750ms) linear infinite;\n }\n\n @keyframes hx-spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .button {\n transition: none;\n }\n\n .button__spinner {\n animation: none;\n opacity: var(--hx-opacity-muted, 0.6);\n }\n }\n\n /* ─── Inverted Mode ─── */\n\n /* Inline-fallback contract for the on-dark-* tokens in this section:\n the literal rgba(255, 255, 255, 0.X) arms are a LIGHT-MODE-only last\n resort (cold-start, CSS-not-loaded). At runtime, hx-theme injects\n the dark.* override (overlay-black-* for the strong border and the\n surface.on-dark-overlay-* fills) so dark-mode inverted buttons stay\n visible on the now-light surface.inverse (#EBEEE9). The inline white\n overlays would render invisible (≈1.1:1) on a light surface, but\n they never paint when the theme is mounted. If a future change\n moves these into a context where hx-theme is not guaranteed,\n replace with mode-aware tokens. */\n\n /* Override text color and filter-based hover/active for all variants */\n :host([inverted]) .button {\n color: var(--hx-button-inverted-color, var(--hx-color-text-inverse, #ffffff));\n filter: none;\n }\n\n :host([inverted]) .button:hover {\n filter: none;\n }\n\n :host([inverted]) .button:active {\n filter: none;\n }\n\n :host([inverted]) .button:focus-visible {\n /* WCAG 1.4.11: focus indicator needs ≥3:1 against adjacent colors.\n border-on-dark-strong (overlay-white-70) ≈ 5:1 on neutral-900 — passes.\n The lower-alpha siblings used to live in border.* but were sub-3:1\n against any plausible surface and could not honour a border contract;\n they're now surface.on-dark-overlay-{default,subtle} (translucent\n fills, not borders) and used elsewhere in this file. See\n tokens.json color.surface.on-dark-overlay-* for canonical ratios. */\n outline-color: var(\n --hx-button-inverted-focus-ring-color,\n var(--hx-color-border-on-dark-strong, rgba(255, 255, 255, 0.7))\n );\n }\n\n /* Primary inverted — resting bg routes through action.primary.bg-inverted-rest\n so dark mode can flip the fill to primary-600. surface.inverse becomes light\n (#EBEEE9) in dark mode; primary-500 on #EBEEE9 = 2.94:1 (sub-3:1 UI floor\n fail for the inverted-button boundary). primary-600 on #EBEEE9 = 4.97:1\n (AA pass). Light mode tracks action.primary.bg-inverted-rest's base value\n (primary-500, 5.20:1 on dark surface.inverse).\n\n Override path note (codex round-11): this binds --hx-button-bg directly,\n matching the cascade convention every other .button--{variant} rule uses\n (light primary at line 89, danger at 120, secondary, tertiary, ghost). The\n consumer override path for inverted-primary rest is\n --hx-color-action-primary-bg-inverted-rest, NOT --hx-button-bg — the same\n pattern as light primary (consumers override --hx-color-action-primary-bg).\n Pinned by dark-mode-resolution.test.ts:185-197 across both modes. */\n :host([inverted]) .button--primary {\n --hx-button-bg: var(--hx-color-action-primary-bg-inverted-rest, #429797);\n }\n\n /* Primary inverted — hover/pressed lift to action.primary.bg-inverted-hover\n (primary-400, light teal). The base :host([inverted]) .button rule binds\n color to text.inverse, which flips by mode (neutral-0 in light, neutral-900\n in dark). On a permanent light-teal fill, white text drops to 2.4:1 in\n light mode (AA fail). Pin color to text.on-primary (neutral-900, no\n dark-mode flip) for both hover and active so the foreground is dark in\n both modes — neutral-900 on primary-400 = 7.27:1 (AA pass).\n Pressed === hover visually in inverted mode is acceptable UX (the\n transient absence of pointer over the button signals release).\n The fallback chain wraps --hx-button-active-bg (highest precedence) and\n --hx-button-hover-bg so consumer overrides on either prop apply under\n :host([inverted]) — the two share a paint here, so either knob is\n honored, with active-bg winning when both are set. */\n :host([inverted]) .button--primary:hover,\n :host([inverted]) .button--primary:active {\n --hx-button-bg: var(\n --hx-button-active-bg,\n var(--hx-button-hover-bg, var(--hx-color-action-primary-bg-inverted-hover, #6ab1b1))\n );\n color: var(\n --hx-button-inverted-primary-interactive-color,\n var(--hx-color-text-on-primary, #0d1825)\n );\n }\n\n /* Danger inverted — sister to primary. Hover/pressed lift to\n action.danger.bg-inverted-hover (error-400, #FC7264). Same foreground\n contract: text.inverse fails in light mode (white on light red ≈ 2.6:1);\n pin to text.on-error (neutral-900, no dark-mode flip) for 6.58:1 in both\n modes. Same active-bg → hover-bg → semantic fallback chain as primary. */\n :host([inverted]) .button--danger:hover,\n :host([inverted]) .button--danger:active {\n --hx-button-bg: var(\n --hx-button-active-bg,\n var(--hx-button-hover-bg, var(--hx-color-action-danger-bg-inverted-hover, #fc7264))\n );\n color: var(\n --hx-button-inverted-danger-interactive-color,\n var(--hx-color-text-on-error, #0d1825)\n );\n }\n\n /* Secondary inverted — white border and translucent hover fill */\n :host([inverted]) .button--secondary {\n --hx-button-border-color: var(--hx-color-border-on-dark-strong, rgba(255, 255, 255, 0.7));\n }\n\n /* Inverted overlay fills read both names so consumer overrides reach paint\n regardless of which token they target: the deprecated --hx-color-border-on-dark-*\n names (3.2.0/3.2.1 public API, scheduled for removal in 4.0.0) and the canonical\n --hx-color-surface-on-dark-overlay-* names (round-8 rename). Deprecated name\n wins when set; otherwise resolves through the canonical alias chain. */\n :host([inverted]) .button--secondary:hover {\n --hx-button-bg: var(\n --hx-color-border-on-dark-default,\n var(--hx-color-surface-on-dark-overlay-default, rgba(255, 255, 255, 0.3))\n );\n }\n\n /* Tertiary inverted — resting at the subtle overlay (10%) lifts to the default\n overlay (30%) on hover so the runtime hover delta is visually distinct, not\n collapsed onto a single token. */\n :host([inverted]) .button--tertiary {\n --hx-button-bg: var(\n --hx-color-border-on-dark-subtle,\n var(--hx-color-surface-on-dark-overlay-subtle, rgba(255, 255, 255, 0.1))\n );\n --hx-button-border-color: transparent;\n }\n\n :host([inverted]) .button--tertiary:hover {\n --hx-button-bg: var(\n --hx-color-border-on-dark-default,\n var(--hx-color-surface-on-dark-overlay-default, rgba(255, 255, 255, 0.3))\n );\n }\n\n /* Ghost inverted — transparent base, translucent hover bg */\n :host([inverted]) .button--ghost {\n --hx-button-bg: transparent;\n --hx-button-border-color: transparent;\n }\n\n :host([inverted]) .button--ghost:hover {\n --hx-button-bg: var(\n --hx-button-inverted-ghost-hover-bg,\n var(\n --hx-color-border-on-dark-default,\n var(--hx-color-surface-on-dark-overlay-default, rgba(255, 255, 255, 0.3))\n )\n );\n }\n\n /* Outline inverted — white border */\n :host([inverted]) .button--outline {\n --hx-button-border-color: var(--hx-color-border-on-dark-strong, rgba(255, 255, 255, 0.7));\n }\n\n :host([inverted]) .button--outline:hover {\n --hx-button-bg: var(\n --hx-color-border-on-dark-default,\n var(--hx-color-surface-on-dark-overlay-default, rgba(255, 255, 255, 0.3))\n );\n }\n\n /* ─── Prefix / Suffix / Label ─── */\n\n .button__prefix,\n .button__suffix {\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .button__label {\n flex: 1 1 auto;\n }\n\n /* ─── High Contrast Mode (forced-colors) ─── */\n\n @media (forced-colors: active) {\n .button {\n /* Ensure button outline is visible in Windows High Contrast mode.\n ButtonText/ButtonFace are system colors recognized by the browser. */\n forced-color-adjust: none;\n background-color: ButtonFace;\n color: ButtonText;\n border: 2px solid ButtonText;\n }\n\n .button:hover {\n /* Hover affordance must survive in HC. Highlight/HighlightText is the\n OS-level \"selected\" pair, mirroring the forcedColorsInteractive mixin's\n hover contract — kept inline since this component owns its bespoke HC\n block (XOR rule). */\n background-color: Highlight;\n color: HighlightText;\n border-color: Highlight;\n }\n\n .button:focus-visible {\n outline: 3px solid Highlight;\n outline-offset: 2px;\n }\n\n .button[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 .button--loading .button__spinner {\n /* Ensure spinner is visible in HCM */\n forced-color-adjust: auto;\n }\n }\n`;\n","import { html, nothing, type TemplateResult, 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 { ifDefined } from 'lit/directives/if-defined.js';\nimport { HelixElement } from '../../base/index.js';\nimport { mixinDelegatesAria } from '../../mixins/index.js';\nimport { helixButtonStyles } from './hx-button.styles.js';\nimport { devWarn } from '../../utils/dev-warn.js';\n\n/** Detail for the hx-click event dispatched by hx-button. */\nexport interface HxButtonClickDetail {\n originalEvent: MouseEvent;\n}\n\n/**\n * A production-grade button component for user interaction. Supports multiple\n * visual variants, sizes, loading state, prefix/suffix slots, anchor rendering,\n * and full ElementInternals form association.\n *\n * @summary Primary interactive element for triggering actions and form submission.\n *\n * @tag hx-button\n *\n * @slot - Default slot for button label text or content.\n * @slot prefix - Icon or content rendered before the label.\n * @slot suffix - Icon or content rendered after the label.\n *\n * @fires {CustomEvent<{originalEvent: MouseEvent}>} hx-click - Dispatched when\n * the button is clicked and is neither disabled nor loading.\n *\n * @csspart button - The native button or anchor element.\n * @csspart label - The label text wrapper span.\n * @csspart prefix - The prefix slot container span.\n * @csspart suffix - The suffix slot container span.\n * @csspart spinner - The loading spinner SVG element.\n *\n * @cssprop [--hx-button-bg=var(--hx-color-action-primary-bg)] - Button background color. **Variant-shadowed**: every `.button--{variant}` rule rebinds this property at descendant scope, so a host-level override (`style=\"--hx-button-bg: …\"` or `:host`-targeting CSS) does not reach paint for primary/secondary/tertiary/danger/ghost/outline buttons. To recolor a variant fill, override the upstream semantic instead — e.g. `--hx-color-action-primary-bg` (light primary), `--hx-color-action-primary-bg-inverted-rest` (inverted primary), `--hx-color-action-danger-bg` (danger), or the inverted overlay tokens for tertiary/secondary/ghost/outline. The `--hx-button-bg` hook still works for the rare case of an unstyled base button without a `variant` class, and is internally rebound by the variant rules to participate in the active/hover override chain.\n * @cssprop [--hx-button-hover-bg] - Hover background override (primary and danger variants only). Other variants (secondary/outline, ghost) keep their hover fills routed through their semantic action.* tokens and do not consume this hook. Under [inverted] for primary/danger, hover and active share a paint (combined :hover, :active rule), so this override applies to both states unless --hx-button-active-bg also takes precedence.\n * @cssprop [--hx-button-active-bg] - Pressed/active background override (primary and danger variants only, including their inverted modes). Takes precedence over --hx-button-hover-bg in the fallback chain. Standard-mode primary/danger default to action.{primary,danger}.bg-active (with filter:none) for AA-pinned pressed contrast. Inverted-mode primary/danger reuse action.{primary,danger}.bg-inverted-hover (combined :hover, :active rule); setting --hx-button-active-bg under [inverted] therefore overrides the lifted hover fill as well as the pressed fill — the two share a paint in inverted mode. Other variants do not consume this hook.\n * @cssprop [--hx-button-color=var(--hx-color-text-on-primary)] - Button text color (variants route through text.on-{role} / text.on-{role}-strong).\n * @cssprop [--hx-button-border-color=transparent] - Button border color (secondary/outline variants route through action.secondary.border).\n * @cssprop [--hx-button-border-radius=var(--hx-border-radius-md)] - Button border radius.\n * @cssprop [--hx-button-font-family=var(--hx-font-family-sans)] - Button font family.\n * @cssprop [--hx-button-font-weight=var(--hx-font-weight-semibold)] - Button font weight.\n * @cssprop [--hx-button-focus-ring-color=var(--hx-focus-ring-color)] - Focus ring color.\n *\n * @cssprop [--hx-button-inverted-color=var(--hx-color-text-inverse)] - Text color when inverted (resolves to neutral-0).\n * @cssprop [--hx-button-inverted-primary-interactive-color=var(--hx-color-text-on-primary)] - Foreground override for inverted primary hover and pressed (combined :hover, :active rule). Defaults to text.on-primary (neutral-900, no dark-mode flip) so dark text rides the lifted primary-400 fill — text.inverse on light teal collapses to ~2.4:1 in light mode.\n * @cssprop [--hx-button-inverted-danger-interactive-color=var(--hx-color-text-on-error)] - Foreground override for inverted danger hover and pressed (combined :hover, :active rule). Defaults to text.on-error (neutral-900); same rationale as the primary override.\n * @cssprop [--hx-button-inverted-ghost-hover-bg=var(--hx-color-surface-on-dark-overlay-default)] - Ghost hover bg when inverted (overlay-white-30 — translucent fill, not a border; contrast not applicable).\n * @cssprop [--hx-button-inverted-focus-ring-color=var(--hx-color-border-on-dark-strong)] - Focus ring color when inverted (overlay-white-70 ≈ 5:1 vs neutral-900 — clears WCAG 1.4.11 3:1 floor for non-text UI).\n *\n * @cssprop [--hx-color-action-primary-bg] - Primary variant resting fill (3.2.1 semantic action layer).\n * @cssprop [--hx-color-action-primary-bg-hover] - Primary variant hover fill.\n * @cssprop [--hx-color-action-primary-bg-active] - Primary variant active/pressed fill.\n * @cssprop [--hx-color-action-secondary-fg] - Secondary/outline variant fg (resolves to primary-600 light, primary-400 dark). Consumed only by .button--secondary; the actual border/surface paint for outline currently routes through --hx-color-border-strong / --hx-color-surface-raised in styles, with this token reserved for the foreground.\n * @cssprop [--hx-color-action-secondary-border] - Secondary/outline variant border (3.2.1 semantic; outline still routes through --hx-color-border-strong by default).\n * @cssprop [--hx-color-action-secondary-bg-hover] - Secondary/outline variant hover fill (3.2.1 semantic; outline still routes through --hx-color-surface-raised by default).\n * @cssprop [--hx-color-action-ghost-fg] - Ghost variant fg.\n * @cssprop [--hx-color-action-ghost-bg-hover] - Ghost variant hover fill.\n * @cssprop [--hx-color-action-danger-bg] - Danger variant resting fill.\n * @cssprop [--hx-color-action-danger-bg-hover] - Danger variant hover fill.\n * @cssprop [--hx-color-action-danger-bg-active] - Danger variant active fill.\n * @cssprop [--hx-color-action-primary-bg-inverted-hover] - Primary variant hover/pressed fill on dark/inverted surface (resolves to primary-400, 7.27:1 on neutral-900).\n * @cssprop [--hx-color-action-danger-bg-inverted-hover] - Danger variant hover/pressed fill on dark/inverted surface (resolves to error-400, 6.58:1 on neutral-900).\n * @cssprop [--hx-color-text-on-primary] - Foreground for primary fill (resolves to neutral-900 — AA-tuned for primary-500).\n * @cssprop [--hx-color-text-on-primary-strong] - Foreground for primary-hover fill (resolves to neutral-0 across modes).\n * @cssprop [--hx-color-text-on-error] - Foreground for danger fill (resolves to neutral-900).\n * @cssprop [--hx-color-text-on-error-strong] - Foreground for danger-hover fill (resolves to neutral-0 across modes).\n * @cssprop [--hx-color-text-primary] - Foreground for tertiary variant on surface.sunken.\n * @cssprop [--hx-color-surface-sunken] - Tertiary variant resting fill.\n * @cssprop [--hx-color-surface-raised] - Tertiary variant hover fill.\n * @cssprop [--hx-color-surface-on-dark-overlay-subtle] - Inverted-tertiary resting fill (overlay-white-10 — translucent fill, not a border).\n * @cssprop [--hx-color-surface-on-dark-overlay-default] - Inverted-tertiary hover fill + inverted-secondary/ghost/outline hover fill (overlay-white-30 — translucent fill, not a border).\n * @cssprop [--hx-color-border-on-dark-strong] - Inverted-secondary/outline border + inverted focus-visible outline (overlay-white-70 ≈ 5:1 — clears WCAG 1.4.11 3:1 floor).\n * @cssprop [--hx-color-border-on-dark-subtle] - DEPRECATED 3.2.2; renamed to --hx-color-surface-on-dark-overlay-subtle (the value paints a translucent fill, not a border). Consume sites read both names via deprecated-first fallback so existing overrides keep working until removal in 4.0.0.\n * @cssprop [--hx-color-border-on-dark-default] - DEPRECATED 3.2.2; renamed to --hx-color-surface-on-dark-overlay-default (the value paints a translucent fill, not a border). Consume sites read both names via deprecated-first fallback so existing overrides keep working until removal in 4.0.0.\n */\n@customElement('hx-button')\nexport class HelixButton extends mixinDelegatesAria(HelixElement) {\n // 3.2.1: forced-colors deference is owned by the bespoke @media block in\n // hx-button.styles.ts (covers loading/disabled/focus, not just the base).\n // Do NOT also compose forcedColorsInteractive here — the mixin's docstring\n // forbids dual composition (XOR rule) and the dual approach was flagged in\n // the token-cascade campaign findings.\n static override styles = [helixButtonStyles];\n\n // ─── Form Association ───\n\n /** @internal */\n static override formAssociated = true;\n\n // ─── Public Properties ───\n\n /**\n * Visual style variant of the 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 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 button is disabled. Prevents all interaction and form actions.\n * @attr disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Whether the button is in a loading state. Shows spinner, prevents interaction,\n * and sets aria-busy. Does not set the disabled attribute.\n * @attr loading\n */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /**\n * The type attribute for the underlying button element. Ignored when href is set.\n * @attr type\n */\n @property({ type: String })\n type: 'button' | 'submit' | 'reset' = 'button';\n\n /**\n * When set, renders an anchor element instead of a button.\n * @attr href\n */\n @property({ type: String })\n href: string | undefined = undefined;\n\n /**\n * Anchor target attribute. Only used when href is set.\n * @attr target\n */\n @property({ type: String })\n target: string | undefined = undefined;\n\n /**\n * Form field name submitted via ElementInternals.setFormValue on submit.\n * @attr name\n */\n @property({ type: String })\n name: string | undefined = undefined;\n\n /**\n * Form field value submitted via ElementInternals.setFormValue on submit.\n * @attr value\n */\n @property({ type: String })\n value: string | undefined = undefined;\n\n /**\n * When true, the button stretches to fill its container width.\n * Sets the host to `display: block` and the inner element to `width: 100%`.\n * @attr full\n */\n @property({ type: Boolean, reflect: true })\n full = false;\n\n /**\n * When true, flips button colors for placement on dark or gradient backgrounds.\n * Forces text to white and adjusts hover/focus ring colors across all variants.\n *\n * **Mode scope:** `[inverted]` is validated for placement on a dark *region*\n * within a light-mode-active page (hero banners, gradient sections, dark\n * cards). It is NOT validated for use within a dark-mode-active root\n * context: in dark mode, `surface.inverse` flips to a light surface\n * (neutral-100), and the lifted `-400` hover/active fills lose UI-floor\n * contrast against it (primary 2.10:1, danger 2.32:1 vs WCAG 1.4.11's 3:1\n * floor). Mode-aware fill stops + foreground for the dark-mode-inverted\n * combination are tracked as a 3.2.x follow-up.\n *\n * @attr inverted\n */\n @property({ type: Boolean, reflect: true })\n inverted = false;\n\n /**\n * Accessible label for icon-only or text-less buttons.\n * Required when the button has no visible text content.\n *\n * Accepts both `accessible-label` and the standard `aria-label` HTML attribute.\n * `accessible-label` takes precedence when both are set.\n *\n * @attr accessible-label\n */\n @property({ type: String, attribute: 'accessible-label' })\n accessibleLabel: string = '';\n\n /**\n * Returns the effective label for the button, checking accessible-label first,\n * then the aria-label attribute, falling back to empty string.\n * @internal\n */\n private get _effectiveLabel(): string {\n return this.accessibleLabel?.trim() || this.ariaLabel?.trim() || '';\n }\n\n // ─── Form API ───\n\n protected override _onFormDisabled(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n // ─── Lifecycle ───\n\n /** @internal */\n private static readonly _VALID_VARIANTS = [\n 'primary',\n 'secondary',\n 'tertiary',\n 'danger',\n 'ghost',\n 'outline',\n ] as const;\n\n // Prevents double-warn on browsers that fire slotchange for empty initial slots.\n private _emptySlotWarnEmitted = false;\n\n override firstUpdated(changedProperties: PropertyValues<this>): void {\n super.firstUpdated(changedProperties);\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot:not([name])');\n const hasContent = (slot?.assignedNodes({ flatten: true }) ?? []).some(\n (n) => n.nodeType !== Node.TEXT_NODE || (n.textContent?.trim().length ?? 0) > 0,\n );\n if (!hasContent && !this._effectiveLabel) {\n this._emptySlotWarnEmitted = true;\n devWarn(\n 'hx-button',\n 'hx-button has no slot content and no accessible-label — button will have no accessible name.',\n );\n }\n }\n\n override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (changedProperties.has('variant')) {\n const validVariants: string[] = [...HelixButton._VALID_VARIANTS];\n if (!validVariants.includes(this.variant)) {\n devWarn(\n 'hx-button',\n `Invalid variant \"${this.variant}\". Expected one of: ${validVariants.join(', ')}. Clamping to \"primary\".`,\n );\n this.variant = 'primary';\n }\n }\n }\n\n // ─── Slot Handlers ───\n\n /** @internal */\n private _handleDefaultSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n const hasContent = slot\n .assignedNodes({ flatten: true })\n .some((n) => n.nodeType !== Node.TEXT_NODE || (n.textContent?.trim().length ?? 0) > 0);\n if (!hasContent && !this._effectiveLabel && !this._emptySlotWarnEmitted) {\n devWarn(\n 'hx-button',\n 'hx-button has no slot content and no accessible-label — button will have no accessible name.',\n );\n }\n // Only reset once content arrives so the guard stays armed for browsers\n // that fire a second slotchange for the same empty initial slot.\n if (hasContent) {\n this._emptySlotWarnEmitted = false;\n }\n }\n\n // ─── Event Handling ───\n\n /**\n * @private\n * @internal\n */\n private _handleClick(e: MouseEvent): void {\n if (this.disabled || this.loading) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n /**\n * Dispatched when the 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 // Handle form submission/reset if form-associated and not in anchor mode\n if (this.href === undefined && this.type === 'submit' && this._internals.form) {\n if (this.name !== undefined && this.value !== undefined) {\n this._internals.setFormValue(this.value);\n }\n this._internals.form.requestSubmit();\n } else if (this.href === undefined && this.type === 'reset' && this._internals.form) {\n this._internals.form.reset();\n }\n }\n\n // ─── Render Helpers ───\n\n /**\n * @private\n * @internal\n */\n private _renderSpinner(): TemplateResult {\n return html`\n <svg\n class=\"button__spinner\"\n part=\"spinner\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <circle\n class=\"button__spinner-track\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n opacity=\"0.3\"\n />\n <path\n class=\"button__spinner-arc\"\n d=\"M12 2a10 10 0 0 1 10 10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n />\n </svg>\n `;\n }\n\n /**\n * @private\n * @internal\n */\n private _renderInner(): TemplateResult {\n return html`\n ${this.loading ? this._renderSpinner() : nothing}\n <span part=\"prefix\" class=\"button__prefix\">\n <slot name=\"prefix\"></slot>\n </span>\n <span part=\"label\" class=\"button__label\">\n <slot @slotchange=${this._handleDefaultSlotChange}></slot>\n </span>\n <span part=\"suffix\" class=\"button__suffix\">\n <slot name=\"suffix\"></slot>\n </span>\n `;\n }\n\n // ─── Render ───\n\n override render() {\n const classes = {\n button: true,\n [`button--${this.variant}`]: true,\n [`button--${this.size}`]: true,\n 'button--loading': this.loading,\n };\n\n if (this.href !== undefined) {\n return html`\n <a\n part=\"button\"\n class=${classMap(classes)}\n href=${this.disabled || this.loading ? nothing : ifDefined(this.href)}\n target=${ifDefined(this.target)}\n rel=${this.target === '_blank' ? 'noopener noreferrer' : nothing}\n aria-label=${this._effectiveLabel || nothing}\n aria-disabled=${this.disabled ? 'true' : nothing}\n aria-busy=${this.loading ? 'true' : nothing}\n tabindex=${this.disabled ? '-1' : nothing}\n @click=${this._handleClick}\n >\n ${this._renderInner()}\n </a>\n `;\n }\n\n return html`\n <button\n part=\"button\"\n class=${classMap(classes)}\n ?disabled=${this.disabled}\n type=${this.type}\n aria-label=${this._effectiveLabel || nothing}\n aria-busy=${this.loading ? 'true' : nothing}\n @click=${this._handleClick}\n >\n ${this._renderInner()}\n </button>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-button': HelixButton;\n }\n interface HTMLElementEventMap {\n 'hx-click': CustomEvent<{ originalEvent: MouseEvent }>;\n }\n}\n"],"names":["helixButtonStyles","css","HelixButton","mixinDelegatesAria","HelixElement","_a","_b","disabled","changedProperties","slot","n","validVariants","devWarn","e","hasContent","html","nothing","classes","classMap","ifDefined","__decorateClass","property","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;A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,CAAA;AAQAkB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAzC/BnB,EA0CX,WAAA,WAAA,CAAA;AAOAkB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAhDfnB,EAiDX,WAAA,QAAA,CAAA;AAOAkB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAvDfnB,EAwDX,WAAA,QAAA,CAAA;AAOAkB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA9DfnB,EA+DX,WAAA,UAAA,CAAA;AAOAkB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GArEfnB,EAsEX,WAAA,QAAA,CAAA;AAOAkB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA5EfnB,EA6EX,WAAA,SAAA,CAAA;AAQAkB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GApF/BnB,EAqFX,WAAA,QAAA,CAAA;AAkBAkB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAtG/BnB,EAuGX,WAAA,YAAA,CAAA;AAYAkB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,oBAAoB;AAAA,GAlH9CnB,EAmHX,WAAA,mBAAA,CAAA;AAnHWA,IAANkB,EAAA;AAAA,EADNE,EAAc,WAAW;AAAA,GACbpB,CAAA;"}
1
+ {"version":3,"file":"hx-button-BOwAEcF1.js","sources":["../../src/components/hx-button/hx-button.styles.ts","../../src/components/hx-button/hx-button.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixButtonStyles = css`\n :host {\n display: inline-block;\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: var(--hx-opacity-disabled, 0.5);\n }\n\n :host([full]) {\n display: block;\n width: 100%;\n }\n\n :host([full]) .button {\n width: 100%;\n justify-content: center;\n }\n\n /* ─── Base Button ─── */\n\n .button {\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-button-border-color, transparent);\n border-radius: var(--hx-button-border-radius, var(--hx-border-radius-md, 0.375rem));\n background-color: var(--hx-button-bg, var(--hx-color-primary-500, #429797));\n color: var(--hx-button-color, var(--hx-color-neutral-0, #ffffff));\n font-family: var(--hx-button-font-family, var(--hx-font-family-sans, sans-serif));\n font-weight: var(--hx-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 }\n\n .button:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-button-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n .button:hover {\n filter: brightness(var(--hx-filter-brightness-hover, 0.9));\n }\n\n .button:active {\n filter: brightness(var(--hx-filter-brightness-active, 0.8));\n }\n\n /* ─── Size Variants ─── */\n\n /* WCAG 2.5.5 (healthcare mandate): minimum 44px touch target for sm variant.\n min-height uses --hx-touch-target-min to guarantee the interactive area\n meets the threshold even though the visual size token is smaller. */\n .button--sm {\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-touch-target-min, 2.75rem);\n }\n\n .button--md {\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 .button--lg {\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 /* ─── Style Variants ─── */\n\n .button--primary {\n --hx-button-bg: var(--hx-color-action-primary-bg, #429797);\n /* Inline #0d1825 matches text.on-primary's resolved primitive (neutral-900);\n cold-start without the semantic still paints AA-tuned dark-on-primary\n rather than white-on-primary (3.43:1 fail). */\n --hx-button-color: var(--hx-color-text-on-primary, #0d1825);\n --hx-button-border-color: transparent;\n }\n\n .button--secondary {\n --hx-button-bg: transparent;\n /* primary-500 (#429797) text on white surface = 3.44:1 — fails AA.\n primary-600 (#0F7078) on white = 5.82:1 — AA pass. */\n --hx-button-color: var(--hx-color-action-secondary-fg, #0f7078);\n --hx-button-border-color: var(--hx-color-action-secondary-border, #0f7078);\n }\n\n .button--secondary:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-action-secondary-bg-hover, #ebf8f8));\n }\n\n .button--tertiary {\n --hx-button-bg: var(--hx-color-surface-sunken, #ebeee9);\n --hx-button-color: var(--hx-color-text-primary, #0d1825);\n --hx-button-border-color: transparent;\n }\n\n .button--tertiary:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-surface-raised, #f5f8f3));\n }\n\n .button--danger {\n --hx-button-bg: var(--hx-color-action-danger-bg, #e5493e);\n /* Inline #0d1825 matches text.on-error's resolved primitive (neutral-900);\n cold-start without the semantic still paints AA-tuned dark-on-error\n rather than white-on-error (3.92:1 fail). */\n --hx-button-color: var(--hx-color-text-on-error, #0d1825);\n --hx-button-border-color: transparent;\n }\n\n /* on-error tokens are tuned for error-500 (neutral-900 on #E5493E ≈ 4.59:1).\n error-600 (#C92A2A) drops that to 3.28:1 — AA fail. text.on-error-strong\n resolves to neutral-0 across modes (no dark flip) so the darker hover fill\n stays legible. Mirrors hx-toast precedent (commit 300e21ab0); routed\n through the semantic tier in 3.2.1 token-cascade remediation. */\n .button--danger:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-action-danger-bg-hover, #c92a2a));\n --hx-button-color: var(--hx-color-text-on-error-strong, #ffffff);\n }\n\n /* Pressed state binds explicitly to action.danger.bg-active (error-700,\n #A21312) + text.on-error-strong (neutral-0) = 7.96:1 AA. Base\n .button:active filter:brightness(0.8) would compound on top of bg-hover\n (#C92A2A) and produce ~3.3:1 sub-AA on the bound colors. Override the\n filter to none. HC override on action.danger.bg-active flips to HC\n error-500 so the on-error-strong (HC = #000) pair is AA in HC too. */\n .button--danger:active {\n --hx-button-bg: var(--hx-button-active-bg, var(--hx-color-action-danger-bg-active, #a21312));\n --hx-button-color: var(--hx-color-text-on-error-strong, #ffffff);\n filter: none;\n }\n\n .button--ghost {\n --hx-button-bg: transparent;\n /* primary-500 (#429797) text on white surface = 3.44:1 — fails AA.\n primary-600 (#0F7078) on white = 5.82:1 — AA pass. */\n --hx-button-color: var(--hx-color-action-ghost-fg, #0f7078);\n --hx-button-border-color: transparent;\n }\n\n .button--ghost:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-action-ghost-bg-hover, #ebf8f8));\n }\n\n .button--outline {\n --hx-button-bg: transparent;\n --hx-button-color: var(--hx-color-text-primary, #0d1825);\n --hx-button-border-color: var(--hx-color-border-strong, #66787b);\n }\n\n .button--outline:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-surface-raised, #f5f8f3));\n }\n\n /* on-primary token resolves to neutral-900 (#0D1825) — tuned for primary-500.\n primary-600 (#0F7078) drops the pair to 3.07:1 — AA fail. text.on-primary-strong\n resolves to neutral-0 across modes (no dark flip) for the darker hover fill.\n Mirrors hx-toast precedent (commit 300e21ab0); routed through the semantic\n tier in 3.2.1 token-cascade remediation. */\n .button--primary:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-action-primary-bg-hover, #0f7078));\n --hx-button-color: var(--hx-color-text-on-primary-strong, #ffffff);\n }\n\n /* Pressed state binds explicitly to action.primary.bg-active (primary-700,\n #0F6363) + text.on-primary-strong (neutral-0) = 7.03:1 AA. The base\n .button:active filter:brightness(0.8) would compound on top of bg-hover\n (#0F7078) and produce ~3.7:1 sub-AA on the bound colors. Override the\n filter to none so the action.*.bg-active token is what actually paints. */\n .button--primary:active {\n --hx-button-bg: var(--hx-button-active-bg, var(--hx-color-action-primary-bg-active, #0f6363));\n --hx-button-color: var(--hx-color-text-on-primary-strong, #ffffff);\n filter: none;\n }\n\n /* ─── Disabled ─── */\n\n /* Note: opacity is applied on :host([disabled]) above — do NOT add opacity here.\n Stacking opacity on both :host and .button[disabled] would multiply to 0.25. */\n .button[disabled] {\n cursor: not-allowed;\n }\n\n /* ─── Loading State ─── */\n\n .button--loading {\n position: relative;\n cursor: wait;\n }\n\n .button__spinner {\n width: 1em;\n height: 1em;\n flex-shrink: 0;\n animation: hx-spin var(--hx-duration-spinner, 750ms) linear infinite;\n }\n\n @keyframes hx-spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .button {\n transition: none;\n }\n\n .button__spinner {\n animation: none;\n opacity: var(--hx-opacity-muted, 0.6);\n }\n }\n\n /* ─── Inverted Mode ─── */\n\n /* Inline-fallback contract for the on-dark-* tokens in this section:\n the literal rgba(255, 255, 255, 0.X) arms are a LIGHT-MODE-only last\n resort (cold-start, CSS-not-loaded). At runtime, hx-theme injects\n the dark.* override (overlay-black-* for the strong border and the\n surface.on-dark-overlay-* fills) so dark-mode inverted buttons stay\n visible on the now-light surface.inverse (#EBEEE9). The inline white\n overlays would render invisible (≈1.1:1) on a light surface, but\n they never paint when the theme is mounted. If a future change\n moves these into a context where hx-theme is not guaranteed,\n replace with mode-aware tokens. */\n\n /* Override text color and filter-based hover/active for all variants */\n :host([inverted]) .button {\n color: var(--hx-button-inverted-color, var(--hx-color-text-inverse, #ffffff));\n filter: none;\n }\n\n :host([inverted]) .button:hover {\n filter: none;\n }\n\n :host([inverted]) .button:active {\n filter: none;\n }\n\n :host([inverted]) .button:focus-visible {\n /* WCAG 1.4.11: focus indicator needs ≥3:1 against adjacent colors.\n border-on-dark-strong (overlay-white-70) ≈ 5:1 on neutral-900 — passes.\n The lower-alpha siblings used to live in border.* but were sub-3:1\n against any plausible surface and could not honour a border contract;\n they're now surface.on-dark-overlay-{default,subtle} (translucent\n fills, not borders) and used elsewhere in this file. See\n tokens.json color.surface.on-dark-overlay-* for canonical ratios. */\n outline-color: var(\n --hx-button-inverted-focus-ring-color,\n var(--hx-color-border-on-dark-strong, rgba(255, 255, 255, 0.7))\n );\n }\n\n /* Primary inverted — resting bg routes through action.primary.bg-inverted-rest\n so dark mode can flip the fill to primary-600. surface.inverse becomes light\n (#EBEEE9) in dark mode; primary-500 on #EBEEE9 = 2.94:1 (sub-3:1 UI floor\n fail for the inverted-button boundary). primary-600 on #EBEEE9 = 4.97:1\n (AA pass). Light mode tracks action.primary.bg-inverted-rest's base value\n (primary-500, 5.20:1 on dark surface.inverse).\n\n Override path note (codex round-11): this binds --hx-button-bg directly,\n matching the cascade convention every other .button--{variant} rule uses\n (light primary at line 89, danger at 120, secondary, tertiary, ghost). The\n consumer override path for inverted-primary rest is\n --hx-color-action-primary-bg-inverted-rest, NOT --hx-button-bg — the same\n pattern as light primary (consumers override --hx-color-action-primary-bg).\n Pinned by dark-mode-resolution.test.ts:185-197 across both modes. */\n :host([inverted]) .button--primary {\n --hx-button-bg: var(--hx-color-action-primary-bg-inverted-rest, #429797);\n }\n\n /* Primary inverted — hover/pressed lift to action.primary.bg-inverted-hover\n (primary-400, light teal). The base :host([inverted]) .button rule binds\n color to text.inverse, which flips by mode (neutral-0 in light, neutral-900\n in dark). On a permanent light-teal fill, white text drops to 2.4:1 in\n light mode (AA fail). Pin color to text.on-primary (neutral-900, no\n dark-mode flip) for both hover and active so the foreground is dark in\n both modes — neutral-900 on primary-400 = 7.27:1 (AA pass).\n Pressed === hover visually in inverted mode is acceptable UX (the\n transient absence of pointer over the button signals release).\n The fallback chain wraps --hx-button-active-bg (highest precedence) and\n --hx-button-hover-bg so consumer overrides on either prop apply under\n :host([inverted]) — the two share a paint here, so either knob is\n honored, with active-bg winning when both are set. */\n :host([inverted]) .button--primary:hover,\n :host([inverted]) .button--primary:active {\n --hx-button-bg: var(\n --hx-button-active-bg,\n var(--hx-button-hover-bg, var(--hx-color-action-primary-bg-inverted-hover, #6ab1b1))\n );\n color: var(\n --hx-button-inverted-primary-interactive-color,\n var(--hx-color-text-on-primary, #0d1825)\n );\n }\n\n /* Danger inverted — sister to primary. Hover/pressed lift to\n action.danger.bg-inverted-hover (error-400, #FC7264). Same foreground\n contract: text.inverse fails in light mode (white on light red ≈ 2.6:1);\n pin to text.on-error (neutral-900, no dark-mode flip) for 6.58:1 in both\n modes. Same active-bg → hover-bg → semantic fallback chain as primary. */\n :host([inverted]) .button--danger:hover,\n :host([inverted]) .button--danger:active {\n --hx-button-bg: var(\n --hx-button-active-bg,\n var(--hx-button-hover-bg, var(--hx-color-action-danger-bg-inverted-hover, #fc7264))\n );\n color: var(\n --hx-button-inverted-danger-interactive-color,\n var(--hx-color-text-on-error, #0d1825)\n );\n }\n\n /* Secondary inverted — white border and translucent hover fill */\n :host([inverted]) .button--secondary {\n --hx-button-border-color: var(--hx-color-border-on-dark-strong, rgba(255, 255, 255, 0.7));\n }\n\n /* Inverted overlay fills read both names so consumer overrides reach paint\n regardless of which token they target: the deprecated --hx-color-border-on-dark-*\n names (3.2.0/3.2.1 public API, scheduled for removal in 4.0.0) and the canonical\n --hx-color-surface-on-dark-overlay-* names (round-8 rename). Deprecated name\n wins when set; otherwise resolves through the canonical alias chain. */\n :host([inverted]) .button--secondary:hover {\n --hx-button-bg: var(\n --hx-color-border-on-dark-default,\n var(--hx-color-surface-on-dark-overlay-default, rgba(255, 255, 255, 0.3))\n );\n }\n\n /* Tertiary inverted — resting at the subtle overlay (10%) lifts to the default\n overlay (30%) on hover so the runtime hover delta is visually distinct, not\n collapsed onto a single token. */\n :host([inverted]) .button--tertiary {\n --hx-button-bg: var(\n --hx-color-border-on-dark-subtle,\n var(--hx-color-surface-on-dark-overlay-subtle, rgba(255, 255, 255, 0.1))\n );\n --hx-button-border-color: transparent;\n }\n\n :host([inverted]) .button--tertiary:hover {\n --hx-button-bg: var(\n --hx-color-border-on-dark-default,\n var(--hx-color-surface-on-dark-overlay-default, rgba(255, 255, 255, 0.3))\n );\n }\n\n /* Ghost inverted — transparent base, translucent hover bg */\n :host([inverted]) .button--ghost {\n --hx-button-bg: transparent;\n --hx-button-border-color: transparent;\n }\n\n :host([inverted]) .button--ghost:hover {\n --hx-button-bg: var(\n --hx-button-inverted-ghost-hover-bg,\n var(\n --hx-color-border-on-dark-default,\n var(--hx-color-surface-on-dark-overlay-default, rgba(255, 255, 255, 0.3))\n )\n );\n }\n\n /* Outline inverted — white border */\n :host([inverted]) .button--outline {\n --hx-button-border-color: var(--hx-color-border-on-dark-strong, rgba(255, 255, 255, 0.7));\n }\n\n :host([inverted]) .button--outline:hover {\n --hx-button-bg: var(\n --hx-color-border-on-dark-default,\n var(--hx-color-surface-on-dark-overlay-default, rgba(255, 255, 255, 0.3))\n );\n }\n\n /* ─── Prefix / Suffix / Label ─── */\n\n .button__prefix,\n .button__suffix {\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .button__label {\n flex: 1 1 auto;\n }\n\n /* ─── High Contrast Mode (forced-colors) ─── */\n\n @media (forced-colors: active) {\n .button {\n /* Ensure button outline is visible in Windows High Contrast mode.\n ButtonText/ButtonFace are system colors recognized by the browser. */\n forced-color-adjust: none;\n background-color: ButtonFace;\n color: ButtonText;\n border: 2px solid ButtonText;\n }\n\n .button:hover {\n /* Hover affordance must survive in HC. Highlight/HighlightText is the\n OS-level \"selected\" pair, mirroring the forcedColorsInteractive mixin's\n hover contract — kept inline since this component owns its bespoke HC\n block (XOR rule). */\n background-color: Highlight;\n color: HighlightText;\n border-color: Highlight;\n }\n\n .button:focus-visible {\n outline: 3px solid Highlight;\n outline-offset: 2px;\n }\n\n .button[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 .button--loading .button__spinner {\n /* Ensure spinner is visible in HCM */\n forced-color-adjust: auto;\n }\n }\n`;\n","import { html, nothing, type TemplateResult, 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 { ifDefined } from 'lit/directives/if-defined.js';\nimport { HelixElement } from '../../base/index.js';\nimport { mixinDelegatesAria } from '../../mixins/index.js';\nimport { helixButtonStyles } from './hx-button.styles.js';\nimport { devWarn } from '../../utils/dev-warn.js';\n\n/** Detail for the hx-click event dispatched by hx-button. */\nexport interface HxButtonClickDetail {\n originalEvent: MouseEvent;\n}\n\n/**\n * A production-grade button component for user interaction. Supports multiple\n * visual variants, sizes, loading state, prefix/suffix slots, anchor rendering,\n * and full ElementInternals form association.\n *\n * @summary Primary interactive element for triggering actions and form submission.\n *\n * @tag hx-button\n *\n * @slot - Default slot for button label text or content.\n * @slot prefix - Icon or content rendered before the label.\n * @slot suffix - Icon or content rendered after the label.\n *\n * @fires {CustomEvent<{originalEvent: MouseEvent}>} hx-click - Dispatched when\n * the button is clicked and is neither disabled nor loading.\n *\n * @csspart button - The native button or anchor element.\n * @csspart label - The label text wrapper span.\n * @csspart prefix - The prefix slot container span.\n * @csspart suffix - The suffix slot container span.\n * @csspart spinner - The loading spinner SVG element.\n *\n * @cssprop [--hx-button-bg=var(--hx-color-action-primary-bg)] - Button background color. **Variant-shadowed**: every `.button--{variant}` rule rebinds this property at descendant scope, so a host-level override (`style=\"--hx-button-bg: …\"` or `:host`-targeting CSS) does not reach paint for primary/secondary/tertiary/danger/ghost/outline buttons. To recolor a variant fill, override the upstream semantic instead — e.g. `--hx-color-action-primary-bg` (light primary), `--hx-color-action-primary-bg-inverted-rest` (inverted primary), `--hx-color-action-danger-bg` (danger), or the inverted overlay tokens for tertiary/secondary/ghost/outline. The `--hx-button-bg` hook still works for the rare case of an unstyled base button without a `variant` class, and is internally rebound by the variant rules to participate in the active/hover override chain.\n * @cssprop [--hx-button-hover-bg] - Hover background override (primary and danger variants only). Other variants (secondary/outline, ghost) keep their hover fills routed through their semantic action.* tokens and do not consume this hook. Under [inverted] for primary/danger, hover and active share a paint (combined :hover, :active rule), so this override applies to both states unless --hx-button-active-bg also takes precedence.\n * @cssprop [--hx-button-active-bg] - Pressed/active background override (primary and danger variants only, including their inverted modes). Takes precedence over --hx-button-hover-bg in the fallback chain. Standard-mode primary/danger default to action.{primary,danger}.bg-active (with filter:none) for AA-pinned pressed contrast. Inverted-mode primary/danger reuse action.{primary,danger}.bg-inverted-hover (combined :hover, :active rule); setting --hx-button-active-bg under [inverted] therefore overrides the lifted hover fill as well as the pressed fill — the two share a paint in inverted mode. Other variants do not consume this hook.\n * @cssprop [--hx-button-color=var(--hx-color-text-on-primary)] - Button text color (variants route through text.on-{role} / text.on-{role}-strong).\n * @cssprop [--hx-button-border-color=transparent] - Button border color (secondary/outline variants route through action.secondary.border).\n * @cssprop [--hx-button-border-radius=var(--hx-border-radius-md)] - Button border radius.\n * @cssprop [--hx-button-font-family=var(--hx-font-family-sans)] - Button font family.\n * @cssprop [--hx-button-font-weight=var(--hx-font-weight-semibold)] - Button font weight.\n * @cssprop [--hx-button-focus-ring-color=var(--hx-focus-ring-color)] - Focus ring color.\n *\n * @cssprop [--hx-button-inverted-color=var(--hx-color-text-inverse)] - Text color when inverted (resolves to neutral-0).\n * @cssprop [--hx-button-inverted-primary-interactive-color=var(--hx-color-text-on-primary)] - Foreground override for inverted primary hover and pressed (combined :hover, :active rule). Defaults to text.on-primary (neutral-900, no dark-mode flip) so dark text rides the lifted primary-400 fill — text.inverse on light teal collapses to ~2.4:1 in light mode.\n * @cssprop [--hx-button-inverted-danger-interactive-color=var(--hx-color-text-on-error)] - Foreground override for inverted danger hover and pressed (combined :hover, :active rule). Defaults to text.on-error (neutral-900); same rationale as the primary override.\n * @cssprop [--hx-button-inverted-ghost-hover-bg=var(--hx-color-surface-on-dark-overlay-default)] - Ghost hover bg when inverted (overlay-white-30 — translucent fill, not a border; contrast not applicable).\n * @cssprop [--hx-button-inverted-focus-ring-color=var(--hx-color-border-on-dark-strong)] - Focus ring color when inverted (overlay-white-70 ≈ 5:1 vs neutral-900 — clears WCAG 1.4.11 3:1 floor for non-text UI).\n *\n * @cssprop [--hx-color-action-primary-bg] - Primary variant resting fill (3.2.1 semantic action layer).\n * @cssprop [--hx-color-action-primary-bg-hover] - Primary variant hover fill.\n * @cssprop [--hx-color-action-primary-bg-active] - Primary variant active/pressed fill.\n * @cssprop [--hx-color-action-secondary-fg] - Secondary/outline variant fg (resolves to primary-600 light, primary-400 dark). Consumed only by .button--secondary; the actual border/surface paint for outline currently routes through --hx-color-border-strong / --hx-color-surface-raised in styles, with this token reserved for the foreground.\n * @cssprop [--hx-color-action-secondary-border] - Secondary/outline variant border (3.2.1 semantic; outline still routes through --hx-color-border-strong by default).\n * @cssprop [--hx-color-action-secondary-bg-hover] - Secondary/outline variant hover fill (3.2.1 semantic; outline still routes through --hx-color-surface-raised by default).\n * @cssprop [--hx-color-action-ghost-fg] - Ghost variant fg.\n * @cssprop [--hx-color-action-ghost-bg-hover] - Ghost variant hover fill.\n * @cssprop [--hx-color-action-danger-bg] - Danger variant resting fill.\n * @cssprop [--hx-color-action-danger-bg-hover] - Danger variant hover fill.\n * @cssprop [--hx-color-action-danger-bg-active] - Danger variant active fill.\n * @cssprop [--hx-color-action-primary-bg-inverted-hover] - Primary variant hover/pressed fill on dark/inverted surface (resolves to primary-400, 7.27:1 on neutral-900).\n * @cssprop [--hx-color-action-danger-bg-inverted-hover] - Danger variant hover/pressed fill on dark/inverted surface (resolves to error-400, 6.58:1 on neutral-900).\n * @cssprop [--hx-color-text-on-primary] - Foreground for primary fill (resolves to neutral-900 — AA-tuned for primary-500).\n * @cssprop [--hx-color-text-on-primary-strong] - Foreground for primary-hover fill (resolves to neutral-0 across modes).\n * @cssprop [--hx-color-text-on-error] - Foreground for danger fill (resolves to neutral-900).\n * @cssprop [--hx-color-text-on-error-strong] - Foreground for danger-hover fill (resolves to neutral-0 across modes).\n * @cssprop [--hx-color-text-primary] - Foreground for tertiary variant on surface.sunken.\n * @cssprop [--hx-color-surface-sunken] - Tertiary variant resting fill.\n * @cssprop [--hx-color-surface-raised] - Tertiary variant hover fill.\n * @cssprop [--hx-color-surface-on-dark-overlay-subtle] - Inverted-tertiary resting fill (overlay-white-10 — translucent fill, not a border).\n * @cssprop [--hx-color-surface-on-dark-overlay-default] - Inverted-tertiary hover fill + inverted-secondary/ghost/outline hover fill (overlay-white-30 — translucent fill, not a border).\n * @cssprop [--hx-color-border-on-dark-strong] - Inverted-secondary/outline border + inverted focus-visible outline (overlay-white-70 ≈ 5:1 — clears WCAG 1.4.11 3:1 floor).\n * @cssprop [--hx-color-border-on-dark-subtle] - DEPRECATED 3.2.2; renamed to --hx-color-surface-on-dark-overlay-subtle (the value paints a translucent fill, not a border). Consume sites read both names via deprecated-first fallback so existing overrides keep working until removal in 4.0.0.\n * @cssprop [--hx-color-border-on-dark-default] - DEPRECATED 3.2.2; renamed to --hx-color-surface-on-dark-overlay-default (the value paints a translucent fill, not a border). Consume sites read both names via deprecated-first fallback so existing overrides keep working until removal in 4.0.0.\n */\n@customElement('hx-button')\nexport class HelixButton extends mixinDelegatesAria(HelixElement) {\n // 3.2.1: forced-colors deference is owned by the bespoke @media block in\n // hx-button.styles.ts (covers loading/disabled/focus, not just the base).\n // Do NOT also compose forcedColorsInteractive here — the mixin's docstring\n // forbids dual composition (XOR rule) and the dual approach was flagged in\n // the token-cascade campaign findings.\n static override styles = [helixButtonStyles];\n\n // ─── Form Association ───\n\n /** @internal */\n static override formAssociated = true;\n\n // ─── Public Properties ───\n\n /**\n * Visual style variant of the 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 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 button is disabled. Prevents all interaction and form actions.\n * @attr disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Whether the button is in a loading state. Shows spinner, prevents interaction,\n * and sets aria-busy. Does not set the disabled attribute.\n * @attr loading\n */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /**\n * The type attribute for the underlying button element. Ignored when href is set.\n * @attr type\n */\n @property({ type: String })\n type: 'button' | 'submit' | 'reset' = 'button';\n\n /**\n * When set, renders an anchor element instead of a button.\n * @attr href\n */\n @property({ type: String })\n href: string | undefined = undefined;\n\n /**\n * Anchor target attribute. Only used when href is set.\n * @attr target\n */\n @property({ type: String })\n target: string | undefined = undefined;\n\n /**\n * Form field name submitted via ElementInternals.setFormValue on submit.\n * @attr name\n */\n @property({ type: String })\n name: string | undefined = undefined;\n\n /**\n * Form field value submitted via ElementInternals.setFormValue on submit.\n * @attr value\n */\n @property({ type: String })\n value: string | undefined = undefined;\n\n /**\n * When true, the button stretches to fill its container width.\n * Sets the host to `display: block` and the inner element to `width: 100%`.\n * @attr full\n */\n @property({ type: Boolean, reflect: true })\n full = false;\n\n /**\n * When true, flips button colors for placement on dark or gradient backgrounds.\n * Forces text to white and adjusts hover/focus ring colors across all variants.\n *\n * **Mode scope:** `[inverted]` is validated for placement on a dark *region*\n * within a light-mode-active page (hero banners, gradient sections, dark\n * cards). It is NOT validated for use within a dark-mode-active root\n * context: in dark mode, `surface.inverse` flips to a light surface\n * (neutral-100), and the lifted `-400` hover/active fills lose UI-floor\n * contrast against it (primary 2.10:1, danger 2.32:1 vs WCAG 1.4.11's 3:1\n * floor). Mode-aware fill stops + foreground for the dark-mode-inverted\n * combination are tracked as a 3.2.x follow-up.\n *\n * @attr inverted\n */\n @property({ type: Boolean, reflect: true })\n inverted = false;\n\n /**\n * Accessible label for icon-only or text-less buttons.\n * Required when the button has no visible text content.\n *\n * Accepts both `accessible-label` and the standard `aria-label` HTML attribute.\n * `accessible-label` takes precedence when both are set.\n *\n * @attr accessible-label\n */\n @property({ type: String, attribute: 'accessible-label' })\n accessibleLabel: string = '';\n\n /**\n * Returns the effective label for the button, checking accessible-label first,\n * then the consumer-set aria-label attribute (read via data-aria-label which\n * mixinDelegatesAria writes when consumers set the host's `aria-label`),\n * then the still-pending `aria-label` attribute (in case the mixin has not\n * yet processed it), falling back to empty string.\n *\n * HX-015 migration: never read `this.ariaLabel` (the native HTMLElement IDL\n * property). The mixin overrides `ariaLabel` to read `data-aria-label` in\n * modern browsers, but the IDL fallback path breaks in fallback browsers and\n * confuses consumers who follow the v3 upgrade guide. Read the attribute\n * storage directly so the source-of-truth is unambiguous.\n *\n * @internal\n */\n private get _effectiveLabel(): string {\n return (\n this.accessibleLabel?.trim() ||\n this.getAttribute('data-aria-label')?.trim() ||\n this.getAttribute('aria-label')?.trim() ||\n ''\n );\n }\n\n // ─── Form API ───\n\n protected override _onFormDisabled(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n // ─── Lifecycle ───\n\n /** @internal */\n private static readonly _VALID_VARIANTS = [\n 'primary',\n 'secondary',\n 'tertiary',\n 'danger',\n 'ghost',\n 'outline',\n ] as const;\n\n // Prevents double-warn on browsers that fire slotchange for empty initial slots.\n private _emptySlotWarnEmitted = false;\n\n override firstUpdated(changedProperties: PropertyValues<this>): void {\n super.firstUpdated(changedProperties);\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot:not([name])');\n const hasContent = (slot?.assignedNodes({ flatten: true }) ?? []).some(\n (n) => n.nodeType !== Node.TEXT_NODE || (n.textContent?.trim().length ?? 0) > 0,\n );\n if (!hasContent && !this._effectiveLabel) {\n this._emptySlotWarnEmitted = true;\n devWarn(\n 'hx-button',\n 'hx-button has no slot content and no accessible-label — button will have no accessible name.',\n );\n }\n }\n\n override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (changedProperties.has('variant')) {\n const validVariants: string[] = [...HelixButton._VALID_VARIANTS];\n if (!validVariants.includes(this.variant)) {\n devWarn(\n 'hx-button',\n `Invalid variant \"${this.variant}\". Expected one of: ${validVariants.join(', ')}. Clamping to \"primary\".`,\n );\n this.variant = 'primary';\n }\n }\n }\n\n // ─── Slot Handlers ───\n\n /** @internal */\n private _handleDefaultSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n const hasContent = slot\n .assignedNodes({ flatten: true })\n .some((n) => n.nodeType !== Node.TEXT_NODE || (n.textContent?.trim().length ?? 0) > 0);\n if (!hasContent && !this._effectiveLabel && !this._emptySlotWarnEmitted) {\n devWarn(\n 'hx-button',\n 'hx-button has no slot content and no accessible-label — button will have no accessible name.',\n );\n }\n // Only reset once content arrives so the guard stays armed for browsers\n // that fire a second slotchange for the same empty initial slot.\n if (hasContent) {\n this._emptySlotWarnEmitted = false;\n }\n }\n\n // ─── Event Handling ───\n\n /**\n * @private\n * @internal\n */\n private _handleClick(e: MouseEvent): void {\n if (this.disabled || this.loading) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n /**\n * Dispatched when the 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 // Handle form submission/reset if form-associated and not in anchor mode\n if (this.href === undefined && this.type === 'submit' && this._internals.form) {\n if (this.name !== undefined && this.value !== undefined) {\n this._internals.setFormValue(this.value);\n }\n this._internals.form.requestSubmit();\n } else if (this.href === undefined && this.type === 'reset' && this._internals.form) {\n this._internals.form.reset();\n }\n }\n\n // ─── Render Helpers ───\n\n /**\n * @private\n * @internal\n */\n private _renderSpinner(): TemplateResult {\n return html`\n <svg\n class=\"button__spinner\"\n part=\"spinner\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <circle\n class=\"button__spinner-track\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n opacity=\"0.3\"\n />\n <path\n class=\"button__spinner-arc\"\n d=\"M12 2a10 10 0 0 1 10 10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n />\n </svg>\n `;\n }\n\n /**\n * @private\n * @internal\n */\n private _renderInner(): TemplateResult {\n return html`\n ${this.loading ? this._renderSpinner() : nothing}\n <span part=\"prefix\" class=\"button__prefix\">\n <slot name=\"prefix\"></slot>\n </span>\n <span part=\"label\" class=\"button__label\">\n <slot @slotchange=${this._handleDefaultSlotChange}></slot>\n </span>\n <span part=\"suffix\" class=\"button__suffix\">\n <slot name=\"suffix\"></slot>\n </span>\n `;\n }\n\n // ─── Render ───\n\n override render() {\n const classes = {\n button: true,\n [`button--${this.variant}`]: true,\n [`button--${this.size}`]: true,\n 'button--loading': this.loading,\n };\n\n // mixinDelegatesAria forwarding: consumer-set aria-* (aria-pressed for\n // toggle buttons, aria-expanded/aria-haspopup/aria-controls for\n // menu/dropdown triggers, aria-describedby for inline help, aria-current\n // for active-link semantics in href mode) land in data-aria-* on the\n // host. Project them onto the inner role-bearing native element so AT\n // walks them on the <button>/<a>, not the generic host.\n const projectedPressed = this.getAttribute('data-aria-pressed');\n const projectedExpanded = this.getAttribute('data-aria-expanded');\n const projectedHasPopup = this.getAttribute('data-aria-haspopup');\n const projectedControls = this.getAttribute('data-aria-controls');\n const projectedDescribedBy = this.getAttribute('data-aria-describedby');\n const projectedCurrent = this.getAttribute('data-aria-current');\n const projectedLabelledBy = this.getAttribute('data-aria-labelledby');\n\n if (this.href !== undefined) {\n return html`\n <a\n part=\"button\"\n class=${classMap(classes)}\n href=${this.disabled || this.loading ? nothing : ifDefined(this.href)}\n target=${ifDefined(this.target)}\n rel=${this.target === '_blank' ? 'noopener noreferrer' : nothing}\n aria-label=${this._effectiveLabel || nothing}\n aria-labelledby=${ifDefined(projectedLabelledBy ?? undefined)}\n aria-disabled=${this.disabled ? 'true' : nothing}\n aria-busy=${this.loading ? 'true' : nothing}\n aria-pressed=${ifDefined(projectedPressed ?? undefined)}\n aria-expanded=${ifDefined(projectedExpanded ?? undefined)}\n aria-haspopup=${ifDefined(projectedHasPopup ?? undefined)}\n aria-controls=${ifDefined(projectedControls ?? undefined)}\n aria-describedby=${ifDefined(projectedDescribedBy ?? undefined)}\n aria-current=${ifDefined(projectedCurrent ?? undefined)}\n tabindex=${this.disabled || this.loading ? '-1' : nothing}\n @click=${this._handleClick}\n >\n ${this._renderInner()}\n </a>\n `;\n }\n\n return html`\n <button\n part=\"button\"\n class=${classMap(classes)}\n ?disabled=${this.disabled}\n type=${this.type}\n aria-label=${this._effectiveLabel || nothing}\n aria-labelledby=${ifDefined(projectedLabelledBy ?? undefined)}\n aria-busy=${this.loading ? 'true' : nothing}\n aria-pressed=${ifDefined(projectedPressed ?? undefined)}\n aria-expanded=${ifDefined(projectedExpanded ?? undefined)}\n aria-haspopup=${ifDefined(projectedHasPopup ?? undefined)}\n aria-controls=${ifDefined(projectedControls ?? undefined)}\n aria-describedby=${ifDefined(projectedDescribedBy ?? undefined)}\n @click=${this._handleClick}\n >\n ${this._renderInner()}\n </button>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-button': HelixButton;\n }\n interface HTMLElementEventMap {\n 'hx-click': CustomEvent<{ originalEvent: MouseEvent }>;\n }\n}\n"],"names":["helixButtonStyles","css","HelixButton","mixinDelegatesAria","HelixElement","_a","_b","_c","disabled","changedProperties","slot","n","validVariants","devWarn","e","hasContent","html","nothing","classes","projectedPressed","projectedExpanded","projectedHasPopup","projectedControls","projectedDescribedBy","projectedCurrent","projectedLabelledBy","classMap","ifDefined","__decorateClass","property","customElement"],"mappings":";;;;;;;AAEO,MAAMA,IAAoBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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decorators.js";
3
- import { classMap as b } from "lit/directives/class-map.js";
2
+ import { property as n, customElement as b } from "lit/decorators.js";
3
+ import { classMap as c } from "lit/directives/class-map.js";
4
4
  import { f as p } from "./forced-colors-CTEDFRGa.js";
5
- import { H as g } from "./helix-element-BNEYeiys.js";
6
- const x = u`
5
+ import { H as m } from "./helix-element-BNEYeiys.js";
6
+ const g = u`
7
7
  :host {
8
8
  display: inline-flex;
9
9
  contain: layout style;
@@ -125,14 +125,14 @@ const x = u`
125
125
  }
126
126
  }
127
127
  `;
128
- var v = Object.defineProperty, f = Object.getOwnPropertyDescriptor, s = (r, e, a, i) => {
129
- for (var t = i > 1 ? void 0 : i ? f(e, a) : e, l = r.length - 1, d; l >= 0; l--)
128
+ var f = Object.defineProperty, x = Object.getOwnPropertyDescriptor, s = (r, e, a, i) => {
129
+ for (var t = i > 1 ? void 0 : i ? x(e, a) : e, l = r.length - 1, d; l >= 0; l--)
130
130
  (d = r[l]) && (t = (i ? d(e, a, t) : d(t)) || t);
131
- return i && t && v(e, a, t), t;
131
+ return i && t && f(e, a, t), t;
132
132
  };
133
- let o = class extends g {
133
+ let o = class extends m {
134
134
  constructor() {
135
- super(...arguments), this._orientation = "horizontal", this.size = "md", this.label = "";
135
+ super(...arguments), this._orientation = "horizontal", this.size = "md", this.label = "", this._consumerAriaLabel = null, this._emptyLabelWarnEmitted = !1;
136
136
  }
137
137
  get orientation() {
138
138
  return this._orientation;
@@ -140,19 +140,18 @@ let o = class extends g {
140
140
  set orientation(r) {
141
141
  r !== "horizontal" && r !== "vertical" && (r = "horizontal"), this._orientation = r;
142
142
  }
143
- // ─── Lifecycle ───
144
143
  updated(r) {
145
- super.updated(r), r.has("size") && this.style.setProperty("--hx-button-group-size", this.size), r.has("label") && (this.label ? this.setAttribute("aria-label", this.label) : this.removeAttribute("aria-label"));
144
+ super.updated(r), r.has("size") && this.style.setProperty("--hx-button-group-size", this.size), r.has("label") && (this.label ? this.setAttribute("aria-label", this.label) : this._consumerAriaLabel !== null ? this.setAttribute("aria-label", this._consumerAriaLabel) : this.removeAttribute("aria-label"));
146
145
  }
147
146
  connectedCallback() {
148
- super.connectedCallback(), this.setAttribute("role", "group"), this.style.setProperty("--hx-button-group-size", this.size), this.label && this.setAttribute("aria-label", this.label);
147
+ super.connectedCallback(), this._consumerAriaLabel === null && this.hasAttribute("aria-label") && (this._consumerAriaLabel = this.getAttribute("aria-label")), this._internals.role = "group", this.hasAttribute("role") || this.setAttribute("role", "group"), this.style.setProperty("--hx-button-group-size", this.size), this.label ? this.setAttribute("aria-label", this.label) : this._consumerAriaLabel !== null || this._emptyLabelWarnEmitted || (this._emptyLabelWarnEmitted = !0);
149
148
  }
150
149
  // ─── Render ───
151
150
  render() {
152
151
  return h`
153
152
  <div
154
153
  part="group"
155
- class=${b({
154
+ class=${c({
156
155
  group: !0,
157
156
  "group--horizontal": this.orientation === "horizontal",
158
157
  "group--vertical": this.orientation === "vertical"
@@ -163,7 +162,7 @@ let o = class extends g {
163
162
  `;
164
163
  }
165
164
  };
166
- o.styles = [x, p];
165
+ o.styles = [g, p];
167
166
  s([
168
167
  n({ type: String, reflect: !0 })
169
168
  ], o.prototype, "orientation", 1);
@@ -174,9 +173,9 @@ s([
174
173
  n({ type: String })
175
174
  ], o.prototype, "label", 2);
176
175
  o = s([
177
- c("hx-button-group")
176
+ b("hx-button-group")
178
177
  ], o);
179
178
  export {
180
179
  o as H
181
180
  };
182
- //# sourceMappingURL=hx-button-group-BI-QBqmO.js.map
181
+ //# sourceMappingURL=hx-button-group-DcHP5MBv.js.map