@helixui/library 1.0.0 → 1.0.1
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/custom-elements.json +213 -22
- package/dist/components/hx-accordion/hx-accordion-item.d.ts +20 -0
- package/dist/components/hx-accordion/hx-accordion-item.d.ts.map +1 -1
- package/dist/components/hx-accordion/index.js +1 -1
- package/dist/components/hx-alert/hx-alert.d.ts +10 -0
- 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-badge/hx-badge.d.ts +2 -0
- 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 +6 -0
- package/dist/components/hx-banner/hx-banner.d.ts.map +1 -1
- package/dist/components/hx-banner/index.js +1 -1
- package/dist/components/hx-breadcrumb/hx-breadcrumb-item.styles.d.ts.map +1 -1
- package/dist/components/hx-breadcrumb/index.js +1 -1
- package/dist/components/hx-card/hx-card.d.ts +1 -0
- package/dist/components/hx-card/hx-card.d.ts.map +1 -1
- package/dist/components/hx-card/hx-card.styles.d.ts.map +1 -1
- package/dist/components/hx-card/index.js +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.styles.d.ts.map +1 -1
- package/dist/components/hx-checkbox/index.js +1 -1
- package/dist/components/hx-code-snippet/index.js +1 -1
- package/dist/components/hx-color-picker/hx-color-picker.d.ts +44 -10
- package/dist/components/hx-color-picker/hx-color-picker.d.ts.map +1 -1
- package/dist/components/hx-color-picker/index.js +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-data-table/hx-data-table.styles.d.ts.map +1 -1
- package/dist/components/hx-data-table/index.js +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-dialog/hx-dialog.styles.d.ts.map +1 -1
- package/dist/components/hx-dialog/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.d.ts +20 -5
- package/dist/components/hx-dropdown/hx-dropdown.d.ts.map +1 -1
- package/dist/components/hx-dropdown/index.js +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-icon-button/hx-icon-button.styles.d.ts.map +1 -1
- package/dist/components/hx-icon-button/index.js +1 -1
- package/dist/components/hx-menu/hx-menu-item.d.ts +1 -0
- package/dist/components/hx-menu/hx-menu-item.d.ts.map +1 -1
- package/dist/components/hx-menu/hx-menu.d.ts +1 -0
- package/dist/components/hx-menu/hx-menu.d.ts.map +1 -1
- package/dist/components/hx-menu/index.js +1 -1
- package/dist/components/hx-meter/hx-meter.d.ts +1 -0
- package/dist/components/hx-meter/hx-meter.d.ts.map +1 -1
- package/dist/components/hx-meter/hx-meter.styles.d.ts.map +1 -1
- package/dist/components/hx-meter/index.js +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-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-pagination/hx-pagination.styles.d.ts.map +1 -1
- package/dist/components/hx-pagination/index.js +1 -1
- package/dist/components/hx-popover/hx-popover.d.ts +41 -9
- package/dist/components/hx-popover/hx-popover.d.ts.map +1 -1
- package/dist/components/hx-popover/hx-popover.styles.d.ts.map +1 -1
- package/dist/components/hx-popover/index.js +1 -1
- package/dist/components/hx-progress-bar/hx-progress-bar.d.ts +2 -0
- package/dist/components/hx-progress-bar/hx-progress-bar.d.ts.map +1 -1
- package/dist/components/hx-progress-bar/index.js +1 -1
- package/dist/components/hx-radio-group/hx-radio.styles.d.ts.map +1 -1
- package/dist/components/hx-radio-group/index.js +1 -1
- package/dist/components/hx-select/hx-select.styles.d.ts.map +1 -1
- package/dist/components/hx-select/index.js +1 -1
- 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/index.js +1 -1
- package/dist/components/hx-split-panel/hx-split-panel.d.ts +44 -11
- package/dist/components/hx-split-panel/hx-split-panel.d.ts.map +1 -1
- package/dist/components/hx-split-panel/hx-split-panel.styles.d.ts.map +1 -1
- package/dist/components/hx-split-panel/index.js +1 -1
- package/dist/components/hx-tabs/hx-tabs.d.ts.map +1 -1
- package/dist/components/hx-tabs/index.js +1 -1
- package/dist/components/hx-tag/hx-tag.d.ts +2 -0
- 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-text-input/hx-text-input.d.ts +1 -1
- package/dist/components/hx-text-input/index.js +1 -1
- package/dist/components/hx-time-picker/hx-time-picker.d.ts +80 -19
- package/dist/components/hx-time-picker/hx-time-picker.d.ts.map +1 -1
- package/dist/components/hx-time-picker/index.js +1 -1
- package/dist/components/hx-toast/hx-toast.d.ts +10 -0
- 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/index.js +1 -1
- package/dist/components/hx-tree-view/hx-tree-item.d.ts +11 -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/hx-tree-view.d.ts +1 -0
- package/dist/components/hx-tree-view/hx-tree-view.d.ts.map +1 -1
- package/dist/components/hx-tree-view/index.js +1 -1
- package/dist/index.js +37 -37
- package/dist/shared/{hx-accordion-Cyswa6J3.js → hx-accordion-DT8qHOay.js} +54 -37
- package/dist/shared/hx-accordion-DT8qHOay.js.map +1 -0
- package/dist/shared/{hx-alert-Cg-zxRiU.js → hx-alert-D6uok29t.js} +95 -28
- package/dist/shared/hx-alert-D6uok29t.js.map +1 -0
- package/dist/shared/{hx-badge-CjT0d8NK.js → hx-badge-BeuWuUj_.js} +57 -31
- package/dist/shared/hx-badge-BeuWuUj_.js.map +1 -0
- package/dist/shared/{hx-banner-lxAIJ2kR.js → hx-banner-DnCBJtRR.js} +27 -23
- package/dist/shared/{hx-banner-lxAIJ2kR.js.map → hx-banner-DnCBJtRR.js.map} +1 -1
- package/dist/shared/{hx-breadcrumb-item-C0rz0fzV.js → hx-breadcrumb-item-Bj2UqhzR.js} +12 -8
- package/dist/shared/{hx-breadcrumb-item-C0rz0fzV.js.map → hx-breadcrumb-item-Bj2UqhzR.js.map} +1 -1
- package/dist/shared/{hx-card-Bg4W4uXC.js → hx-card-B9j2SHyI.js} +15 -11
- package/dist/shared/hx-card-B9j2SHyI.js.map +1 -0
- package/dist/shared/{hx-carousel-item-BKpmFbUT.js → hx-carousel-item-Be0bC-7o.js} +91 -77
- package/dist/shared/hx-carousel-item-Be0bC-7o.js.map +1 -0
- package/dist/shared/{hx-checkbox-BMayOpAM.js → hx-checkbox-CuaJqEo7.js} +3 -1
- package/dist/shared/hx-checkbox-CuaJqEo7.js.map +1 -0
- package/dist/shared/{hx-code-snippet-B4hV7rWG.js → hx-code-snippet-DBwIjl5p.js} +11 -11
- package/dist/shared/{hx-code-snippet-B4hV7rWG.js.map → hx-code-snippet-DBwIjl5p.js.map} +1 -1
- package/dist/shared/{hx-color-picker-BvfJ_h16.js → hx-color-picker-Bb2UPVc3.js} +2 -2
- package/dist/shared/hx-color-picker-Bb2UPVc3.js.map +1 -0
- package/dist/shared/{hx-combobox-BBi3izKJ.js → hx-combobox-CNvY-es8.js} +42 -39
- package/dist/shared/hx-combobox-CNvY-es8.js.map +1 -0
- package/dist/shared/{hx-data-table-DNiDVWR2.js → hx-data-table-BwoJCFgs.js} +9 -8
- package/dist/shared/hx-data-table-BwoJCFgs.js.map +1 -0
- package/dist/shared/{hx-date-picker-D7yCK0nk.js → hx-date-picker-DDcIBJir.js} +43 -37
- package/dist/shared/hx-date-picker-DDcIBJir.js.map +1 -0
- package/dist/shared/{hx-dialog-Z7Ou_AZ9.js → hx-dialog-M7so0sRT.js} +41 -34
- package/dist/shared/hx-dialog-M7so0sRT.js.map +1 -0
- package/dist/shared/{hx-drawer-Dk-_xzy0.js → hx-drawer-CYxuhIQ0.js} +50 -43
- package/dist/shared/hx-drawer-CYxuhIQ0.js.map +1 -0
- package/dist/shared/{hx-dropdown-DnjLnkTj.js → hx-dropdown-7cfowTWv.js} +30 -30
- package/dist/shared/hx-dropdown-7cfowTWv.js.map +1 -0
- package/dist/shared/{hx-file-upload-CUORgnKc.js → hx-file-upload-9HbONfqt.js} +49 -43
- package/dist/shared/hx-file-upload-9HbONfqt.js.map +1 -0
- package/dist/shared/{hx-icon-button-C83bCR0K.js → hx-icon-button-iu0i_faq.js} +39 -29
- package/dist/shared/hx-icon-button-iu0i_faq.js.map +1 -0
- package/dist/shared/{hx-menu-divider-11Dp2VfM.js → hx-menu-divider-DR8klkFT.js} +32 -26
- package/dist/shared/hx-menu-divider-DR8klkFT.js.map +1 -0
- package/dist/shared/{hx-meter-UinDQjl6.js → hx-meter-CZ7lnMra.js} +67 -35
- package/dist/shared/hx-meter-CZ7lnMra.js.map +1 -0
- package/dist/shared/{hx-nav-DSpwWYUX.js → hx-nav-DM6-cGKF.js} +49 -47
- package/dist/shared/hx-nav-DM6-cGKF.js.map +1 -0
- package/dist/shared/{hx-overflow-menu-C7k5wlZy.js → hx-overflow-menu-CobkjAb8.js} +17 -9
- package/dist/shared/{hx-overflow-menu-C7k5wlZy.js.map → hx-overflow-menu-CobkjAb8.js.map} +1 -1
- package/dist/shared/{hx-pagination-BQ0cLTuB.js → hx-pagination-10dpXS95.js} +14 -12
- package/dist/shared/hx-pagination-10dpXS95.js.map +1 -0
- package/dist/shared/hx-popover-ULjonbaO.js +269 -0
- package/dist/shared/hx-popover-ULjonbaO.js.map +1 -0
- package/dist/shared/{hx-progress-bar-C_mdPVF-.js → hx-progress-bar-CnTibV63.js} +67 -57
- package/dist/shared/{hx-progress-bar-C_mdPVF-.js.map → hx-progress-bar-CnTibV63.js.map} +1 -1
- package/dist/shared/{hx-radio-Bqyi8re3.js → hx-radio-BnKcRuQu.js} +10 -8
- package/dist/shared/{hx-radio-Bqyi8re3.js.map → hx-radio-BnKcRuQu.js.map} +1 -1
- package/dist/shared/{hx-select-BBae2LqN.js → hx-select-C50lD7NS.js} +4 -3
- package/dist/shared/hx-select-C50lD7NS.js.map +1 -0
- package/dist/shared/{hx-slider-CpnxH2UP.js → hx-slider-CprSNrRi.js} +3 -2
- package/dist/shared/hx-slider-CprSNrRi.js.map +1 -0
- package/dist/shared/{hx-split-button-BvwoG8h2.js → hx-split-button-CHGy4FUc.js} +11 -11
- package/dist/shared/{hx-split-button-BvwoG8h2.js.map → hx-split-button-CHGy4FUc.js.map} +1 -1
- package/dist/shared/{hx-split-panel-Cxkeauwe.js → hx-split-panel-DYtB45Tr.js} +16 -8
- package/dist/shared/hx-split-panel-DYtB45Tr.js.map +1 -0
- package/dist/shared/{hx-tab-panel-CHB0u1zF.js → hx-tab-panel-BRNcLICw.js} +55 -52
- package/dist/shared/hx-tab-panel-BRNcLICw.js.map +1 -0
- package/dist/shared/{hx-tag-SJJtMlOS.js → hx-tag-B3N-vZ6B.js} +80 -55
- package/dist/shared/hx-tag-B3N-vZ6B.js.map +1 -0
- package/dist/shared/{hx-text-input-BrCjo4fJ.js → hx-text-input-CCZZbWQ9.js} +6 -6
- package/dist/shared/hx-text-input-CCZZbWQ9.js.map +1 -0
- package/dist/shared/{hx-time-picker-DRRAFuVd.js → hx-time-picker-CJcIjH3C.js} +5 -2
- package/dist/shared/hx-time-picker-CJcIjH3C.js.map +1 -0
- package/dist/shared/{hx-top-nav-DzW7XLv-.js → hx-top-nav-D2bQpns3.js} +2 -2
- package/dist/shared/{hx-top-nav-DzW7XLv-.js.map → hx-top-nav-D2bQpns3.js.map} +1 -1
- package/dist/shared/{hx-tree-item-DdH6RbMs.js → hx-tree-item-BobGN76x.js} +119 -96
- package/dist/shared/hx-tree-item-BobGN76x.js.map +1 -0
- package/dist/shared/{toast-factory-B8jicczW.js → toast-factory-MvMMreTu.js} +178 -94
- package/dist/shared/toast-factory-MvMMreTu.js.map +1 -0
- package/package.json +1 -1
- package/dist/shared/hx-accordion-Cyswa6J3.js.map +0 -1
- package/dist/shared/hx-alert-Cg-zxRiU.js.map +0 -1
- package/dist/shared/hx-badge-CjT0d8NK.js.map +0 -1
- package/dist/shared/hx-card-Bg4W4uXC.js.map +0 -1
- package/dist/shared/hx-carousel-item-BKpmFbUT.js.map +0 -1
- package/dist/shared/hx-checkbox-BMayOpAM.js.map +0 -1
- package/dist/shared/hx-color-picker-BvfJ_h16.js.map +0 -1
- package/dist/shared/hx-combobox-BBi3izKJ.js.map +0 -1
- package/dist/shared/hx-data-table-DNiDVWR2.js.map +0 -1
- package/dist/shared/hx-date-picker-D7yCK0nk.js.map +0 -1
- package/dist/shared/hx-dialog-Z7Ou_AZ9.js.map +0 -1
- package/dist/shared/hx-drawer-Dk-_xzy0.js.map +0 -1
- package/dist/shared/hx-dropdown-DnjLnkTj.js.map +0 -1
- package/dist/shared/hx-file-upload-CUORgnKc.js.map +0 -1
- package/dist/shared/hx-icon-button-C83bCR0K.js.map +0 -1
- package/dist/shared/hx-menu-divider-11Dp2VfM.js.map +0 -1
- package/dist/shared/hx-meter-UinDQjl6.js.map +0 -1
- package/dist/shared/hx-nav-DSpwWYUX.js.map +0 -1
- package/dist/shared/hx-pagination-BQ0cLTuB.js.map +0 -1
- package/dist/shared/hx-popover-BQsgrJCW.js +0 -226
- package/dist/shared/hx-popover-BQsgrJCW.js.map +0 -1
- package/dist/shared/hx-select-BBae2LqN.js.map +0 -1
- package/dist/shared/hx-slider-CpnxH2UP.js.map +0 -1
- package/dist/shared/hx-split-panel-Cxkeauwe.js.map +0 -1
- package/dist/shared/hx-tab-panel-CHB0u1zF.js.map +0 -1
- package/dist/shared/hx-tag-SJJtMlOS.js.map +0 -1
- package/dist/shared/hx-text-input-BrCjo4fJ.js.map +0 -1
- package/dist/shared/hx-time-picker-DRRAFuVd.js.map +0 -1
- package/dist/shared/hx-tree-item-DdH6RbMs.js.map +0 -1
- package/dist/shared/toast-factory-B8jicczW.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as w, svg as S, LitElement as _, nothing as u, html as E } from "lit";
|
|
2
|
+
import { property as h, customElement as $ } from "lit/decorators.js";
|
|
3
3
|
import { tokenStyles as k } from "@helixui/tokens/lit";
|
|
4
4
|
import { classMap as D } from "lit/directives/class-map.js";
|
|
5
5
|
import { d as A } from "./dev-warn-YlwPHjtX.js";
|
|
6
|
-
const
|
|
6
|
+
const L = w`
|
|
7
7
|
:host {
|
|
8
8
|
display: block;
|
|
9
9
|
font-family: var(--hx-font-family-sans, sans-serif);
|
|
@@ -13,7 +13,7 @@ const I = b`
|
|
|
13
13
|
border-radius: var(--hx-accordion-border-radius, var(--hx-border-radius-md, 0.375rem));
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
}
|
|
16
|
-
`,
|
|
16
|
+
`, I = w`
|
|
17
17
|
:host {
|
|
18
18
|
display: block;
|
|
19
19
|
}
|
|
@@ -134,12 +134,12 @@ const I = b`
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
`;
|
|
137
|
-
var
|
|
138
|
-
for (var n = t > 1 ? void 0 : t ?
|
|
137
|
+
var O = Object.defineProperty, P = Object.getOwnPropertyDescriptor, p = (e, r, o, t) => {
|
|
138
|
+
for (var n = t > 1 ? void 0 : t ? P(r, o) : r, i = e.length - 1, a; i >= 0; i--)
|
|
139
139
|
(a = e[i]) && (n = (t ? a(r, o, n) : a(n)) || n);
|
|
140
|
-
return t && n &&
|
|
140
|
+
return t && n && O(r, o, n), n;
|
|
141
141
|
};
|
|
142
|
-
const
|
|
142
|
+
const j = S`
|
|
143
143
|
<svg
|
|
144
144
|
xmlns="http://www.w3.org/2000/svg"
|
|
145
145
|
width="16"
|
|
@@ -155,9 +155,21 @@ const L = C`
|
|
|
155
155
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
156
156
|
</svg>
|
|
157
157
|
`;
|
|
158
|
-
let s = class extends
|
|
158
|
+
let s = class extends _ {
|
|
159
159
|
constructor() {
|
|
160
|
-
super(...arguments), this._uid = `hx-accordion-item-${++s._counter}`, this.expanded = !1, this.disabled = !1;
|
|
160
|
+
super(...arguments), this._uid = `hx-accordion-item-${++s._counter}`, this.expanded = !1, this.disabled = !1, this.level = 3;
|
|
161
|
+
}
|
|
162
|
+
// ─── Heading Level Helper ───
|
|
163
|
+
/**
|
|
164
|
+
* Returns a clamped heading level (1–6) for use as `aria-level` on the
|
|
165
|
+
* `<summary>` element. Per the WAI-ARIA APG Accordion pattern, the
|
|
166
|
+
* `<summary>` must be a **direct child** of `<details>` for native
|
|
167
|
+
* disclosure behaviour to work. Instead of wrapping `<summary>` inside
|
|
168
|
+
* an `<h3>` (which breaks the native toggle), we apply
|
|
169
|
+
* `role="heading" aria-level="N"` directly on `<summary>`.
|
|
170
|
+
*/
|
|
171
|
+
get _headingLevel() {
|
|
172
|
+
return Math.max(1, Math.min(6, this.level));
|
|
161
173
|
}
|
|
162
174
|
// ─── Toggle Logic ───
|
|
163
175
|
_toggle() {
|
|
@@ -183,21 +195,23 @@ let s = class extends w {
|
|
|
183
195
|
"item--expanded": this.expanded,
|
|
184
196
|
"item--disabled": this.disabled
|
|
185
197
|
};
|
|
186
|
-
return
|
|
198
|
+
return E`
|
|
187
199
|
<details part="item" class=${D(e)} ?open=${this.expanded}>
|
|
188
200
|
<summary
|
|
189
201
|
id=${`${this._uid}-trigger`}
|
|
190
202
|
part="trigger"
|
|
191
203
|
class="trigger"
|
|
204
|
+
role="heading"
|
|
205
|
+
aria-level=${this._headingLevel}
|
|
192
206
|
tabindex=${this.disabled ? "-1" : "0"}
|
|
193
|
-
aria-expanded=${this.expanded ? "true" :
|
|
194
|
-
aria-disabled=${this.disabled ? "true" :
|
|
207
|
+
aria-expanded=${this.expanded ? "true" : u}
|
|
208
|
+
aria-disabled=${this.disabled ? "true" : u}
|
|
195
209
|
aria-controls=${`${this._uid}-content`}
|
|
196
210
|
@click=${this._handleSummaryClick}
|
|
197
211
|
@keydown=${this._handleKeyDown}
|
|
198
212
|
>
|
|
199
213
|
<slot name="trigger"></slot>
|
|
200
|
-
<span part="icon" class="icon">${
|
|
214
|
+
<span part="icon" class="icon">${j}</span>
|
|
201
215
|
</summary>
|
|
202
216
|
<div class="content-wrapper">
|
|
203
217
|
<div class="content-inner">
|
|
@@ -207,7 +221,7 @@ let s = class extends w {
|
|
|
207
221
|
class="content"
|
|
208
222
|
role="region"
|
|
209
223
|
aria-labelledby=${`${this._uid}-trigger`}
|
|
210
|
-
aria-hidden=${this.expanded ?
|
|
224
|
+
aria-hidden=${this.expanded ? u : "true"}
|
|
211
225
|
>
|
|
212
226
|
<slot></slot>
|
|
213
227
|
</div>
|
|
@@ -217,23 +231,26 @@ let s = class extends w {
|
|
|
217
231
|
`;
|
|
218
232
|
}
|
|
219
233
|
};
|
|
220
|
-
s.styles = [k,
|
|
234
|
+
s.styles = [k, I];
|
|
221
235
|
s._counter = 0;
|
|
222
|
-
|
|
223
|
-
|
|
236
|
+
p([
|
|
237
|
+
h({ type: Boolean, reflect: !0 })
|
|
224
238
|
], s.prototype, "expanded", 2);
|
|
225
|
-
|
|
226
|
-
|
|
239
|
+
p([
|
|
240
|
+
h({ type: Boolean, reflect: !0 })
|
|
227
241
|
], s.prototype, "disabled", 2);
|
|
228
|
-
|
|
229
|
-
|
|
242
|
+
p([
|
|
243
|
+
h({ type: Number })
|
|
244
|
+
], s.prototype, "level", 2);
|
|
245
|
+
s = p([
|
|
246
|
+
$("hx-accordion-item")
|
|
230
247
|
], s);
|
|
231
|
-
var q = Object.defineProperty, R = Object.getOwnPropertyDescriptor,
|
|
248
|
+
var q = Object.defineProperty, R = Object.getOwnPropertyDescriptor, C = (e, r, o, t) => {
|
|
232
249
|
for (var n = t > 1 ? void 0 : t ? R(r, o) : r, i = e.length - 1, a; i >= 0; i--)
|
|
233
250
|
(a = e[i]) && (n = (t ? a(r, o, n) : a(n)) || n);
|
|
234
251
|
return t && n && q(r, o, n), n;
|
|
235
252
|
};
|
|
236
|
-
let c = class extends
|
|
253
|
+
let c = class extends _ {
|
|
237
254
|
constructor() {
|
|
238
255
|
super(...arguments), this.mode = "single", this._handleChildExpand = (e) => {
|
|
239
256
|
if (this.mode !== "single") return;
|
|
@@ -242,14 +259,14 @@ let c = class extends w {
|
|
|
242
259
|
t !== r && t.expanded && (t.expanded = !1, t._dispatchToggleEvent(!1));
|
|
243
260
|
});
|
|
244
261
|
}, this._handleKeyDown = (e) => {
|
|
245
|
-
var f,
|
|
262
|
+
var f, v, x, y;
|
|
246
263
|
if (this._getTriggers().length === 0) return;
|
|
247
264
|
const o = ((f = this.shadowRoot) == null ? void 0 : f.activeElement) ?? document.activeElement;
|
|
248
265
|
let t = null;
|
|
249
266
|
const n = Array.from(this.querySelectorAll("hx-accordion-item"));
|
|
250
267
|
for (const l of n) {
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
268
|
+
const b = (v = l.shadowRoot) == null ? void 0 : v.querySelector('[part="trigger"]');
|
|
269
|
+
if (b === o || ((x = l.shadowRoot) == null ? void 0 : x.activeElement) === b) {
|
|
253
270
|
t = l;
|
|
254
271
|
break;
|
|
255
272
|
}
|
|
@@ -275,8 +292,8 @@ let c = class extends w {
|
|
|
275
292
|
return;
|
|
276
293
|
}
|
|
277
294
|
e.preventDefault();
|
|
278
|
-
const
|
|
279
|
-
|
|
295
|
+
const g = i[d], m = (y = g == null ? void 0 : g.shadowRoot) == null ? void 0 : y.querySelector('[part="trigger"]');
|
|
296
|
+
m == null || m.focus();
|
|
280
297
|
};
|
|
281
298
|
}
|
|
282
299
|
// ─── Lifecycle ───
|
|
@@ -302,7 +319,7 @@ let c = class extends w {
|
|
|
302
319
|
const e = this.querySelectorAll("hx-accordion-item"), r = [];
|
|
303
320
|
return e.forEach((o) => {
|
|
304
321
|
var n;
|
|
305
|
-
const t = (n = o.shadowRoot) == null ? void 0 : n.querySelector("
|
|
322
|
+
const t = (n = o.shadowRoot) == null ? void 0 : n.querySelector('[part="trigger"]');
|
|
306
323
|
t && r.push(t);
|
|
307
324
|
}), r;
|
|
308
325
|
}
|
|
@@ -318,22 +335,22 @@ let c = class extends w {
|
|
|
318
335
|
}
|
|
319
336
|
// ─── Render ───
|
|
320
337
|
render() {
|
|
321
|
-
return
|
|
338
|
+
return E`
|
|
322
339
|
<div part="accordion" class="accordion">
|
|
323
340
|
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
324
341
|
</div>
|
|
325
342
|
`;
|
|
326
343
|
}
|
|
327
344
|
};
|
|
328
|
-
c.styles = [k,
|
|
329
|
-
|
|
330
|
-
|
|
345
|
+
c.styles = [k, L];
|
|
346
|
+
C([
|
|
347
|
+
h({ type: String, reflect: !0 })
|
|
331
348
|
], c.prototype, "mode", 2);
|
|
332
|
-
c =
|
|
333
|
-
|
|
349
|
+
c = C([
|
|
350
|
+
$("hx-accordion")
|
|
334
351
|
], c);
|
|
335
352
|
export {
|
|
336
353
|
c as H,
|
|
337
354
|
s as a
|
|
338
355
|
};
|
|
339
|
-
//# sourceMappingURL=hx-accordion-
|
|
356
|
+
//# sourceMappingURL=hx-accordion-DT8qHOay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-accordion-DT8qHOay.js","sources":["../../src/components/hx-accordion/hx-accordion.styles.ts","../../src/components/hx-accordion/hx-accordion-item.styles.ts","../../src/components/hx-accordion/hx-accordion-item.ts","../../src/components/hx-accordion/hx-accordion.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixAccordionStyles = css`\n :host {\n display: block;\n font-family: var(--hx-font-family-sans, sans-serif);\n }\n\n .accordion {\n border-radius: var(--hx-accordion-border-radius, var(--hx-border-radius-md, 0.375rem));\n overflow: hidden;\n }\n`;\n","import { css } from 'lit';\n\nexport const helixAccordionItemStyles = css`\n :host {\n display: block;\n }\n\n .item {\n border-bottom: var(--hx-border-width-thin, 1px) solid\n var(--hx-accordion-border-color, var(--hx-color-neutral-200, #dee2e6));\n font-family: var(--hx-font-family-sans, sans-serif);\n }\n\n :host(:first-child) .item {\n border-top: var(--hx-border-width-thin, 1px) solid\n var(--hx-accordion-border-color, var(--hx-color-neutral-200, #dee2e6));\n }\n\n /* Remove native details marker */\n .trigger {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--hx-space-3, 0.75rem);\n padding: var(--hx-accordion-trigger-padding, var(--hx-space-4, 1rem));\n cursor: pointer;\n list-style: none;\n font-size: var(--hx-font-size-md, 1rem);\n font-weight: var(--hx-font-weight-semibold, 600);\n color: var(--hx-accordion-trigger-color, var(--hx-color-neutral-800, #212529));\n background-color: var(--hx-accordion-trigger-bg, transparent);\n user-select: none;\n transition: background-color var(--hx-transition-fast, 150ms ease);\n }\n\n /* Hide the native details disclosure triangle */\n .trigger::-webkit-details-marker {\n display: none;\n }\n\n .trigger::marker {\n display: none;\n }\n\n .item--disabled .trigger {\n cursor: not-allowed;\n }\n\n :host(:not([disabled])) .trigger:hover {\n background-color: var(--hx-accordion-trigger-hover-bg, var(--hx-color-neutral-50, #f8f9fa));\n }\n\n .trigger:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-focus-ring-color, var(--hx-color-primary-500, #2563eb));\n outline-offset: var(--hx-focus-ring-offset, -2px);\n }\n\n /* ─── Icon ─── */\n\n .icon {\n flex-shrink: 0;\n width: 1.25rem;\n height: 1.25rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--hx-accordion-icon-color, var(--hx-color-neutral-500, #6c757d));\n transition: transform var(--hx-transition-normal, 250ms ease);\n }\n\n .item--expanded .icon {\n transform: rotate(180deg);\n }\n\n /* ─── Content animation via CSS grid trick ─── */\n\n .content-wrapper {\n display: grid;\n grid-template-rows: 0fr;\n transition: grid-template-rows var(--hx-transition-normal, 250ms ease);\n overflow: hidden;\n }\n\n .item--expanded .content-wrapper,\n details[open]:not(.item--expanded) .content-wrapper {\n grid-template-rows: 1fr;\n }\n\n .content-inner {\n overflow: hidden;\n }\n\n .content {\n padding: var(--hx-accordion-content-padding, 0 var(--hx-space-4, 1rem) var(--hx-space-4, 1rem));\n font-size: var(--hx-font-size-md, 1rem);\n line-height: var(--hx-line-height-normal, 1.5);\n color: var(--hx-accordion-content-color, var(--hx-color-neutral-600, #495057));\n }\n\n /* ─── Disabled host ─── */\n\n :host([disabled]) {\n pointer-events: none;\n opacity: 0.5;\n }\n\n /* ─── Reduced motion ─── */\n\n @media (prefers-reduced-motion: reduce) {\n .trigger {\n transition: none;\n }\n\n .icon {\n transition: none;\n }\n\n .content-wrapper {\n transition: none;\n }\n }\n`;\n","import { LitElement, html, svg, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { tokenStyles } from '@helixui/tokens/lit';\nimport { helixAccordionItemStyles } from './hx-accordion-item.styles.js';\n\nconst chevronIcon = svg`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\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 aria-hidden=\"true\"\n >\n <polyline points=\"6 9 12 15 18 9\"></polyline>\n </svg>\n`;\n\n/**\n * An individual accordion item with collapsible content.\n *\n * @summary Collapsible panel that can be expanded or collapsed.\n *\n * @tag hx-accordion-item\n *\n * @slot trigger - The heading/trigger content for this item.\n * @slot - Default slot for the collapsible body content.\n *\n * @attr {number} level - Heading level (1–6) for the trigger via `role=\"heading\" aria-level`.\n * Defaults to 3. Set this to match the document outline — e.g., use `level=\"2\"` when the\n * accordion appears under an `<h1>` landmark.\n *\n * @fires {CustomEvent<{expanded: boolean, itemId: string}>} hx-expand - Dispatched when the item is expanded.\n * @fires {CustomEvent<{expanded: boolean, itemId: string}>} hx-collapse - Dispatched when the item is collapsed.\n *\n * @csspart item - The outer details element container.\n * @csspart trigger - The summary/trigger element.\n * @csspart content - The collapsible content area.\n * @csspart icon - The expand/collapse icon.\n *\n * @cssprop [--hx-accordion-border-color=var(--hx-color-neutral-200)] - Border color between items.\n * @cssprop [--hx-accordion-trigger-padding=var(--hx-space-4)] - Trigger padding.\n * @cssprop [--hx-accordion-trigger-color=var(--hx-color-neutral-800)] - Trigger text color.\n * @cssprop [--hx-accordion-trigger-bg=transparent] - Trigger background color.\n * @cssprop [--hx-accordion-trigger-hover-bg=var(--hx-color-neutral-50)] - Trigger hover background.\n * @cssprop [--hx-accordion-icon-color=var(--hx-color-neutral-500)] - Icon color.\n * @cssprop [--hx-accordion-content-padding=0 var(--hx-space-4) var(--hx-space-4)] - Content padding.\n * @cssprop [--hx-accordion-content-color=var(--hx-color-neutral-600)] - Content text color.\n */\n@customElement('hx-accordion-item')\nexport class HelixAccordionItem extends LitElement {\n static override styles = [tokenStyles, helixAccordionItemStyles];\n\n private static _counter = 0;\n private _uid = `hx-accordion-item-${++HelixAccordionItem._counter}`;\n\n /**\n * Whether this item is expanded.\n * @attr expanded\n */\n @property({ type: Boolean, reflect: true })\n expanded = false;\n\n /**\n * Whether this item is disabled (cannot be toggled).\n * @attr disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Heading level (1–6) applied via `role=\"heading\" aria-level` on the summary\n * trigger. Defaults to 3. Set to match the document outline around the\n * accordion so screen readers surface accordion items in the heading list.\n * @attr level\n */\n @property({ type: Number })\n level: 1 | 2 | 3 | 4 | 5 | 6 = 3;\n\n // ─── Heading Level Helper ───\n\n /**\n * Returns a clamped heading level (1–6) for use as `aria-level` on the\n * `<summary>` element. Per the WAI-ARIA APG Accordion pattern, the\n * `<summary>` must be a **direct child** of `<details>` for native\n * disclosure behaviour to work. Instead of wrapping `<summary>` inside\n * an `<h3>` (which breaks the native toggle), we apply\n * `role=\"heading\" aria-level=\"N\"` directly on `<summary>`.\n */\n private get _headingLevel(): number {\n return Math.max(1, Math.min(6, this.level));\n }\n\n // ─── Toggle Logic ───\n\n private _toggle(): void {\n if (this.disabled) return;\n\n const willExpand = !this.expanded;\n this.expanded = willExpand;\n\n this._dispatchToggleEvent(willExpand);\n }\n\n _dispatchToggleEvent(expanded: boolean): void {\n const detail = { expanded, itemId: this.id || '' };\n const options = { bubbles: true, composed: true, detail };\n\n if (expanded) {\n this.dispatchEvent(new CustomEvent('hx-expand', options));\n } else {\n this.dispatchEvent(new CustomEvent('hx-collapse', options));\n }\n }\n\n // ─── Event Handlers ───\n\n private _handleSummaryClick(e: MouseEvent): void {\n e.preventDefault();\n this._toggle();\n }\n\n private _handleKeyDown(e: KeyboardEvent): void {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n this._toggle();\n }\n }\n\n // ─── Render ───\n\n override render() {\n const itemClasses = {\n item: true,\n 'item--expanded': this.expanded,\n 'item--disabled': this.disabled,\n };\n\n return html`\n <details part=\"item\" class=${classMap(itemClasses)} ?open=${this.expanded}>\n <summary\n id=${`${this._uid}-trigger`}\n part=\"trigger\"\n class=\"trigger\"\n role=\"heading\"\n aria-level=${this._headingLevel}\n tabindex=${this.disabled ? '-1' : '0'}\n aria-expanded=${this.expanded ? 'true' : nothing}\n aria-disabled=${this.disabled ? 'true' : nothing}\n aria-controls=${`${this._uid}-content`}\n @click=${this._handleSummaryClick}\n @keydown=${this._handleKeyDown}\n >\n <slot name=\"trigger\"></slot>\n <span part=\"icon\" class=\"icon\">${chevronIcon}</span>\n </summary>\n <div class=\"content-wrapper\">\n <div class=\"content-inner\">\n <div\n id=${`${this._uid}-content`}\n part=\"content\"\n class=\"content\"\n role=\"region\"\n aria-labelledby=${`${this._uid}-trigger`}\n aria-hidden=${this.expanded ? nothing : 'true'}\n >\n <slot></slot>\n </div>\n </div>\n </div>\n </details>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-accordion-item': HelixAccordionItem;\n }\n}\n","import { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { tokenStyles } from '@helixui/tokens/lit';\nimport { helixAccordionStyles } from './hx-accordion.styles.js';\nimport './hx-accordion-item.js';\nimport type { HelixAccordionItem } from './hx-accordion-item.js';\nimport { devWarn } from '../../utils/dev-warn.js';\n\n/**\n * An accordion container that manages collapsible content sections.\n *\n * @summary Collapsible content sections with single or multi-expand modes.\n *\n * @tag hx-accordion\n *\n * @slot - Default slot for hx-accordion-item elements.\n *\n * @csspart accordion - The outer container wrapping all accordion items.\n *\n * @cssprop [--hx-accordion-border-radius=var(--hx-border-radius-md)] - Outer border radius.\n *\n * @example\n * ```html\n * <hx-accordion mode=\"single\">\n * <hx-accordion-item>\n * <span slot=\"trigger\">What is this?</span>\n * <p>Answer content here.</p>\n * </hx-accordion-item>\n * </hx-accordion>\n * ```\n */\n@customElement('hx-accordion')\nexport class HelixAccordion extends LitElement {\n static override styles = [tokenStyles, helixAccordionStyles];\n\n /**\n * Expansion mode: 'single' collapses all other items when one expands.\n * 'multi' allows multiple items open simultaneously.\n * @attr mode\n */\n @property({ type: String, reflect: true })\n mode: 'single' | 'multi' = 'single';\n\n // ─── Lifecycle ───\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('hx-expand', this._handleChildExpand);\n this.addEventListener('keydown', this._handleKeyDown);\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('hx-expand', this._handleChildExpand);\n this.removeEventListener('keydown', this._handleKeyDown);\n }\n\n protected override firstUpdated(): void {\n this._enforceSingleMode();\n }\n\n // ─── Single-expand coordination ───\n\n private _enforceSingleMode(): void {\n if (this.mode !== 'single') return;\n\n const items = this.querySelectorAll<HelixAccordionItem>('hx-accordion-item');\n let foundExpanded = false;\n\n items.forEach((item) => {\n if (item.expanded) {\n if (foundExpanded) {\n item.expanded = false;\n } else {\n foundExpanded = true;\n }\n }\n });\n }\n\n /**\n * Handles expand events from child accordion items to enforce single-expand mode.\n * @internal\n */\n private _handleChildExpand = (e: Event): void => {\n if (this.mode !== 'single') return;\n\n const expandedItem = e.composedPath()[0] as HelixAccordionItem;\n const items = this.querySelectorAll<HelixAccordionItem>('hx-accordion-item');\n\n items.forEach((item) => {\n if (item !== expandedItem && item.expanded) {\n item.expanded = false;\n item._dispatchToggleEvent(false);\n }\n });\n };\n\n // ─── Arrow key navigation (ARIA APG Accordion pattern) ───\n\n /**\n * Handles keyboard navigation between accordion triggers using arrow, Home, and End keys.\n * @internal\n */\n private _handleKeyDown = (e: KeyboardEvent): void => {\n const triggers = this._getTriggers();\n if (triggers.length === 0) return;\n\n const activeEl = this.shadowRoot?.activeElement ?? document.activeElement;\n let currentItem: HelixAccordionItem | null = null;\n\n const items = Array.from(this.querySelectorAll<HelixAccordionItem>('hx-accordion-item'));\n for (const item of items) {\n const summary = item.shadowRoot?.querySelector('[part=\"trigger\"]');\n if (summary === activeEl || item.shadowRoot?.activeElement === summary) {\n currentItem = item;\n break;\n }\n }\n\n if (!currentItem) return;\n\n const enabledItems = items.filter((item) => !item.disabled);\n const currentIndex = enabledItems.indexOf(currentItem);\n if (currentIndex === -1) return;\n\n let targetIndex = -1;\n\n switch (e.key) {\n case 'ArrowDown':\n targetIndex = (currentIndex + 1) % enabledItems.length;\n break;\n case 'ArrowUp':\n targetIndex = (currentIndex - 1 + enabledItems.length) % enabledItems.length;\n break;\n case 'Home':\n targetIndex = 0;\n break;\n case 'End':\n targetIndex = enabledItems.length - 1;\n break;\n default:\n return;\n }\n\n e.preventDefault();\n const targetItem = enabledItems[targetIndex];\n const targetSummary = targetItem?.shadowRoot?.querySelector<HTMLElement>('[part=\"trigger\"]');\n targetSummary?.focus();\n };\n\n private _getTriggers(): HTMLElement[] {\n const items = this.querySelectorAll<HelixAccordionItem>('hx-accordion-item');\n const triggers: HTMLElement[] = [];\n items.forEach((item) => {\n const summary = item.shadowRoot?.querySelector<HTMLElement>('[part=\"trigger\"]');\n if (summary) triggers.push(summary);\n });\n return triggers;\n }\n\n // ─── Slot validation ───\n\n private _handleSlotChange(e: Event): void {\n const slot = e.target;\n if (!(slot instanceof HTMLSlotElement)) return;\n const invalid = slot\n .assignedElements()\n .filter((el) => el.tagName.toLowerCase() !== 'hx-accordion-item');\n if (invalid.length > 0) {\n devWarn(\n 'hx-accordion',\n `Default slot expects <hx-accordion-item> elements. Found unexpected: ${invalid.map((el) => `<${el.tagName.toLowerCase()}>`).join(', ')}`,\n );\n }\n }\n\n // ─── Render ───\n\n override render() {\n return html`\n <div part=\"accordion\" class=\"accordion\">\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-accordion': HelixAccordion;\n }\n}\n"],"names":["helixAccordionStyles","css","helixAccordionItemStyles","chevronIcon","svg","HelixAccordionItem","LitElement","willExpand","expanded","options","itemClasses","html","classMap","nothing","tokenStyles","__decorateClass","property","customElement","HelixAccordion","expandedItem","item","activeEl","_a","currentItem","items","summary","_b","_c","enabledItems","currentIndex","targetIndex","targetItem","targetSummary","_d","foundExpanded","triggers","slot","invalid","el","devWarn"],"mappings":";;;;;AAEO,MAAMA,IAAuBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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ACJ,MAAS;AACtB,MAAIA,EAAK,aACHc,IACFd,EAAK,WAAW,KAEhBc,IAAgB;AAAA,IAGtB,CAAC;AAAA,EACH;AAAA,EAyEQ,eAA8B;AACpC,UAAMV,IAAQ,KAAK,iBAAqC,mBAAmB,GACrEW,IAA0B,CAAA;AAChC,WAAAX,EAAM,QAAQ,CAACJ,MAAS;;AACtB,YAAMK,KAAUH,IAAAF,EAAK,eAAL,gBAAAE,EAAiB,cAA2B;AAC5D,MAAIG,KAASU,EAAS,KAAKV,CAAO;AAAA,IACpC,CAAC,GACMU;AAAA,EACT;AAAA;AAAA,EAIQ,kBAAkB,GAAgB;AACxC,UAAMC,IAAO,EAAE;AACf,QAAI,EAAEA,aAAgB,iBAAkB;AACxC,UAAMC,IAAUD,EACb,iBAAA,EACA,OAAO,CAACE,MAAOA,EAAG,QAAQ,YAAA,MAAkB,mBAAmB;AAClE,IAAID,EAAQ,SAAS,KACnBE;AAAA,MACE;AAAA,MACA,wEAAwEF,EAAQ,IAAI,CAACC,MAAO,IAAIA,EAAG,QAAQ,YAAA,CAAa,GAAG,EAAE,KAAK,IAAI,CAAC;AAAA,IAAA;AAAA,EAG7I;AAAA;AAAA,EAIS,SAAS;AAChB,WAAO3B;AAAA;AAAA,4BAEiB,KAAK,iBAAiB;AAAA;AAAA;AAAA,EAGhD;AACF;AA1JaO,EACK,SAAS,CAACJ,GAAad,CAAoB;AAQ3De,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAR9BE,EASX,WAAA,QAAA,CAAA;AATWA,IAANH,EAAA;AAAA,EADNE,EAAc,cAAc;AAAA,GAChBC,CAAA;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { css as v, LitElement as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as v, LitElement as p, html as i, nothing as d } from "lit";
|
|
2
|
+
import { property as n, state as u, customElement as f } from "lit/decorators.js";
|
|
3
3
|
import { classMap as x } from "lit/directives/class-map.js";
|
|
4
4
|
import { tokenStyles as g } from "@helixui/tokens/lit";
|
|
5
5
|
const b = v`
|
|
@@ -11,6 +11,23 @@ const b = v`
|
|
|
11
11
|
display: none;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
/* ─── Screen-reader-only announcement region ─── */
|
|
15
|
+
/* Always present in DOM so AT registers it before content is injected. */
|
|
16
|
+
/* Visually hidden via clip-path technique (superior to display:none which */
|
|
17
|
+
/* removes the element from the AT tree entirely). */
|
|
18
|
+
|
|
19
|
+
.sr-only {
|
|
20
|
+
position: absolute;
|
|
21
|
+
width: 1px;
|
|
22
|
+
height: 1px;
|
|
23
|
+
padding: 0;
|
|
24
|
+
margin: -1px;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
clip: rect(0, 0, 0, 0);
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
border: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
14
31
|
* {
|
|
15
32
|
box-sizing: border-box;
|
|
16
33
|
}
|
|
@@ -43,6 +60,23 @@ const b = v`
|
|
|
43
60
|
border-radius: 0;
|
|
44
61
|
}
|
|
45
62
|
|
|
63
|
+
/* ─── Severity Label (WCAG 1.4.1) ─── */
|
|
64
|
+
/* Visually hidden — provides a non-color cue for screen readers and users */
|
|
65
|
+
/* who cannot distinguish variants by color alone (e.g. color-blind users). */
|
|
66
|
+
/* Always present regardless of showIcon so severity is never color-only. */
|
|
67
|
+
|
|
68
|
+
.alert__severity-label {
|
|
69
|
+
position: absolute;
|
|
70
|
+
width: 1px;
|
|
71
|
+
height: 1px;
|
|
72
|
+
padding: 0;
|
|
73
|
+
margin: -1px;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
clip: rect(0, 0, 0, 0);
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
border: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
46
80
|
/* ─── Icon ─── */
|
|
47
81
|
|
|
48
82
|
.alert__icon {
|
|
@@ -175,19 +209,19 @@ const b = v`
|
|
|
175
209
|
--hx-alert-icon-color: var(--hx-color-error-500, #ef4444);
|
|
176
210
|
}
|
|
177
211
|
`;
|
|
178
|
-
var m = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, a = (e, t,
|
|
179
|
-
for (var
|
|
180
|
-
(
|
|
181
|
-
return
|
|
212
|
+
var m = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, a = (e, t, s, h) => {
|
|
213
|
+
for (var o = h > 1 ? void 0 : h ? _(t, s) : t, l = e.length - 1, c; l >= 0; l--)
|
|
214
|
+
(c = e[l]) && (o = (h ? c(t, s, o) : c(o)) || o);
|
|
215
|
+
return h && o && m(t, s, o), o;
|
|
182
216
|
};
|
|
183
|
-
let r = class extends
|
|
217
|
+
let r = class extends p {
|
|
184
218
|
constructor() {
|
|
185
|
-
super(...arguments), this.variant = "info", this.dismissible = !1, this.open = !1, this.showIcon = !1, this.accent = !1, this.returnFocusTo = null, this._hasActions = !1, this._hasTitle = !1, this._actionsSlotChangeHandler = null, this._titleSlotChangeHandler = null;
|
|
219
|
+
super(...arguments), this.variant = "info", this.dismissible = !1, this.heading = "", this.open = !1, this.showIcon = !1, this.accent = !1, this.returnFocusTo = null, this._hasActions = !1, this._hasTitle = !1, this._actionsSlotChangeHandler = null, this._titleSlotChangeHandler = null;
|
|
186
220
|
}
|
|
187
221
|
// ─── Private Helpers ───
|
|
188
222
|
/** Returns true when the variant requires assertive announcement. */
|
|
189
223
|
get _isAssertive() {
|
|
190
|
-
return this.variant === "error"
|
|
224
|
+
return this.variant === "error";
|
|
191
225
|
}
|
|
192
226
|
/**
|
|
193
227
|
* Returns the appropriate ARIA role based on variant.
|
|
@@ -219,32 +253,51 @@ let r = class extends f {
|
|
|
219
253
|
}, t.addEventListener("slotchange", this._titleSlotChangeHandler));
|
|
220
254
|
}
|
|
221
255
|
updated(e) {
|
|
222
|
-
super.updated(e), e.has("variant") && this.setAttribute("role", this._role), e.has("open")
|
|
256
|
+
if (super.updated(e), e.has("variant") && this.setAttribute("role", this._role), e.has("open"))
|
|
257
|
+
if (this.open)
|
|
258
|
+
this.removeAttribute("aria-hidden"), e.get("open") === !1 && Promise.resolve().then(() => {
|
|
259
|
+
const s = this.renderRoot.querySelector(".sr-only");
|
|
260
|
+
s && (s.textContent = "", Promise.resolve().then(() => {
|
|
261
|
+
var c;
|
|
262
|
+
const o = {
|
|
263
|
+
info: "Info:",
|
|
264
|
+
success: "Success:",
|
|
265
|
+
warning: "Warning:",
|
|
266
|
+
error: "Error:"
|
|
267
|
+
}[this.variant] ?? "", l = ((c = this.textContent) == null ? void 0 : c.trim()) ?? "";
|
|
268
|
+
s.textContent = o ? `${o} ${l}` : l;
|
|
269
|
+
}));
|
|
270
|
+
});
|
|
271
|
+
else {
|
|
272
|
+
this.setAttribute("aria-hidden", "true");
|
|
273
|
+
const t = this.renderRoot.querySelector(".sr-only");
|
|
274
|
+
t && (t.textContent = "");
|
|
275
|
+
}
|
|
223
276
|
}
|
|
224
277
|
// ─── Default Icons ───
|
|
225
278
|
_renderInfoIcon() {
|
|
226
|
-
return
|
|
279
|
+
return i`<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
227
280
|
<path
|
|
228
281
|
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"
|
|
229
282
|
/>
|
|
230
283
|
</svg>`;
|
|
231
284
|
}
|
|
232
285
|
_renderSuccessIcon() {
|
|
233
|
-
return
|
|
286
|
+
return i`<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
234
287
|
<path
|
|
235
288
|
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"
|
|
236
289
|
/>
|
|
237
290
|
</svg>`;
|
|
238
291
|
}
|
|
239
292
|
_renderWarningIcon() {
|
|
240
|
-
return
|
|
293
|
+
return i`<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
241
294
|
<path
|
|
242
295
|
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"
|
|
243
296
|
/>
|
|
244
297
|
</svg>`;
|
|
245
298
|
}
|
|
246
299
|
_renderErrorIcon() {
|
|
247
|
-
return
|
|
300
|
+
return i`<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
248
301
|
<path
|
|
249
302
|
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"
|
|
250
303
|
/>
|
|
@@ -264,7 +317,7 @@ let r = class extends f {
|
|
|
264
317
|
}
|
|
265
318
|
}
|
|
266
319
|
_renderCloseIcon() {
|
|
267
|
-
return
|
|
320
|
+
return i`<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
268
321
|
<path
|
|
269
322
|
d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
|
|
270
323
|
/>
|
|
@@ -294,10 +347,21 @@ let r = class extends f {
|
|
|
294
347
|
alert: !0,
|
|
295
348
|
[`alert--${this.variant}`]: !0,
|
|
296
349
|
"alert--accent": this.accent
|
|
297
|
-
}
|
|
298
|
-
|
|
350
|
+
}, s = {
|
|
351
|
+
info: "Info:",
|
|
352
|
+
success: "Success:",
|
|
353
|
+
warning: "Warning:",
|
|
354
|
+
error: "Error:"
|
|
355
|
+
}[this.variant] ?? "";
|
|
356
|
+
return i`
|
|
357
|
+
<div
|
|
358
|
+
class="sr-only"
|
|
359
|
+
aria-live=${this._isAssertive ? "assertive" : "polite"}
|
|
360
|
+
aria-atomic="true"
|
|
361
|
+
></div>
|
|
299
362
|
<div part="alert" class=${x(e)}>
|
|
300
|
-
|
|
363
|
+
<span class="alert__severity-label">${s}</span>
|
|
364
|
+
${this.showIcon ? i`
|
|
301
365
|
<div part="icon" class="alert__icon">
|
|
302
366
|
<slot name="icon">${this._renderDefaultIcon()}</slot>
|
|
303
367
|
</div>
|
|
@@ -316,11 +380,11 @@ let r = class extends f {
|
|
|
316
380
|
</div>
|
|
317
381
|
</div>
|
|
318
382
|
|
|
319
|
-
${this.dismissible ?
|
|
383
|
+
${this.dismissible ? i`
|
|
320
384
|
<button
|
|
321
385
|
part="close-button"
|
|
322
386
|
class="alert__close-button"
|
|
323
|
-
aria-label
|
|
387
|
+
aria-label=${`Close ${this.heading ? `${this.heading} ` : ""}alert`}
|
|
324
388
|
@click=${this._handleDismiss}
|
|
325
389
|
>
|
|
326
390
|
${this._renderCloseIcon()}
|
|
@@ -332,22 +396,25 @@ let r = class extends f {
|
|
|
332
396
|
};
|
|
333
397
|
r.styles = [g, b];
|
|
334
398
|
a([
|
|
335
|
-
|
|
399
|
+
n({ type: String, reflect: !0 })
|
|
336
400
|
], r.prototype, "variant", 2);
|
|
337
401
|
a([
|
|
338
|
-
|
|
402
|
+
n({ type: Boolean, reflect: !0 })
|
|
339
403
|
], r.prototype, "dismissible", 2);
|
|
340
404
|
a([
|
|
341
|
-
|
|
405
|
+
n({ type: String })
|
|
406
|
+
], r.prototype, "heading", 2);
|
|
407
|
+
a([
|
|
408
|
+
n({ type: Boolean, reflect: !0 })
|
|
342
409
|
], r.prototype, "open", 2);
|
|
343
410
|
a([
|
|
344
|
-
|
|
411
|
+
n({ type: Boolean, reflect: !0, attribute: "show-icon" })
|
|
345
412
|
], r.prototype, "showIcon", 2);
|
|
346
413
|
a([
|
|
347
|
-
|
|
414
|
+
n({ type: Boolean, reflect: !0 })
|
|
348
415
|
], r.prototype, "accent", 2);
|
|
349
416
|
a([
|
|
350
|
-
|
|
417
|
+
n({ type: String, attribute: "return-focus-to" })
|
|
351
418
|
], r.prototype, "returnFocusTo", 2);
|
|
352
419
|
a([
|
|
353
420
|
u()
|
|
@@ -356,9 +423,9 @@ a([
|
|
|
356
423
|
u()
|
|
357
424
|
], r.prototype, "_hasTitle", 2);
|
|
358
425
|
r = a([
|
|
359
|
-
|
|
426
|
+
f("hx-alert")
|
|
360
427
|
], r);
|
|
361
428
|
export {
|
|
362
429
|
r as H
|
|
363
430
|
};
|
|
364
|
-
//# sourceMappingURL=hx-alert-
|
|
431
|
+
//# sourceMappingURL=hx-alert-D6uok29t.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-alert-D6uok29t.js","sources":["../../src/components/hx-alert/hx-alert.styles.ts","../../src/components/hx-alert/hx-alert.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixAlertStyles = css`\n :host {\n display: block;\n }\n\n :host(:not([open])) {\n display: none;\n }\n\n /* ─── Screen-reader-only announcement region ─── */\n /* Always present in DOM so AT registers it before content is injected. */\n /* Visually hidden via clip-path technique (superior to display:none which */\n /* removes the element from the AT tree entirely). */\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n\n * {\n box-sizing: border-box;\n }\n\n /* ─── Alert Container ─── */\n\n .alert {\n display: flex;\n align-items: flex-start;\n gap: var(--hx-alert-gap, var(--hx-space-3, 0.75rem));\n padding: var(--hx-alert-padding, var(--hx-space-4, 1rem));\n border: var(--hx-alert-border-width, var(--hx-border-width-thin, 1px)) solid\n var(--hx-alert-border-color, var(--hx-color-info-200, #b3d9ef));\n border-radius: var(--hx-alert-border-radius, var(--hx-border-radius-md, 0.375rem));\n background-color: var(--hx-alert-bg, var(--hx-color-info-50, #e8f4fd));\n color: var(--hx-alert-color, var(--hx-color-info-800, #1a3a4a));\n font-family: var(--hx-alert-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 }\n\n /* ─── Accent Variant (left border stripe) ─── */\n /* Removes full border and replaces with a left-side accent stripe. */\n /* Common healthcare/enterprise dashboard pattern for dense information UIs. */\n\n .alert--accent {\n border-width: 0;\n border-left: var(--hx-alert-accent-width, 4px) solid\n var(--hx-alert-border-color, var(--hx-color-info-200, #b3d9ef));\n border-radius: 0;\n }\n\n /* ─── Severity Label (WCAG 1.4.1) ─── */\n /* Visually hidden — provides a non-color cue for screen readers and users */\n /* who cannot distinguish variants by color alone (e.g. color-blind users). */\n /* Always present regardless of showIcon so severity is never color-only. */\n\n .alert__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 .alert__icon {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n color: var(--hx-alert-icon-color, var(--hx-color-info-500, #3b82f6));\n }\n\n .alert__icon svg {\n width: var(--hx-space-5, 1.25rem);\n height: var(--hx-space-5, 1.25rem);\n fill: currentColor;\n }\n\n /* ─── Title ─── */\n\n .alert__title {\n display: none;\n font-weight: var(--hx-font-weight-semibold, 600);\n margin-bottom: var(--hx-space-1, 0.25rem);\n }\n\n .alert__title--visible {\n display: block;\n }\n\n /* ─── Message ─── */\n\n .alert__message {\n flex: 1;\n min-width: 0;\n }\n\n /* ─── Actions ─── */\n /* Hidden by default; shown via JS slotchange detection to avoid invisible */\n /* margin-top spacing when no actions are slotted. */\n\n .alert__actions {\n display: none;\n align-items: center;\n gap: var(--hx-space-2, 0.5rem);\n margin-top: var(--hx-space-2, 0.5rem);\n }\n\n .alert__actions--visible {\n display: flex;\n }\n\n /* ─── Close Button ─── */\n /* Minimum 44px touch target per WCAG 2.5.8 (Target Size Minimum, AA) and */\n /* Apple HIG / Google Material guidelines. Uses absolute px units to ensure */\n /* the target size is independent of the consumer's base font size. */\n\n .alert__close-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n min-width: var(--hx-touch-target-size, 44px);\n min-height: var(--hx-touch-target-size, 44px);\n margin-left: auto;\n padding: 0;\n border: none;\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n background: transparent;\n color: var(--hx-alert-color, var(--hx-color-info-800, #1a3a4a));\n cursor: pointer;\n font-size: var(--hx-font-size-md, 1rem);\n line-height: 1;\n transition:\n background-color var(--hx-transition-fast, 150ms ease),\n opacity var(--hx-transition-fast, 150ms ease);\n opacity: 0.7;\n }\n\n .alert__close-button:hover {\n opacity: 1;\n /* color-mix() is supported in Chrome 111+, Firefox 113+, Safari 16.2+. */\n /* Falls back to transparent (no hover background) in older environments. */\n background-color: color-mix(in srgb, currentColor 10%, transparent);\n }\n\n .alert__close-button:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid var(--hx-focus-ring-color, #2563eb);\n outline-offset: var(--hx-focus-ring-offset, 2px);\n opacity: 1;\n }\n\n .alert__close-button svg {\n width: var(--hx-space-4, 1rem);\n height: var(--hx-space-4, 1rem);\n fill: currentColor;\n }\n\n /* ─── Variant: info ─── */\n\n :host([variant='info']) .alert,\n :host(:not([variant])) .alert {\n --hx-alert-bg: var(--hx-color-info-50, #e8f4fd);\n --hx-alert-border-color: var(--hx-color-info-200, #b3d9ef);\n --hx-alert-color: var(--hx-color-info-800, #1a3a4a);\n --hx-alert-icon-color: var(--hx-color-info-500, #3b82f6);\n }\n\n /* ─── Variant: success ─── */\n\n :host([variant='success']) .alert {\n --hx-alert-bg: var(--hx-color-success-50, #ecfdf5);\n --hx-alert-border-color: var(--hx-color-success-200, #a7f3d0);\n --hx-alert-color: var(--hx-color-success-800, #065f46);\n --hx-alert-icon-color: var(--hx-color-success-500, #10b981);\n }\n\n /* ─── Variant: warning ─── */\n\n :host([variant='warning']) .alert {\n --hx-alert-bg: var(--hx-color-warning-50, #fffbeb);\n --hx-alert-border-color: var(--hx-color-warning-200, #fde68a);\n --hx-alert-color: var(--hx-color-warning-800, #92400e);\n --hx-alert-icon-color: var(--hx-color-warning-500, #f59e0b);\n }\n\n /* ─── Variant: error ─── */\n\n :host([variant='error']) .alert {\n --hx-alert-bg: var(--hx-color-error-50, #fef2f2);\n --hx-alert-border-color: var(--hx-color-error-200, #fecaca);\n --hx-alert-color: var(--hx-color-error-800, #991b1b);\n --hx-alert-icon-color: var(--hx-color-error-500, #ef4444);\n }\n`;\n","import { LitElement, html, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { tokenStyles } from '@helixui/tokens/lit';\nimport { helixAlertStyles } from './hx-alert.styles.js';\n\n/** Alert variant determines visual styling and ARIA semantics. */\nexport type AlertVariant = 'info' | 'success' | 'warning' | 'error';\n\n/**\n * A feedback component for communicating status messages, warnings, and errors.\n * Critical for healthcare patient safety alerts.\n *\n * @summary Feedback alert for status messages with variant-based styling and ARIA live regions.\n *\n * @tag hx-alert\n *\n * @slot - Default slot for alert message content.\n * @slot title - Optional title/headline for the alert.\n * @slot icon - Custom icon to override the default variant icon.\n * @slot actions - Action buttons rendered within the alert.\n *\n * @attr {string} heading - Text used to build the close button's contextual aria-label\n * (e.g., \"Close Low blood pressure alert\"). When absent the label falls back to \"Close alert\".\n *\n * @fires {CustomEvent<{reason: string}>} hx-close - Dispatched when the user dismisses the alert.\n * @fires {CustomEvent} hx-after-close - Dispatched after the alert is dismissed.\n *\n * @csspart alert - The outer alert container.\n * @csspart title - The title/headline container.\n * @csspart icon - The icon container.\n * @csspart message - The message content area.\n * @csspart close-button - The dismiss button (only rendered when dismissible).\n * @csspart actions - The actions container.\n *\n * @cssprop [--hx-alert-bg=var(--hx-color-info-50)] - Alert background color.\n * @cssprop [--hx-alert-color=var(--hx-color-info-800)] - Alert text color.\n * @cssprop [--hx-alert-border-color=var(--hx-color-info-200)] - Alert border color.\n * @cssprop [--hx-alert-border-radius=var(--hx-border-radius-md)] - Alert border radius.\n * @cssprop [--hx-alert-border-width=var(--hx-border-width-thin)] - Alert border width.\n * @cssprop [--hx-alert-padding=var(--hx-space-4)] - Alert padding.\n * @cssprop [--hx-alert-gap=var(--hx-space-3)] - Gap between alert elements.\n * @cssprop [--hx-alert-icon-color=var(--hx-color-info-500)] - Alert icon color.\n * @cssprop [--hx-alert-font-family=var(--hx-font-family-sans)] - Alert font family.\n * @cssprop [--hx-touch-target-size=44px] - Minimum touch target size for the close button.\n * @cssprop [--hx-alert-accent-width=4px] - Width of the left border accent stripe.\n */\n@customElement('hx-alert')\nexport class HelixAlert extends LitElement {\n static override styles = [tokenStyles, helixAlertStyles];\n\n // ─── Properties ───\n\n /**\n * Visual variant of the alert that determines colors and ARIA semantics.\n * @attr variant\n */\n @property({ type: String, reflect: true })\n variant: AlertVariant = 'info';\n\n /**\n * Whether the alert can be dismissed by the user.\n * @attr dismissible\n */\n @property({ type: Boolean, reflect: true })\n dismissible = false;\n\n /**\n * Optional heading text that provides context for the close button's accessible label.\n * When provided, the close button is announced as \"Close [heading] alert\".\n * When absent, the close button falls back to \"Close alert\".\n * @attr heading\n */\n @property({ type: String })\n heading = '';\n\n /**\n * Whether the alert is visible. Add the `open` attribute to show the alert.\n * @attr open\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Whether to show the default variant icon. Add `show-icon` attribute to display the icon.\n * @attr show-icon\n */\n @property({ type: Boolean, reflect: true, attribute: 'show-icon' })\n showIcon = false;\n\n /**\n * When true, applies a left border accent stripe instead of a full border.\n * Common healthcare/enterprise dashboard pattern for visual distinction of alert types.\n * @attr accent\n */\n @property({ type: Boolean, reflect: true })\n accent = false;\n\n /**\n * CSS selector for the element to return focus to after the alert is dismissed.\n * When set, the component will find and focus the matching element after dismissal.\n * If not set, focus management is the caller's responsibility via the hx-after-close event.\n * @attr return-focus-to\n */\n @property({ type: String, attribute: 'return-focus-to' })\n returnFocusTo: string | null = null;\n\n // ─── State ───\n\n @state()\n private _hasActions = false;\n\n @state()\n private _hasTitle = false;\n\n // ─── Private Handler References ───\n\n private _actionsSlotChangeHandler: (() => void) | null = null;\n private _titleSlotChangeHandler: (() => void) | null = null;\n\n // ─── Private Helpers ───\n\n /** Returns true when the variant requires assertive announcement. */\n private get _isAssertive(): boolean {\n return this.variant === 'error';\n }\n\n /**\n * Returns the appropriate ARIA role based on variant.\n * role=\"alert\" implies aria-live=\"assertive\"; role=\"status\" implies aria-live=\"polite\".\n * We do NOT set aria-live explicitly to avoid double-announcements in JAWS.\n */\n private get _role(): string {\n return this._isAssertive ? 'alert' : 'status';\n }\n\n // ─── Lifecycle ───\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Apply ARIA role to the host element for reliable screen reader support across\n // Shadow DOM boundaries. Placing role on a shadow-internal element has inconsistent\n // AT support in JAWS+Chrome and VoiceOver+Safari combinations (particularly pre-2024).\n this.setAttribute('role', this._role);\n if (!this.open) {\n this.setAttribute('aria-hidden', 'true');\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n const actionsSlot = this.renderRoot.querySelector<HTMLSlotElement>('slot[name=\"actions\"]');\n if (actionsSlot && this._actionsSlotChangeHandler) {\n actionsSlot.removeEventListener('slotchange', this._actionsSlotChangeHandler);\n }\n const titleSlot = this.renderRoot.querySelector<HTMLSlotElement>('slot[name=\"title\"]');\n if (titleSlot && this._titleSlotChangeHandler) {\n titleSlot.removeEventListener('slotchange', this._titleSlotChangeHandler);\n }\n }\n\n override firstUpdated(): void {\n // Track actions slot content to avoid invisible spacing when no actions are slotted.\n const actionsSlot = this.renderRoot.querySelector<HTMLSlotElement>('slot[name=\"actions\"]');\n if (actionsSlot) {\n this._actionsSlotChangeHandler = () => {\n this._hasActions = actionsSlot.assignedNodes({ flatten: true }).length > 0;\n };\n actionsSlot.addEventListener('slotchange', this._actionsSlotChangeHandler);\n }\n\n // Track title slot content so the title container doesn't create dead space when empty.\n const titleSlot = this.renderRoot.querySelector<HTMLSlotElement>('slot[name=\"title\"]');\n if (titleSlot) {\n this._titleSlotChangeHandler = () => {\n this._hasTitle = titleSlot.assignedNodes({ flatten: true }).length > 0;\n };\n titleSlot.addEventListener('slotchange', this._titleSlotChangeHandler);\n }\n }\n\n protected override updated(changedProperties: Map<PropertyKey, unknown>): void {\n super.updated(changedProperties);\n if (changedProperties.has('variant')) {\n // Keep host ARIA role in sync with variant (assertive vs. polite).\n this.setAttribute('role', this._role);\n }\n if (changedProperties.has('open')) {\n // Manage aria-hidden in addition to display:none for reliable AT exclusion.\n // When open transitions from false→true, removing aria-hidden signals to AT\n // that the live region content should be announced.\n if (this.open) {\n this.removeAttribute('aria-hidden');\n // Trigger announcement via the sr-only polite live region for ATs (JAWS+Chrome,\n // NVDA) that do not re-announce existing content when aria-hidden is merely removed.\n // We inject text after a microtask so the DOM has settled and the live region\n // is registered by the AT before content arrives.\n const previousOpen = changedProperties.get('open');\n if (previousOpen === false) {\n Promise.resolve().then(() => {\n const announcer = this.renderRoot.querySelector<HTMLElement>('.sr-only');\n if (announcer) {\n announcer.textContent = '';\n // Second microtask ensures the clear is processed before re-injection,\n // guaranteeing the AT sees a content change rather than no-op.\n Promise.resolve().then(() => {\n const severityLabels: Record<string, string> = {\n info: 'Info:',\n success: 'Success:',\n warning: 'Warning:',\n error: 'Error:',\n };\n const prefix = severityLabels[this.variant] ?? '';\n const message = this.textContent?.trim() ?? '';\n announcer.textContent = prefix ? `${prefix} ${message}` : message;\n });\n }\n });\n }\n } else {\n this.setAttribute('aria-hidden', 'true');\n // Clear the announcer when hidden so stale text is not re-read on next open.\n const announcer = this.renderRoot.querySelector<HTMLElement>('.sr-only');\n if (announcer) {\n announcer.textContent = '';\n }\n }\n }\n }\n\n // ─── Default Icons ───\n\n private _renderInfoIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n <path\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 private _renderSuccessIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n <path\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 private _renderWarningIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n <path\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 private _renderErrorIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n <path\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 private _renderDefaultIcon() {\n switch (this.variant) {\n case 'success':\n return this._renderSuccessIcon();\n case 'warning':\n return this._renderWarningIcon();\n case 'error':\n return this._renderErrorIcon();\n case 'info':\n default:\n return this._renderInfoIcon();\n }\n }\n\n private _renderCloseIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n <path\n d=\"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z\"\n />\n </svg>`;\n }\n\n // ─── Event Handling ───\n\n private _handleDismiss(): void {\n this.open = false;\n\n /**\n * Dispatched when the user dismisses the alert.\n * @event hx-close\n */\n this.dispatchEvent(\n new CustomEvent('hx-close', {\n bubbles: true,\n composed: true,\n detail: { reason: 'user' },\n }),\n );\n\n /**\n * Dispatched after the alert is dismissed.\n * @event hx-after-close\n */\n this.dispatchEvent(\n new CustomEvent('hx-after-close', {\n bubbles: true,\n composed: true,\n }),\n );\n\n // Return focus to a designated element if specified via returnFocusTo.\n if (this.returnFocusTo) {\n const target = document.querySelector(this.returnFocusTo);\n if (target instanceof HTMLElement) {\n target.focus();\n }\n }\n }\n\n // ─── Render ───\n\n override render() {\n const classes = {\n alert: true,\n [`alert--${this.variant}`]: true,\n 'alert--accent': this.accent,\n };\n\n // WCAG 1.4.1: Always render a visually-hidden severity label so the variant\n // is never conveyed by color alone, regardless of whether showIcon is set.\n const SEVERITY_LABELS: Record<string, string> = {\n info: 'Info:',\n success: 'Success:',\n warning: 'Warning:',\n error: 'Error:',\n };\n const severityLabel = SEVERITY_LABELS[this.variant] ?? '';\n\n return html`\n <div\n class=\"sr-only\"\n aria-live=${this._isAssertive ? 'assertive' : 'polite'}\n aria-atomic=\"true\"\n ></div>\n <div part=\"alert\" class=${classMap(classes)}>\n <span class=\"alert__severity-label\">${severityLabel}</span>\n ${this.showIcon\n ? html`\n <div part=\"icon\" class=\"alert__icon\">\n <slot name=\"icon\">${this._renderDefaultIcon()}</slot>\n </div>\n `\n : nothing}\n\n <div part=\"message\" class=\"alert__message\">\n <div part=\"title\" class=\"alert__title ${this._hasTitle ? 'alert__title--visible' : ''}\">\n <slot name=\"title\"></slot>\n </div>\n <slot></slot>\n <div\n part=\"actions\"\n class=\"alert__actions ${this._hasActions ? 'alert__actions--visible' : ''}\"\n >\n <slot name=\"actions\"></slot>\n </div>\n </div>\n\n ${this.dismissible\n ? html`\n <button\n part=\"close-button\"\n class=\"alert__close-button\"\n aria-label=${`Close ${this.heading ? `${this.heading} ` : ''}alert`}\n @click=${this._handleDismiss}\n >\n ${this._renderCloseIcon()}\n </button>\n `\n : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-alert': HelixAlert;\n }\n}\n\nexport type { HelixAlert as HxAlert };\n"],"names":["helixAlertStyles","css","HelixAlert","LitElement","actionsSlot","titleSlot","changedProperties","announcer","prefix","message","_a","html","target","classes","severityLabel","classMap","nothing","tokenStyles","__decorateClass","property","state","customElement"],"mappings":";;;;AAEO,MAAMA,IAAmBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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