@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,7 +1,7 @@
|
|
|
1
|
-
import { css as f, LitElement as
|
|
2
|
-
import { query as
|
|
1
|
+
import { css as f, LitElement as m, nothing as s, html as h } from "lit";
|
|
2
|
+
import { query as _, state as b, property as c, customElement as x } from "lit/decorators.js";
|
|
3
3
|
import { tokenStyles as y } from "@helixui/tokens/lit";
|
|
4
|
-
import { l as k, u } from "./body-scroll-lock-VBa5TFP-.js";
|
|
4
|
+
import { l as k, u as p } from "./body-scroll-lock-VBa5TFP-.js";
|
|
5
5
|
const E = f`
|
|
6
6
|
:host {
|
|
7
7
|
display: contents;
|
|
@@ -116,8 +116,11 @@ const E = f`
|
|
|
116
116
|
align-items: center;
|
|
117
117
|
justify-content: center;
|
|
118
118
|
flex-shrink: 0;
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
/* WCAG 2.5.5 (healthcare mandate): minimum 44x44px touch target */
|
|
120
|
+
min-width: var(--hx-touch-target-min, 2.75rem);
|
|
121
|
+
min-height: var(--hx-touch-target-min, 2.75rem);
|
|
122
|
+
width: var(--hx-touch-target-min, 2.75rem);
|
|
123
|
+
height: var(--hx-touch-target-min, 2.75rem);
|
|
121
124
|
padding: 0;
|
|
122
125
|
margin-left: auto;
|
|
123
126
|
background: transparent;
|
|
@@ -142,8 +145,12 @@ const E = f`
|
|
|
142
145
|
}
|
|
143
146
|
|
|
144
147
|
.dialog__close-btn:focus-visible {
|
|
145
|
-
outline:
|
|
146
|
-
|
|
148
|
+
outline: var(--hx-focus-ring-width, 2px) solid
|
|
149
|
+
var(
|
|
150
|
+
--hx-dialog-close-btn-focus-ring-color,
|
|
151
|
+
var(--hx-focus-ring-color, var(--hx-color-primary-500))
|
|
152
|
+
);
|
|
153
|
+
outline-offset: var(--hx-focus-ring-offset, 2px);
|
|
147
154
|
}
|
|
148
155
|
|
|
149
156
|
/* ─── Body ─── */
|
|
@@ -182,12 +189,12 @@ const E = f`
|
|
|
182
189
|
border: 0;
|
|
183
190
|
}
|
|
184
191
|
`;
|
|
185
|
-
var w = Object.defineProperty, D = Object.getOwnPropertyDescriptor,
|
|
192
|
+
var w = Object.defineProperty, D = Object.getOwnPropertyDescriptor, n = (e, t, o, r) => {
|
|
186
193
|
for (var a = r > 1 ? void 0 : r ? D(t, o) : t, l = e.length - 1, d; l >= 0; l--)
|
|
187
194
|
(d = e[l]) && (a = (r ? d(t, o, a) : d(a)) || a);
|
|
188
195
|
return r && a && w(t, o, a), a;
|
|
189
196
|
};
|
|
190
|
-
let v = 0, i = class extends
|
|
197
|
+
let v = 0, i = class extends m {
|
|
191
198
|
constructor() {
|
|
192
199
|
super(...arguments), this._hasHeaderSlot = !1, this._hasFooterSlot = !1, this._cachedFocusableElements = [], this._triggerElement = null, this._pendingReturnValue = void 0, this._headingId = `hx-dialog-heading-${++v}`, this._descriptionId = `hx-dialog-description-${v}`, this.open = !1, this.modal = !0, this.closeOnBackdrop = !0, this.heading = "", this.variant = "dialog", this.description = "", this._handleKeyDown = (e) => {
|
|
193
200
|
if (e.key === "Escape") {
|
|
@@ -225,7 +232,7 @@ let v = 0, i = class extends _ {
|
|
|
225
232
|
this._hasHeaderSlot = this.querySelector('[slot="header"]') !== null;
|
|
226
233
|
}
|
|
227
234
|
disconnectedCallback() {
|
|
228
|
-
super.disconnectedCallback(), this._removeGlobalListeners(), this.modal && this.open &&
|
|
235
|
+
super.disconnectedCallback(), this._removeGlobalListeners(), this.modal && this.open && p();
|
|
229
236
|
}
|
|
230
237
|
updated(e) {
|
|
231
238
|
super.updated(e), e.has("open") && (this.open ? this._openDialog() : this._closeDialog());
|
|
@@ -264,7 +271,7 @@ let v = 0, i = class extends _ {
|
|
|
264
271
|
const e = this._dialogEl;
|
|
265
272
|
if (!e) return;
|
|
266
273
|
const t = e.open;
|
|
267
|
-
e.open && (this._pendingReturnValue !== void 0 ? (e.close(this._pendingReturnValue), this._pendingReturnValue = void 0) : e.close()),
|
|
274
|
+
e.open && (this._pendingReturnValue !== void 0 ? (e.close(this._pendingReturnValue), this._pendingReturnValue = void 0) : e.close()), p(), this._removeGlobalListeners(), this._cachedFocusableElements = [], (o = this._triggerElement) == null || o.focus(), this._triggerElement = null, t && this.dispatchEvent(
|
|
268
275
|
new CustomEvent("hx-close", {
|
|
269
276
|
bubbles: !0,
|
|
270
277
|
composed: !0
|
|
@@ -304,7 +311,7 @@ let v = 0, i = class extends _ {
|
|
|
304
311
|
);
|
|
305
312
|
}
|
|
306
313
|
_trapFocus(e) {
|
|
307
|
-
var
|
|
314
|
+
var u;
|
|
308
315
|
const t = this._cachedFocusableElements.length > 0 ? this._cachedFocusableElements : this._getFocusableElements();
|
|
309
316
|
if (t.length === 0) {
|
|
310
317
|
e.preventDefault();
|
|
@@ -312,7 +319,7 @@ let v = 0, i = class extends _ {
|
|
|
312
319
|
}
|
|
313
320
|
const [o, ...r] = t, a = r.length > 0 ? r[r.length - 1] : o;
|
|
314
321
|
if (!o || !a) return;
|
|
315
|
-
const l = document.activeElement, g = ((
|
|
322
|
+
const l = document.activeElement, g = ((u = this.shadowRoot) == null ? void 0 : u.activeElement) ?? l;
|
|
316
323
|
e.shiftKey ? g === o && (e.preventDefault(), a.focus()) : g === a && (e.preventDefault(), o.focus());
|
|
317
324
|
}
|
|
318
325
|
// ─── Cancel logic ───
|
|
@@ -338,13 +345,13 @@ let v = 0, i = class extends _ {
|
|
|
338
345
|
const e = this.heading.trim().length > 0;
|
|
339
346
|
return h`
|
|
340
347
|
<div part="header" class="dialog__header">
|
|
341
|
-
${e ? h`<h2 id=${this._headingId} class="dialog__heading">${this.heading}</h2>` :
|
|
348
|
+
${e ? h`<h2 id=${this._headingId} class="dialog__heading">${this.heading}</h2>` : s}
|
|
342
349
|
<slot name="header" @slotchange=${this._handleHeaderSlotChange}></slot>
|
|
343
350
|
<button
|
|
344
351
|
part="close-button"
|
|
345
352
|
class="dialog__close-btn"
|
|
346
353
|
type="button"
|
|
347
|
-
aria-label
|
|
354
|
+
aria-label=${`Close ${this.heading.trim() || "dialog"}`}
|
|
348
355
|
@click=${() => this.close()}
|
|
349
356
|
></button>
|
|
350
357
|
</div>
|
|
@@ -358,7 +365,7 @@ let v = 0, i = class extends _ {
|
|
|
358
365
|
`;
|
|
359
366
|
}
|
|
360
367
|
_renderNonModalBackdrop() {
|
|
361
|
-
return this.modal || !this.open ?
|
|
368
|
+
return this.modal || !this.open ? s : h`
|
|
362
369
|
<div
|
|
363
370
|
part="backdrop"
|
|
364
371
|
class="dialog-backdrop"
|
|
@@ -371,7 +378,7 @@ let v = 0, i = class extends _ {
|
|
|
371
378
|
_renderDescription() {
|
|
372
379
|
return this.description ? h`<span id=${this._descriptionId} class="dialog__description"
|
|
373
380
|
>${this.description}</span
|
|
374
|
-
>` :
|
|
381
|
+
>` : s;
|
|
375
382
|
}
|
|
376
383
|
// ─── Render ───
|
|
377
384
|
render() {
|
|
@@ -379,11 +386,11 @@ let v = 0, i = class extends _ {
|
|
|
379
386
|
return h`
|
|
380
387
|
${this._renderNonModalBackdrop()}
|
|
381
388
|
<dialog
|
|
382
|
-
role=${this.variant !== "dialog" ? this.variant :
|
|
383
|
-
aria-labelledby=${e ? this._headingId :
|
|
384
|
-
aria-label=${
|
|
385
|
-
aria-describedby=${this.description ? this._descriptionId :
|
|
386
|
-
aria-modal=${this.modal ? "true" :
|
|
389
|
+
role=${this.variant !== "dialog" ? this.variant : s}
|
|
390
|
+
aria-labelledby=${e ? this._headingId : s}
|
|
391
|
+
aria-label=${e ? s : t ?? "Dialog"}
|
|
392
|
+
aria-describedby=${this.description ? this._descriptionId : s}
|
|
393
|
+
aria-modal=${this.modal ? "true" : s}
|
|
387
394
|
>
|
|
388
395
|
<div part="dialog" class="dialog">
|
|
389
396
|
${this._renderHeader()} ${this._renderDescription()}
|
|
@@ -397,22 +404,22 @@ let v = 0, i = class extends _ {
|
|
|
397
404
|
}
|
|
398
405
|
};
|
|
399
406
|
i.styles = [y, E];
|
|
400
|
-
|
|
401
|
-
|
|
407
|
+
n([
|
|
408
|
+
_("dialog")
|
|
402
409
|
], i.prototype, "_dialogEl", 2);
|
|
403
|
-
|
|
410
|
+
n([
|
|
404
411
|
b()
|
|
405
412
|
], i.prototype, "_hasHeaderSlot", 2);
|
|
406
|
-
|
|
413
|
+
n([
|
|
407
414
|
b()
|
|
408
415
|
], i.prototype, "_hasFooterSlot", 2);
|
|
409
|
-
|
|
416
|
+
n([
|
|
410
417
|
c({ type: Boolean, reflect: !0 })
|
|
411
418
|
], i.prototype, "open", 2);
|
|
412
|
-
|
|
419
|
+
n([
|
|
413
420
|
c({ type: Boolean, reflect: !0 })
|
|
414
421
|
], i.prototype, "modal", 2);
|
|
415
|
-
|
|
422
|
+
n([
|
|
416
423
|
c({
|
|
417
424
|
attribute: "close-on-backdrop",
|
|
418
425
|
reflect: !0,
|
|
@@ -422,19 +429,19 @@ s([
|
|
|
422
429
|
}
|
|
423
430
|
})
|
|
424
431
|
], i.prototype, "closeOnBackdrop", 2);
|
|
425
|
-
|
|
432
|
+
n([
|
|
426
433
|
c({ type: String })
|
|
427
434
|
], i.prototype, "heading", 2);
|
|
428
|
-
|
|
435
|
+
n([
|
|
429
436
|
c({ type: String, reflect: !0 })
|
|
430
437
|
], i.prototype, "variant", 2);
|
|
431
|
-
|
|
438
|
+
n([
|
|
432
439
|
c({ type: String })
|
|
433
440
|
], i.prototype, "description", 2);
|
|
434
|
-
i =
|
|
441
|
+
i = n([
|
|
435
442
|
x("hx-dialog")
|
|
436
443
|
], i);
|
|
437
444
|
export {
|
|
438
445
|
i as H
|
|
439
446
|
};
|
|
440
|
-
//# sourceMappingURL=hx-dialog-
|
|
447
|
+
//# sourceMappingURL=hx-dialog-M7so0sRT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-dialog-M7so0sRT.js","sources":["../../src/components/hx-dialog/hx-dialog.styles.ts","../../src/components/hx-dialog/hx-dialog.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixDialogStyles = css`\n :host {\n display: contents;\n }\n\n /* ─── Native dialog reset ─── */\n\n dialog {\n padding: 0;\n border: none;\n background: transparent;\n color: inherit;\n max-width: 100%;\n max-height: 100%;\n overflow: visible;\n /* D5 — ensure native dialog element renders above the non-modal backdrop sibling */\n position: relative;\n z-index: calc(var(--hx-z-index-modal, 100) + 1);\n }\n\n /* ─── Dialog container ─── */\n\n .dialog {\n display: flex;\n flex-direction: column;\n position: relative;\n background-color: var(--hx-dialog-bg, var(--hx-color-neutral-0));\n color: var(--hx-dialog-color, var(--hx-color-neutral-900));\n border-radius: var(--hx-dialog-border-radius, var(--hx-border-radius-lg));\n box-shadow: var(--hx-dialog-shadow, var(--hx-shadow-xl));\n width: var(--hx-dialog-width, var(--hx-size-128, 32rem));\n max-width: calc(100vw - var(--hx-spacing-8, 2rem));\n max-height: calc(100vh - var(--hx-spacing-8, 2rem));\n overflow: hidden;\n outline: none;\n\n /* Open/close animation */\n opacity: 0;\n transform: translateY(var(--hx-spacing-4, 1rem)) scale(0.97);\n transition:\n opacity var(--hx-duration-200, 200ms) var(--hx-ease-out, ease-out),\n transform var(--hx-duration-200, 200ms) var(--hx-ease-out, ease-out);\n }\n\n dialog[open] .dialog {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .dialog {\n transition: none;\n }\n }\n\n /* ─── Native backdrop (modal mode) ─── */\n\n dialog::backdrop {\n background-color: var(--hx-dialog-backdrop-color, var(--hx-color-neutral-900));\n opacity: 0;\n transition: opacity var(--hx-duration-200, 200ms) var(--hx-ease-out, ease-out);\n }\n\n dialog[open]::backdrop {\n opacity: var(--hx-dialog-backdrop-opacity, 0.5);\n }\n\n @media (prefers-reduced-motion: reduce) {\n dialog::backdrop {\n transition: none;\n }\n }\n\n /* ─── Non-modal backdrop overlay ─── */\n\n .dialog-backdrop {\n position: fixed;\n inset: 0;\n background-color: var(--hx-dialog-backdrop-color, var(--hx-color-neutral-900));\n opacity: var(--hx-dialog-backdrop-opacity, 0.5);\n /* D5 — backdrop z-index must be lower than the dialog element's z-index */\n z-index: var(--hx-z-index-modal, 100);\n }\n\n /* ─── Header ─── */\n\n .dialog__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--hx-dialog-header-padding, var(--hx-spacing-5) var(--hx-spacing-6));\n border-bottom: var(--hx-border-width-1) solid\n var(--hx-dialog-header-border-color, var(--hx-color-neutral-200));\n gap: var(--hx-spacing-4);\n flex-shrink: 0;\n }\n\n .dialog__heading {\n margin: 0;\n font-family: var(--hx-font-family-sans);\n font-size: var(--hx-font-size-lg);\n font-weight: var(--hx-font-weight-semibold);\n line-height: var(--hx-line-height-snug);\n color: var(--hx-dialog-heading-color, var(--hx-color-neutral-900));\n flex: 1 1 auto;\n }\n\n /* ─── Built-in close button (D17) ─── */\n\n .dialog__close-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n /* WCAG 2.5.5 (healthcare mandate): minimum 44x44px touch target */\n min-width: var(--hx-touch-target-min, 2.75rem);\n min-height: var(--hx-touch-target-min, 2.75rem);\n width: var(--hx-touch-target-min, 2.75rem);\n height: var(--hx-touch-target-min, 2.75rem);\n padding: 0;\n margin-left: auto;\n background: transparent;\n border: none;\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n cursor: pointer;\n color: var(--hx-color-neutral-500, #6b7280);\n font-size: var(--hx-font-size-xl, 1.25rem);\n line-height: var(--hx-line-height-none, 1);\n transition:\n color var(--hx-duration-100, 100ms) ease,\n background-color var(--hx-duration-100, 100ms) ease;\n }\n\n .dialog__close-btn::before {\n content: '×';\n }\n\n .dialog__close-btn:hover {\n color: var(--hx-color-neutral-900, #111827);\n background-color: var(--hx-color-neutral-100, #f3f4f6);\n }\n\n .dialog__close-btn:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(\n --hx-dialog-close-btn-focus-ring-color,\n var(--hx-focus-ring-color, var(--hx-color-primary-500))\n );\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n /* ─── Body ─── */\n\n .dialog__body {\n flex: 1 1 auto;\n padding: var(--hx-dialog-body-padding, var(--hx-spacing-6));\n overflow-y: auto;\n overscroll-behavior: contain;\n }\n\n /* ─── Footer ─── */\n\n .dialog__footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--hx-spacing-3);\n padding: var(--hx-dialog-footer-padding, var(--hx-spacing-4) var(--hx-spacing-6));\n border-top: var(--hx-border-width-1) solid\n var(--hx-dialog-footer-border-color, var(--hx-color-neutral-200));\n flex-shrink: 0;\n }\n\n /* ─── Visually-hidden description (D8) ─── */\n\n .dialog__description {\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","import { LitElement, html, nothing } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { tokenStyles } from '@helixui/tokens/lit';\nimport { lockBodyScroll, unlockBodyScroll } from '../../utils/body-scroll-lock.js';\nimport { helixDialogStyles } from './hx-dialog.styles.js';\n\n// D21 — deterministic monotonic counter instead of Math.random()\nlet _dialogCounter = 0;\n\n/**\n * A modal and non-modal dialog component built on the native HTML `<dialog>` element.\n * Provides focus trapping, backdrop interaction, keyboard navigation, and full\n * ARIA labelling for enterprise healthcare accessibility requirements.\n *\n * @summary Accessible dialog overlay for confirmations, forms, and detailed content.\n *\n * @tag hx-dialog\n *\n * @slot - Default slot for the dialog body content.\n * @slot header - Slot for custom header content. When provided, replaces the built-in heading.\n * @slot footer - Slot for action buttons or footer content.\n *\n * @fires {CustomEvent<void>} hx-open - Fired when the dialog opens.\n * @fires {CustomEvent<void>} hx-close - Fired when the dialog closes for any reason.\n * @fires {CustomEvent<void>} hx-cancel - Fired when the dialog is dismissed via Escape key or cancel action.\n *\n * @csspart dialog - The inner container div that holds the dialog content.\n * @csspart backdrop - The non-modal backdrop overlay element.\n * @csspart header - The header region containing the heading and header slot.\n * @csspart close-button - The built-in close button in the dialog header.\n * @csspart body - The scrollable body region containing the default slot.\n * @csspart footer - The footer region containing the footer slot.\n *\n * @cssprop [--hx-dialog-bg=var(--hx-color-neutral-0)] - Dialog background color.\n * @cssprop [--hx-dialog-color=var(--hx-color-neutral-900)] - Dialog text color.\n * @cssprop [--hx-dialog-border-radius=var(--hx-border-radius-lg)] - Dialog corner radius.\n * @cssprop [--hx-dialog-shadow=var(--hx-shadow-xl)] - Dialog box shadow.\n * @cssprop [--hx-dialog-width=32rem] - Dialog width.\n * @cssprop [--hx-dialog-backdrop-color=var(--hx-color-neutral-900)] - Backdrop overlay color.\n * @cssprop [--hx-dialog-backdrop-opacity=0.5] - Backdrop overlay opacity (set to 0 to hide; note\n * that opacity:0 makes the backdrop invisible but still present in the layout — use pointer-events\n * carefully if you need a fully non-blocking backdrop).\n * @cssprop [--hx-dialog-header-padding] - Padding inside the dialog header.\n * @cssprop [--hx-dialog-header-border-color=var(--hx-color-neutral-200)] - Header bottom border color.\n * @cssprop [--hx-dialog-heading-color=var(--hx-color-neutral-900)] - Heading text color.\n * @cssprop [--hx-dialog-body-padding] - Padding inside the dialog body.\n * @cssprop [--hx-dialog-footer-padding] - Padding inside the dialog footer.\n * @cssprop [--hx-dialog-footer-border-color=var(--hx-color-neutral-200)] - Footer top border color.\n *\n * @remarks\n * **Browser support for `::backdrop`:** The `dialog::backdrop` pseudo-element inside Shadow DOM\n * is well-supported in Chrome/Chromium and Firefox 122+. For Firefox < 122, modal backdrop\n * animation will silently fall back to no animation. A non-modal backdrop fallback is rendered\n * for non-modal dialogs.\n *\n * **Drupal integration:** This component is Twig-renderable via attributes (`heading`, `open`,\n * `modal`, `close-on-backdrop`). For trigger-button wiring in Drupal behaviors:\n * ```js\n * Drupal.behaviors.hxDialog = {\n * attach(context) {\n * context.querySelectorAll('[data-hx-dialog-trigger]').forEach((btn) => {\n * btn.addEventListener('click', () => {\n * const id = btn.getAttribute('data-hx-dialog-trigger');\n * document.getElementById(id)?.showModal();\n * });\n * });\n * },\n * };\n * ```\n * Focus restoration to the trigger element is handled automatically by the component.\n */\n@customElement('hx-dialog')\nexport class HelixDialog extends LitElement {\n static override styles = [tokenStyles, helixDialogStyles];\n\n // D10 — observe aria-label attribute without shadowing ARIAMixin.ariaLabel\n static override get observedAttributes(): string[] {\n return [...super.observedAttributes, 'aria-label'];\n }\n\n // ─── Queries ───\n\n @query('dialog')\n private _dialogEl: HTMLDialogElement | null | undefined;\n\n // ─── Internal state ───\n\n /** Tracks whether a header slot has been assigned content. */\n @state()\n private _hasHeaderSlot = false;\n\n /** Tracks whether a footer slot has been assigned content. */\n @state()\n private _hasFooterSlot = false;\n\n /** Cached focusable elements — populated on open, cleared on close. */\n private _cachedFocusableElements: HTMLElement[] = [];\n\n /** The element that had focus when the dialog opened — restored on close (D1). */\n private _triggerElement: HTMLElement | null = null;\n\n /** Pending returnValue to pass to native dialog.close() (D11). */\n private _pendingReturnValue: string | undefined = undefined;\n\n // ─── Unique IDs for aria-labelledby / aria-describedby ───\n\n private readonly _headingId = `hx-dialog-heading-${++_dialogCounter}`;\n private readonly _descriptionId = `hx-dialog-description-${_dialogCounter}`;\n\n // ─── Public Properties ───\n\n /**\n * Controls whether the dialog is open.\n * @attr open\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * When true, renders as a modal dialog with a backdrop and focus trap.\n * When false, renders as a non-modal dialog.\n * @attr modal\n */\n @property({ type: Boolean, reflect: true })\n modal = true;\n\n /**\n * When true, clicking the backdrop closes the dialog.\n * @attr close-on-backdrop\n */\n @property({\n attribute: 'close-on-backdrop',\n reflect: true,\n converter: {\n fromAttribute: (value: string | null) => value !== 'false',\n toAttribute: (value: boolean) => String(value),\n },\n })\n closeOnBackdrop = true;\n\n /**\n * Text content for the dialog heading. Used as the accessible label via aria-labelledby.\n * @attr heading\n */\n @property({ type: String })\n heading = '';\n\n /**\n * ARIA role variant. Use `'alertdialog'` for urgent dialogs requiring immediate attention\n * (e.g., drug interaction warnings, critical lab alerts). Defaults to `'dialog'`.\n * @attr variant\n */\n @property({ type: String, reflect: true })\n variant: 'dialog' | 'alertdialog' = 'dialog';\n\n /**\n * Optional description text linked to the dialog via `aria-describedby`.\n * When provided, screen readers will announce this text when the dialog receives focus.\n * Recommended for dialogs that surface critical clinical information.\n * @attr description\n */\n @property({ type: String })\n description = '';\n\n /**\n * Returns the dialog's return value — the string passed to `close(returnValue)`.\n * Mirrors `HTMLDialogElement.returnValue`.\n */\n get returnValue(): string {\n return this._dialogEl?.returnValue ?? '';\n }\n\n // ─── Lifecycle ───\n\n // D10 — re-render when aria-label attribute changes (without declaring a shadowing property)\n override attributeChangedCallback(\n name: string,\n oldVal: string | null,\n newVal: string | null,\n ): void {\n super.attributeChangedCallback(name, oldVal, newVal);\n if (name === 'aria-label' && oldVal !== newVal) {\n this.requestUpdate('aria-label', oldVal);\n }\n }\n\n override firstUpdated(): void {\n // Initialize header slot state without a querySelector in render()\n this._hasHeaderSlot = this.querySelector('[slot=\"header\"]') !== null;\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._removeGlobalListeners();\n // Restore body scroll if disconnected while open\n if (this.modal && this.open) {\n unlockBodyScroll();\n }\n }\n\n override updated(changedProperties: Map<string, unknown>): void {\n super.updated(changedProperties);\n\n if (changedProperties.has('open')) {\n if (this.open) {\n this._openDialog();\n } else {\n this._closeDialog();\n }\n }\n }\n\n // ─── Public Methods ───\n\n /** Opens the dialog in the mode determined by the `modal` property. */\n show(): void {\n this.open = true;\n }\n\n /** Opens the dialog as a modal regardless of the `modal` property setting. */\n showModal(): void {\n this.modal = true;\n this.open = true;\n }\n\n /**\n * Closes the dialog.\n * @param returnValue - Optional return value string stored as `dialog.returnValue`.\n */\n close(returnValue?: string): void {\n if (returnValue !== undefined) {\n this._pendingReturnValue = returnValue;\n }\n this.open = false;\n }\n\n // ─── Private: Open / Close ───\n\n private _openDialog(): void {\n const dialog = this._dialogEl;\n if (!dialog) return;\n\n // D1 — store the element that triggered the dialog open for focus restoration on close\n this._triggerElement = document.activeElement as HTMLElement | null;\n\n if (this.modal) {\n if (!dialog.open) {\n dialog.showModal();\n }\n // D4 — lock body scroll when modal dialog is open. Uses a shared reference-counted\n // lock so that simultaneous hx-dialog / hx-drawer instances don't clobber each other\n // when one closes before the other (see utils/body-scroll-lock.ts).\n lockBodyScroll();\n } else {\n if (!dialog.open) {\n dialog.show();\n }\n }\n\n this._addGlobalListeners();\n\n // Cache focusable elements after the dialog is open in the DOM\n void this.updateComplete.then(() => {\n this._cachedFocusableElements = this._getFocusableElements();\n // D3 — explicitly move initial focus to the first focusable element inside the dialog\n // (browser's built-in focus delegation cannot reach slotted light DOM through Shadow DOM)\n this._cachedFocusableElements[0]?.focus();\n });\n\n this.dispatchEvent(\n new CustomEvent('hx-open', {\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _closeDialog(): void {\n const dialog = this._dialogEl;\n if (!dialog) return;\n\n const wasOpen = dialog.open;\n if (dialog.open) {\n // D11 — forward returnValue to native dialog.close() if provided\n if (this._pendingReturnValue !== undefined) {\n dialog.close(this._pendingReturnValue);\n this._pendingReturnValue = undefined;\n } else {\n dialog.close();\n }\n }\n\n // D4 — release body scroll lock. Uses shared counter so scroll is only restored\n // after every open overlay (hx-dialog + hx-drawer) has closed.\n unlockBodyScroll();\n\n this._removeGlobalListeners();\n this._cachedFocusableElements = [];\n\n // D1 — restore focus to the element that opened the dialog (WCAG 2.4.3)\n this._triggerElement?.focus();\n this._triggerElement = null;\n\n if (wasOpen) {\n this.dispatchEvent(\n new CustomEvent('hx-close', {\n bubbles: true,\n composed: true,\n }),\n );\n }\n }\n\n // ─── Event Listeners ───\n\n private _addGlobalListeners(): void {\n this._dialogEl?.addEventListener('keydown', this._handleKeyDown);\n this._dialogEl?.addEventListener('click', this._handleDialogClick);\n this._dialogEl?.addEventListener('cancel', this._handleNativeCancel);\n }\n\n private _removeGlobalListeners(): void {\n this._dialogEl?.removeEventListener('keydown', this._handleKeyDown);\n this._dialogEl?.removeEventListener('click', this._handleDialogClick);\n this._dialogEl?.removeEventListener('cancel', this._handleNativeCancel);\n }\n\n // ─── Keyboard Handler ───\n\n private _handleKeyDown = (e: KeyboardEvent): void => {\n if (e.key === 'Escape') {\n // Native dialog fires a 'cancel' event before close when Escape is pressed.\n // We prevent default here and handle it ourselves so we fire hx-cancel\n // before setting open = false (which triggers hx-close).\n e.preventDefault();\n this._cancel();\n return;\n }\n\n if (e.key === 'Tab' && this.modal) {\n this._trapFocus(e);\n }\n };\n\n // ─── Focus Trap ───\n\n private _getFocusableElements(): HTMLElement[] {\n const focusableSelectors = [\n 'a[href]',\n 'area[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n 'details > summary',\n ].join(',');\n\n // Collect focusable elements from slotted light DOM content only.\n // Shadow DOM elements (e.g., the built-in close button) remain accessible via\n // the native <dialog> tab order — including them here would cause focus to land\n // on shadow DOM elements whose document.activeElement resolves to the host,\n // breaking the test assertions and D7 initial focus behavior.\n const slots = this.shadowRoot?.querySelectorAll<HTMLSlotElement>('slot') ?? [];\n const lightFocusable: HTMLElement[] = [];\n\n slots.forEach((slot) => {\n slot.assignedElements({ flatten: true }).forEach((el) => {\n if (el instanceof HTMLElement) {\n if (el.matches(focusableSelectors)) {\n lightFocusable.push(el);\n }\n el.querySelectorAll<HTMLElement>(focusableSelectors).forEach((child) => {\n lightFocusable.push(child);\n });\n }\n });\n });\n\n return lightFocusable.filter(\n (el) => !el.hasAttribute('disabled') && el.getAttribute('tabindex') !== '-1',\n );\n }\n\n private _trapFocus(e: KeyboardEvent): void {\n const focusable =\n this._cachedFocusableElements.length > 0\n ? this._cachedFocusableElements\n : this._getFocusableElements();\n if (focusable.length === 0) {\n e.preventDefault();\n return;\n }\n\n const [first, ...rest] = focusable;\n const last = rest.length > 0 ? rest[rest.length - 1] : first;\n\n if (!first || !last) return;\n\n const active = document.activeElement;\n // Also check shadow root active element\n const shadowActive = this.shadowRoot?.activeElement;\n const currentActive = (shadowActive ?? active) as HTMLElement | null;\n\n if (e.shiftKey) {\n // Shift+Tab: if focus is on first, wrap to last\n if (currentActive === first) {\n e.preventDefault();\n last.focus();\n }\n } else {\n // Tab: if focus is on last, wrap to first\n if (currentActive === last) {\n e.preventDefault();\n first.focus();\n }\n }\n }\n\n // ─── Backdrop Click ───\n\n private _handleDialogClick = (e: MouseEvent): void => {\n if (!this.closeOnBackdrop) return;\n\n // The native dialog element fills only the content area in showModal().\n // Clicks on the backdrop reach the <dialog> element itself.\n // We detect this by checking whether the click target is the dialog element.\n const target = e.target as HTMLElement;\n if (target === this._dialogEl) {\n this._cancel();\n }\n };\n\n // ─── Non-modal backdrop click ───\n\n private _handleBackdropClick = (): void => {\n if (!this.closeOnBackdrop) return;\n this._cancel();\n };\n\n // ─── Native cancel (Escape via browser, before our handler runs) ───\n\n private _handleNativeCancel = (e: Event): void => {\n // We always prevent the native cancel so we can manage close state ourselves.\n e.preventDefault();\n };\n\n // ─── Cancel logic ───\n\n private _cancel(): void {\n this.dispatchEvent(\n new CustomEvent('hx-cancel', {\n bubbles: true,\n composed: true,\n }),\n );\n\n this.open = false;\n // hx-close is dispatched by _closeDialog() which is called via the open property setter\n }\n\n // ─── Slot change handlers ───\n\n private _handleHeaderSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasHeaderSlot = slot.assignedNodes({ flatten: true }).length > 0;\n }\n\n private _handleFooterSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasFooterSlot = slot.assignedNodes({ flatten: true }).length > 0;\n }\n\n // ─── Render Helpers ───\n\n private _renderHeader() {\n const hasHeading = this.heading.trim().length > 0;\n\n // Always render header to include the built-in close button (D17)\n return html`\n <div part=\"header\" class=\"dialog__header\">\n ${hasHeading\n ? html`<h2 id=${this._headingId} class=\"dialog__heading\">${this.heading}</h2>`\n : nothing}\n <slot name=\"header\" @slotchange=${this._handleHeaderSlotChange}></slot>\n <button\n part=\"close-button\"\n class=\"dialog__close-btn\"\n type=\"button\"\n aria-label=${`Close ${this.heading.trim() || 'dialog'}`}\n @click=${() => this.close()}\n ></button>\n </div>\n `;\n }\n\n private _renderFooter() {\n return html`\n <div part=\"footer\" class=\"dialog__footer\" ?hidden=${!this._hasFooterSlot}>\n <slot name=\"footer\" @slotchange=${this._handleFooterSlotChange}></slot>\n </div>\n `;\n }\n\n private _renderNonModalBackdrop() {\n if (this.modal || !this.open) return nothing;\n return html`\n <div\n part=\"backdrop\"\n class=\"dialog-backdrop\"\n @click=${this._handleBackdropClick}\n aria-hidden=\"true\"\n ></div>\n `;\n }\n\n // D8 — render visually-hidden description for aria-describedby\n private _renderDescription() {\n if (!this.description) return nothing;\n return html`<span id=${this._descriptionId} class=\"dialog__description\"\n >${this.description}</span\n >`;\n }\n\n // ─── Render ───\n\n override render() {\n const hasHeading = this.heading.trim().length > 0;\n // D10 — read aria-label via getAttribute to avoid shadowing ARIAMixin.ariaLabel\n const ariaLabel = this.getAttribute('aria-label');\n\n return html`\n ${this._renderNonModalBackdrop()}\n <dialog\n role=${this.variant !== 'dialog' ? this.variant : nothing}\n aria-labelledby=${hasHeading ? this._headingId : nothing}\n aria-label=${!hasHeading ? (ariaLabel ?? 'Dialog') : nothing}\n aria-describedby=${this.description ? this._descriptionId : nothing}\n aria-modal=${this.modal ? 'true' : nothing}\n >\n <div part=\"dialog\" class=\"dialog\">\n ${this._renderHeader()} ${this._renderDescription()}\n <div part=\"body\" class=\"dialog__body\">\n <slot></slot>\n </div>\n ${this._renderFooter()}\n </div>\n </dialog>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-dialog': HelixDialog;\n }\n}\n"],"names":["helixDialogStyles","css","_dialogCounter","HelixDialog","LitElement","_a","name","oldVal","newVal","unlockBodyScroll","changedProperties","returnValue","dialog","lockBodyScroll","wasOpen","_b","_c","focusableSelectors","slots","lightFocusable","slot","el","child","focusable","first","rest","last","active","currentActive","hasHeading","html","nothing","ariaLabel","tokenStyles","__decorateClass","query","state","property","value","customElement"],"mappings":";;;;AAEO,MAAMA,IAAoBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAxEflC,EAyEX,WAAA,WAAA,CAAA;AAQA+B,EAAA;AAAA,EADCG,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAhF9BlC,EAiFX,WAAA,WAAA,CAAA;AASA+B,EAAA;AAAA,EADCG,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAzFflC,EA0FX,WAAA,eAAA,CAAA;AA1FWA,IAAN+B,EAAA;AAAA,EADNK,EAAc,WAAW;AAAA,GACbpC,CAAA;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { css as b, LitElement as
|
|
2
|
-
import { query as f, state as c, property as d, customElement as
|
|
3
|
-
import { classMap as
|
|
1
|
+
import { css as b, LitElement as w, nothing as p, html as h } from "lit";
|
|
2
|
+
import { query as f, state as c, property as d, customElement as g } from "lit/decorators.js";
|
|
3
|
+
import { classMap as _ } from "lit/directives/class-map.js";
|
|
4
4
|
import { ifDefined as m } from "lit/directives/if-defined.js";
|
|
5
|
-
import { tokenStyles as
|
|
5
|
+
import { tokenStyles as y } from "@helixui/tokens/lit";
|
|
6
6
|
import { l as x, u as E } from "./body-scroll-lock-VBa5TFP-.js";
|
|
7
7
|
const S = b`
|
|
8
8
|
/* P2-03: Explicit [hidden] rule to survive CSS resets that may override the UA stylesheet. */
|
|
@@ -189,8 +189,11 @@ const S = b`
|
|
|
189
189
|
display: inline-flex;
|
|
190
190
|
align-items: center;
|
|
191
191
|
justify-content: center;
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
/* WCAG 2.5.5 (healthcare mandate): minimum 44x44px touch target */
|
|
193
|
+
min-width: var(--hx-touch-target-min, 2.75rem);
|
|
194
|
+
min-height: var(--hx-touch-target-min, 2.75rem);
|
|
195
|
+
width: var(--hx-touch-target-min, 2.75rem);
|
|
196
|
+
height: var(--hx-touch-target-min, 2.75rem);
|
|
194
197
|
padding: 0;
|
|
195
198
|
border: none;
|
|
196
199
|
border-radius: var(--hx-border-radius-md, 0.375rem);
|
|
@@ -207,8 +210,12 @@ const S = b`
|
|
|
207
210
|
}
|
|
208
211
|
|
|
209
212
|
.drawer-close-button:focus-visible {
|
|
210
|
-
outline:
|
|
211
|
-
|
|
213
|
+
outline: var(--hx-focus-ring-width, 2px) solid
|
|
214
|
+
var(
|
|
215
|
+
--hx-drawer-close-btn-focus-ring-color,
|
|
216
|
+
var(--hx-focus-ring-color, var(--hx-color-primary-500))
|
|
217
|
+
);
|
|
218
|
+
outline-offset: var(--hx-focus-ring-offset, 2px);
|
|
212
219
|
}
|
|
213
220
|
|
|
214
221
|
/* ─── Body ─── */
|
|
@@ -233,18 +240,18 @@ const S = b`
|
|
|
233
240
|
flex-shrink: 0;
|
|
234
241
|
}
|
|
235
242
|
`;
|
|
236
|
-
var k = Object.defineProperty, F = Object.getOwnPropertyDescriptor,
|
|
237
|
-
for (var o =
|
|
238
|
-
(l = e[n]) && (o = (
|
|
239
|
-
return
|
|
243
|
+
var k = Object.defineProperty, F = Object.getOwnPropertyDescriptor, i = (e, t, r, s) => {
|
|
244
|
+
for (var o = s > 1 ? void 0 : s ? F(t, r) : t, n = e.length - 1, l; n >= 0; n--)
|
|
245
|
+
(l = e[n]) && (o = (s ? l(t, r, o) : l(o)) || o);
|
|
246
|
+
return s && o && k(t, r, o), o;
|
|
240
247
|
};
|
|
241
248
|
let A = 0;
|
|
242
|
-
const
|
|
249
|
+
const C = {
|
|
243
250
|
sm: "20rem",
|
|
244
251
|
md: "30rem",
|
|
245
252
|
lg: "40rem",
|
|
246
253
|
full: "100%"
|
|
247
|
-
},
|
|
254
|
+
}, u = [
|
|
248
255
|
"a[href]",
|
|
249
256
|
"area[href]",
|
|
250
257
|
"button:not([disabled])",
|
|
@@ -254,7 +261,7 @@ const L = {
|
|
|
254
261
|
'[tabindex]:not([tabindex="-1"])',
|
|
255
262
|
"details > summary"
|
|
256
263
|
].join(",");
|
|
257
|
-
let a = class extends
|
|
264
|
+
let a = class extends w {
|
|
258
265
|
constructor() {
|
|
259
266
|
super(...arguments), this._isOpen = !1, this._hasHeaderActionsSlot = !1, this._hasFooterSlot = !1, this._hasLabelSlot = !1, this._cachedFocusableElements = [], this._triggerElement = null, this._animationTimeout = null, this._hasScrollLock = !1, this._siblingAriaHiddenElements = [], this._titleId = `hx-drawer-title-${++A}`, this.open = !1, this.placement = "end", this.size = "md", this.contained = !1, this.noHeader = !1, this.noFooter = !1, this.label = "", this._handleKeyDown = (e) => {
|
|
260
267
|
if (this._isOpen) {
|
|
@@ -287,7 +294,7 @@ let a = class extends _ {
|
|
|
287
294
|
}
|
|
288
295
|
// ─── Private: Size CSS variable ───
|
|
289
296
|
_applySizeVar() {
|
|
290
|
-
const e =
|
|
297
|
+
const e = C[this.size] ?? this.size;
|
|
291
298
|
this.style.setProperty("--_drawer-size", e);
|
|
292
299
|
}
|
|
293
300
|
// ─── Private: Open / Close ───
|
|
@@ -308,10 +315,10 @@ let a = class extends _ {
|
|
|
308
315
|
}).catch(console.error);
|
|
309
316
|
}
|
|
310
317
|
_closeDrawer() {
|
|
311
|
-
this._animationTimeout !== null && (clearTimeout(this._animationTimeout), this._animationTimeout = null), this._isOpen = !1, this._removeListeners(), this._cachedFocusableElements = [], this._restoreBodyScroll(), this._restoreBackgroundForScreenReaders(), this.dispatchEvent(new CustomEvent("hx-hide", { bubbles: !0, composed: !0 }));
|
|
318
|
+
this._animationTimeout !== null && (clearTimeout(this._animationTimeout), this._animationTimeout = null), this._isOpen = !1, this._removeListeners(), this._cachedFocusableElements = [], this._restoreBodyScroll(), this._restoreBackgroundForScreenReaders(), this.dispatchEvent(new CustomEvent("hx-hide", { bubbles: !0, composed: !0 })), this._triggerElement && typeof this._triggerElement.focus == "function" && this._triggerElement.focus(), this._triggerElement = null;
|
|
312
319
|
const e = this._getAnimationDuration();
|
|
313
320
|
this._animationTimeout = setTimeout(() => {
|
|
314
|
-
this.dispatchEvent(new CustomEvent("hx-after-hide", { bubbles: !0, composed: !0 }))
|
|
321
|
+
this.dispatchEvent(new CustomEvent("hx-after-hide", { bubbles: !0, composed: !0 }));
|
|
315
322
|
}, e);
|
|
316
323
|
}
|
|
317
324
|
_getAnimationDuration() {
|
|
@@ -349,13 +356,13 @@ let a = class extends _ {
|
|
|
349
356
|
}
|
|
350
357
|
}
|
|
351
358
|
_getFocusableElements() {
|
|
352
|
-
var
|
|
359
|
+
var s, o;
|
|
353
360
|
const e = Array.from(
|
|
354
|
-
((
|
|
361
|
+
((s = this.shadowRoot) == null ? void 0 : s.querySelectorAll(u)) ?? []
|
|
355
362
|
), t = ((o = this.shadowRoot) == null ? void 0 : o.querySelectorAll("slot")) ?? [], r = [];
|
|
356
363
|
return t.forEach((n) => {
|
|
357
364
|
n.assignedElements({ flatten: !0 }).forEach((l) => {
|
|
358
|
-
l instanceof HTMLElement && (l.matches(
|
|
365
|
+
l instanceof HTMLElement && (l.matches(u) && r.push(l), l.querySelectorAll(u).forEach((v) => {
|
|
359
366
|
r.push(v);
|
|
360
367
|
}));
|
|
361
368
|
});
|
|
@@ -369,7 +376,7 @@ let a = class extends _ {
|
|
|
369
376
|
e.preventDefault();
|
|
370
377
|
return;
|
|
371
378
|
}
|
|
372
|
-
const [r, ...
|
|
379
|
+
const [r, ...s] = t, o = s.length > 0 ? s[s.length - 1] : r;
|
|
373
380
|
if (!r || !o) return;
|
|
374
381
|
const n = document.activeElement;
|
|
375
382
|
e.shiftKey ? n === r && (e.preventDefault(), o.focus()) : n === o && (e.preventDefault(), r.focus());
|
|
@@ -389,7 +396,7 @@ let a = class extends _ {
|
|
|
389
396
|
}
|
|
390
397
|
// ─── Render Helpers ───
|
|
391
398
|
_renderHeader() {
|
|
392
|
-
return this.noHeader ?
|
|
399
|
+
return this.noHeader ? p : h`
|
|
393
400
|
<div part="header" class="drawer-header">
|
|
394
401
|
<p part="title" id=${this._titleId} class="drawer-title">
|
|
395
402
|
<slot name="label" @slotchange=${this._handleLabelSlotChange}></slot>
|
|
@@ -432,7 +439,7 @@ let a = class extends _ {
|
|
|
432
439
|
`;
|
|
433
440
|
}
|
|
434
441
|
_renderFooter() {
|
|
435
|
-
return this.noFooter ?
|
|
442
|
+
return this.noFooter ? p : h`
|
|
436
443
|
<div part="footer" class="drawer-footer" ?hidden=${!this._hasFooterSlot}>
|
|
437
444
|
<slot name="footer" @slotchange=${this._handleFooterSlotChange}></slot>
|
|
438
445
|
</div>
|
|
@@ -447,7 +454,7 @@ let a = class extends _ {
|
|
|
447
454
|
return h`
|
|
448
455
|
<div
|
|
449
456
|
part="overlay"
|
|
450
|
-
class=${
|
|
457
|
+
class=${_(e)}
|
|
451
458
|
role="dialog"
|
|
452
459
|
aria-modal="true"
|
|
453
460
|
aria-labelledby=${m(t)}
|
|
@@ -456,7 +463,7 @@ let a = class extends _ {
|
|
|
456
463
|
@click=${this._handleOverlayClick}
|
|
457
464
|
>
|
|
458
465
|
<div class="drawer-backdrop" aria-hidden="true"></div>
|
|
459
|
-
<div part="panel" class="drawer-panel" tabindex="-1"
|
|
466
|
+
<div part="panel" class="drawer-panel" tabindex="-1">
|
|
460
467
|
${this._renderHeader()}
|
|
461
468
|
<div part="body" class="drawer-body">
|
|
462
469
|
<slot></slot>
|
|
@@ -467,50 +474,50 @@ let a = class extends _ {
|
|
|
467
474
|
`;
|
|
468
475
|
}
|
|
469
476
|
};
|
|
470
|
-
a.styles = [
|
|
471
|
-
|
|
477
|
+
a.styles = [y, S];
|
|
478
|
+
i([
|
|
472
479
|
f(".drawer-overlay")
|
|
473
480
|
], a.prototype, "_overlayEl", 2);
|
|
474
|
-
|
|
481
|
+
i([
|
|
475
482
|
f(".drawer-panel")
|
|
476
483
|
], a.prototype, "_panelEl", 2);
|
|
477
|
-
|
|
484
|
+
i([
|
|
478
485
|
c()
|
|
479
486
|
], a.prototype, "_isOpen", 2);
|
|
480
|
-
|
|
487
|
+
i([
|
|
481
488
|
c()
|
|
482
489
|
], a.prototype, "_hasHeaderActionsSlot", 2);
|
|
483
|
-
|
|
490
|
+
i([
|
|
484
491
|
c()
|
|
485
492
|
], a.prototype, "_hasFooterSlot", 2);
|
|
486
|
-
|
|
493
|
+
i([
|
|
487
494
|
c()
|
|
488
495
|
], a.prototype, "_hasLabelSlot", 2);
|
|
489
|
-
|
|
496
|
+
i([
|
|
490
497
|
d({ type: Boolean, reflect: !0 })
|
|
491
498
|
], a.prototype, "open", 2);
|
|
492
|
-
|
|
499
|
+
i([
|
|
493
500
|
d({ type: String, reflect: !0 })
|
|
494
501
|
], a.prototype, "placement", 2);
|
|
495
|
-
|
|
502
|
+
i([
|
|
496
503
|
d({ type: String, reflect: !0 })
|
|
497
504
|
], a.prototype, "size", 2);
|
|
498
|
-
|
|
505
|
+
i([
|
|
499
506
|
d({ type: Boolean, reflect: !0 })
|
|
500
507
|
], a.prototype, "contained", 2);
|
|
501
|
-
|
|
508
|
+
i([
|
|
502
509
|
d({ type: Boolean, reflect: !0, attribute: "no-header" })
|
|
503
510
|
], a.prototype, "noHeader", 2);
|
|
504
|
-
|
|
511
|
+
i([
|
|
505
512
|
d({ type: Boolean, reflect: !0, attribute: "no-footer" })
|
|
506
513
|
], a.prototype, "noFooter", 2);
|
|
507
|
-
|
|
514
|
+
i([
|
|
508
515
|
d({ type: String })
|
|
509
516
|
], a.prototype, "label", 2);
|
|
510
|
-
a =
|
|
511
|
-
|
|
517
|
+
a = i([
|
|
518
|
+
g("hx-drawer")
|
|
512
519
|
], a);
|
|
513
520
|
export {
|
|
514
521
|
a as H
|
|
515
522
|
};
|
|
516
|
-
//# sourceMappingURL=hx-drawer-
|
|
523
|
+
//# sourceMappingURL=hx-drawer-CYxuhIQ0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-drawer-CYxuhIQ0.js","sources":["../../src/components/hx-drawer/hx-drawer.styles.ts","../../src/components/hx-drawer/hx-drawer.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixDrawerStyles = css`\n /* P2-03: Explicit [hidden] rule to survive CSS resets that may override the UA stylesheet. */\n [hidden] {\n display: none !important;\n }\n\n :host {\n display: contents;\n }\n\n :host([contained]) {\n display: block;\n position: relative;\n overflow: hidden;\n }\n\n /* ─── Overlay ─── */\n\n .drawer-overlay {\n position: fixed;\n inset: 0;\n z-index: var(--hx-z-index-modal, 400);\n display: flex;\n pointer-events: none;\n visibility: hidden;\n }\n\n :host([contained]) .drawer-overlay {\n position: absolute;\n }\n\n .drawer-overlay.is-open {\n pointer-events: auto;\n visibility: visible;\n }\n\n /* ─── Backdrop ─── */\n\n .drawer-backdrop {\n position: absolute;\n inset: 0;\n background-color: var(--hx-drawer-backdrop-color, var(--hx-color-neutral-900));\n opacity: 0;\n transition: opacity var(--hx-duration-300, 300ms) var(--hx-ease-out, ease-out);\n }\n\n .drawer-overlay.is-open .drawer-backdrop {\n opacity: var(--hx-drawer-backdrop-opacity, 0.5);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .drawer-backdrop {\n transition: none;\n }\n }\n\n /* ─── Panel ─── */\n\n .drawer-panel {\n position: absolute;\n display: flex;\n flex-direction: column;\n background-color: var(--hx-drawer-bg, var(--hx-color-neutral-0));\n color: var(--hx-drawer-color, var(--hx-color-neutral-900));\n box-shadow: var(--hx-drawer-shadow, var(--hx-shadow-xl));\n overflow: hidden;\n outline: none;\n z-index: 1;\n transition:\n transform var(--hx-duration-300, 300ms) var(--hx-ease-out, ease-out),\n opacity var(--hx-duration-300, 300ms) var(--hx-ease-out, ease-out);\n opacity: 0;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .drawer-panel {\n transition: none;\n }\n }\n\n /* ─── Placement: end (default — right) ─── */\n\n :host([placement='end']) .drawer-panel,\n :host(:not([placement])) .drawer-panel {\n top: 0;\n right: 0;\n bottom: 0;\n width: var(--_drawer-size, var(--hx-drawer-size-md, 30rem));\n max-width: 100%;\n transform: translateX(100%);\n }\n\n :host([placement='end']) .drawer-overlay.is-open .drawer-panel,\n :host(:not([placement])) .drawer-overlay.is-open .drawer-panel {\n transform: translateX(0);\n opacity: 1;\n }\n\n /* ─── Placement: start (left) ─── */\n\n :host([placement='start']) .drawer-panel {\n top: 0;\n left: 0;\n bottom: 0;\n width: var(--_drawer-size, var(--hx-drawer-size-md, 30rem));\n max-width: 100%;\n transform: translateX(-100%);\n }\n\n :host([placement='start']) .drawer-overlay.is-open .drawer-panel {\n transform: translateX(0);\n opacity: 1;\n }\n\n /* ─── Placement: top ─── */\n\n :host([placement='top']) .drawer-panel {\n top: 0;\n left: 0;\n right: 0;\n height: var(--_drawer-size, var(--hx-drawer-size-md, 30rem));\n max-height: 100%;\n width: 100%;\n transform: translateY(-100%);\n }\n\n :host([placement='top']) .drawer-overlay.is-open .drawer-panel {\n transform: translateY(0);\n opacity: 1;\n }\n\n /* ─── Placement: bottom ─── */\n\n :host([placement='bottom']) .drawer-panel {\n bottom: 0;\n left: 0;\n right: 0;\n height: var(--_drawer-size, var(--hx-drawer-size-md, 30rem));\n max-height: 100%;\n width: 100%;\n transform: translateY(100%);\n }\n\n :host([placement='bottom']) .drawer-overlay.is-open .drawer-panel {\n transform: translateY(0);\n opacity: 1;\n }\n\n /* ─── Header ─── */\n\n .drawer-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--hx-spacing-4, 1rem);\n padding: var(\n --hx-drawer-header-padding,\n var(--hx-spacing-5, 1.25rem) var(--hx-spacing-6, 1.5rem)\n );\n border-bottom: var(--hx-border-width-1, 1px) solid\n var(--hx-drawer-header-border-color, var(--hx-color-neutral-200));\n flex-shrink: 0;\n }\n\n .drawer-title {\n margin: 0;\n flex: 1 1 auto;\n font-family: var(--hx-font-family-sans);\n font-size: var(--hx-font-size-lg);\n font-weight: var(--hx-font-weight-semibold);\n line-height: var(--hx-line-height-snug);\n color: var(--hx-drawer-title-color, var(--hx-color-neutral-900));\n }\n\n .drawer-header-actions {\n display: flex;\n align-items: center;\n gap: var(--hx-spacing-2, 0.5rem);\n flex-shrink: 0;\n }\n\n .drawer-close-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n /* WCAG 2.5.5 (healthcare mandate): minimum 44x44px touch target */\n min-width: var(--hx-touch-target-min, 2.75rem);\n min-height: var(--hx-touch-target-min, 2.75rem);\n width: var(--hx-touch-target-min, 2.75rem);\n height: var(--hx-touch-target-min, 2.75rem);\n padding: 0;\n border: none;\n border-radius: var(--hx-border-radius-md, 0.375rem);\n background: transparent;\n color: var(--hx-color-neutral-500);\n cursor: pointer;\n flex-shrink: 0;\n transition: background-color var(--hx-duration-100, 100ms) ease;\n }\n\n .drawer-close-button:hover {\n background-color: var(--hx-color-neutral-100);\n color: var(--hx-color-neutral-900);\n }\n\n .drawer-close-button:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(\n --hx-drawer-close-btn-focus-ring-color,\n var(--hx-focus-ring-color, var(--hx-color-primary-500))\n );\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n /* ─── Body ─── */\n\n .drawer-body {\n flex: 1 1 auto;\n padding: var(--hx-drawer-body-padding, var(--hx-spacing-6, 1.5rem));\n overflow-y: auto;\n overscroll-behavior: contain;\n }\n\n /* ─── Footer ─── */\n\n .drawer-footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--hx-spacing-3, 0.75rem);\n padding: var(--hx-drawer-footer-padding, var(--hx-spacing-4, 1rem) var(--hx-spacing-6, 1.5rem));\n border-top: var(--hx-border-width-1, 1px) solid\n var(--hx-drawer-footer-border-color, var(--hx-color-neutral-200));\n flex-shrink: 0;\n }\n`;\n","import { LitElement, html, nothing } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { tokenStyles } from '@helixui/tokens/lit';\nimport { lockBodyScroll, unlockBodyScroll } from '../../utils/body-scroll-lock.js';\nimport { helixDrawerStyles } from './hx-drawer.styles.js';\n\n// Module-level counter for stable, SSR-safe IDs (avoids Math.random() hydration mismatch)\nlet _hxDrawerIdCounter = 0;\n\ntype DrawerPlacement = 'start' | 'end' | 'top' | 'bottom';\ntype DrawerSizePreset = 'sm' | 'md' | 'lg' | 'full';\ntype DrawerSize = DrawerSizePreset | (string & Record<never, never>);\n\nconst DRAWER_SIZE_MAP: Record<DrawerSizePreset, string> = {\n sm: '20rem',\n md: '30rem',\n lg: '40rem',\n full: '100%',\n};\n\nconst FOCUSABLE_SELECTORS = [\n 'a[href]',\n 'area[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n 'details > summary',\n].join(',');\n\n/**\n * A slide-in drawer panel that can appear from any edge of the viewport.\n * Supports focus trapping, overlay backdrop, keyboard navigation, and full\n * ARIA labelling for enterprise healthcare accessibility requirements.\n *\n * @summary Slide-in panel overlay from any viewport edge.\n *\n * @tag hx-drawer\n *\n * @slot label - The drawer title text.\n * @slot header-actions - Action buttons displayed in the header near the close button.\n * @slot - Default slot for the drawer body content.\n * @slot footer - Action buttons or footer content.\n *\n * @fires {CustomEvent<void>} hx-show - Fired when the drawer begins to open.\n * @fires {CustomEvent<void>} hx-after-show - Fired after the drawer open animation completes.\n * @fires {CustomEvent<void>} hx-hide - Fired when the drawer begins to close.\n * @fires {CustomEvent<void>} hx-after-hide - Fired after the drawer close animation completes.\n * @fires {CustomEvent<void>} hx-initial-focus - Fired when initial focus is set inside the drawer. Cancelable to override focus behavior.\n *\n * @csspart overlay - The full-screen overlay container (includes backdrop and panel).\n * @csspart panel - The drawer panel itself.\n * @csspart header - The header region containing the title and actions.\n * @csspart title - The drawer title element.\n * @csspart close-btn - The built-in close button.\n * @csspart body - The scrollable body region.\n * @csspart footer - The footer region.\n *\n * @attr [label] - Accessible label for the dialog when no visible label slot is provided.\n *\n * @cssprop [--hx-drawer-bg=var(--hx-color-neutral-0)] - Drawer panel background color.\n * @cssprop [--hx-drawer-color=var(--hx-color-neutral-900)] - Drawer panel text color.\n * @cssprop [--hx-drawer-shadow=var(--hx-shadow-xl)] - Drawer panel box shadow.\n * @cssprop [--hx-drawer-backdrop-color=var(--hx-color-neutral-900)] - Backdrop color.\n * @cssprop [--hx-drawer-backdrop-opacity=0.5] - Backdrop opacity.\n * @cssprop [--hx-drawer-header-padding] - Padding inside the header.\n * @cssprop [--hx-drawer-header-border-color=var(--hx-color-neutral-200)] - Header border color.\n * @cssprop [--hx-drawer-title-color=var(--hx-color-neutral-900)] - Title text color.\n * @cssprop [--hx-drawer-body-padding] - Padding inside the body.\n * @cssprop [--hx-drawer-footer-padding] - Padding inside the footer.\n * @cssprop [--hx-drawer-footer-border-color=var(--hx-color-neutral-200)] - Footer border color.\n */\n@customElement('hx-drawer')\nexport class HelixDrawer extends LitElement {\n static override styles = [tokenStyles, helixDrawerStyles];\n\n // ─── Queries ───\n\n /**\n * Reference to the overlay element that wraps the backdrop and panel.\n * @internal\n */\n @query('.drawer-overlay')\n private _overlayEl: HTMLElement | null | undefined;\n\n /**\n * Reference to the drawer panel element used for focus management.\n * @internal\n */\n @query('.drawer-panel')\n private _panelEl: HTMLElement | null | undefined;\n\n // ─── Internal state ───\n\n /**\n * Whether the drawer is in the open state and visible to the user.\n * @internal\n */\n @state()\n private _isOpen = false;\n\n /**\n * Whether the header-actions slot has any assigned content.\n * @internal\n */\n @state()\n private _hasHeaderActionsSlot = false;\n\n /**\n * Whether the footer slot has any assigned content.\n * @internal\n */\n @state()\n private _hasFooterSlot = false;\n\n /**\n * Whether the label slot has any assigned content.\n * @internal\n */\n @state()\n private _hasLabelSlot = false;\n\n /**\n * Cached list of focusable elements within the drawer, used for focus trapping.\n * @internal\n */\n private _cachedFocusableElements: HTMLElement[] = [];\n /**\n * The element that triggered the drawer to open, restored focus when the drawer closes.\n * @internal\n */\n private _triggerElement: HTMLElement | null = null;\n /**\n * Handle for the pending animation end timeout, cleared when the drawer opens or closes again.\n * @internal\n */\n private _animationTimeout: ReturnType<typeof setTimeout> | null = null;\n /** Whether this drawer instance currently holds a body-scroll lock. */\n private _hasScrollLock = false;\n /**\n * Elements outside the drawer that were given aria-hidden during open, restored on close.\n * @internal\n */\n private _siblingAriaHiddenElements: Element[] = [];\n\n /**\n * Unique ID for the title element, used by aria-labelledby to link the dialog to its label.\n * @internal\n */\n private readonly _titleId = `hx-drawer-title-${++_hxDrawerIdCounter}`;\n\n // ─── Public Properties ───\n\n /**\n * Controls whether the drawer is open.\n * @attr open\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Which edge of the viewport the drawer slides in from.\n * @attr placement\n */\n @property({ type: String, reflect: true })\n placement: DrawerPlacement = 'end';\n\n /**\n * The size of the drawer panel. Use 'sm', 'md', 'lg', 'full', or any valid CSS length.\n * @attr size\n */\n @property({ type: String, reflect: true })\n size: DrawerSize = 'md';\n\n /**\n * When true, the drawer is constrained to its positioned parent instead of the viewport.\n * The host element must have `position: relative` (or the library handles it via :host).\n * @attr contained\n */\n @property({ type: Boolean, reflect: true })\n contained = false;\n\n /**\n * When true, the header (title, header-actions, close button) is hidden.\n * @attr no-header\n */\n @property({ type: Boolean, reflect: true, attribute: 'no-header' })\n noHeader = false;\n\n /**\n * When true, the footer slot is hidden.\n * @attr no-footer\n */\n @property({ type: Boolean, reflect: true, attribute: 'no-footer' })\n noFooter = false;\n\n /**\n * Accessible label for the dialog when the `label` slot is not populated.\n * When the `label` slot is used, `aria-labelledby` takes precedence.\n * @attr label\n */\n @property({ type: String })\n label = '';\n\n // ─── Lifecycle ───\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._removeListeners();\n if (this._animationTimeout !== null) {\n clearTimeout(this._animationTimeout);\n }\n this._restoreBodyScroll();\n }\n\n override updated(changedProperties: Map<string, unknown>): void {\n super.updated(changedProperties);\n\n if (changedProperties.has('open')) {\n if (this.open) {\n this._openDrawer();\n } else {\n this._closeDrawer();\n }\n }\n\n if (changedProperties.has('size')) {\n this._applySizeVar();\n }\n }\n\n // ─── Public Methods ───\n\n /** Opens the drawer. */\n show(): void {\n this.open = true;\n }\n\n /** Closes the drawer. */\n hide(): void {\n this.open = false;\n }\n\n // ─── Private: Size CSS variable ───\n\n private _applySizeVar(): void {\n const resolvedSize = DRAWER_SIZE_MAP[this.size as DrawerSizePreset] ?? this.size;\n this.style.setProperty('--_drawer-size', resolvedSize);\n }\n\n // ─── Private: Open / Close ───\n\n private _lockBodyScroll(): void {\n if (this.contained || this._hasScrollLock) return;\n // Uses a shared reference-counted lock so that simultaneous hx-dialog / hx-drawer\n // instances don't clobber each other when one closes before the other\n // (see utils/body-scroll-lock.ts).\n lockBodyScroll();\n this._hasScrollLock = true;\n }\n\n private _restoreBodyScroll(): void {\n if (!this._hasScrollLock) return;\n unlockBodyScroll();\n this._hasScrollLock = false;\n }\n\n private _openDrawer(): void {\n // Capture trigger for focus restoration (P2-04: use instanceof guard)\n const active = document.activeElement;\n this._triggerElement = active instanceof HTMLElement ? active : null;\n\n // P1-05: clear any pending animation timeout before scheduling a new one\n if (this._animationTimeout !== null) {\n clearTimeout(this._animationTimeout);\n this._animationTimeout = null;\n }\n\n this._applySizeVar();\n this._lockBodyScroll();\n this._hideBackgroundFromScreenReaders();\n\n // Dispatch hx-show before visual update\n this.dispatchEvent(new CustomEvent('hx-show', { bubbles: true, composed: true }));\n\n // Transition to open state\n void this.updateComplete\n .then(() => {\n this._isOpen = true;\n this._addListeners();\n\n // Set initial focus after next render\n return this.updateComplete;\n })\n .then(() => {\n this._cachedFocusableElements = this._getFocusableElements();\n this._setInitialFocus();\n\n // Dispatch hx-after-show after animation duration\n const duration = this._getAnimationDuration();\n this._animationTimeout = setTimeout(() => {\n this.dispatchEvent(new CustomEvent('hx-after-show', { bubbles: true, composed: true }));\n }, duration);\n })\n .catch(console.error);\n }\n\n private _closeDrawer(): void {\n // P1-05: clear any pending animation timeout before scheduling a new one\n if (this._animationTimeout !== null) {\n clearTimeout(this._animationTimeout);\n this._animationTimeout = null;\n }\n\n this._isOpen = false;\n this._removeListeners();\n this._cachedFocusableElements = [];\n this._restoreBodyScroll();\n this._restoreBackgroundForScreenReaders();\n\n this.dispatchEvent(new CustomEvent('hx-hide', { bubbles: true, composed: true }));\n\n // Restore focus to the trigger immediately — before any animation timeout.\n // WCAG 2.4.3: focus must never remain on invisible or inert content.\n if (this._triggerElement && typeof this._triggerElement.focus === 'function') {\n this._triggerElement.focus();\n }\n this._triggerElement = null;\n\n // Animation cleanup only — no focus management inside this timeout.\n const duration = this._getAnimationDuration();\n this._animationTimeout = setTimeout(() => {\n this.dispatchEvent(new CustomEvent('hx-after-hide', { bubbles: true, composed: true }));\n }, duration);\n }\n\n private _getAnimationDuration(): number {\n if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return 0;\n return 300;\n }\n\n // ─── Background aria-hidden management (P1-03) ───\n\n private _hideBackgroundFromScreenReaders(): void {\n if (this.contained) return;\n this._siblingAriaHiddenElements = [];\n Array.from(document.body.children).forEach((child) => {\n if (child === this || child.contains(this)) return;\n if (!child.hasAttribute('aria-hidden')) {\n child.setAttribute('aria-hidden', 'true');\n this._siblingAriaHiddenElements.push(child);\n }\n });\n }\n\n private _restoreBackgroundForScreenReaders(): void {\n this._siblingAriaHiddenElements.forEach((el) => {\n el.removeAttribute('aria-hidden');\n });\n this._siblingAriaHiddenElements = [];\n }\n\n // ─── Event Listeners (P1-01: use only document listener, not overlay) ───\n\n private _addListeners(): void {\n document.addEventListener('keydown', this._handleKeyDown);\n }\n\n private _removeListeners(): void {\n document.removeEventListener('keydown', this._handleKeyDown);\n }\n\n // ─── Keyboard Handler ───\n\n /**\n * Handles keyboard events on the document to trap focus and close the drawer on Escape.\n * @internal\n */\n private _handleKeyDown = (e: KeyboardEvent): void => {\n if (!this._isOpen) return;\n\n if (e.key === 'Escape') {\n e.preventDefault();\n this.open = false;\n return;\n }\n\n if (e.key === 'Tab') {\n this._trapFocus(e);\n }\n };\n\n // ─── Focus ───\n\n private _setInitialFocus(): void {\n const event = new CustomEvent('hx-initial-focus', {\n bubbles: true,\n composed: true,\n cancelable: true,\n });\n this.dispatchEvent(event);\n\n if (!event.defaultPrevented) {\n const focusable = this._cachedFocusableElements;\n if (focusable.length > 0 && focusable[0]) {\n focusable[0].focus();\n } else {\n this._panelEl?.focus();\n }\n }\n }\n\n private _getFocusableElements(): HTMLElement[] {\n const shadowFocusable = Array.from(\n this.shadowRoot?.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTORS) ?? [],\n );\n\n const slots = this.shadowRoot?.querySelectorAll<HTMLSlotElement>('slot') ?? [];\n const lightFocusable: HTMLElement[] = [];\n\n slots.forEach((slot) => {\n slot.assignedElements({ flatten: true }).forEach((el) => {\n if (el instanceof HTMLElement) {\n if (el.matches(FOCUSABLE_SELECTORS)) {\n lightFocusable.push(el);\n }\n el.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTORS).forEach((child) => {\n lightFocusable.push(child);\n });\n }\n });\n });\n\n return [...shadowFocusable, ...lightFocusable].filter(\n (el) => !el.hasAttribute('disabled') && el.getAttribute('tabindex') !== '-1',\n );\n }\n\n private _trapFocus(e: KeyboardEvent): void {\n const focusable =\n this._cachedFocusableElements.length > 0\n ? this._cachedFocusableElements\n : this._getFocusableElements();\n\n if (focusable.length === 0) {\n e.preventDefault();\n return;\n }\n\n const [first, ...rest] = focusable;\n const last = rest.length > 0 ? rest[rest.length - 1] : first;\n\n if (!first || !last) return;\n\n // P1-02: Use document.activeElement for reliable detection of slotted (light DOM) elements.\n // shadowRoot.activeElement returns the <slot> host for slotted content, not the actual element.\n const active = document.activeElement as HTMLElement | null;\n\n if (e.shiftKey) {\n if (active === first) {\n e.preventDefault();\n last.focus();\n }\n } else {\n if (active === last) {\n e.preventDefault();\n first.focus();\n }\n }\n }\n\n // ─── Overlay Click ───\n\n /**\n * Handles clicks on the overlay backdrop to close the drawer when the user clicks outside the panel.\n * @internal\n */\n private _handleOverlayClick = (e: MouseEvent): void => {\n // Only close when clicking the overlay itself (backdrop), not the panel\n const target = e.target as HTMLElement;\n if (target === this._overlayEl || target.classList.contains('drawer-backdrop')) {\n this.open = false;\n }\n };\n\n // ─── Slot change handlers ───\n\n private _handleHeaderActionsSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasHeaderActionsSlot = slot.assignedNodes({ flatten: true }).length > 0;\n }\n\n private _handleFooterSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasFooterSlot = slot.assignedNodes({ flatten: true }).length > 0;\n }\n\n private _handleLabelSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasLabelSlot = slot.assignedNodes({ flatten: true }).length > 0;\n }\n\n // ─── Render Helpers ───\n\n private _renderHeader() {\n if (this.noHeader) return nothing;\n\n return html`\n <div part=\"header\" class=\"drawer-header\">\n <p part=\"title\" id=${this._titleId} class=\"drawer-title\">\n <slot name=\"label\" @slotchange=${this._handleLabelSlotChange}></slot>\n </p>\n <div class=\"drawer-header-actions\">\n ${this._hasHeaderActionsSlot\n ? html`<slot\n name=\"header-actions\"\n @slotchange=${this._handleHeaderActionsSlotChange}\n ></slot>`\n : html`<slot\n name=\"header-actions\"\n @slotchange=${this._handleHeaderActionsSlotChange}\n style=\"display:none\"\n ></slot>`}\n <button\n part=\"close-btn\"\n class=\"drawer-close-button\"\n aria-label=\"Close drawer\"\n @click=${() => {\n this.open = false;\n }}\n >\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 <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n </div>\n `;\n }\n\n private _renderFooter() {\n if (this.noFooter) return nothing;\n\n return html`\n <div part=\"footer\" class=\"drawer-footer\" ?hidden=${!this._hasFooterSlot}>\n <slot name=\"footer\" @slotchange=${this._handleFooterSlotChange}></slot>\n </div>\n `;\n }\n\n // ─── Render ───\n\n override render() {\n const overlayClasses = {\n 'drawer-overlay': true,\n 'is-open': this._isOpen,\n };\n\n // P1-06: ensure the dialog always has an accessible name.\n // Priority: aria-labelledby (slot) > aria-label (prop) > aria-label (fallback \"Drawer\")\n const ariaLabelledby = this._hasLabelSlot ? this._titleId : undefined;\n const ariaLabel = !this._hasLabelSlot ? this.label || 'Drawer' : undefined;\n\n return html`\n <div\n part=\"overlay\"\n class=${classMap(overlayClasses)}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=${ifDefined(ariaLabelledby)}\n aria-label=${ifDefined(ariaLabel)}\n tabindex=\"-1\"\n @click=${this._handleOverlayClick}\n >\n <div class=\"drawer-backdrop\" aria-hidden=\"true\"></div>\n <div part=\"panel\" class=\"drawer-panel\" tabindex=\"-1\">\n ${this._renderHeader()}\n <div part=\"body\" class=\"drawer-body\">\n <slot></slot>\n </div>\n ${this._renderFooter()}\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-drawer': HelixDrawer;\n }\n}\n"],"names":["helixDrawerStyles","css","_hxDrawerIdCounter","DRAWER_SIZE_MAP","FOCUSABLE_SELECTORS","HelixDrawer","LitElement","target","changedProperties","resolvedSize","lockBodyScroll","unlockBodyScroll","active","duration","child","el","event","focusable","_a","shadowFocusable","slots","_b","lightFocusable","slot","first","rest","last","nothing","html","overlayClasses","ariaLabelledby","ariaLabel","classMap","ifDefined","tokenStyles","__decorateClass","query","state","property","customElement"],"mappings":";;;;;;AAEO,MAAMA,IAAoBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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