@helixui/library 0.3.1 → 0.3.2
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 +2330 -1860
- package/dist/components/hx-action-bar/hx-action-bar.d.ts +3 -1
- package/dist/components/hx-action-bar/hx-action-bar.d.ts.map +1 -1
- package/dist/components/hx-action-bar/index.js +1 -1
- package/dist/components/hx-badge/hx-badge.d.ts +8 -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.d.ts +1 -0
- package/dist/components/hx-badge/index.d.ts.map +1 -1
- package/dist/components/hx-badge/index.js +1 -1
- package/dist/components/hx-breadcrumb/hx-breadcrumb-item.styles.d.ts.map +1 -1
- package/dist/components/hx-breadcrumb/hx-breadcrumb.d.ts +0 -25
- package/dist/components/hx-breadcrumb/hx-breadcrumb.d.ts.map +1 -1
- package/dist/components/hx-breadcrumb/index.js +1 -1
- package/dist/components/hx-button/hx-button.styles.d.ts.map +1 -1
- package/dist/components/hx-button/index.js +1 -1
- package/dist/components/hx-button-group/hx-button-group.d.ts +3 -1
- package/dist/components/hx-button-group/hx-button-group.d.ts.map +1 -1
- package/dist/components/hx-button-group/index.js +1 -1
- package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts +3 -1
- package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts.map +1 -1
- package/dist/components/hx-checkbox-group/index.js +1 -1
- package/dist/components/hx-container/hx-container.d.ts +12 -0
- package/dist/components/hx-container/hx-container.d.ts.map +1 -1
- package/dist/components/hx-container/hx-container.styles.d.ts.map +1 -1
- package/dist/components/hx-container/index.d.ts +1 -0
- package/dist/components/hx-container/index.d.ts.map +1 -1
- package/dist/components/hx-container/index.js +1 -1
- package/dist/components/hx-copy-button/hx-copy-button.d.ts +7 -0
- package/dist/components/hx-copy-button/hx-copy-button.d.ts.map +1 -1
- package/dist/components/hx-drawer/hx-drawer.d.ts +1 -1
- package/dist/components/hx-drawer/index.js +1 -1
- package/dist/components/hx-icon-button/hx-icon-button.d.ts +87 -0
- package/dist/components/hx-icon-button/hx-icon-button.d.ts.map +1 -0
- package/dist/components/hx-icon-button/hx-icon-button.styles.d.ts +2 -0
- package/dist/components/hx-icon-button/hx-icon-button.styles.d.ts.map +1 -0
- package/dist/components/hx-icon-button/index.d.ts +2 -0
- package/dist/components/hx-icon-button/index.d.ts.map +1 -0
- package/dist/components/hx-icon-button/index.js +5 -0
- package/dist/components/hx-icon-button/index.js.map +1 -0
- package/dist/components/hx-image/index.js +1 -1
- package/dist/components/hx-number-input/hx-number-input.d.ts +2 -2
- package/dist/components/hx-number-input/hx-number-input.d.ts.map +1 -1
- package/dist/components/hx-pagination/hx-pagination.d.ts +2 -0
- package/dist/components/hx-pagination/hx-pagination.d.ts.map +1 -1
- package/dist/components/hx-pagination/index.d.ts +1 -0
- package/dist/components/hx-pagination/index.d.ts.map +1 -1
- package/dist/components/hx-prose/index.js +1 -1
- package/dist/components/hx-radio-group/hx-radio-group.d.ts +31 -10
- package/dist/components/hx-radio-group/hx-radio-group.d.ts.map +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-slider/hx-slider.d.ts +6 -4
- 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-spinner/hx-spinner.d.ts +12 -6
- package/dist/components/hx-spinner/hx-spinner.d.ts.map +1 -1
- package/dist/components/hx-spinner/index.d.ts +1 -0
- package/dist/components/hx-spinner/index.d.ts.map +1 -1
- package/dist/components/hx-stack/hx-stack.d.ts +20 -0
- package/dist/components/hx-stack/hx-stack.d.ts.map +1 -1
- package/dist/components/hx-stack/index.js +1 -1
- package/dist/components/hx-steps/hx-step.d.ts +8 -0
- package/dist/components/hx-steps/hx-step.d.ts.map +1 -1
- package/dist/components/hx-structured-list/index.js +1 -1
- package/dist/components/hx-switch/hx-switch.d.ts +2 -2
- package/dist/components/hx-switch/hx-switch.d.ts.map +1 -1
- package/dist/components/hx-tag/index.d.ts +3 -0
- package/dist/components/hx-tag/index.d.ts.map +1 -1
- package/dist/components/hx-text/hx-text.d.ts +0 -2
- package/dist/components/hx-text/hx-text.d.ts.map +1 -1
- package/dist/components/hx-textarea/hx-textarea.d.ts +7 -0
- package/dist/components/hx-textarea/hx-textarea.d.ts.map +1 -1
- package/dist/components/hx-textarea/index.js +1 -1
- package/dist/components/hx-theme/hx-theme.d.ts +4 -0
- package/dist/components/hx-theme/hx-theme.d.ts.map +1 -1
- package/dist/components/hx-theme/index.d.ts +3 -1
- package/dist/components/hx-theme/index.d.ts.map +1 -1
- package/dist/components/hx-toggle-button/hx-toggle-button.d.ts +2 -2
- package/dist/components/hx-toggle-button/hx-toggle-button.d.ts.map +1 -1
- package/dist/components/hx-toggle-button/index.js +1 -1
- package/dist/components/hx-tree-view/hx-tree-item.d.ts +29 -10
- 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 +22 -2
- package/dist/components/hx-tree-view/hx-tree-view.d.ts.map +1 -1
- package/dist/components/hx-tree-view/hx-tree-view.styles.d.ts.map +1 -1
- package/dist/components/hx-tree-view/index.d.ts +6 -1
- package/dist/components/hx-tree-view/index.d.ts.map +1 -1
- package/dist/components/hx-tree-view/index.js +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +107 -105
- package/dist/index.js.map +1 -1
- package/dist/shared/{hx-action-bar-D43v5rA2.js → hx-action-bar-B4i9tBCP.js} +71 -61
- package/dist/shared/hx-action-bar-B4i9tBCP.js.map +1 -0
- package/dist/shared/{hx-badge-DYB1Pnym.js → hx-badge-CjT0d8NK.js} +9 -2
- package/dist/shared/hx-badge-CjT0d8NK.js.map +1 -0
- package/dist/shared/{hx-breadcrumb-item-TKRcrMYc.js → hx-breadcrumb-item-DtSxRZ_W.js} +25 -18
- package/dist/shared/hx-breadcrumb-item-DtSxRZ_W.js.map +1 -0
- package/dist/shared/{hx-button-SAbf4_jC.js → hx-button-CtiJsmOg.js} +31 -29
- package/dist/shared/hx-button-CtiJsmOg.js.map +1 -0
- package/dist/shared/{hx-button-group-DET_Pkxt.js → hx-button-group-BMV5qFs4.js} +19 -13
- package/dist/shared/{hx-button-group-DET_Pkxt.js.map → hx-button-group-BMV5qFs4.js.map} +1 -1
- package/dist/shared/{hx-checkbox-group-CIIijwmc.js → hx-checkbox-group-DTS9iT4b.js} +26 -20
- package/dist/shared/hx-checkbox-group-DTS9iT4b.js.map +1 -0
- package/dist/shared/{hx-container-BXZBaOGG.js → hx-container-DLUKnTi9.js} +9 -8
- package/dist/shared/hx-container-DLUKnTi9.js.map +1 -0
- package/dist/shared/hx-copy-button-BXL1xkxb.js.map +1 -1
- package/dist/shared/{hx-drawer-CenIAGuR.js → hx-drawer-bTF0nbrg.js} +2 -2
- package/dist/shared/hx-drawer-bTF0nbrg.js.map +1 -0
- package/dist/shared/hx-icon-button-C_fsUJW4.js +257 -0
- package/dist/shared/hx-icon-button-C_fsUJW4.js.map +1 -0
- package/dist/shared/{hx-image-CzkOEeO4.js → hx-image-xyb_tHCR.js} +2 -2
- package/dist/shared/hx-image-xyb_tHCR.js.map +1 -0
- package/dist/shared/hx-number-input-CS6_w1lT.js.map +1 -1
- package/dist/shared/hx-pagination-DNFgXQm3.js.map +1 -1
- package/dist/shared/{hx-prose-BUkZ8rB3.js → hx-prose-DZh2KrMb.js} +10 -7
- package/dist/shared/{hx-prose-BUkZ8rB3.js.map → hx-prose-DZh2KrMb.js.map} +1 -1
- package/dist/shared/{hx-radio-reSaVmIB.js → hx-radio-CGtFKls2.js} +42 -14
- package/dist/shared/hx-radio-CGtFKls2.js.map +1 -0
- package/dist/shared/{hx-slider-CzHOl3Ur.js → hx-slider-Duzmuid9.js} +12 -8
- package/dist/shared/hx-slider-Duzmuid9.js.map +1 -0
- package/dist/shared/hx-spinner-BOApJ-g9.js.map +1 -1
- package/dist/shared/{hx-stack-C3xUwi6-.js → hx-stack-CfoW7jU7.js} +21 -1
- package/dist/shared/{hx-stack-C3xUwi6-.js.map → hx-stack-CfoW7jU7.js.map} +1 -1
- package/dist/shared/hx-step-nMT0fHEn.js.map +1 -1
- package/dist/shared/{hx-structured-list-DKborM60.js → hx-structured-list-CMja1VXz.js} +5 -5
- package/dist/shared/{hx-structured-list-DKborM60.js.map → hx-structured-list-CMja1VXz.js.map} +1 -1
- package/dist/shared/hx-switch-BPvIcDpM.js.map +1 -1
- package/dist/shared/hx-text-NjKoQATI.js.map +1 -1
- package/dist/shared/{hx-textarea-BLcReynr.js → hx-textarea-B_nmxzhC.js} +12 -8
- package/dist/shared/hx-textarea-B_nmxzhC.js.map +1 -0
- package/dist/shared/hx-theme-6GDoUG8j.js.map +1 -1
- package/dist/shared/{hx-toggle-button---Z4zvmn.js → hx-toggle-button--xCXWRJW.js} +3 -3
- package/dist/shared/{hx-toggle-button---Z4zvmn.js.map → hx-toggle-button--xCXWRJW.js.map} +1 -1
- package/dist/shared/{hx-tree-item-CIo3ek2M.js → hx-tree-item-Cesh_du5.js} +170 -148
- package/dist/shared/hx-tree-item-Cesh_du5.js.map +1 -0
- package/package.json +7 -1
- package/dist/shared/hx-action-bar-D43v5rA2.js.map +0 -1
- package/dist/shared/hx-badge-DYB1Pnym.js.map +0 -1
- package/dist/shared/hx-breadcrumb-item-TKRcrMYc.js.map +0 -1
- package/dist/shared/hx-button-SAbf4_jC.js.map +0 -1
- package/dist/shared/hx-checkbox-group-CIIijwmc.js.map +0 -1
- package/dist/shared/hx-container-BXZBaOGG.js.map +0 -1
- package/dist/shared/hx-drawer-CenIAGuR.js.map +0 -1
- package/dist/shared/hx-image-CzkOEeO4.js.map +0 -1
- package/dist/shared/hx-radio-reSaVmIB.js.map +0 -1
- package/dist/shared/hx-slider-CzHOl3Ur.js.map +0 -1
- package/dist/shared/hx-textarea-BLcReynr.js.map +0 -1
- package/dist/shared/hx-tree-item-CIo3ek2M.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { H as r, a as x } from "./shared/hx-accordion-D95XSAft.js";
|
|
2
|
-
import { H as a } from "./shared/hx-action-bar-
|
|
2
|
+
import { H as a } from "./shared/hx-action-bar-B4i9tBCP.js";
|
|
3
3
|
import { H as i } from "./shared/hx-alert-BQpT4gL3.js";
|
|
4
4
|
import { H as s } from "./shared/hx-avatar-yHjmNdtf.js";
|
|
5
|
-
import { H as m } from "./shared/hx-badge-
|
|
6
|
-
import { H as n, a as u } from "./shared/hx-breadcrumb-item-
|
|
7
|
-
import { H as c } from "./shared/hx-button-
|
|
8
|
-
import { H as S } from "./shared/hx-button-group-
|
|
5
|
+
import { H as m } from "./shared/hx-badge-CjT0d8NK.js";
|
|
6
|
+
import { H as n, a as u } from "./shared/hx-breadcrumb-item-DtSxRZ_W.js";
|
|
7
|
+
import { H as c } from "./shared/hx-button-CtiJsmOg.js";
|
|
8
|
+
import { H as S } from "./shared/hx-button-group-BMV5qFs4.js";
|
|
9
9
|
import { H as I } from "./shared/hx-card-DAkEfpJd.js";
|
|
10
|
-
import { H as
|
|
10
|
+
import { H as B, a as P } from "./shared/hx-carousel-item-C2yBnM0r.js";
|
|
11
11
|
import { H as k } from "./shared/hx-checkbox-BMayOpAM.js";
|
|
12
|
-
import { H as D } from "./shared/hx-checkbox-group-
|
|
12
|
+
import { H as D } from "./shared/hx-checkbox-group-DTS9iT4b.js";
|
|
13
13
|
import { H as L } from "./shared/hx-code-snippet-DdEqy-1B.js";
|
|
14
14
|
import { H as F } from "./shared/hx-color-picker-K2x_dyeG.js";
|
|
15
15
|
import { H as M } from "./shared/hx-combobox-DjMigccw.js";
|
|
16
|
-
import { H as R } from "./shared/hx-container-
|
|
16
|
+
import { H as R } from "./shared/hx-container-DLUKnTi9.js";
|
|
17
17
|
import { H as y } from "./shared/hx-copy-button-BXL1xkxb.js";
|
|
18
18
|
import { H as O } from "./shared/hx-data-table-D3NZvc3P.js";
|
|
19
19
|
import { H as j } from "./shared/hx-date-picker-CIHwx9b3.js";
|
|
20
20
|
import { H as z } from "./shared/hx-dialog-e4CSD8xX.js";
|
|
21
21
|
import { H as J } from "./shared/hx-divider-XgWIz4Mr.js";
|
|
22
|
-
import { H as Q } from "./shared/hx-drawer-
|
|
22
|
+
import { H as Q } from "./shared/hx-drawer-bTF0nbrg.js";
|
|
23
23
|
import { H as X } from "./shared/hx-dropdown-DnjLnkTj.js";
|
|
24
24
|
import { H as Z } from "./shared/hx-field-Dz-7M_SC.js";
|
|
25
25
|
import { H as $ } from "./shared/hx-field-label-Bg-EWvqF.js";
|
|
@@ -29,47 +29,48 @@ import { H as ae } from "./shared/hx-format-date-BsVr8gpD.js";
|
|
|
29
29
|
import { H as ie, a as le } from "./shared/hx-grid-BsDBCTbt.js";
|
|
30
30
|
import { H as pe } from "./shared/hx-help-text-DaOPN1iB.js";
|
|
31
31
|
import { H as fe } from "./shared/hx-icon--xsJztDh.js";
|
|
32
|
-
import { H as ue } from "./shared/hx-
|
|
33
|
-
import { H as ce } from "./shared/hx-
|
|
34
|
-
import { H as Se
|
|
35
|
-
import { H as
|
|
36
|
-
import { H as ke } from "./shared/hx-
|
|
37
|
-
import { H as De } from "./shared/hx-
|
|
38
|
-
import { H as Le } from "./shared/hx-
|
|
39
|
-
import { H as Fe } from "./shared/hx-
|
|
40
|
-
import { H as Me } from "./shared/hx-
|
|
41
|
-
import { H as Re } from "./shared/hx-
|
|
42
|
-
import { H as ye } from "./shared/hx-
|
|
43
|
-
import { H as Oe } from "./shared/hx-
|
|
44
|
-
import { H as je } from "./shared/hx-progress-
|
|
45
|
-
import { H as ze } from "./shared/hx-
|
|
46
|
-
import { H as Je
|
|
47
|
-
import { H as We } from "./shared/hx-
|
|
48
|
-
import { H as Ye } from "./shared/hx-
|
|
49
|
-
import { H as _e
|
|
50
|
-
import { H as oo } from "./shared/hx-
|
|
51
|
-
import { H as xo } from "./shared/hx-
|
|
52
|
-
import { H as ao } from "./shared/hx-
|
|
53
|
-
import { H as io } from "./shared/hx-
|
|
54
|
-
import { H as so } from "./shared/hx-split-
|
|
55
|
-
import { H as mo } from "./shared/hx-
|
|
56
|
-
import { H as no } from "./shared/hx-
|
|
57
|
-
import { H as co
|
|
58
|
-
import { H as
|
|
59
|
-
import { H as
|
|
60
|
-
import { H as Co
|
|
61
|
-
import { H as wo } from "./shared/hx-
|
|
62
|
-
import { H as Ao } from "./shared/hx-
|
|
63
|
-
import { H as Go } from "./shared/hx-text-
|
|
64
|
-
import { H as No } from "./shared/hx-
|
|
65
|
-
import { H as ho } from "./shared/hx-
|
|
66
|
-
import { H as Vo } from "./shared/hx-
|
|
67
|
-
import { H as Uo
|
|
68
|
-
import { H as Eo } from "./shared/hx-
|
|
69
|
-
import { H as Ko } from "./shared/hx-
|
|
70
|
-
import { H as Wo } from "./shared/hx-
|
|
71
|
-
import { H as Yo
|
|
72
|
-
import { H as $o } from "./shared/hx-
|
|
32
|
+
import { H as ue } from "./shared/hx-icon-button-C_fsUJW4.js";
|
|
33
|
+
import { H as ce } from "./shared/hx-image-xyb_tHCR.js";
|
|
34
|
+
import { H as Se } from "./shared/hx-link-DfNy_UU8.js";
|
|
35
|
+
import { H as Ie, a as ge } from "./shared/hx-list-CF-AAnp-.js";
|
|
36
|
+
import { H as Pe, a as Ce, b as ke } from "./shared/hx-menu-divider-Buc5XA9E.js";
|
|
37
|
+
import { H as De } from "./shared/hx-meter-qcXl0zCL.js";
|
|
38
|
+
import { H as Le } from "./shared/hx-nav-CWwByFdq.js";
|
|
39
|
+
import { H as Fe } from "./shared/hx-number-input-CS6_w1lT.js";
|
|
40
|
+
import { H as Me } from "./shared/hx-overflow-menu-CAS1Mlus.js";
|
|
41
|
+
import { H as Re } from "./shared/hx-pagination-DNFgXQm3.js";
|
|
42
|
+
import { H as ye } from "./shared/hx-popover-BjAyLbzp.js";
|
|
43
|
+
import { H as Oe } from "./shared/hx-popup-CYf9Q5sj.js";
|
|
44
|
+
import { H as je } from "./shared/hx-progress-bar-b3_m1hna.js";
|
|
45
|
+
import { H as ze } from "./shared/hx-progress-ring-wOSv2y_I.js";
|
|
46
|
+
import { H as Je } from "./shared/hx-prose-DZh2KrMb.js";
|
|
47
|
+
import { H as Qe, a as We } from "./shared/hx-radio-CGtFKls2.js";
|
|
48
|
+
import { H as Ye } from "./shared/hx-rating-C4kTOyHF.js";
|
|
49
|
+
import { H as _e } from "./shared/hx-select-D9bYJcDv.js";
|
|
50
|
+
import { H as eo, a as oo } from "./shared/hx-nav-item-DItaMWl0.js";
|
|
51
|
+
import { H as xo } from "./shared/hx-skeleton-BHvALyd7.js";
|
|
52
|
+
import { H as ao } from "./shared/hx-slider-Duzmuid9.js";
|
|
53
|
+
import { H as io } from "./shared/hx-spinner-BOApJ-g9.js";
|
|
54
|
+
import { H as so } from "./shared/hx-split-button-DhncgAtZ.js";
|
|
55
|
+
import { H as mo } from "./shared/hx-split-panel-Cxkeauwe.js";
|
|
56
|
+
import { H as no } from "./shared/hx-stack-CfoW7jU7.js";
|
|
57
|
+
import { H as co } from "./shared/hx-status-indicator-oYWOkWlD.js";
|
|
58
|
+
import { H as So, a as bo } from "./shared/hx-step-nMT0fHEn.js";
|
|
59
|
+
import { H as go, a as Bo } from "./shared/hx-structured-list-CMja1VXz.js";
|
|
60
|
+
import { H as Co } from "./shared/hx-switch-BPvIcDpM.js";
|
|
61
|
+
import { H as vo, a as Do, b as wo } from "./shared/hx-tab-panel-C7h5lRpw.js";
|
|
62
|
+
import { H as Ao } from "./shared/hx-tag-SJJtMlOS.js";
|
|
63
|
+
import { H as Go } from "./shared/hx-text-NjKoQATI.js";
|
|
64
|
+
import { H as No } from "./shared/hx-text-input-BUMgOQHX.js";
|
|
65
|
+
import { H as ho } from "./shared/hx-textarea-B_nmxzhC.js";
|
|
66
|
+
import { H as Vo } from "./shared/hx-theme-6GDoUG8j.js";
|
|
67
|
+
import { H as Uo } from "./shared/hx-time-picker-a-BCkecJ.js";
|
|
68
|
+
import { H as qo, a as zo, t as Eo } from "./shared/hx-toast-ikwh9Y03.js";
|
|
69
|
+
import { H as Ko } from "./shared/hx-toggle-button--xCXWRJW.js";
|
|
70
|
+
import { H as Wo } from "./shared/hx-tooltip-DN6lMlP5.js";
|
|
71
|
+
import { H as Yo } from "./shared/hx-top-nav-8lDKNZUj.js";
|
|
72
|
+
import { H as _o, a as $o } from "./shared/hx-tree-item-Cesh_du5.js";
|
|
73
|
+
import { H as or } from "./shared/hx-visually-hidden-CCTQTjbR.js";
|
|
73
74
|
export {
|
|
74
75
|
r as HelixAccordion,
|
|
75
76
|
x as HelixAccordionItem,
|
|
@@ -82,8 +83,8 @@ export {
|
|
|
82
83
|
c as HelixButton,
|
|
83
84
|
S as HelixButtonGroup,
|
|
84
85
|
I as HelixCard,
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
B as HelixCarousel,
|
|
87
|
+
P as HelixCarouselItem,
|
|
87
88
|
k as HelixCheckbox,
|
|
88
89
|
D as HelixCheckboxGroup,
|
|
89
90
|
L as HelixCodeSnippet,
|
|
@@ -106,58 +107,59 @@ export {
|
|
|
106
107
|
le as HelixGridItem,
|
|
107
108
|
pe as HelixHelpText,
|
|
108
109
|
fe as HelixIcon,
|
|
109
|
-
ue as
|
|
110
|
-
ce as
|
|
111
|
-
Se as
|
|
112
|
-
|
|
113
|
-
ge as
|
|
114
|
-
Pe as
|
|
115
|
-
|
|
116
|
-
ke as
|
|
117
|
-
De as
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
Fe as
|
|
121
|
-
Me as
|
|
122
|
-
Re as
|
|
123
|
-
ye as
|
|
124
|
-
Oe as
|
|
125
|
-
je as
|
|
126
|
-
ze as
|
|
127
|
-
Je as
|
|
128
|
-
|
|
129
|
-
We as
|
|
130
|
-
Ye as
|
|
131
|
-
|
|
132
|
-
oo as
|
|
133
|
-
xo as
|
|
134
|
-
ao as
|
|
135
|
-
io as
|
|
136
|
-
so as
|
|
137
|
-
mo as
|
|
138
|
-
no as
|
|
139
|
-
co as
|
|
140
|
-
|
|
141
|
-
bo as
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
Co as
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
wo as
|
|
148
|
-
Ao as
|
|
149
|
-
Go as
|
|
150
|
-
No as
|
|
151
|
-
ho as
|
|
152
|
-
Vo as
|
|
153
|
-
Uo as
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
Ko as
|
|
157
|
-
Wo as
|
|
158
|
-
Yo as
|
|
159
|
-
|
|
160
|
-
$o as
|
|
161
|
-
|
|
110
|
+
ue as HelixIconButton,
|
|
111
|
+
ce as HelixImage,
|
|
112
|
+
Se as HelixLink,
|
|
113
|
+
Ie as HelixList,
|
|
114
|
+
ge as HelixListItem,
|
|
115
|
+
Pe as HelixMenu,
|
|
116
|
+
Ce as HelixMenuDivider,
|
|
117
|
+
ke as HelixMenuItem,
|
|
118
|
+
De as HelixMeter,
|
|
119
|
+
Le as HelixNav,
|
|
120
|
+
eo as HelixNavItem,
|
|
121
|
+
Fe as HelixNumberInput,
|
|
122
|
+
Me as HelixOverflowMenu,
|
|
123
|
+
Re as HelixPagination,
|
|
124
|
+
ye as HelixPopover,
|
|
125
|
+
Oe as HelixPopup,
|
|
126
|
+
je as HelixProgressBar,
|
|
127
|
+
ze as HelixProgressRing,
|
|
128
|
+
Je as HelixProse,
|
|
129
|
+
Qe as HelixRadio,
|
|
130
|
+
We as HelixRadioGroup,
|
|
131
|
+
Ye as HelixRating,
|
|
132
|
+
_e as HelixSelect,
|
|
133
|
+
oo as HelixSideNav,
|
|
134
|
+
xo as HelixSkeleton,
|
|
135
|
+
ao as HelixSlider,
|
|
136
|
+
io as HelixSpinner,
|
|
137
|
+
so as HelixSplitButton,
|
|
138
|
+
mo as HelixSplitPanel,
|
|
139
|
+
no as HelixStack,
|
|
140
|
+
co as HelixStatusIndicator,
|
|
141
|
+
So as HelixStep,
|
|
142
|
+
bo as HelixSteps,
|
|
143
|
+
go as HelixStructuredList,
|
|
144
|
+
Bo as HelixStructuredListRow,
|
|
145
|
+
Co as HelixSwitch,
|
|
146
|
+
vo as HelixTab,
|
|
147
|
+
Do as HelixTabPanel,
|
|
148
|
+
wo as HelixTabs,
|
|
149
|
+
Ao as HelixTag,
|
|
150
|
+
Go as HelixText,
|
|
151
|
+
No as HelixTextInput,
|
|
152
|
+
ho as HelixTextarea,
|
|
153
|
+
Vo as HelixTheme,
|
|
154
|
+
Uo as HelixTimePicker,
|
|
155
|
+
qo as HelixToast,
|
|
156
|
+
zo as HelixToastStack,
|
|
157
|
+
Ko as HelixToggleButton,
|
|
158
|
+
Wo as HelixTooltip,
|
|
159
|
+
Yo as HelixTopNav,
|
|
160
|
+
_o as HelixTreeItem,
|
|
161
|
+
$o as HelixTreeView,
|
|
162
|
+
or as HelixVisuallyHidden,
|
|
163
|
+
Eo as toast
|
|
162
164
|
};
|
|
163
165
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css as d, LitElement as b, html as f } from "lit";
|
|
2
|
-
import { property as
|
|
2
|
+
import { property as l, state as p, customElement as u } from "lit/decorators.js";
|
|
3
3
|
import { tokenStyles as v } from "@helixui/tokens/lit";
|
|
4
4
|
const x = d`
|
|
5
5
|
:host {
|
|
@@ -119,30 +119,40 @@ const x = d`
|
|
|
119
119
|
flex-shrink: 0;
|
|
120
120
|
}
|
|
121
121
|
`;
|
|
122
|
-
var m = Object.defineProperty, g = Object.getOwnPropertyDescriptor,
|
|
123
|
-
for (var i =
|
|
124
|
-
(r =
|
|
125
|
-
return
|
|
122
|
+
var m = Object.defineProperty, g = Object.getOwnPropertyDescriptor, c = (t, e, s, a) => {
|
|
123
|
+
for (var i = a > 1 ? void 0 : a ? g(e, s) : e, o = t.length - 1, r; o >= 0; o--)
|
|
124
|
+
(r = t[o]) && (i = (a ? r(e, s, i) : r(i)) || i);
|
|
125
|
+
return a && i && m(e, s, i), i;
|
|
126
126
|
};
|
|
127
127
|
let n = class extends b {
|
|
128
128
|
constructor() {
|
|
129
|
-
super(...arguments), this.size = "md", this.variant = "default", this.position = "top", this.
|
|
130
|
-
var
|
|
131
|
-
if (
|
|
132
|
-
|
|
133
|
-
else if (
|
|
134
|
-
|
|
135
|
-
else if (
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
} else if (
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
|
|
129
|
+
super(...arguments), this.size = "md", this.variant = "default", this.position = "top", this._sticky = !1, this.ariaLabel = "Actions", this._focusableCache = null, this._hasOverflow = !1, this._handleKeydown = (t) => {
|
|
130
|
+
var e, s;
|
|
131
|
+
if (t.key === "ArrowRight")
|
|
132
|
+
t.preventDefault(), this._moveFocus("next");
|
|
133
|
+
else if (t.key === "ArrowLeft")
|
|
134
|
+
t.preventDefault(), this._moveFocus("prev");
|
|
135
|
+
else if (t.key === "Home") {
|
|
136
|
+
t.preventDefault();
|
|
137
|
+
const a = this._getFocusableItems();
|
|
138
|
+
a.length && (a.forEach((i, o) => i.setAttribute("tabindex", o === 0 ? "0" : "-1")), (e = a[0]) == null || e.focus());
|
|
139
|
+
} else if (t.key === "End") {
|
|
140
|
+
t.preventDefault();
|
|
141
|
+
const a = this._getFocusableItems(), i = a.length - 1;
|
|
142
|
+
a.length && (a.forEach((o, r) => o.setAttribute("tabindex", r === i ? "0" : "-1")), (s = a[i]) == null || s.focus());
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
+
get sticky() {
|
|
147
|
+
return this._sticky;
|
|
148
|
+
}
|
|
149
|
+
set sticky(t) {
|
|
150
|
+
t && console.warn(
|
|
151
|
+
'[hx-action-bar] The `sticky` property is deprecated. Use `position="sticky"` instead.'
|
|
152
|
+
);
|
|
153
|
+
const e = this._sticky;
|
|
154
|
+
this._sticky = t, this.requestUpdate("sticky", e);
|
|
155
|
+
}
|
|
146
156
|
connectedCallback() {
|
|
147
157
|
super.connectedCallback(), this.hasAttribute("role") || this.setAttribute("role", "none"), this.addEventListener("keydown", this._handleKeydown);
|
|
148
158
|
}
|
|
@@ -153,64 +163,64 @@ let n = class extends b {
|
|
|
153
163
|
super.disconnectedCallback(), this.removeEventListener("keydown", this._handleKeydown);
|
|
154
164
|
}
|
|
155
165
|
// ─── Focusable item discovery ───
|
|
156
|
-
_isFocusable(
|
|
157
|
-
if (
|
|
158
|
-
if (
|
|
159
|
-
const
|
|
160
|
-
return
|
|
166
|
+
_isFocusable(t) {
|
|
167
|
+
if (t.hasAttribute("disabled") || t.disabled === !0) return !1;
|
|
168
|
+
if (t.tabIndex >= 0) return !0;
|
|
169
|
+
const s = t.tagName.toLowerCase();
|
|
170
|
+
return s === "button" || s === "input" || s === "select" || s === "textarea";
|
|
161
171
|
}
|
|
162
172
|
_getFocusableItems() {
|
|
163
|
-
var
|
|
173
|
+
var s;
|
|
164
174
|
if (this._focusableCache) return this._focusableCache;
|
|
165
|
-
const
|
|
166
|
-
for (const
|
|
167
|
-
const i =
|
|
175
|
+
const t = ((s = this.shadowRoot) == null ? void 0 : s.querySelectorAll("slot")) ?? [], e = [];
|
|
176
|
+
for (const a of Array.from(t)) {
|
|
177
|
+
const i = a.assignedElements({ flatten: !0 });
|
|
168
178
|
for (const o of i)
|
|
169
179
|
if (o instanceof HTMLElement)
|
|
170
180
|
if (this._isFocusable(o))
|
|
171
|
-
|
|
181
|
+
e.push(o);
|
|
172
182
|
else {
|
|
173
183
|
const r = o.querySelectorAll("*");
|
|
174
184
|
for (const h of Array.from(r))
|
|
175
|
-
this._isFocusable(h) &&
|
|
185
|
+
this._isFocusable(h) && e.push(h);
|
|
176
186
|
}
|
|
177
187
|
}
|
|
178
|
-
return this._focusableCache =
|
|
188
|
+
return this._focusableCache = e, e;
|
|
179
189
|
}
|
|
180
190
|
// ─── Roving tabindex helpers ───
|
|
181
191
|
_initRovingTabindex() {
|
|
182
192
|
this._focusableCache = null;
|
|
183
|
-
const e = this._getFocusableItems();
|
|
184
|
-
if (!e.length) return;
|
|
185
|
-
e.some((a) => a.getAttribute("tabindex") === "0") ? e.forEach((a) => {
|
|
186
|
-
a.getAttribute("tabindex") === null && a.setAttribute("tabindex", "-1");
|
|
187
|
-
}) : e.forEach((a, s) => a.setAttribute("tabindex", s === 0 ? "0" : "-1"));
|
|
188
|
-
}
|
|
189
|
-
_moveFocus(e) {
|
|
190
|
-
var o;
|
|
191
193
|
const t = this._getFocusableItems();
|
|
192
194
|
if (!t.length) return;
|
|
193
|
-
|
|
195
|
+
t.some((s) => s.getAttribute("tabindex") === "0") ? t.forEach((s) => {
|
|
196
|
+
s.getAttribute("tabindex") === null && s.setAttribute("tabindex", "-1");
|
|
197
|
+
}) : t.forEach((s, a) => s.setAttribute("tabindex", a === 0 ? "0" : "-1"));
|
|
198
|
+
}
|
|
199
|
+
_moveFocus(t) {
|
|
200
|
+
var o;
|
|
201
|
+
const e = this._getFocusableItems();
|
|
202
|
+
if (!e.length) return;
|
|
203
|
+
const s = document.activeElement, a = e.indexOf(s);
|
|
194
204
|
let i;
|
|
195
|
-
|
|
205
|
+
t === "next" ? i = a < e.length - 1 ? a + 1 : 0 : i = a > 0 ? a - 1 : e.length - 1, e.forEach((r, h) => {
|
|
196
206
|
r.setAttribute("tabindex", h === i ? "0" : "-1");
|
|
197
|
-
}), (o =
|
|
207
|
+
}), (o = e[i]) == null || o.focus();
|
|
198
208
|
}
|
|
199
209
|
// ─── Event Handlers ───
|
|
200
|
-
_handleSlotChange(
|
|
201
|
-
const
|
|
202
|
-
|
|
210
|
+
_handleSlotChange(t) {
|
|
211
|
+
const e = t.target;
|
|
212
|
+
e.name === "overflow" && (this._hasOverflow = e.assignedElements({ flatten: !0 }).length > 0), this._initRovingTabindex();
|
|
203
213
|
}
|
|
204
214
|
// ─── Render ───
|
|
205
215
|
render() {
|
|
206
|
-
const
|
|
216
|
+
const t = this.position === "sticky" || this.sticky, e = this.position === "bottom", s = t ? " base--sticky" : e ? " base--bottom" : "";
|
|
207
217
|
return f`
|
|
208
218
|
<div
|
|
209
219
|
part="base"
|
|
210
220
|
role="toolbar"
|
|
211
221
|
aria-label=${this.ariaLabel}
|
|
212
222
|
aria-orientation="horizontal"
|
|
213
|
-
class="base base--${this.size} base--${this.variant}${
|
|
223
|
+
class="base base--${this.size} base--${this.variant}${s}"
|
|
214
224
|
>
|
|
215
225
|
<div part="start" class="section section--start">
|
|
216
226
|
<slot name="start" @slotchange=${this._handleSlotChange}></slot>
|
|
@@ -229,28 +239,28 @@ let n = class extends b {
|
|
|
229
239
|
}
|
|
230
240
|
};
|
|
231
241
|
n.styles = [v, x];
|
|
232
|
-
|
|
233
|
-
|
|
242
|
+
c([
|
|
243
|
+
l({ type: String, reflect: !0 })
|
|
234
244
|
], n.prototype, "size", 2);
|
|
235
|
-
|
|
236
|
-
|
|
245
|
+
c([
|
|
246
|
+
l({ type: String, reflect: !0 })
|
|
237
247
|
], n.prototype, "variant", 2);
|
|
238
|
-
|
|
239
|
-
|
|
248
|
+
c([
|
|
249
|
+
l({ type: String, reflect: !0 })
|
|
240
250
|
], n.prototype, "position", 2);
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
], n.prototype, "sticky",
|
|
244
|
-
|
|
245
|
-
|
|
251
|
+
c([
|
|
252
|
+
l({ type: Boolean, reflect: !0 })
|
|
253
|
+
], n.prototype, "sticky", 1);
|
|
254
|
+
c([
|
|
255
|
+
l({ attribute: "aria-label" })
|
|
246
256
|
], n.prototype, "ariaLabel", 2);
|
|
247
|
-
|
|
257
|
+
c([
|
|
248
258
|
p()
|
|
249
259
|
], n.prototype, "_hasOverflow", 2);
|
|
250
|
-
n =
|
|
260
|
+
n = c([
|
|
251
261
|
u("hx-action-bar")
|
|
252
262
|
], n);
|
|
253
263
|
export {
|
|
254
264
|
n as H
|
|
255
265
|
};
|
|
256
|
-
//# sourceMappingURL=hx-action-bar-
|
|
266
|
+
//# sourceMappingURL=hx-action-bar-B4i9tBCP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-action-bar-B4i9tBCP.js","sources":["../../src/components/hx-action-bar/hx-action-bar.styles.ts","../../src/components/hx-action-bar/hx-action-bar.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixActionBarStyles = css`\n :host {\n display: block;\n }\n\n /* ─── Base ─── */\n\n .base {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--hx-action-bar-gap, var(--hx-space-2, 0.5rem));\n padding: var(--hx-action-bar-padding, var(--hx-space-2, 0.5rem) var(--hx-space-3, 0.75rem));\n background: var(--hx-action-bar-bg, transparent);\n border: var(--hx-action-bar-border, none);\n box-sizing: border-box;\n width: 100%;\n }\n\n /* ─── Sticky (top) ─── */\n\n .base--sticky {\n position: sticky;\n top: 0;\n padding-top: max(var(--hx-action-bar-padding-block-start, 0px), env(safe-area-inset-top, 0px));\n z-index: var(--hx-action-bar-z-index, 10);\n /*\n * Consumers: when this bar is sticky, add scroll-padding-top to the scroll container\n * equal to the bar's rendered height so anchor targets are not hidden behind the bar.\n * Example: .scroll-container { scroll-padding-top: 2.5rem; }\n */\n }\n\n /* ─── Bottom sticky ─── */\n\n .base--bottom {\n position: sticky;\n bottom: 0;\n /*\n * Respect iOS home-indicator safe area on devices with notch/home bar.\n * Falls back to 0px on devices that do not support env().\n */\n padding-bottom: max(\n var(--hx-action-bar-padding-block-end, 0px),\n env(safe-area-inset-bottom, 0px)\n );\n z-index: var(--hx-action-bar-z-index, 10);\n }\n\n /* ─── Variant: outlined ─── */\n\n .base--outlined {\n background: var(--hx-action-bar-bg, var(--hx-color-neutral-0, #fff));\n border: var(\n --hx-action-bar-border,\n var(--hx-border-width-thin, 1px) solid var(--hx-color-neutral-200, #e5e7eb)\n );\n border-radius: var(--hx-border-radius-md, 0.375rem);\n }\n\n /* ─── Variant: filled ─── */\n\n .base--filled {\n background: var(--hx-action-bar-bg, var(--hx-color-neutral-50, #f9fafb));\n border-radius: var(--hx-border-radius-md, 0.375rem);\n }\n\n /* ─── Size modifiers ─── */\n\n .base--sm {\n padding: var(--hx-action-bar-padding, var(--hx-space-1, 0.25rem) var(--hx-space-2, 0.5rem));\n gap: var(--hx-action-bar-gap, var(--hx-space-1, 0.25rem));\n min-height: var(--hx-size-8, 2rem);\n }\n\n .base--md {\n min-height: var(--hx-size-10, 2.5rem);\n }\n\n .base--lg {\n padding: var(--hx-action-bar-padding, var(--hx-space-3, 0.75rem) var(--hx-space-4, 1rem));\n gap: var(--hx-action-bar-gap, var(--hx-space-3, 0.75rem));\n min-height: var(--hx-size-12, 3rem);\n }\n\n /* ─── Sections ─── */\n\n .section {\n display: flex;\n align-items: center;\n gap: inherit;\n }\n\n /*\n * Equal flex-basis on start and end guarantees the center section is visually centered\n * within the full bar width, regardless of how wide start and end content are.\n */\n .section--start {\n flex: 1 1 0;\n justify-content: flex-start;\n }\n\n .section--center {\n flex: 0 0 auto;\n justify-content: center;\n }\n\n .section--end {\n flex: 1 1 0;\n justify-content: flex-end;\n }\n\n /* ─── Slotted content ─── */\n\n ::slotted(*) {\n flex-shrink: 0;\n }\n`;\n","import { LitElement, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { tokenStyles } from '@helixui/tokens/lit';\nimport { helixActionBarStyles } from './hx-action-bar.styles.js';\n\n/**\n * A horizontal toolbar container for grouping related action buttons and controls.\n * Implements the ARIA toolbar pattern with roving tabindex keyboard navigation.\n *\n * @summary Horizontal action bar for grouping related controls.\n *\n * @tag hx-action-bar\n *\n * @slot start - Left-aligned actions.\n * @slot - Center content (default slot).\n * @slot end - Right-aligned actions.\n * @slot overflow - Actions revealed when the bar is constrained for space.\n *\n * @csspart base - The root toolbar container element.\n * @csspart start - The start (left) slot wrapper.\n * @csspart center - The center (default) slot wrapper.\n * @csspart end - The end (right) slot wrapper.\n * @csspart overflow - The overflow slot wrapper (hidden when no overflow content).\n *\n * @cssprop [--hx-action-bar-bg=transparent] - Bar background color (default variant).\n * @cssprop [--hx-action-bar-border=none] - Bar border (default variant).\n * @cssprop [--hx-action-bar-padding=var(--hx-space-2,0.5rem) var(--hx-space-3,0.75rem)] - Inner padding.\n * @cssprop [--hx-action-bar-gap=var(--hx-space-2,0.5rem)] - Gap between slotted items.\n * @cssprop [--hx-action-bar-z-index=10] - Z-index when sticky or bottom position.\n *\n * @attr {string} aria-label - Required. Identifies the toolbar to assistive technology.\n * When multiple toolbars appear on the same page, each must have a unique, descriptive label.\n *\n * @example\n * ```html\n * <hx-action-bar aria-label=\"Patient actions\">\n * <hx-button slot=\"start\">Save</hx-button>\n * <hx-button slot=\"end\" variant=\"ghost\">Cancel</hx-button>\n * </hx-action-bar>\n * ```\n */\n@customElement('hx-action-bar')\nexport class HelixActionBar extends LitElement {\n static override styles = [tokenStyles, helixActionBarStyles];\n\n /**\n * Size of the action bar — propagated as a data attribute to slotted children.\n * @attr size\n */\n @property({ type: String, reflect: true })\n size: 'sm' | 'md' | 'lg' = 'md';\n\n /**\n * Visual variant controlling the bar background.\n * @attr variant\n */\n @property({ type: String, reflect: true })\n variant: 'default' | 'outlined' | 'filled' = 'default';\n\n /**\n * Position and sticky behavior of the action bar.\n * - `top` — normal flow (default)\n * - `sticky` — sticks to the top of the scroll container; add `scroll-padding-top` to the\n * scroll container equal to the bar height to prevent anchor targets from scrolling behind it\n * - `bottom` — sticks to the bottom of the scroll container with iOS safe-area-inset support\n * @attr position\n */\n @property({ type: String, reflect: true })\n position: 'top' | 'bottom' | 'sticky' = 'top';\n\n /**\n * @deprecated Use `position=\"sticky\"` instead.\n * When true, the bar sticks to the top of its scroll container.\n * @attr sticky\n */\n @property({ type: Boolean, reflect: true })\n get sticky(): boolean {\n return this._sticky;\n }\n set sticky(value: boolean) {\n if (value) {\n console.warn(\n '[hx-action-bar] The `sticky` property is deprecated. Use `position=\"sticky\"` instead.',\n );\n }\n const old = this._sticky;\n this._sticky = value;\n this.requestUpdate('sticky', old);\n }\n private _sticky = false;\n\n /**\n * Accessible label for the toolbar.\n * Required when multiple toolbars appear on the same page.\n * @attr aria-label\n */\n @property({ attribute: 'aria-label' })\n ariaLabel: string = 'Actions';\n\n /** Cached list of focusable items — invalidated on slot change. */\n private _focusableCache: HTMLElement[] | null = null;\n\n /** Whether the overflow slot has assigned content. */\n @state()\n private _hasOverflow = false;\n\n // ─── Lifecycle ───\n\n /** Arrow function field — stable reference for add/removeEventListener. */\n private _handleKeydown = (e: KeyboardEvent): void => {\n if (e.key === 'ArrowRight') {\n e.preventDefault();\n this._moveFocus('next');\n } else if (e.key === 'ArrowLeft') {\n e.preventDefault();\n this._moveFocus('prev');\n } else if (e.key === 'Home') {\n e.preventDefault();\n // Move directly to first item — do NOT call _moveFocus which would visit other items first.\n const items = this._getFocusableItems();\n if (items.length) {\n items.forEach((el, i) => el.setAttribute('tabindex', i === 0 ? '0' : '-1'));\n items[0]?.focus();\n }\n } else if (e.key === 'End') {\n e.preventDefault();\n const items = this._getFocusableItems();\n const last = items.length - 1;\n if (items.length) {\n items.forEach((el, i) => el.setAttribute('tabindex', i === last ? '0' : '-1'));\n items[last]?.focus();\n }\n }\n };\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Prevent dual aria-label announcement: the host carries the consumer's\n // aria-label attribute while the inner div[role=\"toolbar\"] receives the\n // same value. Setting role=\"none\" on the host hides it from the\n // accessibility tree so only the toolbar is announced.\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'none');\n }\n this.addEventListener('keydown', this._handleKeydown);\n }\n\n override firstUpdated(): void {\n // Slot assignments are complete by firstUpdated; initialize roving tabindex\n // immediately rather than waiting for the async slotchange event.\n this._initRovingTabindex();\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('keydown', this._handleKeydown);\n }\n\n // ─── Focusable item discovery ───\n\n private _isFocusable(el: HTMLElement): boolean {\n // Check disabled via DOM attribute (native elements) or property (custom elements)\n if (el.hasAttribute('disabled')) return false;\n const elWithDisabled = el as HTMLElement & { disabled?: boolean };\n if (elWithDisabled.disabled === true) return false;\n\n // Use the IDL tabIndex property — covers both DOM attribute and ElementInternals settings.\n // Custom elements (e.g. hx-button) that set tabIndex via ElementInternals are discoverable.\n if (el.tabIndex >= 0) return true;\n\n const tag = el.tagName.toLowerCase();\n return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';\n }\n\n private _getFocusableItems(): HTMLElement[] {\n if (this._focusableCache) return this._focusableCache;\n\n const slots = this.shadowRoot?.querySelectorAll('slot') ?? [];\n const items: HTMLElement[] = [];\n\n for (const slot of Array.from(slots)) {\n const assigned = (slot as HTMLSlotElement).assignedElements({ flatten: true });\n for (const el of assigned) {\n if (!(el instanceof HTMLElement)) continue;\n if (this._isFocusable(el)) {\n // Element is itself focusable — include it and do NOT also recurse into its children\n // to prevent double-counting compound components (e.g. <a><button>).\n items.push(el);\n } else {\n // Element is a non-focusable wrapper (e.g. <div>, <span>) — find focusable children.\n const descendants = el.querySelectorAll<HTMLElement>('*');\n for (const d of Array.from(descendants)) {\n if (this._isFocusable(d)) {\n items.push(d);\n }\n }\n }\n }\n }\n\n this._focusableCache = items;\n return items;\n }\n\n // ─── Roving tabindex helpers ───\n\n private _initRovingTabindex(): void {\n this._focusableCache = null; // invalidate cache on slot change\n const items = this._getFocusableItems();\n if (!items.length) return;\n const hasActive = items.some((el) => el.getAttribute('tabindex') === '0');\n if (!hasActive) {\n // No item is active yet — make the first item tabbable.\n items.forEach((el, i) => el.setAttribute('tabindex', i === 0 ? '0' : '-1'));\n } else {\n // An item is already active — ensure new items get tabindex=\"-1\"\n // without disturbing the currently active item.\n items.forEach((el) => {\n if (el.getAttribute('tabindex') === null) el.setAttribute('tabindex', '-1');\n });\n }\n }\n\n private _moveFocus(direction: 'next' | 'prev'): void {\n const items = this._getFocusableItems();\n if (!items.length) return;\n\n const focused = document.activeElement as HTMLElement | null;\n const currentIndex = items.indexOf(focused as HTMLElement);\n\n let nextIndex: number;\n if (direction === 'next') {\n nextIndex = currentIndex < items.length - 1 ? currentIndex + 1 : 0;\n } else {\n nextIndex = currentIndex > 0 ? currentIndex - 1 : items.length - 1;\n }\n\n items.forEach((el, i) => {\n el.setAttribute('tabindex', i === nextIndex ? '0' : '-1');\n });\n\n items[nextIndex]?.focus();\n }\n\n // ─── Event Handlers ───\n\n private _handleSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n if (slot.name === 'overflow') {\n this._hasOverflow = slot.assignedElements({ flatten: true }).length > 0;\n }\n this._initRovingTabindex();\n }\n\n // ─── Render ───\n\n override render() {\n const isSticky = this.position === 'sticky' || this.sticky;\n const isBottom = this.position === 'bottom';\n const positionClass = isSticky ? ' base--sticky' : isBottom ? ' base--bottom' : '';\n\n return html`\n <div\n part=\"base\"\n role=\"toolbar\"\n aria-label=${this.ariaLabel}\n aria-orientation=\"horizontal\"\n class=\"base base--${this.size} base--${this.variant}${positionClass}\"\n >\n <div part=\"start\" class=\"section section--start\">\n <slot name=\"start\" @slotchange=${this._handleSlotChange}></slot>\n </div>\n <div part=\"center\" class=\"section section--center\">\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n <div part=\"end\" class=\"section section--end\">\n <slot name=\"end\" @slotchange=${this._handleSlotChange}></slot>\n </div>\n <div part=\"overflow\" class=\"section section--overflow\" ?hidden=${!this._hasOverflow}>\n <slot name=\"overflow\" @slotchange=${this._handleSlotChange}></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-action-bar': HelixActionBar;\n }\n}\n"],"names":["helixActionBarStyles","css","HelixActionBar","LitElement","e","items","el","i","_a","last","_b","value","old","tag","slots","slot","assigned","descendants","d","direction","focused","currentIndex","nextIndex","isSticky","isBottom","positionClass","html","tokenStyles","__decorateClass","property","state","customElement"],"mappings":";;;AAEO,MAAMA,IAAuBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;ACwC7B,IAAMC,IAAN,cAA6BC,EAAW;AAAA,EAAxC,cAAA;AAAA,UAAA,GAAA,SAAA,GAQL,KAAA,OAA2B,MAO3B,KAAA,UAA6C,WAW7C,KAAA,WAAwC,OAqBxC,KAAQ,UAAU,IAQlB,KAAA,YAAoB,WAGpB,KAAQ,kBAAwC,MAIhD,KAAQ,eAAe,IAKvB,KAAQ,iBAAiB,CAACC,MAA2B;;AACnD,UAAIA,EAAE,QAAQ;AACZ,QA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P9B3B,EAQX,WAAA,QAAA,CAAA;AAOA0B,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAd9B3B,EAeX,WAAA,WAAA,CAAA;AAWA0B,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAzB9B3B,EA0BX,WAAA,YAAA,CAAA;AAQI0B,EAAA;AAAA,EADHC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAjC/B3B,EAkCP,WAAA,UAAA,CAAA;AAqBJ0B,EAAA;AAAA,EADCC,EAAS,EAAE,WAAW,aAAA,CAAc;AAAA,GAtD1B3B,EAuDX,WAAA,aAAA,CAAA;AAOQ0B,EAAA;AAAA,EADPE,EAAA;AAAM,GA7DI5B,EA8DH,WAAA,gBAAA,CAAA;AA9DGA,IAAN0B,EAAA;AAAA,EADNG,EAAc,eAAe;AAAA,GACjB7B,CAAA;"}
|
|
@@ -102,15 +102,22 @@ const f = g`
|
|
|
102
102
|
border-radius: var(--hx-border-radius-full, 9999px);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
/* Guard: hide prefix slot and slotted content in dot mode to prevent overflow */
|
|
106
|
+
.badge--dot ::slotted(*) {
|
|
107
|
+
display: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
105
110
|
/* ─── Pulse Animation ─── */
|
|
106
111
|
|
|
107
112
|
@keyframes wc-badge-pulse {
|
|
108
113
|
0%,
|
|
109
114
|
100% {
|
|
110
115
|
opacity: 1;
|
|
116
|
+
box-shadow: 0 0 0 0 var(--hx-badge-pulse-color, currentColor);
|
|
111
117
|
}
|
|
112
118
|
50% {
|
|
113
|
-
opacity: 0.
|
|
119
|
+
opacity: 0.7;
|
|
120
|
+
box-shadow: 0 0 0 4px transparent;
|
|
114
121
|
}
|
|
115
122
|
}
|
|
116
123
|
|
|
@@ -252,4 +259,4 @@ e = r([
|
|
|
252
259
|
export {
|
|
253
260
|
e as H
|
|
254
261
|
};
|
|
255
|
-
//# sourceMappingURL=hx-badge-
|
|
262
|
+
//# sourceMappingURL=hx-badge-CjT0d8NK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-badge-CjT0d8NK.js","sources":["../../src/components/hx-badge/hx-badge.styles.ts","../../src/components/hx-badge/hx-badge.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixBadgeStyles = css`\n :host {\n display: inline-block;\n }\n\n .badge {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--hx-space-1, 0.25rem);\n border-radius: var(--hx-badge-border-radius, var(--hx-border-radius-md, 0.375rem));\n background-color: var(--hx-badge-bg, var(--hx-color-primary-500, #2563eb));\n color: var(--hx-badge-color, var(--hx-color-neutral-0, #ffffff));\n font-family: var(--hx-badge-font-family, var(--hx-font-family-sans, sans-serif));\n font-weight: var(--hx-badge-font-weight, var(--hx-font-weight-semibold, 600));\n line-height: var(--hx-line-height-tight, 1.25);\n white-space: nowrap;\n vertical-align: middle;\n position: relative;\n }\n\n /* ─── Size Variants ─── */\n\n .badge--sm {\n font-size: var(--hx-badge-font-size, var(--hx-font-size-2xs, 0.625rem));\n padding: var(--hx-badge-padding-y, var(--hx-space-0-5, 0.125rem))\n var(--hx-badge-padding-x, var(--hx-space-1-5, 0.375rem));\n }\n\n .badge--md {\n font-size: var(--hx-badge-font-size, var(--hx-font-size-xs, 0.75rem));\n padding: var(--hx-badge-padding-y, var(--hx-space-1, 0.25rem))\n var(--hx-badge-padding-x, var(--hx-space-2, 0.5rem));\n }\n\n .badge--lg {\n font-size: var(--hx-badge-font-size, var(--hx-font-size-sm, 0.875rem));\n padding: var(--hx-badge-padding-y, var(--hx-space-1, 0.25rem))\n var(--hx-badge-padding-x, var(--hx-space-3, 0.75rem));\n }\n\n /* ─── Style Variants ─── */\n\n .badge--primary {\n --hx-badge-bg: var(--hx-color-primary-500, #2563eb);\n --hx-badge-color: var(--hx-color-neutral-0, #ffffff);\n --hx-badge-pulse-color: var(--hx-color-primary-500, #2563eb);\n }\n\n .badge--secondary {\n --hx-badge-bg: var(--hx-badge-secondary-bg, var(--hx-color-neutral-100, #f3f4f6));\n --hx-badge-color: var(--hx-badge-secondary-color, var(--hx-color-neutral-700, #374151));\n --hx-badge-pulse-color: var(--hx-badge-secondary-bg, var(--hx-color-neutral-100, #f3f4f6));\n }\n\n .badge--success {\n --hx-badge-bg: var(--hx-color-success-700, #15803d);\n --hx-badge-color: var(--hx-color-neutral-0, #ffffff);\n --hx-badge-pulse-color: var(--hx-color-success-700, #15803d);\n }\n\n .badge--warning {\n --hx-badge-bg: var(--hx-color-warning-500, #eab308);\n --hx-badge-color: var(--hx-color-neutral-900, #1a1a1a);\n --hx-badge-pulse-color: var(--hx-color-warning-500, #eab308);\n }\n\n .badge--error {\n --hx-badge-bg: var(--hx-color-error-500, #dc2626);\n --hx-badge-color: var(--hx-color-neutral-0, #ffffff);\n --hx-badge-pulse-color: var(--hx-color-error-500, #dc2626);\n }\n\n .badge--neutral {\n --hx-badge-bg: var(--hx-color-neutral-200, #e5e7eb);\n --hx-badge-color: var(--hx-color-neutral-700, #374151);\n --hx-badge-pulse-color: var(--hx-color-neutral-200, #e5e7eb);\n }\n\n .badge--info {\n --hx-badge-bg: var(--hx-badge-info-bg, var(--hx-color-info-700, #0369a1));\n --hx-badge-color: var(--hx-badge-info-color, var(--hx-color-neutral-0, #ffffff));\n --hx-badge-pulse-color: var(--hx-badge-info-bg, var(--hx-color-info-700, #0369a1));\n }\n\n /* ─── Pill Mode ─── */\n\n .badge--pill {\n border-radius: var(--hx-badge-border-radius, var(--hx-border-radius-full, 9999px));\n }\n\n /* ─── Dot Indicator (empty + pulse) ─── */\n\n .badge--dot {\n width: var(--hx-badge-dot-size, var(--hx-size-2, 0.5rem));\n height: var(--hx-badge-dot-size, var(--hx-size-2, 0.5rem));\n padding: 0;\n border-radius: var(--hx-border-radius-full, 9999px);\n }\n\n /* Guard: hide prefix slot and slotted content in dot mode to prevent overflow */\n .badge--dot ::slotted(*) {\n display: none;\n }\n\n /* ─── Pulse Animation ─── */\n\n @keyframes wc-badge-pulse {\n 0%,\n 100% {\n opacity: 1;\n box-shadow: 0 0 0 0 var(--hx-badge-pulse-color, currentColor);\n }\n 50% {\n opacity: 0.7;\n box-shadow: 0 0 0 4px transparent;\n }\n }\n\n .badge--pulse {\n animation: wc-badge-pulse var(--hx-badge-pulse-duration, var(--hx-duration-slow, 2s))\n var(--hx-badge-pulse-easing, var(--hx-ease-in-out, ease-in-out)) infinite;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .badge--pulse {\n animation: none;\n }\n }\n\n /* ─── Remove Button ─── */\n\n .badge__remove-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: none;\n border: none;\n padding: 0;\n margin-inline-start: var(--hx-space-1, 0.25rem);\n cursor: pointer;\n color: inherit;\n opacity: 0.7;\n border-radius: var(--hx-border-radius-sm, 0.125rem);\n line-height: 0;\n }\n\n .badge__remove-button:hover {\n opacity: 1;\n }\n\n .badge__remove-button:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid var(--hx-focus-ring-color, currentColor);\n outline-offset: var(--hx-focus-ring-offset, 1px);\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 { helixBadgeStyles } from './hx-badge.styles.js';\n\n/**\n * A small status indicator for notifications, counts, and labels.\n *\n * @summary Presentational badge for status indicators, notification counts, and labels.\n *\n * @tag hx-badge\n *\n * @slot - Default slot for badge content (text, number). When empty with pulse enabled, renders as a dot indicator.\n * @slot prefix - Icon or content rendered before the badge text.\n *\n * @fires {CustomEvent<void>} hx-remove - Dispatched when the user clicks the remove button.\n *\n * @csspart badge - The badge element.\n * @csspart remove-button - The remove/dismiss button.\n *\n * @cssprop [--hx-badge-bg=var(--hx-color-primary-500)] - Badge background color. The primary override point.\n * @cssprop [--hx-badge-color=var(--hx-color-neutral-0)] - Badge text color. The primary override point.\n * @cssprop [--hx-badge-font-size] - Badge font size (set per size variant).\n * @cssprop [--hx-badge-font-weight=var(--hx-font-weight-semibold)] - Badge font weight.\n * @cssprop [--hx-badge-font-family=var(--hx-font-family-sans)] - Badge font family.\n * @cssprop [--hx-badge-border-radius=var(--hx-border-radius-md)] - Badge border radius.\n * @cssprop [--hx-badge-padding-x] - Badge horizontal padding (set per size variant).\n * @cssprop [--hx-badge-padding-y] - Badge vertical padding (set per size variant).\n * @cssprop [--hx-badge-pulse-color] - Pulse color matching variant background with reduced opacity.\n * @cssprop [--hx-badge-dot-size=var(--hx-size-2)] - Dot indicator size when rendered without content.\n * @cssprop [--hx-badge-secondary-bg=var(--hx-color-neutral-100)] - Background for the secondary variant.\n * @cssprop [--hx-badge-secondary-color=var(--hx-color-neutral-700)] - Text color for the secondary variant.\n * @cssprop [--hx-badge-info-bg=var(--hx-color-info-700)] - Background for the info variant.\n * @cssprop [--hx-badge-info-color=var(--hx-color-neutral-0)] - Text color for the info variant.\n */\n@customElement('hx-badge')\nexport class HelixBadge extends LitElement {\n static override styles = [tokenStyles, helixBadgeStyles];\n\n /**\n * Visual style variant of the badge.\n * @attr variant\n */\n @property({ type: String, reflect: true })\n variant: 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'neutral' | 'info' =\n 'primary';\n\n /**\n * Size of the badge.\n * @attr size\n */\n @property({ type: String, reflect: true })\n size: 'sm' | 'md' | 'lg' = 'md';\n\n /**\n * Whether the badge uses fully rounded (pill) styling.\n * @attr pill\n */\n @property({ type: Boolean, reflect: true })\n pill = false;\n\n /**\n * Whether the badge displays an animated pulse for attention.\n * @attr pulse\n */\n @property({ type: Boolean, reflect: true })\n pulse = false;\n\n /**\n * Whether the badge renders a dismiss button.\n * @attr removable\n */\n @property({ type: Boolean, reflect: true })\n removable = false;\n\n /**\n * Numeric count to display. When set, renders the count as badge content.\n * When count exceeds `max`, displays `${max}+` (e.g. `99+`).\n * @attr count\n */\n @property({ type: Number, reflect: true })\n count: number | undefined = undefined;\n\n /**\n * Maximum count value before truncation to `${max}+`. Defaults to 99.\n * @attr max\n */\n @property({ type: Number, reflect: true })\n max = 99;\n\n /**\n * Accessible label for the dot indicator mode (pulse + empty slot).\n * Required for WCAG 4.1.2 compliance when using the dot indicator pattern.\n * Example: `dot-label=\"3 new messages\"`.\n * @attr dot-label\n */\n @property({ type: String, attribute: 'dot-label' })\n dotLabel = '';\n\n /**\n * Accessible label for the remove button. Should describe what is being removed.\n * Defaults to \"Remove\". For better accessibility, include context: e.g. \"Remove Critical badge\".\n * @attr remove-label\n */\n @property({ type: String, attribute: 'remove-label' })\n removeLabel = 'Remove';\n\n /**\n * Tracks whether the default slot has assigned content.\n */\n @state()\n private _hasSlotContent = false;\n\n // ─── Slot Change Handling ───\n\n private _handleSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n const nodes = slot.assignedNodes({ flatten: true });\n // Check if any assigned node has non-whitespace content\n this._hasSlotContent = nodes.some((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) return true;\n if (node.nodeType === Node.TEXT_NODE) {\n return (node.textContent ?? '').trim().length > 0;\n }\n return false;\n });\n }\n\n // ─── Event Handling ───\n\n private _handleRemove(): void {\n this.dispatchEvent(\n new CustomEvent('hx-remove', {\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // ─── Count Display ───\n\n private get _countDisplay(): string {\n if (this.count === undefined) return '';\n return this.count > this.max ? `${this.max}+` : String(this.count);\n }\n\n // ─── Render ───\n\n override render() {\n const hasCount = this.count !== undefined;\n const isDot = !this._hasSlotContent && !hasCount && this.pulse;\n\n const classes = {\n badge: true,\n [`badge--${this.variant}`]: true,\n [`badge--${this.size}`]: true,\n 'badge--pill': this.pill,\n 'badge--pulse': this.pulse,\n 'badge--dot': isDot,\n };\n\n return html`\n <span\n part=\"badge\"\n class=${classMap(classes)}\n role=${isDot && this.dotLabel ? 'img' : nothing}\n aria-label=${isDot && this.dotLabel ? this.dotLabel : nothing}\n aria-live=${hasCount ? 'polite' : nothing}\n >\n <slot name=\"prefix\"></slot>\n ${hasCount ? this._countDisplay : html`<slot @slotchange=${this._handleSlotChange}></slot>`}\n ${this.removable\n ? html`<button\n part=\"remove-button\"\n class=\"badge__remove-button\"\n aria-label=${this.removeLabel}\n @click=${this._handleRemove}\n >\n <svg viewBox=\"0 0 12 12\" aria-hidden=\"true\" width=\"10\" height=\"10\">\n <path\n d=\"M2.22 2.22a.75.75 0 011.06 0L6 4.94l2.72-2.72a.75.75 0 011.06 1.06L7.06 6l2.72 2.72a.75.75 0 01-1.06 1.06L6 7.06 3.28 9.78a.75.75 0 01-1.06-1.06L4.94 6 2.22 3.28a.75.75 0 010-1.06z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>`\n : nothing}\n </span>\n `;\n }\n}\n\n/**\n * @deprecated Use `HelixBadge` instead. This alias will be removed in a future\n * major version as part of the project-wide migration from `Wc` to `Hx` prefixes.\n * @since 0.1.0\n * @removal-target 1.0.0\n */\nexport type WcBadge = HelixBadge;\n\n/** Canonical type alias for the hx-badge component. */\nexport type HxBadge = HelixBadge;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-badge': HelixBadge;\n }\n}\n"],"names":["helixBadgeStyles","css","HelixBadge","LitElement","e","nodes","node","hasCount","isDot","classes","html","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;AA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