@helixui/library 3.8.0 → 3.9.0-next.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/aaa-verdicts.json +2036 -0
- package/custom-elements.json +532 -569
- package/dist/components/hx-accordion/hx-accordion-item.d.ts.map +1 -1
- package/dist/components/hx-accordion/hx-accordion-item.styles.d.ts.map +1 -1
- package/dist/components/hx-accordion/index.js +1 -1
- package/dist/components/hx-alert/hx-alert.d.ts +0 -8
- package/dist/components/hx-alert/hx-alert.d.ts.map +1 -1
- package/dist/components/hx-alert/hx-alert.styles.d.ts.map +1 -1
- package/dist/components/hx-alert/index.js +1 -1
- package/dist/components/hx-avatar/hx-avatar.d.ts +4 -1
- package/dist/components/hx-avatar/hx-avatar.d.ts.map +1 -1
- package/dist/components/hx-avatar/hx-avatar.styles.d.ts.map +1 -1
- package/dist/components/hx-avatar/index.js +1 -1
- package/dist/components/hx-badge/hx-badge.d.ts.map +1 -1
- package/dist/components/hx-badge/hx-badge.styles.d.ts.map +1 -1
- package/dist/components/hx-badge/index.js +1 -1
- package/dist/components/hx-banner/hx-banner.d.ts +0 -8
- package/dist/components/hx-banner/hx-banner.d.ts.map +1 -1
- package/dist/components/hx-banner/hx-banner.styles.d.ts.map +1 -1
- package/dist/components/hx-banner/index.js +1 -1
- package/dist/components/hx-carousel/hx-carousel.d.ts.map +1 -1
- package/dist/components/hx-carousel/hx-carousel.styles.d.ts.map +1 -1
- package/dist/components/hx-carousel/index.js +1 -1
- package/dist/components/hx-checkbox/hx-checkbox.d.ts.map +1 -1
- package/dist/components/hx-checkbox/hx-checkbox.styles.d.ts.map +1 -1
- package/dist/components/hx-checkbox/index.js +1 -1
- package/dist/components/hx-clinical-status/hx-clinical-status.d.ts +7 -9
- package/dist/components/hx-clinical-status/hx-clinical-status.d.ts.map +1 -1
- package/dist/components/hx-clinical-status/hx-clinical-status.styles.d.ts.map +1 -1
- package/dist/components/hx-clinical-status/index.js +1 -1
- package/dist/components/hx-combobox/hx-combobox.d.ts.map +1 -1
- package/dist/components/hx-combobox/hx-combobox.styles.d.ts.map +1 -1
- package/dist/components/hx-combobox/index.js +1 -1
- package/dist/components/hx-date-picker/hx-date-picker.d.ts.map +1 -1
- package/dist/components/hx-date-picker/hx-date-picker.styles.d.ts.map +1 -1
- package/dist/components/hx-date-picker/index.js +1 -1
- package/dist/components/hx-drawer/hx-drawer.d.ts.map +1 -1
- package/dist/components/hx-drawer/hx-drawer.styles.d.ts.map +1 -1
- package/dist/components/hx-drawer/index.js +1 -1
- package/dist/components/hx-dropdown/hx-dropdown.styles.d.ts.map +1 -1
- package/dist/components/hx-dropdown/index.js +1 -1
- package/dist/components/hx-file-upload/hx-file-upload.d.ts +28 -0
- package/dist/components/hx-file-upload/hx-file-upload.d.ts.map +1 -1
- package/dist/components/hx-file-upload/hx-file-upload.styles.d.ts.map +1 -1
- package/dist/components/hx-file-upload/index.js +1 -1
- package/dist/components/hx-help-text/hx-help-text.d.ts.map +1 -1
- package/dist/components/hx-help-text/hx-help-text.styles.d.ts.map +1 -1
- package/dist/components/hx-help-text/index.js +1 -1
- package/dist/components/hx-icon/hx-icon.d.ts +108 -12
- package/dist/components/hx-icon/hx-icon.d.ts.map +1 -1
- package/dist/components/hx-icon/hx-icon.styles.d.ts.map +1 -1
- package/dist/components/hx-icon/index.js +1 -1
- package/dist/components/hx-link/hx-link.d.ts.map +1 -1
- package/dist/components/hx-link/hx-link.styles.d.ts.map +1 -1
- package/dist/components/hx-link/index.js +1 -1
- package/dist/components/hx-menu/hx-menu-item.d.ts.map +1 -1
- package/dist/components/hx-menu/hx-menu-item.styles.d.ts.map +1 -1
- package/dist/components/hx-menu/index.js +1 -1
- package/dist/components/hx-nav/hx-nav.d.ts.map +1 -1
- package/dist/components/hx-nav/hx-nav.styles.d.ts.map +1 -1
- package/dist/components/hx-nav/index.js +1 -1
- package/dist/components/hx-number-input/hx-number-input.d.ts.map +1 -1
- package/dist/components/hx-number-input/hx-number-input.styles.d.ts.map +1 -1
- package/dist/components/hx-number-input/index.js +1 -1
- package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts +5 -1
- package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts.map +1 -1
- package/dist/components/hx-overflow-menu/hx-overflow-menu.styles.d.ts.map +1 -1
- package/dist/components/hx-overflow-menu/index.js +1 -1
- package/dist/components/hx-phi-field/hx-phi-field.d.ts.map +1 -1
- package/dist/components/hx-phi-field/hx-phi-field.styles.d.ts.map +1 -1
- package/dist/components/hx-phi-field/index.js +1 -1
- package/dist/components/hx-radio-group/hx-radio-group.d.ts.map +1 -1
- package/dist/components/hx-radio-group/index.js +1 -1
- package/dist/components/hx-rating/hx-rating.d.ts.map +1 -1
- package/dist/components/hx-rating/hx-rating.styles.d.ts.map +1 -1
- package/dist/components/hx-rating/index.js +1 -1
- package/dist/components/hx-side-nav/hx-nav-item.d.ts.map +1 -1
- package/dist/components/hx-side-nav/hx-nav-item.styles.d.ts.map +1 -1
- package/dist/components/hx-side-nav/hx-side-nav.d.ts.map +1 -1
- package/dist/components/hx-side-nav/hx-side-nav.styles.d.ts.map +1 -1
- package/dist/components/hx-side-nav/index.js +1 -1
- package/dist/components/hx-slider/hx-slider.d.ts +28 -0
- package/dist/components/hx-slider/hx-slider.d.ts.map +1 -1
- package/dist/components/hx-slider/index.js +1 -1
- package/dist/components/hx-split-button/hx-split-button.d.ts.map +1 -1
- package/dist/components/hx-split-button/hx-split-button.styles.d.ts.map +1 -1
- package/dist/components/hx-split-button/index.js +1 -1
- package/dist/components/hx-stat/hx-stat.d.ts.map +1 -1
- package/dist/components/hx-stat/hx-stat.styles.d.ts.map +1 -1
- package/dist/components/hx-stat/index.js +1 -1
- package/dist/components/hx-steps/hx-step.d.ts.map +1 -1
- package/dist/components/hx-steps/hx-step.styles.d.ts.map +1 -1
- package/dist/components/hx-steps/index.js +1 -1
- package/dist/components/hx-tag/hx-tag.d.ts.map +1 -1
- package/dist/components/hx-tag/hx-tag.styles.d.ts.map +1 -1
- package/dist/components/hx-tag/index.js +1 -1
- package/dist/components/hx-time-picker/hx-time-picker.d.ts.map +1 -1
- package/dist/components/hx-time-picker/hx-time-picker.styles.d.ts.map +1 -1
- package/dist/components/hx-time-picker/index.js +1 -1
- package/dist/components/hx-toast/hx-toast.d.ts +0 -8
- package/dist/components/hx-toast/hx-toast.d.ts.map +1 -1
- package/dist/components/hx-toast/hx-toast.styles.d.ts.map +1 -1
- package/dist/components/hx-toast/index.js +1 -1
- package/dist/components/hx-top-nav/hx-top-nav.d.ts.map +1 -1
- package/dist/components/hx-top-nav/hx-top-nav.styles.d.ts.map +1 -1
- package/dist/components/hx-top-nav/index.js +1 -1
- package/dist/components/hx-tree-view/hx-tree-item.d.ts.map +1 -1
- package/dist/components/hx-tree-view/hx-tree-item.styles.d.ts.map +1 -1
- package/dist/components/hx-tree-view/index.js +1 -1
- package/dist/css/helix-all.css +116 -54
- package/dist/css/helix-core.css +19 -4
- package/dist/css/helix-feedback.css +15 -18
- package/dist/css/helix-forms.css +39 -12
- package/dist/css/helix-media.css +6 -3
- package/dist/css/helix-navigation.css +16 -7
- package/dist/css/helix-overlay.css +10 -0
- package/dist/css/helix-tokens.css +3 -2
- package/dist/css/helix-utility.css +5 -0
- package/dist/css/hx-alert.css +4 -8
- package/dist/css/hx-avatar.css +1 -2
- package/dist/css/hx-badge.css +5 -0
- package/dist/css/hx-banner.css +4 -8
- package/dist/css/hx-carousel.css +6 -3
- package/dist/css/hx-checkbox.css +4 -9
- package/dist/css/hx-clinical-status.css +4 -7
- package/dist/css/hx-combobox.css +8 -0
- package/dist/css/hx-date-picker.css +5 -0
- package/dist/css/hx-drawer.css +5 -0
- package/dist/css/hx-dropdown.css +5 -0
- package/dist/css/hx-file-upload.css +4 -0
- package/dist/css/hx-help-text.css +5 -0
- package/dist/css/hx-icon.css +7 -0
- package/dist/css/hx-link.css +1 -2
- package/dist/css/hx-nav.css +7 -0
- package/dist/css/hx-number-input.css +2 -3
- package/dist/css/hx-overflow-menu.css +5 -0
- package/dist/css/hx-phi-field.css +2 -3
- package/dist/css/hx-rating.css +6 -0
- package/dist/css/hx-side-nav.css +3 -5
- package/dist/css/hx-split-button.css +5 -0
- package/dist/css/hx-stat.css +1 -2
- package/dist/css/hx-tag.css +5 -0
- package/dist/css/hx-time-picker.css +5 -0
- package/dist/css/hx-toast.css +6 -0
- package/dist/css/hx-top-nav.css +1 -2
- package/dist/css/index.css +1 -1
- package/dist/css/manifest.json +4 -1
- package/dist/index.js +33 -33
- package/dist/shared/{hx-accordion-ZVzgDzTG.js → hx-accordion-DR--Ev4t.js} +48 -54
- package/dist/shared/hx-accordion-DR--Ev4t.js.map +1 -0
- package/dist/shared/{hx-alert-Bto8-TIi.js → hx-alert-C0axS32J.js} +40 -79
- package/dist/shared/hx-alert-C0axS32J.js.map +1 -0
- package/dist/shared/{hx-avatar-C9hOmlAb.js → hx-avatar-ChAYWnK8.js} +22 -24
- package/dist/shared/hx-avatar-ChAYWnK8.js.map +1 -0
- package/dist/shared/{hx-badge-DFL35nzi.js → hx-badge-vX-1cuLA.js} +16 -11
- package/dist/shared/hx-badge-vX-1cuLA.js.map +1 -0
- package/dist/shared/{hx-banner-fpRnciIO.js → hx-banner-PbHwFNSb.js} +51 -90
- package/dist/shared/hx-banner-PbHwFNSb.js.map +1 -0
- package/dist/shared/{hx-carousel-item-z1Lc24op.js → hx-carousel-item-BVIKgQ4i.js} +72 -102
- package/dist/shared/hx-carousel-item-BVIKgQ4i.js.map +1 -0
- package/dist/shared/{hx-checkbox-DcgyGS9V.js → hx-checkbox-DDSXXhps.js} +31 -38
- package/dist/shared/hx-checkbox-DDSXXhps.js.map +1 -0
- package/dist/shared/{hx-clinical-status-D3XQIOqX.js → hx-clinical-status-ZSVEc3Qg.js} +68 -87
- package/dist/shared/hx-clinical-status-ZSVEc3Qg.js.map +1 -0
- package/dist/shared/{hx-combobox-NgJaLbs2.js → hx-combobox-Be-mqOv4.js} +35 -45
- package/dist/shared/hx-combobox-Be-mqOv4.js.map +1 -0
- package/dist/shared/{hx-date-picker-0PtEav0K.js → hx-date-picker-CziP3Hm1.js} +15 -22
- package/dist/shared/hx-date-picker-CziP3Hm1.js.map +1 -0
- package/dist/shared/{hx-drawer-CM_upadk.js → hx-drawer-BlU2oX8-.js} +32 -36
- package/dist/shared/hx-drawer-BlU2oX8-.js.map +1 -0
- package/dist/shared/{hx-dropdown-xHwTJecv.js → hx-dropdown-DREqpIpm.js} +16 -11
- package/dist/shared/hx-dropdown-DREqpIpm.js.map +1 -0
- package/dist/shared/{hx-file-upload-D3rKROK5.js → hx-file-upload-CU5QGZSP.js} +137 -80
- package/dist/shared/hx-file-upload-CU5QGZSP.js.map +1 -0
- package/dist/shared/hx-help-text-CNaZ82LT.js +137 -0
- package/dist/shared/hx-help-text-CNaZ82LT.js.map +1 -0
- package/dist/shared/hx-icon-bxz9eB9a.js +386 -0
- package/dist/shared/hx-icon-bxz9eB9a.js.map +1 -0
- package/dist/shared/{hx-link-CMnZRUtQ.js → hx-link-BURSdYLp.js} +19 -26
- package/dist/shared/hx-link-BURSdYLp.js.map +1 -0
- package/dist/shared/{hx-menu-divider-A6Guuzi_.js → hx-menu-divider-g0grbWV9.js} +19 -31
- package/dist/shared/hx-menu-divider-g0grbWV9.js.map +1 -0
- package/dist/shared/{hx-nav-ChMTfn7o.js → hx-nav-GTsAZGOx.js} +46 -59
- package/dist/shared/hx-nav-GTsAZGOx.js.map +1 -0
- package/dist/shared/{hx-nav-item-ClN17f1y.js → hx-nav-item-CxE7Mp3M.js} +62 -64
- package/dist/shared/hx-nav-item-CxE7Mp3M.js.map +1 -0
- package/dist/shared/{hx-number-input-MggsT7F0.js → hx-number-input-Bvyc9kOi.js} +48 -53
- package/dist/shared/hx-number-input-Bvyc9kOi.js.map +1 -0
- package/dist/shared/{hx-overflow-menu-DFjJAziP.js → hx-overflow-menu-LrTteeR1.js} +32 -39
- package/dist/shared/hx-overflow-menu-LrTteeR1.js.map +1 -0
- package/dist/shared/{hx-phi-field-C19oxlrr.js → hx-phi-field-sZt_rYIL.js} +46 -66
- package/dist/shared/hx-phi-field-sZt_rYIL.js.map +1 -0
- package/dist/shared/{hx-radio-BY4zpwdh.js → hx-radio-BD_c9NJy.js} +51 -56
- package/dist/shared/{hx-radio-BY4zpwdh.js.map → hx-radio-BD_c9NJy.js.map} +1 -1
- package/dist/shared/{hx-rating-C3QP53k9.js → hx-rating-BGK4AxvI.js} +45 -71
- package/dist/shared/hx-rating-BGK4AxvI.js.map +1 -0
- package/dist/shared/{hx-slider-Blmv_rwS.js → hx-slider-CkOk5BCY.js} +83 -23
- package/dist/shared/{hx-slider-Blmv_rwS.js.map → hx-slider-CkOk5BCY.js.map} +1 -1
- package/dist/shared/{hx-split-button-CdNz1XAu.js → hx-split-button-Bg9FHrFK.js} +12 -16
- package/dist/shared/hx-split-button-Bg9FHrFK.js.map +1 -0
- package/dist/shared/{hx-stat-Gtw_SpK8.js → hx-stat-wKxbyep6.js} +22 -55
- package/dist/shared/hx-stat-wKxbyep6.js.map +1 -0
- package/dist/shared/{hx-step-CUzliIK_.js → hx-step-CyGQAuiB.js} +5 -25
- package/dist/shared/hx-step-CyGQAuiB.js.map +1 -0
- package/dist/shared/{hx-tag-C5aCUpVi.js → hx-tag-BqO6HY6V.js} +26 -21
- package/dist/shared/hx-tag-BqO6HY6V.js.map +1 -0
- package/dist/shared/{hx-time-picker-DfJkBwcX.js → hx-time-picker-if5Cl0Ei.js} +32 -38
- package/dist/shared/hx-time-picker-if5Cl0Ei.js.map +1 -0
- package/dist/shared/{hx-top-nav-CsTxOtVI.js → hx-top-nav-vP6oDWMV.js} +24 -38
- package/dist/shared/hx-top-nav-vP6oDWMV.js.map +1 -0
- package/dist/shared/{hx-tree-item-CXyspGxI.js → hx-tree-item-D8hwKd5m.js} +54 -57
- package/dist/shared/hx-tree-item-D8hwKd5m.js.map +1 -0
- package/dist/shared/{toast-factory-Dht3pVsw.js → toast-factory-DgnbFxVs.js} +127 -153
- package/dist/shared/toast-factory-DgnbFxVs.js.map +1 -0
- package/figma-inventory.json +283 -304
- package/package.json +8 -4
- package/dist/shared/hx-accordion-ZVzgDzTG.js.map +0 -1
- package/dist/shared/hx-alert-Bto8-TIi.js.map +0 -1
- package/dist/shared/hx-avatar-C9hOmlAb.js.map +0 -1
- package/dist/shared/hx-badge-DFL35nzi.js.map +0 -1
- package/dist/shared/hx-banner-fpRnciIO.js.map +0 -1
- package/dist/shared/hx-carousel-item-z1Lc24op.js.map +0 -1
- package/dist/shared/hx-checkbox-DcgyGS9V.js.map +0 -1
- package/dist/shared/hx-clinical-status-D3XQIOqX.js.map +0 -1
- package/dist/shared/hx-combobox-NgJaLbs2.js.map +0 -1
- package/dist/shared/hx-date-picker-0PtEav0K.js.map +0 -1
- package/dist/shared/hx-drawer-CM_upadk.js.map +0 -1
- package/dist/shared/hx-dropdown-xHwTJecv.js.map +0 -1
- package/dist/shared/hx-file-upload-D3rKROK5.js.map +0 -1
- package/dist/shared/hx-help-text-Xb2Yr8x2.js +0 -156
- package/dist/shared/hx-help-text-Xb2Yr8x2.js.map +0 -1
- package/dist/shared/hx-icon-fuVm4-bk.js +0 -283
- package/dist/shared/hx-icon-fuVm4-bk.js.map +0 -1
- package/dist/shared/hx-link-CMnZRUtQ.js.map +0 -1
- package/dist/shared/hx-menu-divider-A6Guuzi_.js.map +0 -1
- package/dist/shared/hx-nav-ChMTfn7o.js.map +0 -1
- package/dist/shared/hx-nav-item-ClN17f1y.js.map +0 -1
- package/dist/shared/hx-number-input-MggsT7F0.js.map +0 -1
- package/dist/shared/hx-overflow-menu-DFjJAziP.js.map +0 -1
- package/dist/shared/hx-phi-field-C19oxlrr.js.map +0 -1
- package/dist/shared/hx-rating-C3QP53k9.js.map +0 -1
- package/dist/shared/hx-split-button-CdNz1XAu.js.map +0 -1
- package/dist/shared/hx-stat-Gtw_SpK8.js.map +0 -1
- package/dist/shared/hx-step-CUzliIK_.js.map +0 -1
- package/dist/shared/hx-tag-C5aCUpVi.js.map +0 -1
- package/dist/shared/hx-time-picker-DfJkBwcX.js.map +0 -1
- package/dist/shared/hx-top-nav-CsTxOtVI.js.map +0 -1
- package/dist/shared/hx-tree-item-CXyspGxI.js.map +0 -1
- package/dist/shared/toast-factory-Dht3pVsw.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toast-factory-Dht3pVsw.js","sources":["../../src/components/hx-toast/hx-toast.styles.ts","../../src/components/hx-toast/hx-toast.ts","../../src/components/hx-toast/hx-toast-stack.ts","../../src/components/hx-toast/toast-factory.ts"],"sourcesContent":["import { css } from 'lit';\n\n/**\n * hx-toast styles.\n *\n * Component-tier tokens with two-level var() fallback:\n * var(--hx-toast-{prop}, var(--hx-color-{semantic}, #hex))\n * Inner hex fallbacks track the \"precision cool\" palette (3.2.0):\n * neutral-0 = #FFFFFF, neutral-900 = #0D1825 (surface-inverse anchor),\n * primary-600 = #0F7078, success-600 = #0E8A4A, warning-500 = #C2711C,\n * error-600 = #C92A2A.\n */\nexport const helixToastStyles = css`\n /* ─── hx-toast host ─── */\n\n :host {\n display: block;\n pointer-events: none;\n }\n\n :host([open]) {\n pointer-events: auto;\n }\n\n /* ─── Toast base ─── */\n\n .toast {\n display: flex;\n align-items: flex-start;\n gap: var(--hx-space-3, 0.75rem);\n padding: var(--hx-space-3, 0.75rem) var(--hx-space-4, 1rem);\n border-radius: var(--hx-toast-border-radius, var(--hx-border-radius-md, 0.375rem));\n background-color: var(--hx-toast-bg, var(--hx-color-surface-inverse, #0d1825));\n color: var(--hx-toast-color, var(--hx-color-text-inverse, #ffffff));\n font-family: var(--hx-toast-font-family, var(--hx-font-family-sans, sans-serif));\n font-size: var(--hx-font-size-sm, 0.875rem);\n line-height: var(--hx-line-height-normal, 1.5);\n box-shadow: var(\n --hx-toast-shadow,\n var(--hx-shadow-md, 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1))\n );\n opacity: 0;\n transform: translateY(var(--hx-toast-enter-translate, var(--hx-space-2, 0.5rem)));\n transition:\n opacity var(--hx-transition-normal, 250ms ease),\n transform var(--hx-transition-normal, 250ms ease);\n width: var(--hx-toast-width, 20rem);\n max-width: 100%;\n pointer-events: auto;\n }\n\n :host([open]) .toast {\n opacity: 1;\n transform: translateY(0);\n }\n\n /* ─── Variant overrides ─── */\n\n /*\n * Toast variants paint on darker brand fills (primary-600/success-700/\n * error-600) because the lighter -500 fills can't pass AA against white\n * text in the precision-cool palette. The neutral-900 on-{role} tokens\n * are tuned for the lighter -500 surfaces and would fail here (e.g.\n * neutral-900 on primary-600 = 3.07:1), so the on-{role}-strong tokens\n * (neutral-0, no dark-mode flip) keep fg legible on the darker fills.\n * - text.on-primary-strong on info.bg-strong (primary-600, #0F7078) = 5.82:1\n * - text.on-success-strong on success.bg-strong (success-700, #146831) = 6.88:1\n * (success-600 #0E8A4A on white = 4.42:1 — drifts under AA at 14px)\n * - text.on-error-strong on danger.bg-strong (error-600, #C92A2A) = 5.46:1\n * - text.on-warning on warning.bg-strong (warning-500, #C2711C) = 4.83:1\n * (warning stays on the lighter -500 surface so on-warning works)\n *\n * 3.2.1 token-cascade: bg variants now route through surface.{role}-strong\n * semantics; fg variants route through text.on-{role}-strong (or on-warning\n * for the warning variant). Component-tier tokens are NOT bypassed — the\n * --hx-toast-bg / --hx-toast-color slots remain the single override point.\n */\n .toast--success {\n --hx-toast-bg: var(--hx-color-surface-success-strong, #146831);\n --hx-toast-color: var(--hx-color-text-on-success-strong, #ffffff);\n }\n\n .toast--warning {\n --hx-toast-bg: var(--hx-color-surface-warning-strong, #c2711c);\n --hx-toast-color: var(--hx-color-text-on-warning, #0d1825);\n }\n\n .toast--danger {\n --hx-toast-bg: var(--hx-color-surface-danger-strong, #c92a2a);\n --hx-toast-color: var(--hx-color-text-on-error-strong, #ffffff);\n }\n\n .toast--info {\n --hx-toast-bg: var(--hx-color-surface-info-strong, #0f7078);\n --hx-toast-color: var(--hx-color-text-on-primary-strong, #ffffff);\n }\n\n /* ─── Severity Label (WCAG 1.4.1) ─── */\n /* Visually hidden — non-color cue for severity variants (success/warning/danger/info). */\n /* Ensures variant is not conveyed by color alone for color-blind users. */\n\n .toast__severity-label {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n\n /* ─── Icon ─── */\n\n .toast__icon {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n line-height: 1;\n }\n\n .toast__icon:empty {\n display: none;\n }\n\n /* ─── Message ─── */\n\n .toast__message {\n flex: 1 1 auto;\n min-width: 0;\n }\n\n /* ─── Action slot ─── */\n\n .toast__action {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n }\n\n .toast__action:empty {\n display: none;\n }\n\n /* ─── Close button ─── */\n\n .toast__close {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n /* WCAG 2.5.5: minimum 44×44px touch target */\n min-width: var(--hx-touch-target-min, 2.75rem);\n min-height: var(--hx-touch-target-min, 2.75rem);\n padding: var(--hx-space-1, 0.25rem);\n background: transparent;\n border: none;\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n color: inherit;\n cursor: pointer;\n opacity: var(--hx-opacity-75, 0.75);\n transition: opacity var(--hx-transition-fast, 150ms ease);\n }\n\n .toast__close:hover {\n opacity: 1;\n }\n\n .toast__close:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid currentColor;\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n /* ─── Reduced motion ─── */\n\n @media (prefers-reduced-motion: reduce) {\n .toast {\n transition: none;\n }\n\n .toast__close {\n transition: none;\n }\n }\n\n /* ─── Forced Colors (Windows High Contrast) ─── */\n /* Sole owner: bespoke per-class HC overrides on .toast and .toast__close.\n The shared forcedColorsSurface mixin was dropped in 3.2.1 (XOR rule);\n this block now carries the surface contract the mixin used to provide\n (background:Canvas + color:CanvasText + border:1px solid CanvasText)\n plus the per-class affordances the mixin never touched. */\n\n @media (forced-colors: active) {\n .toast {\n background: Canvas;\n color: CanvasText;\n border: 1px solid CanvasText;\n }\n\n .toast__close {\n color: ButtonText;\n border: 1px solid ButtonText;\n }\n }\n`;\n\nexport const helixToastStackStyles = css`\n :host {\n display: block;\n position: fixed;\n z-index: var(--hx-z-index-toast, 1700);\n pointer-events: none;\n }\n\n .toast-stack {\n display: flex;\n flex-direction: column;\n gap: var(--hx-space-3, 0.75rem);\n padding: var(--hx-space-4, 1rem);\n pointer-events: none;\n }\n\n /* ─── Placements ─── */\n\n :host([placement='top-start']) {\n top: 0;\n inset-inline-start: 0;\n inset-inline-end: auto;\n bottom: auto;\n }\n\n :host([placement='top-center']) {\n top: 0;\n inset-inline-start: 50%;\n transform: translateX(-50%);\n inset-inline-end: auto;\n bottom: auto;\n }\n\n :host([placement='top-end']) {\n top: 0;\n inset-inline-end: 0;\n inset-inline-start: auto;\n bottom: auto;\n }\n\n :host([placement='bottom-start']) {\n bottom: 0;\n inset-inline-start: 0;\n inset-inline-end: auto;\n top: auto;\n }\n\n :host([placement='bottom-center']) {\n bottom: 0;\n inset-inline-start: 50%;\n transform: translateX(-50%);\n inset-inline-end: auto;\n top: auto;\n }\n\n :host([placement='bottom-end']) {\n bottom: 0;\n inset-inline-end: 0;\n inset-inline-start: auto;\n top: auto;\n }\n\n /* ─── Bottom placements: reverse order so newest is on top ─── */\n\n :host([placement^='bottom']) .toast-stack {\n flex-direction: column-reverse;\n }\n\n /* ─── Slide direction by placement ─── */\n\n :host([placement^='top']) ::slotted(hx-toast) {\n --hx-toast-enter-translate: calc(var(--hx-space-2, 0.5rem) * -1);\n }\n`;\n","import { html, nothing, type PropertyValues } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HelixElement } from '../../base/index.js';\nimport { devWarn } from '../../utils/dev-warn.js';\nimport { helixToastStyles } from './hx-toast.styles.js';\n\nexport type ToastVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';\n\n// (group-6) WCAG 2.2.3 minimum display times by variant. When `duration > 0`\n// and shorter than the role-implied minimum, a devWarn fires recommending the\n// caller either lengthen `duration` or set `duration=0` for persistent\n// toasts. AT cannot reliably finish reading a danger announcement in less\n// than ~6 seconds; success/info polite announcements need at least ~3s.\nconst MIN_DISPLAY_MS_BY_VARIANT: Record<ToastVariant, number> = {\n default: 3000,\n info: 3000,\n success: 3000,\n warning: 4000,\n danger: 6000,\n};\n\n/**\n * A transient notification message that auto-dismisses after a configurable duration.\n * Supports multiple visual variants, a closable button, icon/action slots, and full\n * ARIA live region semantics for screen readers.\n *\n * @summary Transient notification toast component.\n *\n * @tag hx-toast\n *\n * @slot - Default slot for the notification message.\n * @slot icon - Optional icon rendered before the message.\n * @slot action - Optional action button rendered after the message.\n *\n * @fires {CustomEvent} hx-show - Dispatched when the toast becomes visible.\n * @fires {CustomEvent} hx-hide - Dispatched when the toast begins hiding.\n * @fires {CustomEvent} hx-after-hide - Dispatched after the hide animation completes.\n *\n * @csspart base - The inner toast container div.\n * @csspart icon - The icon slot wrapper.\n * @csspart message - The message slot wrapper.\n * @csspart close-button - The dismiss button (only when closable).\n * @csspart action - The action slot wrapper.\n *\n * @cssprop [--hx-toast-bg=var(--hx-color-surface-inverse)] - Toast background color.\n * @cssprop [--hx-toast-color=var(--hx-color-text-inverse)] - Toast text color.\n * @cssprop [--hx-toast-border-radius=var(--hx-border-radius-md)] - Toast border radius.\n * @cssprop [--hx-toast-shadow] - Toast box shadow.\n * @cssprop [--hx-toast-width=20rem] - Toast width.\n * @cssprop [--hx-space-3] - Spacing token.\n * @cssprop [--hx-space-4] - Spacing token.\n * @cssprop [--hx-border-radius-md] - CSS custom property.\n * @cssprop [--hx-color-surface-inverse] - Default-variant background semantic (neutral-900 anchor; flipped per mode).\n * @cssprop [--hx-color-text-inverse] - Default-variant foreground semantic (neutral-0 anchor; flipped per mode).\n * @cssprop [--hx-toast-font-family=var(--hx-font-family-sans)] - CSS custom property.\n * @cssprop [--hx-font-family-sans] - Font family.\n * @cssprop [--hx-font-size-sm] - Font size.\n * @cssprop [--hx-line-height-normal] - Line height.\n * @cssprop [--hx-shadow-md] - Box shadow.\n * @cssprop [--hx-toast-enter-translate=var(--hx-space-2)] - CSS custom property.\n * @cssprop [--hx-space-2] - Spacing token.\n * @cssprop [--hx-transition-normal] - Transition timing.\n * @cssprop [--hx-color-surface-success-strong] - Success-variant background semantic (3.2.1 cascade).\n * @cssprop [--hx-color-surface-warning-strong] - Warning-variant background semantic (3.2.1 cascade).\n * @cssprop [--hx-color-surface-danger-strong] - Danger-variant background semantic (3.2.1 cascade).\n * @cssprop [--hx-color-surface-info-strong] - Info-variant background semantic (3.2.1 cascade).\n * @cssprop [--hx-color-text-on-success-strong] - Success-variant foreground semantic (neutral-0 across modes).\n * @cssprop [--hx-color-text-on-warning] - Warning-variant foreground semantic (neutral-900; warning sits on lighter -500 fill).\n * @cssprop [--hx-color-text-on-error-strong] - Danger-variant foreground semantic (neutral-0 across modes).\n * @cssprop [--hx-color-text-on-primary-strong] - Info-variant foreground semantic (neutral-0 across modes).\n * @cssprop [--hx-touch-target-min] - Minimum touch target size.\n * @cssprop [--hx-space-1] - Spacing token.\n * @cssprop [--hx-border-radius-sm] - CSS custom property.\n * @cssprop [--hx-opacity-75] - Opacity.\n * @cssprop [--hx-transition-fast] - Transition timing.\n * @cssprop [--hx-focus-ring-width] - Width.\n * @cssprop [--hx-focus-ring-offset] - CSS custom property.\n *\n * @aaa-certified 2026-05-09\n * @aaa-criteria 1.4.6, 1.4.9, 2.1.3, 2.3.3, 2.4.12, 2.4.13, 2.5.5, 3.2.5, 3.3.6, forced-colors, apg-keyboard\n * @aaa-audit src/components/hx-toast/AAA-AUDIT.md\n * @keyboard-contract dismiss=Escape\n * @aria-pattern alert\n * @aria-pattern-source https://www.w3.org/WAI/ARIA/apg/patterns/alert/\n * @forced-colors-supported true\n * @stability stable\n * @since 3.7.0\n * @form-associated false\n * @theme-aware true\n * @brand-aware true\n * @drupal-sdc-eligible true\n * @react-wrapper-status complete\n * @figma-component-name hx-toast\n * @priority-tier P0\n * @phi-handles false\n * @clinical-context none\n */\n@customElement('hx-toast')\nexport class HelixToast extends HelixElement {\n // 3.2.1: forced-colors deference is owned by the bespoke @media block in\n // hx-toast.styles.ts (per-class overrides on .toast and .toast__close —\n // strictly more than the shared mixin's :host/[part] surface contract).\n // XOR rule per styles/forced-colors.ts: do NOT also compose\n // forcedColorsSurface — overlapping selectors inside the same media query\n // create a fragile specificity war.\n static override styles = [helixToastStyles];\n\n // ─── Public Properties ───\n\n /**\n * Visual style variant.\n * @attr variant\n */\n @property({ type: String, reflect: true })\n variant: 'default' | 'success' | 'warning' | 'danger' | 'info' = 'default';\n\n /**\n * Auto-dismiss duration in milliseconds. Set to 0 for persistent toasts.\n * @attr duration\n */\n @property({ type: Number })\n duration = 5000;\n\n /**\n * Whether to show a close button.\n * @attr closable\n */\n @property({ type: Boolean, reflect: true })\n closable = false;\n\n /**\n * Whether the toast is currently visible.\n * @attr open\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Accessible label for the close button. Override for localization.\n * @attr label-close\n */\n @property({ attribute: 'label-close' })\n labelClose = 'Dismiss notification';\n\n // ─── Private State ───\n\n /** @internal */\n @query('.toast') private _toastEl!: HTMLElement | null;\n\n /** @internal Tracks whether the action slot has slotted content. */\n @state() private _hasActionContent = false;\n\n /** @internal */\n private _timer: ReturnType<typeof setTimeout> | null = null;\n\n // ─── Reduced Motion ───\n\n /** @internal Returns true when the user has opted into reduced motion. */\n private get _reducedMotion(): boolean {\n // Guard for SSR — window.matchMedia is unavailable server-side\n if (typeof window === 'undefined') return false;\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n }\n\n /** @internal */\n private _timerStartedAt: number | null = null;\n\n /** @internal */\n private _timerRemaining: number | null = null;\n\n // ─── Lifecycle ───\n\n override connectedCallback(): void {\n super.connectedCallback();\n // (group-6) Host-canonical role + aria-atomic via ElementInternals.\n // role implies aria-live per ARIA spec (alert→assertive, status→polite),\n // so we do NOT also set explicit aria-live (avoids §5.1 double-announce\n // on older NVDA/JAWS).\n //\n // (group-6 codex round-1) Dual-write: keep an attribute fallback for\n // `role` on the host, harmonized with hx-alert/hx-banner. Some AT +\n // browser combos still ignore internals-backed ARIA reflection on\n // custom elements (notably older JAWS + Chrome and certain\n // VoiceOver+Safari builds); without an attribute they would stop\n // announcing toasts entirely. role implies aria-live, so we do NOT\n // also write an explicit aria-live attribute (the implicit live region\n // is what `role` already provides — adding aria-live duplicates the\n // signal and re-introduces the §5.1 double-announce on those same\n // older AT+browser combos).\n this._internals.role = this._role;\n this._internals.ariaAtomic = 'true';\n this.setAttribute('role', this._role);\n }\n\n override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (changedProperties.has('variant')) {\n // Keep host role in sync with variant (alert vs status).\n // Dual-write: internals (modern) + attribute (legacy fallback).\n this._internals.role = this._role;\n this.setAttribute('role', this._role);\n }\n if (changedProperties.has('open') || changedProperties.has('duration')) {\n this._auditWcag223();\n }\n if (changedProperties.has('open')) {\n if (this.open) {\n this.removeAttribute('aria-hidden');\n this._emitShow();\n if (this.duration > 0 && !this._reducedMotion && !this._hasActionContent) {\n this._startTimer();\n }\n } else {\n this.setAttribute('aria-hidden', 'true');\n this._clearTimer();\n this._emitHide();\n }\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._clearTimer();\n }\n\n /**\n * (group-6 §5.3) WCAG 2.2.3 (Level AA — No Time Limits) audit. When\n * `duration` is shorter than the role-implied minimum-display-time for the\n * current variant, surface a developer warning recommending a longer\n * duration or `duration=0` for persistent toasts. Danger toasts in\n * particular are safety-critical and routinely need more than 5 seconds\n * for screen readers to finish reading.\n *\n * Fires only in DEV builds (Vite tree-shakes the call in production).\n *\n * @internal\n */\n private _auditWcag223(): void {\n if (this.duration <= 0) return;\n const min = MIN_DISPLAY_MS_BY_VARIANT[this.variant] ?? 0;\n if (this.duration < min) {\n devWarn(\n 'hx-toast',\n `duration=${this.duration}ms is shorter than the WCAG 2.2.3 minimum (${min}ms) for variant=\"${this.variant}\". Increase duration or set duration=0 for persistent toasts (recommended for variant=\"danger\").`,\n );\n }\n }\n\n // ─── Public API ───\n\n /** Show the toast. */\n show(): void {\n if (!this.open) {\n this.open = true;\n }\n }\n\n /** Hide the toast. */\n hide(): void {\n if (this.open) {\n this.open = false;\n }\n }\n\n // ─── Private Helpers ───\n\n /** @internal */\n private _startTimer(remaining?: number): void {\n this._clearTimerHandle();\n const delay = remaining ?? this.duration;\n this._timerStartedAt = Date.now();\n this._timerRemaining = delay;\n this._timer = setTimeout(() => {\n this.open = false;\n }, delay);\n }\n\n /** @internal */\n private _pauseTimer(): void {\n if (this._timer === null || this._timerStartedAt === null || this._timerRemaining === null) {\n return;\n }\n const elapsed = Date.now() - this._timerStartedAt;\n this._timerRemaining = Math.max(0, this._timerRemaining - elapsed);\n this._clearTimerHandle();\n }\n\n /** @internal */\n private _clearTimerHandle(): void {\n if (this._timer !== null) {\n clearTimeout(this._timer);\n this._timer = null;\n }\n }\n\n /** @internal */\n private _clearTimer(): void {\n this._clearTimerHandle();\n this._timerStartedAt = null;\n this._timerRemaining = null;\n }\n\n /** @internal */\n private _emitShow(): void {\n this.dispatchEvent(new CustomEvent<void>('hx-show', { bubbles: true, composed: true }));\n }\n\n /** @internal */\n private _emitHide(): void {\n this.dispatchEvent(new CustomEvent<void>('hx-hide', { bubbles: true, composed: true }));\n\n let fired = false;\n const fireAfterHide = () => {\n if (fired) return;\n fired = true;\n this.dispatchEvent(new CustomEvent<void>('hx-after-hide', { bubbles: true, composed: true }));\n };\n\n // Fire on transitionend if available; fallback ensures it fires in test environments\n // and when transitions are disabled (prefers-reduced-motion, no CSS transitions).\n const base = this._toastEl;\n if (base) {\n base.addEventListener('transitionend', fireAfterHide, { once: true });\n }\n // Fallback fires after the CSS transition duration (250ms) plus a small buffer.\n setTimeout(fireAfterHide, 300);\n }\n\n // ─── Event Handlers ───\n\n /** @internal */\n private _handleMouseEnter(): void {\n this._pauseTimer();\n }\n\n /** @internal */\n private _handleMouseLeave(): void {\n if (this.open && this.duration > 0) {\n this._startTimer(this._timerRemaining ?? undefined);\n }\n }\n\n /** @internal */\n private _handleFocusIn(): void {\n this._pauseTimer();\n }\n\n /** @internal */\n private _handleFocusOut(): void {\n if (this.open && this.duration > 0) {\n this._startTimer(this._timerRemaining ?? undefined);\n }\n }\n\n /** @internal */\n private _handleClose(): void {\n this.hide();\n }\n\n /** @internal */\n private _handleActionSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasActionContent = slot.assignedNodes({ flatten: true }).length > 0;\n if (this._hasActionContent && this.open) {\n this._pauseTimer();\n }\n }\n\n // ─── ARIA Helpers ───\n\n /**\n * @internal\n * Variant→role mapping (harmonized with hx-alert/hx-banner per group-6):\n * only `danger` is assertive (role=alert); all other variants are polite\n * (role=status). role implies aria-live, so we do NOT also expose an\n * `_ariaLive` getter — that path was removed when the inner div stopped\n * carrying explicit aria-live (§5.1 double-announce mitigation).\n */\n private get _role(): 'alert' | 'status' {\n return this.variant === 'danger' ? 'alert' : 'status';\n }\n\n // ─── WCAG 1.4.1: Default Icons ───\n // Each semantic variant renders a default icon when no icon is slotted,\n // ensuring the severity is not conveyed by color alone.\n\n /** @internal */\n private _renderSuccessIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\" width=\"16\" height=\"16\">\n <path\n fill=\"currentColor\"\n d=\"M10 2a8 8 0 100 16 8 8 0 000-16zm3.03 6.28a.75.75 0 00-1.06-1.06L9 10.19 7.78 8.97a.75.75 0 00-1.06 1.06l1.75 1.75a.75.75 0 001.06 0l3.5-3.5z\"\n />\n </svg>`;\n }\n\n /** @internal */\n private _renderWarningIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\" width=\"16\" height=\"16\">\n <path\n fill=\"currentColor\"\n d=\"M8.49 2.92a1.75 1.75 0 013.02 0l6.25 10.83A1.75 1.75 0 0116.25 16H3.75a1.75 1.75 0 01-1.51-2.25L8.49 2.92zM10 7a.75.75 0 01.75.75v3a.75.75 0 01-1.5 0v-3A.75.75 0 0110 7zm0 7.5a.75.75 0 100-1.5.75.75 0 000 1.5z\"\n />\n </svg>`;\n }\n\n /** @internal */\n private _renderDangerIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\" width=\"16\" height=\"16\">\n <path\n fill=\"currentColor\"\n d=\"M10 2a8 8 0 100 16 8 8 0 000-16zm-1.72 5.22a.75.75 0 011.06 0L10 7.94l.66-.72a.75.75 0 111.06 1.06L11.06 9l.66.72a.75.75 0 11-1.06 1.06L10 10.06l-.66.72a.75.75 0 01-1.06-1.06L8.94 9l-.66-.72a.75.75 0 010-1.06z\"\n />\n </svg>`;\n }\n\n /** @internal */\n private _renderInfoIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\" width=\"16\" height=\"16\">\n <path\n fill=\"currentColor\"\n d=\"M10 2a8 8 0 100 16 8 8 0 000-16zm.75 4.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM9.25 9a.75.75 0 011.5 0v4a.75.75 0 01-1.5 0V9z\"\n />\n </svg>`;\n }\n\n /** @internal Returns the default icon for the current variant, or nothing for 'default'. */\n private get _defaultIcon() {\n switch (this.variant) {\n case 'success':\n return this._renderSuccessIcon();\n case 'warning':\n return this._renderWarningIcon();\n case 'danger':\n return this._renderDangerIcon();\n case 'info':\n return this._renderInfoIcon();\n default:\n return nothing;\n }\n }\n\n // ─── WCAG 1.4.1: Severity label map ───\n\n /** @internal */\n private static readonly _SEVERITY_LABELS: Partial<Record<ToastVariant, string>> = {\n success: 'Success',\n warning: 'Warning',\n danger: 'Error',\n info: 'Info',\n };\n\n /** @internal */\n private get _severityLabel(): string {\n return HelixToast._SEVERITY_LABELS[this.variant] ?? '';\n }\n\n // ─── Render ───\n //\n // (group-6) Host-canonical live region: role + aria-atomic live on the\n // host via ElementInternals (set in connectedCallback). The inner base\n // div is a presentation-only wrapper — it does NOT carry role, aria-live,\n // or aria-atomic. role implies aria-live per ARIA spec, so the host has\n // NO explicit aria-live attribute either (avoids §5.1 double-announce on\n // older NVDA/JAWS that read both role and aria-live as separate live\n // regions).\n\n override render() {\n const severityLabel = this._severityLabel;\n\n return html`\n <div\n part=\"base\"\n class=${classMap({\n toast: true,\n [`toast--${this.variant}`]: true,\n })}\n @mouseenter=${this._handleMouseEnter}\n @mouseleave=${this._handleMouseLeave}\n @focusin=${this._handleFocusIn}\n @focusout=${this._handleFocusOut}\n >\n ${this.open\n ? html`\n ${severityLabel\n ? html`<span class=\"toast__severity-label\">${severityLabel}: </span>`\n : nothing}\n <span part=\"icon\" class=\"toast__icon\">\n <slot name=\"icon\">${this._defaultIcon}</slot>\n </span>\n <span part=\"message\" class=\"toast__message\">\n <slot></slot>\n </span>\n <span part=\"action\" class=\"toast__action\">\n <slot name=\"action\" @slotchange=${this._handleActionSlotChange}></slot>\n </span>\n ${this.closable\n ? html`\n <button\n part=\"close-button\"\n class=\"toast__close\"\n aria-label=${this.labelClose}\n @click=${this._handleClose}\n >\n <svg\n aria-hidden=\"true\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M18 6L6 18M6 6l12 12\" />\n </svg>\n </button>\n `\n : nothing}\n `\n : nothing}\n </div>\n `;\n }\n}\n\n// ─── Declarative Global Types ───\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-toast': HelixToast;\n }\n}\n","import { html } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HelixElement } from '../../base/index.js';\nimport { helixToastStackStyles } from './hx-toast.styles.js';\n\nexport type ToastStackPlacement =\n | 'top-start'\n | 'top-center'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-center'\n | 'bottom-end';\n\n/**\n * A fixed-position container that stacks `hx-toast` elements at the specified\n * corner of the viewport. Enforces a maximum visible toast count via `stack-limit`.\n *\n * @summary Toast stack container managing position and count limits.\n *\n * @tag hx-toast-stack\n *\n * @slot - Accepts `hx-toast` elements.\n *\n * @csspart base - The inner stack container div.\n *\n * @cssprop [--hx-z-index-toast=9000] - Z-index for the fixed stack.\n *\n * ─── ARIA scope (group-6 §3.2 / §5.9) ─────────────────────────────────────\n *\n * `hx-toast-stack` deliberately has NO `role`, `aria-live`, `aria-atomic`,\n * or `aria-relevant` on its host or inner container. Each child `hx-toast`\n * is its own live region (role=alert/status via ElementInternals). Wrapping\n * those toasts in a second live region (e.g. `role=\"log\"` on the stack)\n * would create nested live regions, which causes older NVDA/JAWS to\n * announce every toast TWICE — once for the toast's own role, once for the\n * surrounding log region.\n *\n * The stack is purely a positional/z-index container; it is invisible to\n * the AT tree. Do NOT add a container role unless this entire architecture\n * is rewritten so individual toasts no longer carry their own roles.\n */\n@customElement('hx-toast-stack')\nexport class HelixToastStack extends HelixElement {\n static override styles = [helixToastStackStyles];\n\n /**\n * Corner of the viewport where toasts appear.\n * @attr placement\n */\n @property({ type: String, reflect: true })\n placement:\n | 'top-start'\n | 'top-center'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-center'\n | 'bottom-end' = 'bottom-end';\n\n /**\n * Maximum number of simultaneously visible toasts. 0 = unlimited.\n * @attr stack-limit\n */\n @property({ type: Number, attribute: 'stack-limit' })\n stackLimit = 3;\n\n override render() {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n 'toast-stack': true,\n [`toast-stack--${this.placement}`]: true,\n })}\n >\n <slot></slot>\n </div>\n `;\n }\n}\n\n// ─── Declarative Global Types ───\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-toast-stack': HelixToastStack;\n }\n}\n","import { HelixToast } from './hx-toast.js';\nimport { HelixToastStack } from './hx-toast-stack.js';\nimport type { ToastVariant } from './hx-toast.js';\nimport type { ToastStackPlacement } from './hx-toast-stack.js';\n\nexport interface ToastOptions {\n /** The notification message text. */\n message: string;\n /** Visual variant. Defaults to 'default'. */\n variant?: ToastVariant;\n /** Auto-dismiss duration in ms. 0 = persistent. Defaults to 3000. */\n duration?: number;\n /** Placement of the shared stack. Defaults to 'bottom-end'. */\n placement?: ToastStackPlacement;\n}\n\n/**\n * (group-6 §5.5) Minimum on-screen lifetime for any toast created via the\n * factory, regardless of `stackLimit`-driven displacement. Prevents\n * AT-clipping when rapid-fire `toast()` calls (e.g. during a Drupal\n * BigPipe re-attach burst) would otherwise hide a toast before NVDA/JAWS\n * finished reading it.\n */\nconst MIN_DISPLAY_MS = 1500;\n\n/**\n * @internal\n *\n * Single coherent state machine per deferred toast (codex p1 round-2 holistic).\n *\n * ```\n * queued ── timer fires ──► showing ──► hiding ──► done\n * │\n * └── consumer hide() / DOM detach ──► cancelled ──► removed (terminal)\n * ```\n *\n * Every state transition flows through ONE of two helpers:\n *\n * - `promoteDeferredToShowing` — natural progression when the queued timer\n * fires. Pops the append-deadline, decrements `_pendingAppends`, clears\n * the inline `display: none` artifact, calls `show()`.\n * - `cancelDeferredToast` — terminal cancellation, whether triggered by a\n * consumer `.hide()` call inside the defer window OR by detecting a DOM\n * detach inside the timer callback. Pops the append-deadline, decrements\n * `_pendingAppends`, cancels the queued `setTimeout`, detaches the toast\n * element from the DOM, clears the inline `display: none` artifact, and\n * marks the deferred record as `cancelled` so the timer callback (if it\n * still fires) is a no-op.\n *\n * Concentrating cleanup in these two helpers prevents the per-call leaks\n * that produced rounds 4–8 of codex findings (`_pendingAppends` drift,\n * `_pendingAppendDeadlines` zombie entries, DOM-resident `display: none`\n * elements, double-show on cancelled toasts).\n */\ntype DeferredStatus = 'queued' | 'showing' | 'cancelled';\n\n/**\n * @internal\n * Captures a single displacement that THIS queued toast owns — the hide\n * timer it scheduled to free its slot. Recorded only for the survivor\n * branch (where we created the timer); the longer-burst fallback path\n * shares a previously-scheduled hide and stores `null` here.\n *\n * On cancellation we unwind the displacement: clearTimeout the hide\n * timer, drop the target from `_pendingDisplacements`, and pop its\n * `_pendingHideDeadlines` entry. Without this, decrementing the\n * pending-append count alone leaves the survivor pool under-counted —\n * the next `toast()` call sees fewer survivors than really exist and\n * skips the deferred-show path, briefly exceeding `stackLimit`.\n */\ninterface DisplacementClaim {\n target: HelixToast;\n fireAt: number;\n timerId: ReturnType<typeof setTimeout>;\n}\n\n/**\n * @internal\n * Captures a synth displacement scheduled by the saturation-fallback path.\n * Unlike `DisplacementClaim`, the synth has no schedule-time `target` — its\n * victim is picked dynamically when the timer fires (the oldest still-open,\n * not-already-displacing toast). On cancellation we clear the timer and\n * pop the synth hide-deadline; we deliberately do NOT touch\n * `_pendingDisplacements` (no target was ever inserted).\n */\ninterface SynthDisplacementClaim {\n fireAt: number;\n timerId: ReturnType<typeof setTimeout>;\n}\n\ninterface DeferredRecord {\n /** Current state in the lifecycle. */\n status: DeferredStatus;\n /** Owning stack — needed for queue accounting. */\n stack: HelixToastStack;\n /** Date.now()+deferAppendMs — used to pop the append-deadline timeline. */\n fireAt: number;\n /** Handle to the queued setTimeout so cancellation can clear it. */\n timerId: ReturnType<typeof setTimeout> | null;\n /**\n * Displacement THIS queued toast owns (survivor branch only). `null` for\n * the longer-burst fallback branch where this toast claimed an existing\n * hide-deadline scheduled by an earlier call.\n */\n displacement: DisplacementClaim | null;\n /**\n * (codex p2) Synth displacements THIS queued toast scheduled via the\n * saturation-fallback path. Tracked separately from `displacement`\n * because synths have no schedule-time target — the victim is chosen at\n * fire time. On cancellation each synth's timer is cleared and its\n * hide-deadline popped from `_pendingHideDeadlines` so a later poll of\n * the timeline does not see a phantom slot AND no stale `setTimeout`\n * fires later to hide an unrelated victim that this cancelled toast\n * never needed displaced. Empty array (not null) when there are none —\n * keeps the cleanup loop branchless.\n */\n synthDisplacements: SynthDisplacementClaim[];\n /**\n * (codex p2 round-10) MutationObserver scoped to the parent stack that\n * watches for THIS queued toast appearing in `removedNodes`. Without this,\n * a consumer running `toastEl.remove()` (or detaching the parent) inside\n * the defer window leaves the queued reservation in `_pendingAppends` and\n * the displacement claim live until the timer eventually fires —\n * displacement claim drift, follow-on `toast()` overshoots, the orphaned\n * displacement timer eventually hides a still-needed survivor.\n *\n * The observer fires synchronously after the removal microtask completes,\n * so cleanup runs before any follow-on `toast()` call observes a stale\n * `_pendingAppends` count. Disconnected by both `promoteDeferredToShowing`\n * (natural promotion path) and `cancelDeferredToast` (cancellation path)\n * so the observer never lingers past the queued window.\n */\n removalObserver: MutationObserver | null;\n}\n\nconst _deferredRecords = new WeakMap<HelixToast, DeferredRecord>();\n\n/** @internal Tracks `show()` timestamps so the factory can defer displacement. */\nconst _shownAt = new WeakMap<HelixToast, number>();\n\n/**\n * @internal\n * Tracks toasts that already have a deferred-hide scheduled so successive\n * `toast()` calls within the same MIN_DISPLAY_MS window do NOT pile multiple\n * timers on the same target while leaving newer overflow toasts untouched.\n */\nconst _pendingDisplacements = new WeakSet<HelixToast>();\n\n/**\n * @internal\n * Per-stack count of toasts that have been created via `toast()` but whose\n * append-and-show is queued behind a deferred-hide. These toasts already\n * \"own\" a future visible slot, so a subsequent burst call must count them\n * when deciding whether further displacement is needed — otherwise the\n * stack briefly exceeds `stackLimit`.\n *\n * Mutated only by `promoteDeferredToShowing` and `cancelDeferredToast` so\n * the count stays in lockstep with the deferred-record lifecycle.\n */\nconst _pendingAppends = new WeakMap<HelixToastStack, number>();\n\n/**\n * @internal\n * Per-stack ordered list of `Date.now()`-style timestamps when previously\n * scheduled deferred-hide timers will fire, plus when previously queued\n * appends will become visible. Used by longer-burst calls that exhaust the\n * live survivor pool: when every existing survivor has already been picked\n * for displacement by an earlier burst call, the next call has no fresh\n * target to hide. The new toast must still be queued so the stack never\n * exceeds `stackLimit`; we queue it for the NEXT free slot.\n */\nconst _pendingHideDeadlines = new WeakMap<HelixToastStack, number[]>();\nconst _pendingAppendDeadlines = new WeakMap<HelixToastStack, number[]>();\n\n/** @internal */\nfunction pushDeadline(map: WeakMap<HelixToastStack, number[]>, stack: HelixToastStack, ts: number) {\n const list = map.get(stack);\n if (list) {\n list.push(ts);\n list.sort((a, b) => a - b);\n } else {\n map.set(stack, [ts]);\n }\n}\n\n/** @internal */\nfunction popDeadline(\n map: WeakMap<HelixToastStack, number[]>,\n stack: HelixToastStack,\n ts: number,\n): void {\n const list = map.get(stack);\n if (!list) return;\n const idx = list.indexOf(ts);\n if (idx >= 0) list.splice(idx, 1);\n if (list.length === 0) map.delete(stack);\n}\n\n/** @internal Decrement the per-stack pending-append count (or clear at zero). */\nfunction decrementPendingAppends(stack: HelixToastStack): void {\n const remaining = (_pendingAppends.get(stack) ?? 1) - 1;\n if (remaining > 0) {\n _pendingAppends.set(stack, remaining);\n } else {\n _pendingAppends.delete(stack);\n }\n}\n\n/**\n * @internal\n * Cancels a deferred toast in any pre-`show()` state. Safe to call multiple\n * times on the same element — the deferred-record check makes subsequent\n * calls no-ops. Used by:\n *\n * 1. The consumer-facing `hide()` override installed during the defer window\n * (covers `t.hide()` mid-window).\n * 2. The deferred `setTimeout` callback when it discovers a non-connected\n * element (covers plain `t.remove()` / parent removal).\n */\nfunction cancelDeferredToast(toastEl: HelixToast): void {\n const record = _deferredRecords.get(toastEl);\n if (!record || record.status !== 'queued') return;\n\n // Mark cancelled FIRST so re-entry (e.g. from inside the timer callback,\n // or the removal observer firing on the same tick we're already in) sees\n // the terminal state and bails.\n record.status = 'cancelled';\n\n // Disconnect the parent-removal observer FIRST so its callback cannot\n // re-enter `cancelDeferredToast` for the `toastEl.remove()` we're about\n // to perform below. The status flip above already guards re-entry, but\n // disconnecting also frees the observer's reference to the stack subtree\n // immediately — no point keeping it armed for an already-cancelled record.\n if (record.removalObserver !== null) {\n record.removalObserver.disconnect();\n record.removalObserver = null;\n }\n\n // Clear the queued setTimeout so it cannot fire. (When cancellation is\n // triggered FROM that timer callback, timerId is set but the engine has\n // already dequeued it — clearTimeout on a fired id is a documented no-op.)\n if (record.timerId !== null) {\n clearTimeout(record.timerId);\n record.timerId = null;\n }\n\n // Decrement the per-stack queue count so subsequent burst calls do not\n // think this slot is still reserved.\n decrementPendingAppends(record.stack);\n popDeadline(_pendingAppendDeadlines, record.stack, record.fireAt);\n\n // Unwind the displacement we owned, if any. Without this, the\n // survivor-pool filter (`!_pendingDisplacements.has(t)`) keeps treating\n // the displaced target as already-leaving — a follow-on `toast()` call\n // observes too few survivors, skips the deferred-show path, and shows\n // immediately. Result: stack briefly exceeds `stackLimit` until the\n // orphaned displacement timer eventually fires. The fallback branch\n // (longer-burst path) does not own a displacement (`displacement ===\n // null`); it claimed an existing hide-deadline scheduled by an earlier\n // call, so cancellation is just our own queue-bookkeeping.\n if (record.displacement) {\n const { target, fireAt, timerId } = record.displacement;\n clearTimeout(timerId);\n _pendingDisplacements.delete(target);\n popDeadline(_pendingHideDeadlines, record.stack, fireAt);\n }\n\n // (codex p2) Unwind any synth displacements THIS toast scheduled via\n // the saturation-fallback path. Distinct from `record.displacement`\n // because synths have no schedule-time `target` — the victim is chosen\n // dynamically when the synth timer fires. Without this cleanup, a\n // cancelled synth-owning toast leaves its synth `setTimeout` armed; at\n // fire time it picks an UNRELATED still-open victim and hides it,\n // even though the call that scheduled the synth no longer exists in\n // the queue. The fix here clears each synth timer and pops its\n // synthesized hide-deadline so the timeline stays consistent for any\n // follow-on saturation-burst poll.\n for (const synth of record.synthDisplacements) {\n clearTimeout(synth.timerId);\n popDeadline(_pendingHideDeadlines, record.stack, synth.fireAt);\n }\n record.synthDisplacements = [];\n\n // Clear the inline `display: none` we set during the defer window so a\n // still-attached toast does not leave a zero-box artifact behind.\n toastEl.style.removeProperty('display');\n\n // Detach from DOM. A cancelled toast must not linger as a zombie element\n // (codex p2 round-2 finding) — the public API contract is that the\n // element is gone after `hide()` resolves, just like for shown toasts\n // post-`hx-after-hide`.\n toastEl.remove();\n\n // Drop the record entirely; the toast has reached its terminal state.\n _deferredRecords.delete(toastEl);\n}\n\n/**\n * @internal\n * Natural progression: the queued `setTimeout` fired and the slot is\n * available. Pop the append-deadline, decrement the queue count, clear the\n * inline `display: none`, and call `show()`.\n */\nfunction promoteDeferredToShowing(toastEl: HelixToast, wireAutoRemove: () => void): void {\n const record = _deferredRecords.get(toastEl);\n if (!record || record.status !== 'queued') return;\n\n record.status = 'showing';\n record.timerId = null;\n // (codex p2 round-10) Disconnect the parent-removal observer — once the\n // toast promotes to `showing`, its lifecycle is governed by the standard\n // auto-dismiss / `hx-after-hide` path which already handles cleanup.\n // Leaving the observer armed would leak a long-lived MutationObserver\n // reference per shown toast.\n if (record.removalObserver !== null) {\n record.removalObserver.disconnect();\n record.removalObserver = null;\n }\n decrementPendingAppends(record.stack);\n popDeadline(_pendingAppendDeadlines, record.stack, record.fireAt);\n\n // Clearing display BEFORE show() ensures the toast is in layout flow on\n // the same frame visibility activates — avoids a one-frame\n // invisible-but-allocated layout window.\n toastEl.style.removeProperty('display');\n wireAutoRemove();\n toastEl.show();\n _shownAt.set(toastEl, Date.now());\n\n // Showing toasts no longer need the deferred record — their lifecycle is\n // now governed by the standard auto-dismiss / hx-after-hide path.\n _deferredRecords.delete(toastEl);\n}\n\n/**\n * Imperatively create and display a toast notification.\n *\n * Creates a shared `hx-toast-stack` on `document.body` if one does not exist,\n * then appends a new `hx-toast` with the given options. Respects the stack's\n * `stackLimit` by hiding the oldest visible toast when the limit is exceeded.\n *\n * @example\n * import { toast } from '@helixui/library/components/hx-toast/index.js';\n * toast({ message: 'Patient record saved.', variant: 'success' });\n */\nexport function toast(options: ToastOptions): HelixToast {\n if (typeof document === 'undefined') throw new Error('toast() requires a browser environment');\n const placement = options.placement ?? 'bottom-end';\n\n // Find or create a dedicated stack for this placement\n const stackSelector = `hx-toast-stack[placement=\"${placement}\"]`;\n let stack = document.querySelector<HelixToastStack>(stackSelector);\n if (!stack) {\n stack = document.createElement('hx-toast-stack');\n stack.placement = placement;\n // Intentional design decision: the toast stack is appended to document.body rather\n // than inserted near the caller. This is required so that the fixed-position overlay\n // is not clipped by an ancestor with `overflow: hidden`, `transform`, or `filter`\n // (all of which create a new stacking context and break fixed positioning).\n // Drupal compatibility note: Drupal's BigPipe / AJAX behaviors can re-attach the\n // document body without removing these stacks. The selector check above\n // (`document.querySelector`) ensures only one stack per placement is ever created,\n // preventing duplicates on re-attach cycles.\n document.body.appendChild(stack);\n }\n\n // Enforce stack limit: hide oldest open toasts if at capacity.\n // (group-6 §5.5) Minimum display time prevents AT-clipping under rapid-fire\n // bursts. If a toast has not yet been on screen for MIN_DISPLAY_MS, defer\n // its hide until the remainder elapses; otherwise hide immediately.\n let deferAppendMs = 0;\n // Displacements scheduled by THIS call's overflow loop (survivor branch\n // only). Captured per call so the deferred record below can take\n // ownership of them and unwind them on cancellation. Practically this\n // list has at most one entry — the round-1 fix keeps overflow at 1 per\n // call — but the array form is honest about the loop shape.\n const scheduledDisplacements: DisplacementClaim[] = [];\n // (codex p2 saturation) Synth displacement scheduled by the\n // saturation fallback path. The synth timer picks its victim\n // dynamically at fire time (since there is no eligible target at\n // schedule time); cancellation only needs to clear the timer and pop\n // the synth hide-deadline. Stored separately because the displacement\n // record requires a real `target: HelixToast` reference, which we use\n // `toastEl` for (the new toast itself acts as the placeholder — it is\n // never in `_pendingDisplacements`, so the `delete()` in\n // `cancelDeferredToast` is a no-op).\n const synthDisplacements: SynthDisplacementClaim[] = [];\n if (stack.stackLimit > 0) {\n const openToasts = [...stack.querySelectorAll<HelixToast>('hx-toast')].filter((t) => t.open);\n // Treat anything already queued for displacement as already-hiding so we\n // pick the next surviving oldest. Since the new toast is appended after\n // this block, we must overshoot by 1 to cover it. We also count toasts\n // that are already queued behind a deferred append on this same stack —\n // they \"own\" a visible slot when their timer fires, so the displacement\n // math must reserve room for them too.\n const survivors = openToasts.filter((t) => !_pendingDisplacements.has(t));\n const queuedAppends = _pendingAppends.get(stack) ?? 0;\n const overflow = survivors.length + queuedAppends + 1 - stack.stackLimit;\n\n // Track which slots we've already accounted for in this call. Each\n // displacement we schedule below frees one slot; each pending hide we\n // claim from the existing timeline also frees one slot. The new toast\n // claims the soonest free slot — its deferAppendMs is set to that\n // deadline's remaining time (0 if a slot frees immediately).\n const claimedHideTimestamps: number[] = [];\n\n for (let i = 0; i < overflow; i++) {\n const target = survivors[i];\n if (target) {\n const shownAt = _shownAt.get(target);\n const elapsed = shownAt === undefined ? Number.POSITIVE_INFINITY : Date.now() - shownAt;\n if (elapsed >= MIN_DISPLAY_MS) {\n target.hide();\n // Slot frees synchronously; deferAppendMs stays at 0 unless a\n // later iteration of this loop forces it higher.\n continue;\n }\n const remaining = MIN_DISPLAY_MS - elapsed;\n const fireAt = Date.now() + remaining;\n _pendingDisplacements.add(target);\n pushDeadline(_pendingHideDeadlines, stack, fireAt);\n const stackRef = stack;\n const timerId = setTimeout(() => {\n _pendingDisplacements.delete(target);\n popDeadline(_pendingHideDeadlines, stackRef, fireAt);\n // Guard: only hide if still open (consumer may have hidden it manually)\n if (target.open) target.hide();\n }, remaining);\n claimedHideTimestamps.push(fireAt);\n // Record this displacement on a per-call list so the deferred\n // record (created later, after the toast element exists) can take\n // ownership of it for cancellation cleanup. Pre-existing deferred\n // records on OTHER toasts are unaffected; this list resets per\n // call.\n scheduledDisplacements.push({ target, fireAt, timerId });\n if (remaining > deferAppendMs) deferAppendMs = remaining;\n continue;\n }\n\n // No live survivor available for this overflow slot: every visible\n // toast is already queued for displacement by an earlier burst call.\n // (codex p1 round-2: longer-burst gap.) Find the next free slot from\n // the existing pending-hide timeline that we have not already\n // claimed in this call or by an earlier queued append.\n const allHideDeadlines = _pendingHideDeadlines.get(stack) ?? [];\n const allAppendDeadlines = _pendingAppendDeadlines.get(stack) ?? [];\n // A pending append CONSUMES a hide-slot when it fires, so any append\n // deadline ≤ a hide deadline cancels that hide-slot from the pool of\n // free slots available to *this* new toast. We pair them in\n // chronological order: each append claims the next hide slot.\n const availableHideDeadlines = [...allHideDeadlines].sort((a, b) => a - b);\n const queuedAppendsPending = [...allAppendDeadlines].sort((a, b) => a - b);\n // Pair each queued append with the soonest hide it depends on.\n for (const appendAt of queuedAppendsPending) {\n for (let j = 0; j < availableHideDeadlines.length; j++) {\n if ((availableHideDeadlines[j] as number) <= appendAt) {\n availableHideDeadlines.splice(j, 1);\n break;\n }\n }\n }\n // Subtract slots claimed by THIS call's earlier loop iterations.\n for (const claimed of claimedHideTimestamps) {\n const idx = availableHideDeadlines.indexOf(claimed);\n if (idx >= 0) availableHideDeadlines.splice(idx, 1);\n }\n let nextFreeAt = availableHideDeadlines[0];\n if (nextFreeAt === undefined) {\n // (codex p2) Max-burst saturation: every visible survivor is\n // already in `_pendingDisplacements` AND every pending hide slot\n // is paired with a queued append. The stack is fully reserved\n // for the next MIN_DISPLAY_MS window — there is no existing\n // hide-deadline this toast can ride.\n //\n // Without action, the previous code path bailed (`break`),\n // leaving the new toast on the immediate-show path and briefly\n // exceeding `stackLimit`. Fix: synthesize a future displacement\n // by deferring against the LATEST queued-append deadline +\n // MIN_DISPLAY_MS — that is the soonest moment at which the\n // queued chain frees up and a fresh displacement is legal.\n //\n // We also schedule a real hide at that moment that picks the\n // oldest open toast dynamically. By the time it fires, every\n // toast in the burst chain ahead of us has promoted, lived its\n // MIN_DISPLAY_MS, and is eligible to be displaced. Pushing the\n // synthesized deadline into `_pendingHideDeadlines` keeps the\n // queue accounting consistent with the survivor-branch shape so\n // any later saturation-burst call observes a coherent timeline.\n const allDeadlines: number[] = [];\n for (const ts of allHideDeadlines) allDeadlines.push(ts);\n for (const ts of allAppendDeadlines) allDeadlines.push(ts);\n for (const ts of claimedHideTimestamps) allDeadlines.push(ts);\n if (allDeadlines.length === 0) {\n // Truly pathological: overflow > 0 with no deadlines anywhere.\n // Bail rather than guess.\n break;\n }\n nextFreeAt = Math.max(...allDeadlines) + MIN_DISPLAY_MS;\n const synthFireAt = nextFreeAt;\n const synthRemaining = synthFireAt - Date.now();\n const stackRef = stack;\n pushDeadline(_pendingHideDeadlines, stackRef, synthFireAt);\n const synthTimerId = setTimeout(() => {\n popDeadline(_pendingHideDeadlines, stackRef, synthFireAt);\n // Pick the oldest-still-open toast at fire time. By\n // construction every queued chain ahead has had time to\n // promote and live MIN_DISPLAY_MS, so the oldest open is\n // always displaceable.\n const liveOpen = [...stackRef.querySelectorAll<HelixToast>('hx-toast')].filter(\n (t) => t.open && !_pendingDisplacements.has(t),\n );\n const victim = liveOpen[0];\n if (victim) victim.hide();\n }, synthRemaining);\n // Defer attachment to the deferred record until after `toastEl`\n // is created. Cancellation will clearTimeout this id and pop\n // the synth hide-deadline.\n synthDisplacements.push({ fireAt: synthFireAt, timerId: synthTimerId });\n }\n claimedHideTimestamps.push(nextFreeAt);\n const remaining = nextFreeAt - Date.now();\n if (remaining > deferAppendMs) deferAppendMs = Math.max(0, remaining);\n }\n }\n\n // Create toast element. We attach the auto-remove `hx-after-hide` listener\n // ONLY after the first `show()` has fired, otherwise the toast's initial\n // mount with the default `open=false` causes its `updated()` to dispatch a\n // spurious `hx-hide` → `hx-after-hide` chain that would self-remove the\n // queued toast before its slot ever opens.\n const toastEl = document.createElement('hx-toast');\n toastEl.variant = options.variant ?? 'default';\n toastEl.duration = options.duration ?? 3000;\n toastEl.closable = true;\n toastEl.textContent = options.message;\n\n /** Wires the lifecycle hide listener — called once, the first time `show()` fires. */\n const wireAutoRemove = (): void => {\n toastEl.addEventListener('hx-after-hide', () => {\n _shownAt.delete(toastEl);\n _pendingDisplacements.delete(toastEl);\n toastEl.remove();\n });\n };\n\n if (deferAppendMs > 0) {\n // Suppress the spurious initial `hx-hide` / `hx-after-hide` events that\n // hx-toast's `updated()` dispatches when an element mounts with the\n // default `open=false`. Consumers should only see hide events for\n // toasts that actually showed; for a QUEUED toast the first real hide\n // is its own auto-dismiss or the displaced-hide later. The listeners\n // are `{ once: true }` so they fire exactly once on the spurious mount\n // events and never interfere with subsequent legitimate hides.\n const swallowInitial = (e: Event): void => {\n e.stopImmediatePropagation();\n e.stopPropagation();\n };\n toastEl.addEventListener('hx-hide', swallowInitial, { once: true });\n toastEl.addEventListener('hx-after-hide', swallowInitial, { once: true });\n\n // (codex p2) Hide the queued toast from layout flow during the defer\n // window. Without this, the toast's `:host { display: block }` keeps\n // it in the document layout even with `open=false` — its outer wrapper\n // pushes earlier toasts out of position and may be announced by some\n // ATs on insertion. `display: none` removes it from layout AND the\n // accessibility tree until `show()` flips it visible. The inline style\n // is cleared inside the deferred `setTimeout` (or the cancellation\n // helper) so the natural `:host` display rule reasserts.\n toastEl.style.display = 'none';\n\n // Override `hide()` so a consumer call inside the defer window flows\n // through the canonical cancellation helper. After cancellation the\n // toast is no longer in the DOM (and its deferred record is gone), so\n // any subsequent `hide()` calls fall through to the original\n // implementation — which itself is a safe no-op on a detached toast.\n const originalHide = toastEl.hide.bind(toastEl);\n toastEl.hide = function deferredHide(this: HelixToast): void {\n const record = _deferredRecords.get(toastEl);\n if (record?.status === 'queued') {\n cancelDeferredToast(toastEl);\n return;\n }\n originalHide();\n };\n }\n\n // Append the toast to the stack synchronously so the host element is\n // connected and consumers awaiting `t.updateComplete` after `toast()`\n // resolve immediately. For the immediate-show path the very next line\n // calls `show()` so the toast renders open on its first Lit update; for\n // the deferred path the toast renders with `open=false` (queued) and\n // flips open when the slot frees up.\n stack.appendChild(toastEl);\n if (deferAppendMs > 0) {\n // Defer `show()` (which flips `open=true` and starts the auto-dismiss\n // timer) by exactly the longest deferred-hide window so the new toast\n // becomes visible as the displaced one disappears — preserving both\n // `stackLimit` (max visible) and MIN_DISPLAY_MS (min lifetime). Until\n // then the toast is in the DOM but `open=false`, so the visible count\n // never exceeds `stackLimit`.\n const targetStack = stack;\n const appendFireAt = Date.now() + deferAppendMs;\n _pendingAppends.set(targetStack, (_pendingAppends.get(targetStack) ?? 0) + 1);\n pushDeadline(_pendingAppendDeadlines, targetStack, appendFireAt);\n\n // Register the deferred record so `cancelDeferredToast` and\n // `promoteDeferredToShowing` can drive a single coherent state machine.\n // The timerId is filled in immediately below; the record is created\n // first so cancellation reaching the lookup before assignment still\n // sees a 'queued' status and works correctly.\n //\n // Take ownership of the displacement THIS call scheduled (survivor\n // branch). Practically `scheduledDisplacements` has at most one entry\n // per call — round-1 burst-fix keeps overflow at 1 — and the\n // longer-burst fallback path schedules nothing here, instead reusing\n // an existing hide-deadline. We pick the soonest entry (in case the\n // shape ever changes) and leave any others orphaned (they'd still\n // fire as plain hides; they aren't owned by THIS toast). The\n // fallback path stores `displacement: null` so cancellation only\n // unwinds our own queue bookkeeping.\n const ownedDisplacement = scheduledDisplacements.length > 0 ? scheduledDisplacements[0]! : null;\n // (codex p2) Take ownership of any synth displacements THIS call\n // scheduled via the saturation-fallback path. Stored on the deferred\n // record (not promoted into `scheduledDisplacements` with a phantom\n // `target: toastEl`) so cancellation can unwind them via the synth\n // cleanup loop in `cancelDeferredToast` without the misleading\n // `_pendingDisplacements.delete(toastEl)` no-op the older shape\n // implied. Each synth still claims a slot in `_pendingHideDeadlines`\n // — cancellation pops them so the timeline stays consistent.\n const record: DeferredRecord = {\n status: 'queued',\n stack: targetStack,\n fireAt: appendFireAt,\n timerId: null,\n displacement: ownedDisplacement,\n synthDisplacements: [...synthDisplacements],\n removalObserver: null,\n };\n _deferredRecords.set(toastEl, record);\n\n // (codex p2 round-10) Watch for direct DOM removal during the defer\n // window. Without this, a consumer running `toastEl.remove()` (or\n // detaching the parent stack) skips the `hide()` override AND the\n // `setTimeout` does not run cleanup until the full `deferAppendMs`\n // window elapses. Result: `_pendingAppends` stays incremented, the\n // displacement claim hangs (the displaced survivor still hides on\n // schedule even though no replacement is coming), follow-on\n // `toast()` overshoots the stack limit, and a MutationObserver on\n // the stack subtree leaks until the orphaned timer eventually fires.\n //\n // The observer fires synchronously after the removal microtask, so\n // any follow-on `toast()` call observes the post-cleanup state.\n // Cancellation routes through the canonical helper, which is\n // idempotent (status check at the top) and disconnects this\n // observer first.\n const removalObserver = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n for (const removed of mutation.removedNodes) {\n if (removed === toastEl) {\n cancelDeferredToast(toastEl);\n return;\n }\n }\n }\n });\n removalObserver.observe(targetStack, { childList: true });\n record.removalObserver = removalObserver;\n\n record.timerId = setTimeout(() => {\n // The setTimeout callback covers two paths:\n //\n // 1. Plain DOM removal. The consumer ran `toastEl.remove()` (or a\n // parent was detached) without going through `hide()`, so the\n // `hide()` override above never ran. Treat the missing\n // connection as cancellation — the canonical helper already\n // handles all bookkeeping idempotently.\n //\n // 2. Natural promotion. The defer window elapsed and the slot is\n // free. Promote 'queued' → 'showing'.\n const currentRecord = _deferredRecords.get(toastEl);\n if (!currentRecord || currentRecord.status === 'cancelled') {\n // Already cancelled (consumer hide() during defer window). All\n // bookkeeping was performed in `cancelDeferredToast`; nothing to\n // do here.\n return;\n }\n if (!toastEl.isConnected) {\n cancelDeferredToast(toastEl);\n return;\n }\n promoteDeferredToShowing(toastEl, wireAutoRemove);\n }, deferAppendMs);\n } else {\n wireAutoRemove();\n toastEl.show();\n _shownAt.set(toastEl, Date.now());\n }\n\n return toastEl;\n}\n"],"names":["helixToastStyles","css","helixToastStackStyles","MIN_DISPLAY_MS_BY_VARIANT","HelixToast","HelixElement","changedProperties","min","devWarn","remaining","delay","elapsed","fired","fireAfterHide","base","slot","html","nothing","severityLabel","classMap","__decorateClass","property","query","state","customElement","HelixToastStack","MIN_DISPLAY_MS","_deferredRecords","_shownAt","_pendingDisplacements","_pendingAppends","_pendingHideDeadlines","_pendingAppendDeadlines","pushDeadline","map","stack","ts","list","a","b","popDeadline","idx","decrementPendingAppends","cancelDeferredToast","toastEl","record","target","fireAt","timerId","synth","promoteDeferredToShowing","wireAutoRemove","toast","options","placement","stackSelector","deferAppendMs","scheduledDisplacements","synthDisplacements","survivors","t","queuedAppends","overflow","claimedHideTimestamps","i","shownAt","stackRef","allHideDeadlines","allAppendDeadlines","availableHideDeadlines","queuedAppendsPending","appendAt","j","claimed","nextFreeAt","allDeadlines","synthFireAt","synthRemaining","synthTimerId","victim","swallowInitial","e","originalHide","targetStack","appendFireAt","ownedDisplacement","removalObserver","mutations","mutation","removed","currentRecord"],"mappings":";;;;;AAYO,MAAMA,KAAmBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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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