@helixui/library 0.3.4 → 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 +7076 -5902
- package/dist/components/hx-accordion/hx-accordion-item.d.ts +22 -0
- package/dist/components/hx-accordion/hx-accordion-item.d.ts.map +1 -1
- package/dist/components/hx-accordion/hx-accordion.d.ts +8 -0
- package/dist/components/hx-accordion/hx-accordion.d.ts.map +1 -1
- package/dist/components/hx-accordion/index.js +1 -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-alert/hx-alert.d.ts +12 -5
- package/dist/components/hx-alert/hx-alert.d.ts.map +1 -1
- package/dist/components/hx-alert/hx-alert.styles.d.ts.map +1 -1
- package/dist/components/hx-alert/index.js +1 -1
- package/dist/components/hx-avatar/hx-avatar.d.ts.map +1 -1
- package/dist/components/hx-avatar/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 +105 -0
- package/dist/components/hx-banner/hx-banner.d.ts.map +1 -0
- package/dist/components/hx-banner/hx-banner.styles.d.ts +2 -0
- package/dist/components/hx-banner/hx-banner.styles.d.ts.map +1 -0
- package/dist/components/hx-banner/index.d.ts +3 -0
- package/dist/components/hx-banner/index.d.ts.map +1 -0
- package/dist/components/hx-banner/index.js +5 -0
- package/dist/components/hx-banner/index.js.map +1 -0
- package/dist/components/hx-breadcrumb/hx-breadcrumb-item.styles.d.ts.map +1 -1
- package/dist/components/hx-breadcrumb/hx-breadcrumb.d.ts +5 -0
- 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.d.ts +17 -0
- package/dist/components/hx-button/hx-button.d.ts.map +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 +8 -0
- 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-card/hx-card.d.ts +17 -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.d.ts +122 -0
- package/dist/components/hx-carousel/hx-carousel.d.ts.map +1 -1
- package/dist/components/hx-carousel/hx-carousel.styles.d.ts.map +1 -1
- package/dist/components/hx-carousel/index.js +1 -1
- package/dist/components/hx-checkbox/hx-checkbox.d.ts +3 -1
- package/dist/components/hx-checkbox/hx-checkbox.d.ts.map +1 -1
- package/dist/components/hx-checkbox/hx-checkbox.styles.d.ts.map +1 -1
- package/dist/components/hx-checkbox/index.js +1 -1
- package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts +5 -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-code-snippet/hx-code-snippet.d.ts +21 -6
- package/dist/components/hx-code-snippet/hx-code-snippet.d.ts.map +1 -1
- package/dist/components/hx-code-snippet/index.js +1 -1
- package/dist/components/hx-color-picker/hx-color-picker.d.ts +47 -0
- package/dist/components/hx-color-picker/hx-color-picker.d.ts.map +1 -1
- package/dist/components/hx-color-picker/hx-color-picker.styles.d.ts.map +1 -1
- package/dist/components/hx-color-picker/index.js +1 -1
- package/dist/components/hx-combobox/hx-combobox.d.ts +24 -0
- package/dist/components/hx-combobox/hx-combobox.d.ts.map +1 -1
- package/dist/components/hx-combobox/hx-combobox.styles.d.ts.map +1 -1
- package/dist/components/hx-combobox/index.js +1 -1
- package/dist/components/hx-container/hx-container.d.ts +3 -1
- package/dist/components/hx-container/hx-container.d.ts.map +1 -1
- package/dist/components/hx-copy-button/hx-copy-button.d.ts +6 -0
- package/dist/components/hx-copy-button/hx-copy-button.d.ts.map +1 -1
- package/dist/components/hx-copy-button/index.js +1 -1
- package/dist/components/hx-counter/hx-counter.d.ts +79 -0
- package/dist/components/hx-counter/hx-counter.d.ts.map +1 -0
- package/dist/components/hx-counter/hx-counter.styles.d.ts +2 -0
- package/dist/components/hx-counter/hx-counter.styles.d.ts.map +1 -0
- package/dist/components/hx-counter/index.d.ts +3 -0
- package/dist/components/hx-counter/index.d.ts.map +1 -0
- package/dist/components/hx-counter/index.js +5 -0
- package/dist/components/hx-counter/index.js.map +1 -0
- package/dist/components/hx-data-table/hx-data-table.d.ts +6 -0
- package/dist/components/hx-data-table/hx-data-table.d.ts.map +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.d.ts +124 -0
- package/dist/components/hx-date-picker/hx-date-picker.d.ts.map +1 -1
- package/dist/components/hx-date-picker/hx-date-picker.styles.d.ts.map +1 -1
- package/dist/components/hx-date-picker/index.js +1 -1
- package/dist/components/hx-dialog/hx-dialog.d.ts.map +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-divider/hx-divider.d.ts +3 -0
- package/dist/components/hx-divider/hx-divider.d.ts.map +1 -1
- package/dist/components/hx-drawer/hx-drawer.d.ts +54 -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 -0
- 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-field/hx-field.d.ts +31 -1
- package/dist/components/hx-field/hx-field.d.ts.map +1 -1
- package/dist/components/hx-field/index.js +1 -1
- package/dist/components/hx-file-upload/hx-file-upload.d.ts +12 -0
- package/dist/components/hx-file-upload/hx-file-upload.d.ts.map +1 -1
- package/dist/components/hx-file-upload/hx-file-upload.styles.d.ts.map +1 -1
- package/dist/components/hx-file-upload/index.js +1 -1
- package/dist/components/hx-form/hx-form.d.ts +24 -0
- package/dist/components/hx-form/hx-form.d.ts.map +1 -1
- package/dist/components/hx-form/index.js +1 -1
- package/dist/components/hx-help-text/hx-help-text.d.ts +3 -0
- package/dist/components/hx-help-text/hx-help-text.d.ts.map +1 -1
- package/dist/components/hx-icon-button/hx-icon-button.d.ts.map +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-list/hx-list.d.ts.map +1 -1
- package/dist/components/hx-list/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 +13 -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 +3 -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.d.ts +15 -1
- package/dist/components/hx-nav/hx-nav.d.ts.map +1 -1
- package/dist/components/hx-nav/hx-nav.styles.d.ts.map +1 -1
- package/dist/components/hx-nav/index.js +1 -1
- package/dist/components/hx-number-input/hx-number-input.d.ts +2 -0
- package/dist/components/hx-number-input/hx-number-input.d.ts.map +1 -1
- package/dist/components/hx-number-input/index.js +1 -1
- package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts +14 -0
- package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts.map +1 -1
- package/dist/components/hx-overflow-menu/hx-overflow-menu.styles.d.ts.map +1 -1
- package/dist/components/hx-overflow-menu/index.js +1 -1
- package/dist/components/hx-pagination/hx-pagination.d.ts +5 -0
- package/dist/components/hx-pagination/hx-pagination.d.ts.map +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 +43 -39
- 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 +12 -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-progress-ring/hx-progress-ring.d.ts.map +1 -1
- package/dist/components/hx-progress-ring/index.js +1 -1
- package/dist/components/hx-radio-group/hx-radio-group.d.ts +75 -3
- package/dist/components/hx-radio-group/hx-radio-group.d.ts.map +1 -1
- package/dist/components/hx-radio-group/hx-radio.d.ts +3 -1
- package/dist/components/hx-radio-group/hx-radio.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-rating/hx-rating.d.ts +18 -3
- package/dist/components/hx-rating/hx-rating.d.ts.map +1 -1
- package/dist/components/hx-rating/index.js +1 -1
- package/dist/components/hx-select/hx-select.d.ts +9 -0
- package/dist/components/hx-select/hx-select.d.ts.map +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-side-nav/hx-side-nav.d.ts.map +1 -1
- package/dist/components/hx-side-nav/index.js +1 -1
- package/dist/components/hx-slider/hx-slider.d.ts +2 -0
- package/dist/components/hx-slider/hx-slider.d.ts.map +1 -1
- package/dist/components/hx-slider/index.js +1 -1
- package/dist/components/hx-split-button/hx-split-button.d.ts +16 -0
- package/dist/components/hx-split-button/hx-split-button.d.ts.map +1 -1
- package/dist/components/hx-split-button/index.js +1 -1
- package/dist/components/hx-split-panel/hx-split-panel.d.ts +44 -0
- 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-stat/hx-stat.d.ts +71 -0
- package/dist/components/hx-stat/hx-stat.d.ts.map +1 -0
- package/dist/components/hx-stat/hx-stat.styles.d.ts +2 -0
- package/dist/components/hx-stat/hx-stat.styles.d.ts.map +1 -0
- package/dist/components/hx-stat/index.d.ts +3 -0
- package/dist/components/hx-stat/index.d.ts.map +1 -0
- package/dist/components/hx-stat/index.js +5 -0
- package/dist/components/hx-stat/index.js.map +1 -0
- package/dist/components/hx-steps/hx-steps.d.ts +5 -0
- package/dist/components/hx-steps/hx-steps.d.ts.map +1 -1
- package/dist/components/hx-steps/index.js +1 -1
- package/dist/components/hx-structured-list/hx-structured-list.d.ts +2 -0
- package/dist/components/hx-structured-list/hx-structured-list.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 -0
- package/dist/components/hx-switch/hx-switch.d.ts.map +1 -1
- package/dist/components/hx-switch/index.js +1 -1
- package/dist/components/hx-table/hx-table.d.ts +60 -0
- package/dist/components/hx-table/hx-table.d.ts.map +1 -0
- package/dist/components/hx-table/hx-table.styles.d.ts +9 -0
- package/dist/components/hx-table/hx-table.styles.d.ts.map +1 -0
- package/dist/components/hx-table/hx-tbody.d.ts +23 -0
- package/dist/components/hx-table/hx-tbody.d.ts.map +1 -0
- package/dist/components/hx-table/hx-td.d.ts +46 -0
- package/dist/components/hx-table/hx-td.d.ts.map +1 -0
- package/dist/components/hx-table/hx-tfoot.d.ts +23 -0
- package/dist/components/hx-table/hx-tfoot.d.ts.map +1 -0
- package/dist/components/hx-table/hx-th.d.ts +61 -0
- package/dist/components/hx-table/hx-th.d.ts.map +1 -0
- package/dist/components/hx-table/hx-thead.d.ts +23 -0
- package/dist/components/hx-table/hx-thead.d.ts.map +1 -0
- package/dist/components/hx-table/hx-tr.d.ts +33 -0
- package/dist/components/hx-table/hx-tr.d.ts.map +1 -0
- package/dist/components/hx-table/index.d.ts +9 -0
- package/dist/components/hx-table/index.d.ts.map +1 -0
- package/dist/components/hx-table/index.js +11 -0
- package/dist/components/hx-table/index.js.map +1 -0
- 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 +2 -1
- package/dist/components/hx-text-input/hx-text-input.d.ts.map +1 -1
- package/dist/components/hx-text-input/index.js +1 -1
- package/dist/components/hx-textarea/hx-textarea.d.ts +14 -0
- package/dist/components/hx-textarea/hx-textarea.d.ts.map +1 -1
- package/dist/components/hx-textarea/hx-textarea.styles.d.ts.map +1 -1
- package/dist/components/hx-textarea/index.js +1 -1
- package/dist/components/hx-time-picker/hx-time-picker.d.ts +83 -1
- 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-stack.d.ts +36 -0
- package/dist/components/hx-toast/hx-toast-stack.d.ts.map +1 -0
- package/dist/components/hx-toast/hx-toast.d.ts +10 -52
- 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.d.ts +6 -2
- package/dist/components/hx-toast/index.d.ts.map +1 -1
- package/dist/components/hx-toast/index.js +1 -1
- package/dist/components/hx-toast/toast-factory.d.ts +25 -0
- package/dist/components/hx-toast/toast-factory.d.ts.map +1 -0
- package/dist/components/hx-toggle-button/hx-toggle-button.d.ts +1 -0
- 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-tooltip/hx-tooltip.d.ts +1 -45
- package/dist/components/hx-tooltip/hx-tooltip.d.ts.map +1 -1
- package/dist/components/hx-tooltip/index.js +1 -1
- package/dist/components/hx-top-nav/hx-top-nav.d.ts.map +1 -1
- package/dist/components/hx-top-nav/index.js +1 -1
- package/dist/components/hx-tree-view/hx-tree-item.d.ts +61 -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 +16 -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.d.ts +20 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +169 -155
- package/dist/index.js.map +1 -1
- package/dist/shared/body-scroll-lock-VBa5TFP-.js +12 -0
- package/dist/shared/body-scroll-lock-VBa5TFP-.js.map +1 -0
- package/dist/shared/dev-warn-YlwPHjtX.js +6 -0
- package/dist/shared/dev-warn-YlwPHjtX.js.map +1 -0
- package/dist/shared/{hx-accordion-D95XSAft.js → hx-accordion-DT8qHOay.js} +73 -53
- package/dist/shared/hx-accordion-DT8qHOay.js.map +1 -0
- package/dist/shared/{hx-action-bar-B4i9tBCP.js → hx-action-bar-we_WJety.js} +41 -40
- package/dist/shared/hx-action-bar-we_WJety.js.map +1 -0
- package/dist/shared/{hx-alert-BQpT4gL3.js → hx-alert-D6uok29t.js} +95 -28
- package/dist/shared/hx-alert-D6uok29t.js.map +1 -0
- package/dist/shared/{hx-avatar-yHjmNdtf.js → hx-avatar-Cep6Urm3.js} +62 -65
- package/dist/shared/hx-avatar-Cep6Urm3.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-DnCBJtRR.js +353 -0
- package/dist/shared/hx-banner-DnCBJtRR.js.map +1 -0
- package/dist/shared/{hx-breadcrumb-item-DtSxRZ_W.js → hx-breadcrumb-item-Bj2UqhzR.js} +54 -48
- package/dist/shared/hx-breadcrumb-item-Bj2UqhzR.js.map +1 -0
- package/dist/shared/{hx-button-CtiJsmOg.js → hx-button-Cbhqpm5i.js} +111 -28
- package/dist/shared/hx-button-Cbhqpm5i.js.map +1 -0
- package/dist/shared/{hx-button-group-BMV5qFs4.js → hx-button-group-CWjWv-wS.js} +10 -10
- package/dist/shared/hx-button-group-CWjWv-wS.js.map +1 -0
- package/dist/shared/{hx-card-DAkEfpJd.js → hx-card-B9j2SHyI.js} +26 -22
- package/dist/shared/hx-card-B9j2SHyI.js.map +1 -0
- package/dist/shared/{hx-carousel-item-C2yBnM0r.js → hx-carousel-item-Be0bC-7o.js} +150 -98
- 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-checkbox-group-DTS9iT4b.js → hx-checkbox-group-ydUdV9Sx.js} +7 -7
- package/dist/shared/hx-checkbox-group-ydUdV9Sx.js.map +1 -0
- package/dist/shared/{hx-code-snippet-DdEqy-1B.js → hx-code-snippet-DBwIjl5p.js} +71 -59
- package/dist/shared/hx-code-snippet-DBwIjl5p.js.map +1 -0
- package/dist/shared/{hx-color-picker-K2x_dyeG.js → hx-color-picker-Bb2UPVc3.js} +101 -91
- package/dist/shared/hx-color-picker-Bb2UPVc3.js.map +1 -0
- package/dist/shared/{hx-combobox-DjMigccw.js → hx-combobox-CNvY-es8.js} +104 -65
- package/dist/shared/hx-combobox-CNvY-es8.js.map +1 -0
- package/dist/shared/hx-container-DLUKnTi9.js.map +1 -1
- package/dist/shared/{hx-copy-button-BXL1xkxb.js → hx-copy-button-CLBA31to.js} +45 -50
- package/dist/shared/hx-copy-button-CLBA31to.js.map +1 -0
- package/dist/shared/hx-counter-D-1NXzGs.js +138 -0
- package/dist/shared/hx-counter-D-1NXzGs.js.map +1 -0
- package/dist/shared/{hx-data-table-D3NZvc3P.js → hx-data-table-BwoJCFgs.js} +102 -96
- package/dist/shared/hx-data-table-BwoJCFgs.js.map +1 -0
- package/dist/shared/{hx-date-picker-CIHwx9b3.js → hx-date-picker-DDcIBJir.js} +58 -47
- package/dist/shared/hx-date-picker-DDcIBJir.js.map +1 -0
- package/dist/shared/{hx-dialog-e4CSD8xX.js → hx-dialog-M7so0sRT.js} +33 -25
- package/dist/shared/hx-dialog-M7so0sRT.js.map +1 -0
- package/dist/shared/hx-divider-XgWIz4Mr.js.map +1 -1
- package/dist/shared/{hx-drawer-bTF0nbrg.js → hx-drawer-CYxuhIQ0.js} +53 -45
- 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-field-Dz-7M_SC.js → hx-field-CDP8EXuj.js} +22 -19
- package/dist/shared/hx-field-CDP8EXuj.js.map +1 -0
- package/dist/shared/{hx-file-upload-DnYiIhyN.js → hx-file-upload-9HbONfqt.js} +63 -54
- package/dist/shared/hx-file-upload-9HbONfqt.js.map +1 -0
- package/dist/shared/{hx-form-BJeLK34m.js → hx-form-BFv_N1dm.js} +9 -1
- package/dist/shared/{hx-form-BJeLK34m.js.map → hx-form-BFv_N1dm.js.map} +1 -1
- package/dist/shared/hx-help-text-DaOPN1iB.js.map +1 -1
- package/dist/shared/{hx-icon-button-C_fsUJW4.js → hx-icon-button-iu0i_faq.js} +40 -32
- package/dist/shared/hx-icon-button-iu0i_faq.js.map +1 -0
- package/dist/shared/{hx-list-CF-AAnp-.js → hx-list-CdRNgeoP.js} +7 -9
- package/dist/shared/{hx-list-CF-AAnp-.js.map → hx-list-CdRNgeoP.js.map} +1 -1
- package/dist/shared/{hx-menu-divider-Buc5XA9E.js → hx-menu-divider-DR8klkFT.js} +46 -38
- package/dist/shared/hx-menu-divider-DR8klkFT.js.map +1 -0
- package/dist/shared/{hx-meter-qcXl0zCL.js → hx-meter-CZ7lnMra.js} +87 -49
- package/dist/shared/hx-meter-CZ7lnMra.js.map +1 -0
- package/dist/shared/{hx-nav-CWwByFdq.js → hx-nav-DM6-cGKF.js} +97 -95
- package/dist/shared/hx-nav-DM6-cGKF.js.map +1 -0
- package/dist/shared/{hx-nav-item-DItaMWl0.js → hx-nav-item-D54-5eUM.js} +12 -12
- package/dist/shared/hx-nav-item-D54-5eUM.js.map +1 -0
- package/dist/shared/{hx-number-input-CS6_w1lT.js → hx-number-input-BP6TIA92.js} +5 -1
- package/dist/shared/hx-number-input-BP6TIA92.js.map +1 -0
- package/dist/shared/{hx-overflow-menu-CAS1Mlus.js → hx-overflow-menu-CobkjAb8.js} +50 -37
- package/dist/shared/hx-overflow-menu-CobkjAb8.js.map +1 -0
- package/dist/shared/{hx-pagination-DNFgXQm3.js → hx-pagination-10dpXS95.js} +74 -69
- 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-b3_m1hna.js → hx-progress-bar-CnTibV63.js} +69 -50
- package/dist/shared/hx-progress-bar-CnTibV63.js.map +1 -0
- package/dist/shared/{hx-progress-ring-wOSv2y_I.js → hx-progress-ring-BHJBaXNk.js} +2 -4
- package/dist/shared/hx-progress-ring-BHJBaXNk.js.map +1 -0
- package/dist/shared/{hx-radio-CGtFKls2.js → hx-radio-BnKcRuQu.js} +46 -12
- package/dist/shared/hx-radio-BnKcRuQu.js.map +1 -0
- package/dist/shared/{hx-rating-C4kTOyHF.js → hx-rating-Y_t7Z4qb.js} +104 -67
- package/dist/shared/hx-rating-Y_t7Z4qb.js.map +1 -0
- package/dist/shared/{hx-select-D9bYJcDv.js → hx-select-C50lD7NS.js} +19 -12
- package/dist/shared/hx-select-C50lD7NS.js.map +1 -0
- package/dist/shared/{hx-slider-Duzmuid9.js → hx-slider-CprSNrRi.js} +11 -6
- package/dist/shared/hx-slider-CprSNrRi.js.map +1 -0
- package/dist/shared/{hx-split-button-DhncgAtZ.js → hx-split-button-CHGy4FUc.js} +19 -18
- package/dist/shared/hx-split-button-CHGy4FUc.js.map +1 -0
- 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-stat-C2wfph8W.js +212 -0
- package/dist/shared/hx-stat-C2wfph8W.js.map +1 -0
- package/dist/shared/{hx-step-nMT0fHEn.js → hx-step-DYoIumpR.js} +29 -29
- package/dist/shared/hx-step-DYoIumpR.js.map +1 -0
- package/dist/shared/{hx-structured-list-CMja1VXz.js → hx-structured-list-CMWllxGg.js} +23 -17
- package/dist/shared/{hx-structured-list-CMja1VXz.js.map → hx-structured-list-CMWllxGg.js.map} +1 -1
- package/dist/shared/{hx-switch-BPvIcDpM.js → hx-switch-DkKchcuP.js} +8 -3
- package/dist/shared/{hx-switch-BPvIcDpM.js.map → hx-switch-DkKchcuP.js.map} +1 -1
- package/dist/shared/{hx-tab-panel-C7h5lRpw.js → hx-tab-panel-BRNcLICw.js} +129 -120
- 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-td-CVwCGBYf.js +604 -0
- package/dist/shared/hx-td-CVwCGBYf.js.map +1 -0
- package/dist/shared/{hx-text-input-BUMgOQHX.js → hx-text-input-CCZZbWQ9.js} +10 -6
- package/dist/shared/hx-text-input-CCZZbWQ9.js.map +1 -0
- package/dist/shared/{hx-textarea-B_nmxzhC.js → hx-textarea-BsQdB1Rk.js} +51 -18
- package/dist/shared/hx-textarea-BsQdB1Rk.js.map +1 -0
- package/dist/shared/{hx-time-picker-a-BCkecJ.js → hx-time-picker-CJcIjH3C.js} +65 -54
- package/dist/shared/hx-time-picker-CJcIjH3C.js.map +1 -0
- package/dist/shared/{hx-toggle-button--xCXWRJW.js → hx-toggle-button-D4F1soEM.js} +34 -22
- package/dist/shared/{hx-toggle-button--xCXWRJW.js.map → hx-toggle-button-D4F1soEM.js.map} +1 -1
- package/dist/shared/{hx-tooltip-DN6lMlP5.js → hx-tooltip-Bk1iQRHs.js} +23 -23
- package/dist/shared/hx-tooltip-Bk1iQRHs.js.map +1 -0
- package/dist/shared/{hx-top-nav-8lDKNZUj.js → hx-top-nav-D2bQpns3.js} +43 -30
- package/dist/shared/{hx-top-nav-8lDKNZUj.js.map → hx-top-nav-D2bQpns3.js.map} +1 -1
- package/dist/shared/{hx-tree-item-Cesh_du5.js → hx-tree-item-BobGN76x.js} +202 -120
- package/dist/shared/hx-tree-item-BobGN76x.js.map +1 -0
- package/dist/shared/{hx-toast-ikwh9Y03.js → toast-factory-MvMMreTu.js} +181 -94
- package/dist/shared/toast-factory-MvMMreTu.js.map +1 -0
- package/dist/tools/cem-a11y-analyzer/analyzers/aria-analyzer.d.ts +12 -0
- package/dist/tools/cem-a11y-analyzer/analyzers/aria-analyzer.d.ts.map +1 -0
- package/dist/tools/cem-a11y-analyzer/analyzers/focus-analyzer.d.ts +13 -0
- package/dist/tools/cem-a11y-analyzer/analyzers/focus-analyzer.d.ts.map +1 -0
- package/dist/tools/cem-a11y-analyzer/analyzers/form-analyzer.d.ts +13 -0
- package/dist/tools/cem-a11y-analyzer/analyzers/form-analyzer.d.ts.map +1 -0
- package/dist/tools/cem-a11y-analyzer/analyzers/keyboard-analyzer.d.ts +12 -0
- package/dist/tools/cem-a11y-analyzer/analyzers/keyboard-analyzer.d.ts.map +1 -0
- package/dist/tools/cem-a11y-analyzer/analyzers/label-analyzer.d.ts +13 -0
- package/dist/tools/cem-a11y-analyzer/analyzers/label-analyzer.d.ts.map +1 -0
- package/dist/tools/cem-a11y-analyzer/analyzers/motion-analyzer.d.ts +12 -0
- package/dist/tools/cem-a11y-analyzer/analyzers/motion-analyzer.d.ts.map +1 -0
- package/dist/tools/cem-a11y-analyzer/index.d.ts +14 -0
- package/dist/tools/cem-a11y-analyzer/index.d.ts.map +1 -0
- package/dist/tools/cem-a11y-analyzer/reporter.d.ts +6 -0
- package/dist/tools/cem-a11y-analyzer/reporter.d.ts.map +1 -0
- package/dist/tools/cem-a11y-analyzer/scorer.d.ts +22 -0
- package/dist/tools/cem-a11y-analyzer/scorer.d.ts.map +1 -0
- package/dist/tools/cem-a11y-analyzer/types.d.ts +171 -0
- package/dist/tools/cem-a11y-analyzer/types.d.ts.map +1 -0
- package/dist/utils/body-scroll-lock.d.ts +34 -0
- package/dist/utils/body-scroll-lock.d.ts.map +1 -0
- package/dist/utils/dev-warn.d.ts +19 -0
- package/dist/utils/dev-warn.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/shared/hx-accordion-D95XSAft.js.map +0 -1
- package/dist/shared/hx-action-bar-B4i9tBCP.js.map +0 -1
- package/dist/shared/hx-alert-BQpT4gL3.js.map +0 -1
- package/dist/shared/hx-avatar-yHjmNdtf.js.map +0 -1
- package/dist/shared/hx-badge-CjT0d8NK.js.map +0 -1
- package/dist/shared/hx-breadcrumb-item-DtSxRZ_W.js.map +0 -1
- package/dist/shared/hx-button-CtiJsmOg.js.map +0 -1
- package/dist/shared/hx-button-group-BMV5qFs4.js.map +0 -1
- package/dist/shared/hx-card-DAkEfpJd.js.map +0 -1
- package/dist/shared/hx-carousel-item-C2yBnM0r.js.map +0 -1
- package/dist/shared/hx-checkbox-BMayOpAM.js.map +0 -1
- package/dist/shared/hx-checkbox-group-DTS9iT4b.js.map +0 -1
- package/dist/shared/hx-code-snippet-DdEqy-1B.js.map +0 -1
- package/dist/shared/hx-color-picker-K2x_dyeG.js.map +0 -1
- package/dist/shared/hx-combobox-DjMigccw.js.map +0 -1
- package/dist/shared/hx-copy-button-BXL1xkxb.js.map +0 -1
- package/dist/shared/hx-data-table-D3NZvc3P.js.map +0 -1
- package/dist/shared/hx-date-picker-CIHwx9b3.js.map +0 -1
- package/dist/shared/hx-dialog-e4CSD8xX.js.map +0 -1
- package/dist/shared/hx-drawer-bTF0nbrg.js.map +0 -1
- package/dist/shared/hx-dropdown-DnjLnkTj.js.map +0 -1
- package/dist/shared/hx-field-Dz-7M_SC.js.map +0 -1
- package/dist/shared/hx-file-upload-DnYiIhyN.js.map +0 -1
- package/dist/shared/hx-icon-button-C_fsUJW4.js.map +0 -1
- package/dist/shared/hx-menu-divider-Buc5XA9E.js.map +0 -1
- package/dist/shared/hx-meter-qcXl0zCL.js.map +0 -1
- package/dist/shared/hx-nav-CWwByFdq.js.map +0 -1
- package/dist/shared/hx-nav-item-DItaMWl0.js.map +0 -1
- package/dist/shared/hx-number-input-CS6_w1lT.js.map +0 -1
- package/dist/shared/hx-overflow-menu-CAS1Mlus.js.map +0 -1
- package/dist/shared/hx-pagination-DNFgXQm3.js.map +0 -1
- package/dist/shared/hx-popover-BjAyLbzp.js +0 -226
- package/dist/shared/hx-popover-BjAyLbzp.js.map +0 -1
- package/dist/shared/hx-progress-bar-b3_m1hna.js.map +0 -1
- package/dist/shared/hx-progress-ring-wOSv2y_I.js.map +0 -1
- package/dist/shared/hx-radio-CGtFKls2.js.map +0 -1
- package/dist/shared/hx-rating-C4kTOyHF.js.map +0 -1
- package/dist/shared/hx-select-D9bYJcDv.js.map +0 -1
- package/dist/shared/hx-slider-Duzmuid9.js.map +0 -1
- package/dist/shared/hx-split-button-DhncgAtZ.js.map +0 -1
- package/dist/shared/hx-split-panel-Cxkeauwe.js.map +0 -1
- package/dist/shared/hx-step-nMT0fHEn.js.map +0 -1
- package/dist/shared/hx-tab-panel-C7h5lRpw.js.map +0 -1
- package/dist/shared/hx-tag-SJJtMlOS.js.map +0 -1
- package/dist/shared/hx-text-input-BUMgOQHX.js.map +0 -1
- package/dist/shared/hx-textarea-B_nmxzhC.js.map +0 -1
- package/dist/shared/hx-time-picker-a-BCkecJ.js.map +0 -1
- package/dist/shared/hx-toast-ikwh9Y03.js.map +0 -1
- package/dist/shared/hx-tooltip-DN6lMlP5.js.map +0 -1
- package/dist/shared/hx-tree-item-Cesh_du5.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css as g, LitElement as c, nothing as
|
|
1
|
+
import { css as g, LitElement as c, nothing as l, html as d } from "lit";
|
|
2
2
|
import { property as o, state as p, customElement as x } from "lit/decorators.js";
|
|
3
3
|
import { classMap as u } from "lit/directives/class-map.js";
|
|
4
4
|
import { tokenStyles as v } from "@helixui/tokens/lit";
|
|
@@ -87,6 +87,22 @@ const f = g`
|
|
|
87
87
|
--hx-badge-pulse-color: var(--hx-badge-info-bg, var(--hx-color-info-700, #0369a1));
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
/* ─── Semantic Variant Label (WCAG 1.4.1) ─── */
|
|
91
|
+
/* Visually hidden text prefix for semantic variants (success/warning/error/info). */
|
|
92
|
+
/* Ensures the variant is not conveyed by color alone. */
|
|
93
|
+
|
|
94
|
+
.badge__variant-label {
|
|
95
|
+
position: absolute;
|
|
96
|
+
width: 1px;
|
|
97
|
+
height: 1px;
|
|
98
|
+
padding: 0;
|
|
99
|
+
margin: -1px;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
clip: rect(0, 0, 0, 0);
|
|
102
|
+
white-space: nowrap;
|
|
103
|
+
border: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
90
106
|
/* ─── Pill Mode ─── */
|
|
91
107
|
|
|
92
108
|
.badge--pill {
|
|
@@ -158,19 +174,19 @@ const f = g`
|
|
|
158
174
|
outline-offset: var(--hx-focus-ring-offset, 1px);
|
|
159
175
|
}
|
|
160
176
|
`;
|
|
161
|
-
var m = Object.defineProperty, y = Object.getOwnPropertyDescriptor,
|
|
162
|
-
for (var s =
|
|
163
|
-
(
|
|
164
|
-
return
|
|
177
|
+
var m = Object.defineProperty, y = Object.getOwnPropertyDescriptor, a = (i, t, n, r) => {
|
|
178
|
+
for (var s = r > 1 ? void 0 : r ? y(t, n) : t, h = i.length - 1, b; h >= 0; h--)
|
|
179
|
+
(b = i[h]) && (s = (r ? b(t, n, s) : b(s)) || s);
|
|
180
|
+
return r && s && m(t, n, s), s;
|
|
165
181
|
};
|
|
166
182
|
let e = class extends c {
|
|
167
183
|
constructor() {
|
|
168
184
|
super(...arguments), this.variant = "primary", this.size = "md", this.pill = !1, this.pulse = !1, this.removable = !1, this.count = void 0, this.max = 99, this.dotLabel = "", this.removeLabel = "Remove", this._hasSlotContent = !1;
|
|
169
185
|
}
|
|
170
186
|
// ─── Slot Change Handling ───
|
|
171
|
-
_handleSlotChange(
|
|
172
|
-
const
|
|
173
|
-
this._hasSlotContent =
|
|
187
|
+
_handleSlotChange(i) {
|
|
188
|
+
const n = i.target.assignedNodes({ flatten: !0 });
|
|
189
|
+
this._hasSlotContent = n.some((r) => r.nodeType === Node.ELEMENT_NODE ? !0 : r.nodeType === Node.TEXT_NODE ? (r.textContent ?? "").trim().length > 0 : !1);
|
|
174
190
|
}
|
|
175
191
|
// ─── Event Handling ───
|
|
176
192
|
_handleRemove() {
|
|
@@ -185,27 +201,31 @@ let e = class extends c {
|
|
|
185
201
|
get _countDisplay() {
|
|
186
202
|
return this.count === void 0 ? "" : this.count > this.max ? `${this.max}+` : String(this.count);
|
|
187
203
|
}
|
|
204
|
+
get _semanticVariantLabel() {
|
|
205
|
+
return e._SEMANTIC_VARIANT_LABELS[this.variant] ?? "";
|
|
206
|
+
}
|
|
188
207
|
// ─── Render ───
|
|
189
208
|
render() {
|
|
190
|
-
const
|
|
209
|
+
const i = this.count !== void 0, t = !this._hasSlotContent && !i && this.pulse, n = {
|
|
191
210
|
badge: !0,
|
|
192
211
|
[`badge--${this.variant}`]: !0,
|
|
193
212
|
[`badge--${this.size}`]: !0,
|
|
194
213
|
"badge--pill": this.pill,
|
|
195
214
|
"badge--pulse": this.pulse,
|
|
196
|
-
"badge--dot":
|
|
197
|
-
};
|
|
198
|
-
return
|
|
215
|
+
"badge--dot": t
|
|
216
|
+
}, r = this._semanticVariantLabel;
|
|
217
|
+
return d`
|
|
199
218
|
<span
|
|
200
219
|
part="badge"
|
|
201
|
-
class=${u(
|
|
202
|
-
role=${
|
|
203
|
-
aria-label=${
|
|
204
|
-
aria-live=${
|
|
220
|
+
class=${u(n)}
|
|
221
|
+
role=${t && this.dotLabel ? "img" : l}
|
|
222
|
+
aria-label=${t && this.dotLabel ? this.dotLabel : l}
|
|
223
|
+
aria-live=${i ? "polite" : l}
|
|
205
224
|
>
|
|
225
|
+
${r ? d`<span class="badge__variant-label">${r}: </span>` : l}
|
|
206
226
|
<slot name="prefix"></slot>
|
|
207
|
-
${
|
|
208
|
-
${this.removable ?
|
|
227
|
+
${i ? this._countDisplay : d`<slot @slotchange=${this._handleSlotChange}></slot>`}
|
|
228
|
+
${this.removable ? d`<button
|
|
209
229
|
part="remove-button"
|
|
210
230
|
class="badge__remove-button"
|
|
211
231
|
aria-label=${this.removeLabel}
|
|
@@ -217,46 +237,52 @@ let e = class extends c {
|
|
|
217
237
|
fill="currentColor"
|
|
218
238
|
/>
|
|
219
239
|
</svg>
|
|
220
|
-
</button>` :
|
|
240
|
+
</button>` : l}
|
|
221
241
|
</span>
|
|
222
242
|
`;
|
|
223
243
|
}
|
|
224
244
|
};
|
|
225
245
|
e.styles = [v, f];
|
|
226
|
-
|
|
246
|
+
e._SEMANTIC_VARIANT_LABELS = {
|
|
247
|
+
success: "Success",
|
|
248
|
+
warning: "Warning",
|
|
249
|
+
error: "Error",
|
|
250
|
+
info: "Info"
|
|
251
|
+
};
|
|
252
|
+
a([
|
|
227
253
|
o({ type: String, reflect: !0 })
|
|
228
254
|
], e.prototype, "variant", 2);
|
|
229
|
-
|
|
255
|
+
a([
|
|
230
256
|
o({ type: String, reflect: !0 })
|
|
231
257
|
], e.prototype, "size", 2);
|
|
232
|
-
|
|
258
|
+
a([
|
|
233
259
|
o({ type: Boolean, reflect: !0 })
|
|
234
260
|
], e.prototype, "pill", 2);
|
|
235
|
-
|
|
261
|
+
a([
|
|
236
262
|
o({ type: Boolean, reflect: !0 })
|
|
237
263
|
], e.prototype, "pulse", 2);
|
|
238
|
-
|
|
264
|
+
a([
|
|
239
265
|
o({ type: Boolean, reflect: !0 })
|
|
240
266
|
], e.prototype, "removable", 2);
|
|
241
|
-
|
|
267
|
+
a([
|
|
242
268
|
o({ type: Number, reflect: !0 })
|
|
243
269
|
], e.prototype, "count", 2);
|
|
244
|
-
|
|
270
|
+
a([
|
|
245
271
|
o({ type: Number, reflect: !0 })
|
|
246
272
|
], e.prototype, "max", 2);
|
|
247
|
-
|
|
273
|
+
a([
|
|
248
274
|
o({ type: String, attribute: "dot-label" })
|
|
249
275
|
], e.prototype, "dotLabel", 2);
|
|
250
|
-
|
|
276
|
+
a([
|
|
251
277
|
o({ type: String, attribute: "remove-label" })
|
|
252
278
|
], e.prototype, "removeLabel", 2);
|
|
253
|
-
|
|
279
|
+
a([
|
|
254
280
|
p()
|
|
255
281
|
], e.prototype, "_hasSlotContent", 2);
|
|
256
|
-
e =
|
|
282
|
+
e = a([
|
|
257
283
|
x("hx-badge")
|
|
258
284
|
], e);
|
|
259
285
|
export {
|
|
260
286
|
e as H
|
|
261
287
|
};
|
|
262
|
-
//# sourceMappingURL=hx-badge-
|
|
288
|
+
//# sourceMappingURL=hx-badge-BeuWuUj_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-badge-BeuWuUj_.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 /* ─── Semantic Variant Label (WCAG 1.4.1) ─── */\n /* Visually hidden text prefix for semantic variants (success/warning/error/info). */\n /* Ensures the variant is not conveyed by color alone. */\n\n .badge__variant-label {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n\n /* ─── 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 // ─── WCAG 1.4.1: Semantic variant label map ───\n // Variants that carry semantic meaning beyond decoration need a non-color cue.\n // Visually-hidden text is prepended so screen reader users and color-blind\n // users get the variant context even when no icon is slotted.\n\n private static readonly _SEMANTIC_VARIANT_LABELS: Partial<Record<HelixBadge['variant'], string>> =\n {\n success: 'Success',\n warning: 'Warning',\n error: 'Error',\n info: 'Info',\n };\n\n private get _semanticVariantLabel(): string {\n return HelixBadge._SEMANTIC_VARIANT_LABELS[this.variant] ?? '';\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 const variantLabel = this._semanticVariantLabel;\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 ${variantLabel\n ? html`<span class=\"badge__variant-label\">${variantLabel}: </span>`\n : nothing}\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","variantLabel","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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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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IAAM;AAAA,GA5C9Bd,EA6CX,WAAA,SAAA,CAAA;AAOAa,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAnD9Bd,EAoDX,WAAA,OAAA,CAAA;AASAa,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,aAAa;AAAA,GA5DvCd,EA6DX,WAAA,YAAA,CAAA;AAQAa,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,gBAAgB;AAAA,GApE1Cd,EAqEX,WAAA,eAAA,CAAA;AAMQa,EAAA;AAAA,EADPE,EAAA;AAAM,GA1EIf,EA2EH,WAAA,mBAAA,CAAA;AA3EGA,IAANa,EAAA;AAAA,EADNG,EAAc,UAAU;AAAA,GACZhB,CAAA;"}
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import { css as b, LitElement as f, html as n, nothing as d } from "lit";
|
|
2
|
+
import { property as a, customElement as u } from "lit/decorators.js";
|
|
3
|
+
import { classMap as v } from "lit/directives/class-map.js";
|
|
4
|
+
import { ifDefined as x } from "lit/directives/if-defined.js";
|
|
5
|
+
import { tokenStyles as p } from "@helixui/tokens/lit";
|
|
6
|
+
const g = b`
|
|
7
|
+
:host {
|
|
8
|
+
display: block;
|
|
9
|
+
width: 100%;
|
|
10
|
+
position: var(--hx-banner-position, sticky);
|
|
11
|
+
top: 0;
|
|
12
|
+
left: 0;
|
|
13
|
+
right: 0;
|
|
14
|
+
z-index: var(--hx-banner-z-index, 100);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host(:not([open])) {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
* {
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* ─── Banner Container ─── */
|
|
26
|
+
|
|
27
|
+
.banner {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: var(--hx-banner-gap, var(--hx-space-3, 0.75rem));
|
|
31
|
+
padding: var(--hx-banner-padding, var(--hx-space-3, 0.75rem) var(--hx-space-4, 1rem));
|
|
32
|
+
background-color: var(--hx-banner-bg, var(--hx-color-info-50, #e8f4fd));
|
|
33
|
+
color: var(--hx-banner-color, var(--hx-color-info-800, #1a3a4a));
|
|
34
|
+
border-bottom: var(--hx-banner-border-width, var(--hx-border-width-thin, 1px)) solid
|
|
35
|
+
var(--hx-banner-border-color, var(--hx-color-info-200, #b3d9ef));
|
|
36
|
+
font-family: var(--hx-banner-font-family, var(--hx-font-family-sans, sans-serif));
|
|
37
|
+
font-size: var(--hx-font-size-sm, 0.875rem);
|
|
38
|
+
line-height: var(--hx-line-height-normal, 1.5);
|
|
39
|
+
width: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* ─── Icon ─── */
|
|
43
|
+
|
|
44
|
+
.banner__icon {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
color: var(--hx-banner-icon-color, var(--hx-color-info-500, #3b82f6));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.banner__icon svg {
|
|
52
|
+
width: var(--hx-space-5, 1.25rem);
|
|
53
|
+
height: var(--hx-space-5, 1.25rem);
|
|
54
|
+
fill: currentColor;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* ─── Message ─── */
|
|
58
|
+
|
|
59
|
+
.banner__message {
|
|
60
|
+
flex: 1;
|
|
61
|
+
min-width: 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* ─── Action Link ─── */
|
|
65
|
+
|
|
66
|
+
.banner__action {
|
|
67
|
+
display: inline-flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
flex-shrink: 0;
|
|
70
|
+
color: var(--hx-banner-action-color, var(--hx-banner-color, var(--hx-color-info-800, #1a3a4a)));
|
|
71
|
+
font-weight: var(--hx-font-weight-semibold, 600);
|
|
72
|
+
text-decoration: underline;
|
|
73
|
+
text-underline-offset: 2px;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
background: transparent;
|
|
76
|
+
border: none;
|
|
77
|
+
padding: 0;
|
|
78
|
+
font-size: inherit;
|
|
79
|
+
font-family: inherit;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.banner__action:hover {
|
|
83
|
+
opacity: 0.8;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.banner__action:focus-visible {
|
|
87
|
+
outline: var(--hx-focus-ring-width, 2px) solid var(--hx-focus-ring-color, #2563eb);
|
|
88
|
+
outline-offset: var(--hx-focus-ring-offset, 2px);
|
|
89
|
+
border-radius: var(--hx-border-radius-sm, 0.25rem);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* ─── Close Button ─── */
|
|
93
|
+
/* Minimum 44px touch target per WCAG 2.5.8 (Target Size Minimum, AA) and */
|
|
94
|
+
/* Apple HIG / Google Material guidelines. Uses absolute px units to ensure */
|
|
95
|
+
/* the target size is independent of the consumer's base font size. */
|
|
96
|
+
|
|
97
|
+
.banner__close-button {
|
|
98
|
+
display: inline-flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
flex-shrink: 0;
|
|
102
|
+
min-width: var(--hx-touch-target-size, 44px);
|
|
103
|
+
min-height: var(--hx-touch-target-size, 44px);
|
|
104
|
+
margin-left: auto;
|
|
105
|
+
padding: 0;
|
|
106
|
+
border: none;
|
|
107
|
+
border-radius: var(--hx-border-radius-sm, 0.25rem);
|
|
108
|
+
background: transparent;
|
|
109
|
+
color: var(--hx-banner-color, var(--hx-color-info-800, #1a3a4a));
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
font-size: var(--hx-font-size-md, 1rem);
|
|
112
|
+
line-height: 1;
|
|
113
|
+
transition:
|
|
114
|
+
background-color var(--hx-transition-fast, 150ms ease),
|
|
115
|
+
opacity var(--hx-transition-fast, 150ms ease);
|
|
116
|
+
opacity: 0.7;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.banner__close-button:hover {
|
|
120
|
+
opacity: 1;
|
|
121
|
+
/* color-mix() is supported in Chrome 111+, Firefox 113+, Safari 16.2+. */
|
|
122
|
+
/* Falls back to transparent (no hover background) in older environments. */
|
|
123
|
+
background-color: color-mix(in srgb, currentColor 10%, transparent);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.banner__close-button:focus-visible {
|
|
127
|
+
outline: var(--hx-focus-ring-width, 2px) solid var(--hx-focus-ring-color, #2563eb);
|
|
128
|
+
outline-offset: var(--hx-focus-ring-offset, 2px);
|
|
129
|
+
opacity: 1;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.banner__close-button svg {
|
|
133
|
+
width: var(--hx-space-4, 1rem);
|
|
134
|
+
height: var(--hx-space-4, 1rem);
|
|
135
|
+
fill: currentColor;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* ─── Variant: info ─── */
|
|
139
|
+
|
|
140
|
+
:host([variant='info']) .banner,
|
|
141
|
+
:host(:not([variant])) .banner {
|
|
142
|
+
--hx-banner-bg: var(--hx-color-info-50, #e8f4fd);
|
|
143
|
+
--hx-banner-border-color: var(--hx-color-info-200, #b3d9ef);
|
|
144
|
+
--hx-banner-color: var(--hx-color-info-800, #1a3a4a);
|
|
145
|
+
--hx-banner-icon-color: var(--hx-color-info-500, #3b82f6);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* ─── Variant: success ─── */
|
|
149
|
+
|
|
150
|
+
:host([variant='success']) .banner {
|
|
151
|
+
--hx-banner-bg: var(--hx-color-success-50, #ecfdf5);
|
|
152
|
+
--hx-banner-border-color: var(--hx-color-success-200, #a7f3d0);
|
|
153
|
+
--hx-banner-color: var(--hx-color-success-800, #065f46);
|
|
154
|
+
--hx-banner-icon-color: var(--hx-color-success-500, #10b981);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* ─── Variant: warning ─── */
|
|
158
|
+
|
|
159
|
+
:host([variant='warning']) .banner {
|
|
160
|
+
--hx-banner-bg: var(--hx-color-warning-50, #fffbeb);
|
|
161
|
+
--hx-banner-border-color: var(--hx-color-warning-200, #fde68a);
|
|
162
|
+
--hx-banner-color: var(--hx-color-warning-800, #92400e);
|
|
163
|
+
--hx-banner-icon-color: var(--hx-color-warning-500, #f59e0b);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* ─── Variant: error ─── */
|
|
167
|
+
|
|
168
|
+
:host([variant='error']) .banner {
|
|
169
|
+
--hx-banner-bg: var(--hx-color-error-50, #fef2f2);
|
|
170
|
+
--hx-banner-border-color: var(--hx-color-error-200, #fecaca);
|
|
171
|
+
--hx-banner-color: var(--hx-color-error-800, #991b1b);
|
|
172
|
+
--hx-banner-icon-color: var(--hx-color-error-500, #ef4444);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* ─── Position: fixed ─── */
|
|
176
|
+
/* When position="fixed", override the host-level CSS custom property. */
|
|
177
|
+
/* The :host rule above sets position via var(--hx-banner-position). */
|
|
178
|
+
/* We use an attribute selector to override it cleanly without duplication. */
|
|
179
|
+
|
|
180
|
+
:host([position='fixed']) {
|
|
181
|
+
position: fixed;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* ─── Reduced Motion ─── */
|
|
185
|
+
|
|
186
|
+
@media (prefers-reduced-motion: reduce) {
|
|
187
|
+
.banner__close-button {
|
|
188
|
+
transition: none;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
`;
|
|
192
|
+
var m = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, o = (e, i, c, s) => {
|
|
193
|
+
for (var t = s > 1 ? void 0 : s ? _(i, c) : i, h = e.length - 1, l; h >= 0; h--)
|
|
194
|
+
(l = e[h]) && (t = (s ? l(i, c, t) : l(t)) || t);
|
|
195
|
+
return s && t && m(i, c, t), t;
|
|
196
|
+
};
|
|
197
|
+
let r = class extends f {
|
|
198
|
+
constructor() {
|
|
199
|
+
super(...arguments), this.variant = "info", this.position = "sticky", this.dismissible = !1, this.heading = "", this.actionLabel = "", this.actionHref = "", this.open = !0;
|
|
200
|
+
}
|
|
201
|
+
// ─── Private Helpers ───
|
|
202
|
+
/** Returns true when the variant requires assertive announcement. */
|
|
203
|
+
get _isAssertive() {
|
|
204
|
+
return this.variant === "error" || this.variant === "warning";
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Returns the appropriate ARIA role based on variant.
|
|
208
|
+
* role="alert" implies aria-live="assertive"; role="status" implies aria-live="polite".
|
|
209
|
+
* We do NOT set aria-live explicitly to avoid double-announcements in JAWS.
|
|
210
|
+
*/
|
|
211
|
+
get _role() {
|
|
212
|
+
return this._isAssertive ? "alert" : "status";
|
|
213
|
+
}
|
|
214
|
+
// ─── Lifecycle ───
|
|
215
|
+
connectedCallback() {
|
|
216
|
+
super.connectedCallback(), this.setAttribute("role", this._role), this.open || this.setAttribute("aria-hidden", "true");
|
|
217
|
+
}
|
|
218
|
+
updated(e) {
|
|
219
|
+
super.updated(e), e.has("variant") && this.setAttribute("role", this._role), e.has("open") && (this.open ? this.removeAttribute("aria-hidden") : this.setAttribute("aria-hidden", "true"));
|
|
220
|
+
}
|
|
221
|
+
// ─── Default Icons ───
|
|
222
|
+
_renderInfoIcon() {
|
|
223
|
+
return n`<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
224
|
+
<path
|
|
225
|
+
d="M10 2a8 8 0 100 16 8 8 0 000-16zm.75 4.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM9.25 9a.75.75 0 011.5 0v4a.75.75 0 01-1.5 0V9z"
|
|
226
|
+
/>
|
|
227
|
+
</svg>`;
|
|
228
|
+
}
|
|
229
|
+
_renderSuccessIcon() {
|
|
230
|
+
return n`<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
231
|
+
<path
|
|
232
|
+
d="M10 2a8 8 0 100 16 8 8 0 000-16zm3.03 6.28a.75.75 0 00-1.06-1.06L9 10.19 7.78 8.97a.75.75 0 00-1.06 1.06l1.75 1.75a.75.75 0 001.06 0l3.5-3.5z"
|
|
233
|
+
/>
|
|
234
|
+
</svg>`;
|
|
235
|
+
}
|
|
236
|
+
_renderWarningIcon() {
|
|
237
|
+
return n`<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
238
|
+
<path
|
|
239
|
+
d="M8.49 2.92a1.75 1.75 0 013.02 0l6.25 10.83A1.75 1.75 0 0116.25 16H3.75a1.75 1.75 0 01-1.51-2.25L8.49 2.92zM10 7a.75.75 0 01.75.75v3a.75.75 0 01-1.5 0v-3A.75.75 0 0110 7zm0 7.5a.75.75 0 100-1.5.75.75 0 000 1.5z"
|
|
240
|
+
/>
|
|
241
|
+
</svg>`;
|
|
242
|
+
}
|
|
243
|
+
_renderErrorIcon() {
|
|
244
|
+
return n`<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
245
|
+
<path
|
|
246
|
+
d="M10 2a8 8 0 100 16 8 8 0 000-16zm-1.72 5.22a.75.75 0 011.06 0L10 7.94l.66-.72a.75.75 0 111.06 1.06L11.06 9l.66.72a.75.75 0 11-1.06 1.06L10 10.06l-.66.72a.75.75 0 01-1.06-1.06L8.94 9l-.66-.72a.75.75 0 010-1.06z"
|
|
247
|
+
/>
|
|
248
|
+
</svg>`;
|
|
249
|
+
}
|
|
250
|
+
_renderDefaultIcon() {
|
|
251
|
+
switch (this.variant) {
|
|
252
|
+
case "success":
|
|
253
|
+
return this._renderSuccessIcon();
|
|
254
|
+
case "warning":
|
|
255
|
+
return this._renderWarningIcon();
|
|
256
|
+
case "error":
|
|
257
|
+
return this._renderErrorIcon();
|
|
258
|
+
case "info":
|
|
259
|
+
default:
|
|
260
|
+
return this._renderInfoIcon();
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
_renderCloseIcon() {
|
|
264
|
+
return n`<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
265
|
+
<path
|
|
266
|
+
d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
|
|
267
|
+
/>
|
|
268
|
+
</svg>`;
|
|
269
|
+
}
|
|
270
|
+
// ─── Public Methods ───
|
|
271
|
+
/**
|
|
272
|
+
* Programmatically dismisses the banner. Sets open=false and dispatches hx-dismiss.
|
|
273
|
+
*/
|
|
274
|
+
dismiss() {
|
|
275
|
+
this._handleDismiss();
|
|
276
|
+
}
|
|
277
|
+
// ─── Event Handling ───
|
|
278
|
+
_handleDismiss() {
|
|
279
|
+
this.open = !1, this.dispatchEvent(
|
|
280
|
+
new CustomEvent("hx-dismiss", {
|
|
281
|
+
bubbles: !0,
|
|
282
|
+
composed: !0,
|
|
283
|
+
detail: { reason: "user" }
|
|
284
|
+
})
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
// ─── Render ───
|
|
288
|
+
render() {
|
|
289
|
+
const e = {
|
|
290
|
+
banner: !0,
|
|
291
|
+
[`banner--${this.variant}`]: !0
|
|
292
|
+
}, i = this.actionLabel.length > 0 && this.actionHref.length > 0;
|
|
293
|
+
return n`
|
|
294
|
+
<div part="banner" class=${v(e)}>
|
|
295
|
+
<div part="icon" class="banner__icon">${this._renderDefaultIcon()}</div>
|
|
296
|
+
|
|
297
|
+
<div part="message" class="banner__message">
|
|
298
|
+
<slot></slot>
|
|
299
|
+
</div>
|
|
300
|
+
|
|
301
|
+
${i ? n`
|
|
302
|
+
<a
|
|
303
|
+
part="action"
|
|
304
|
+
class="banner__action"
|
|
305
|
+
href=${x(this.actionHref || void 0)}
|
|
306
|
+
aria-label=${this.heading ? `${this.actionLabel}: ${this.heading}` : this.actionLabel}
|
|
307
|
+
>
|
|
308
|
+
<slot name="action">${this.actionLabel}</slot>
|
|
309
|
+
</a>
|
|
310
|
+
` : d}
|
|
311
|
+
${this.dismissible ? n`
|
|
312
|
+
<button
|
|
313
|
+
part="close-button"
|
|
314
|
+
class="banner__close-button"
|
|
315
|
+
aria-label=${`Dismiss ${this.heading ? `${this.heading} ` : ""}banner`}
|
|
316
|
+
@click=${this._handleDismiss}
|
|
317
|
+
>
|
|
318
|
+
${this._renderCloseIcon()}
|
|
319
|
+
</button>
|
|
320
|
+
` : d}
|
|
321
|
+
</div>
|
|
322
|
+
`;
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
r.styles = [p, g];
|
|
326
|
+
o([
|
|
327
|
+
a({ type: String, reflect: !0 })
|
|
328
|
+
], r.prototype, "variant", 2);
|
|
329
|
+
o([
|
|
330
|
+
a({ type: String, reflect: !0 })
|
|
331
|
+
], r.prototype, "position", 2);
|
|
332
|
+
o([
|
|
333
|
+
a({ type: Boolean, reflect: !0 })
|
|
334
|
+
], r.prototype, "dismissible", 2);
|
|
335
|
+
o([
|
|
336
|
+
a({ type: String })
|
|
337
|
+
], r.prototype, "heading", 2);
|
|
338
|
+
o([
|
|
339
|
+
a({ type: String, attribute: "action-label" })
|
|
340
|
+
], r.prototype, "actionLabel", 2);
|
|
341
|
+
o([
|
|
342
|
+
a({ type: String, attribute: "action-href" })
|
|
343
|
+
], r.prototype, "actionHref", 2);
|
|
344
|
+
o([
|
|
345
|
+
a({ type: Boolean, reflect: !0 })
|
|
346
|
+
], r.prototype, "open", 2);
|
|
347
|
+
r = o([
|
|
348
|
+
u("hx-banner")
|
|
349
|
+
], r);
|
|
350
|
+
export {
|
|
351
|
+
r as H
|
|
352
|
+
};
|
|
353
|
+
//# sourceMappingURL=hx-banner-DnCBJtRR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-banner-DnCBJtRR.js","sources":["../../src/components/hx-banner/hx-banner.styles.ts","../../src/components/hx-banner/hx-banner.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixBannerStyles = css`\n :host {\n display: block;\n width: 100%;\n position: var(--hx-banner-position, sticky);\n top: 0;\n left: 0;\n right: 0;\n z-index: var(--hx-banner-z-index, 100);\n }\n\n :host(:not([open])) {\n display: none;\n }\n\n * {\n box-sizing: border-box;\n }\n\n /* ─── Banner Container ─── */\n\n .banner {\n display: flex;\n align-items: center;\n gap: var(--hx-banner-gap, var(--hx-space-3, 0.75rem));\n padding: var(--hx-banner-padding, var(--hx-space-3, 0.75rem) var(--hx-space-4, 1rem));\n background-color: var(--hx-banner-bg, var(--hx-color-info-50, #e8f4fd));\n color: var(--hx-banner-color, var(--hx-color-info-800, #1a3a4a));\n border-bottom: var(--hx-banner-border-width, var(--hx-border-width-thin, 1px)) solid\n var(--hx-banner-border-color, var(--hx-color-info-200, #b3d9ef));\n font-family: var(--hx-banner-font-family, var(--hx-font-family-sans, sans-serif));\n font-size: var(--hx-font-size-sm, 0.875rem);\n line-height: var(--hx-line-height-normal, 1.5);\n width: 100%;\n }\n\n /* ─── Icon ─── */\n\n .banner__icon {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n color: var(--hx-banner-icon-color, var(--hx-color-info-500, #3b82f6));\n }\n\n .banner__icon svg {\n width: var(--hx-space-5, 1.25rem);\n height: var(--hx-space-5, 1.25rem);\n fill: currentColor;\n }\n\n /* ─── Message ─── */\n\n .banner__message {\n flex: 1;\n min-width: 0;\n }\n\n /* ─── Action Link ─── */\n\n .banner__action {\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n color: var(--hx-banner-action-color, var(--hx-banner-color, var(--hx-color-info-800, #1a3a4a)));\n font-weight: var(--hx-font-weight-semibold, 600);\n text-decoration: underline;\n text-underline-offset: 2px;\n cursor: pointer;\n background: transparent;\n border: none;\n padding: 0;\n font-size: inherit;\n font-family: inherit;\n }\n\n .banner__action:hover {\n opacity: 0.8;\n }\n\n .banner__action:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid var(--hx-focus-ring-color, #2563eb);\n outline-offset: var(--hx-focus-ring-offset, 2px);\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n }\n\n /* ─── Close Button ─── */\n /* Minimum 44px touch target per WCAG 2.5.8 (Target Size Minimum, AA) and */\n /* Apple HIG / Google Material guidelines. Uses absolute px units to ensure */\n /* the target size is independent of the consumer's base font size. */\n\n .banner__close-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n min-width: var(--hx-touch-target-size, 44px);\n min-height: var(--hx-touch-target-size, 44px);\n margin-left: auto;\n padding: 0;\n border: none;\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n background: transparent;\n color: var(--hx-banner-color, var(--hx-color-info-800, #1a3a4a));\n cursor: pointer;\n font-size: var(--hx-font-size-md, 1rem);\n line-height: 1;\n transition:\n background-color var(--hx-transition-fast, 150ms ease),\n opacity var(--hx-transition-fast, 150ms ease);\n opacity: 0.7;\n }\n\n .banner__close-button:hover {\n opacity: 1;\n /* color-mix() is supported in Chrome 111+, Firefox 113+, Safari 16.2+. */\n /* Falls back to transparent (no hover background) in older environments. */\n background-color: color-mix(in srgb, currentColor 10%, transparent);\n }\n\n .banner__close-button:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid var(--hx-focus-ring-color, #2563eb);\n outline-offset: var(--hx-focus-ring-offset, 2px);\n opacity: 1;\n }\n\n .banner__close-button svg {\n width: var(--hx-space-4, 1rem);\n height: var(--hx-space-4, 1rem);\n fill: currentColor;\n }\n\n /* ─── Variant: info ─── */\n\n :host([variant='info']) .banner,\n :host(:not([variant])) .banner {\n --hx-banner-bg: var(--hx-color-info-50, #e8f4fd);\n --hx-banner-border-color: var(--hx-color-info-200, #b3d9ef);\n --hx-banner-color: var(--hx-color-info-800, #1a3a4a);\n --hx-banner-icon-color: var(--hx-color-info-500, #3b82f6);\n }\n\n /* ─── Variant: success ─── */\n\n :host([variant='success']) .banner {\n --hx-banner-bg: var(--hx-color-success-50, #ecfdf5);\n --hx-banner-border-color: var(--hx-color-success-200, #a7f3d0);\n --hx-banner-color: var(--hx-color-success-800, #065f46);\n --hx-banner-icon-color: var(--hx-color-success-500, #10b981);\n }\n\n /* ─── Variant: warning ─── */\n\n :host([variant='warning']) .banner {\n --hx-banner-bg: var(--hx-color-warning-50, #fffbeb);\n --hx-banner-border-color: var(--hx-color-warning-200, #fde68a);\n --hx-banner-color: var(--hx-color-warning-800, #92400e);\n --hx-banner-icon-color: var(--hx-color-warning-500, #f59e0b);\n }\n\n /* ─── Variant: error ─── */\n\n :host([variant='error']) .banner {\n --hx-banner-bg: var(--hx-color-error-50, #fef2f2);\n --hx-banner-border-color: var(--hx-color-error-200, #fecaca);\n --hx-banner-color: var(--hx-color-error-800, #991b1b);\n --hx-banner-icon-color: var(--hx-color-error-500, #ef4444);\n }\n\n /* ─── Position: fixed ─── */\n /* When position=\"fixed\", override the host-level CSS custom property. */\n /* The :host rule above sets position via var(--hx-banner-position). */\n /* We use an attribute selector to override it cleanly without duplication. */\n\n :host([position='fixed']) {\n position: fixed;\n }\n\n /* ─── Reduced Motion ─── */\n\n @media (prefers-reduced-motion: reduce) {\n .banner__close-button {\n transition: none;\n }\n }\n`;\n","import { LitElement, html, nothing } from 'lit';\nimport { customElement, property } 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 { helixBannerStyles } from './hx-banner.styles.js';\n\n/** Banner variant determines visual styling and ARIA semantics. */\nexport type BannerVariant = 'info' | 'success' | 'warning' | 'error';\n\n/** Banner position determines CSS positioning behavior. */\nexport type BannerPosition = 'sticky' | 'fixed';\n\n/**\n * A full-width page-level banner for persistent notifications and announcements.\n * Designed for healthcare applications requiring prominent system-level messaging.\n *\n * @summary Full-width page-level banner for persistent notifications with variant-based styling and ARIA live regions.\n *\n * @tag hx-banner\n *\n * @slot - Default slot for banner message content.\n * @slot action - Optional slot to override the built-in action link with custom content.\n *\n * @fires {CustomEvent<{reason: string}>} hx-dismiss - Dispatched when the user dismisses the banner.\n *\n * @csspart banner - The outer banner container.\n * @csspart icon - The icon container.\n * @csspart message - The message content area.\n * @csspart action - The action link element (only rendered when action-label and action-href are set).\n * @csspart close-button - The dismiss button (only rendered when dismissible).\n *\n * @cssprop [--hx-banner-bg=var(--hx-color-info-50)] - Banner background color.\n * @cssprop [--hx-banner-color=var(--hx-color-info-800)] - Banner text color.\n * @cssprop [--hx-banner-border-color=var(--hx-color-info-200)] - Banner bottom border color.\n * @cssprop [--hx-banner-border-width=var(--hx-border-width-thin)] - Banner bottom border width.\n * @cssprop [--hx-banner-padding=var(--hx-space-3) var(--hx-space-4)] - Banner padding.\n * @cssprop [--hx-banner-gap=var(--hx-space-3)] - Gap between banner elements.\n * @cssprop [--hx-banner-icon-color=var(--hx-color-info-500)] - Banner icon color.\n * @cssprop [--hx-banner-font-family=var(--hx-font-family-sans)] - Banner font family.\n * @cssprop [--hx-banner-action-color=var(--hx-banner-color)] - Action link color.\n * @cssprop [--hx-banner-position=sticky] - CSS position value (sticky or fixed).\n * @cssprop [--hx-banner-z-index=100] - Banner z-index for stacking context.\n * @cssprop [--hx-touch-target-size=44px] - Minimum touch target size for the close button.\n */\n@customElement('hx-banner')\nexport class HelixBanner extends LitElement {\n static override styles = [tokenStyles, helixBannerStyles];\n\n // ─── Properties ───\n\n /**\n * Visual variant of the banner that determines colors and ARIA semantics.\n * @attr variant\n */\n @property({ type: String, reflect: true })\n variant: BannerVariant = 'info';\n\n /**\n * CSS positioning behavior. \"sticky\" keeps the banner in flow; \"fixed\" pins it to the viewport.\n * @attr position\n */\n @property({ type: String, reflect: true })\n position: BannerPosition = 'sticky';\n\n /**\n * Whether the banner can be dismissed by the user.\n * @attr dismissible\n */\n @property({ type: Boolean, reflect: true })\n dismissible = false;\n\n /**\n * Heading text for the banner, used to provide context in the action link's and\n * close button's accessible labels.\n * @attr heading\n */\n @property({ type: String })\n heading = '';\n\n /**\n * Label text for the optional action link. Requires action-href to render.\n * @attr action-label\n */\n @property({ type: String, attribute: 'action-label' })\n actionLabel = '';\n\n /**\n * URL for the optional action link. Requires action-label to render.\n * @attr action-href\n */\n @property({ type: String, attribute: 'action-href' })\n actionHref = '';\n\n /**\n * Whether the banner is visible. Defaults to true — banners are shown by default.\n * @attr open\n */\n @property({ type: Boolean, reflect: true })\n open = true;\n\n // ─── Private Helpers ───\n\n /** Returns true when the variant requires assertive announcement. */\n private get _isAssertive(): boolean {\n return this.variant === 'error' || this.variant === 'warning';\n }\n\n /**\n * Returns the appropriate ARIA role based on variant.\n * role=\"alert\" implies aria-live=\"assertive\"; role=\"status\" implies aria-live=\"polite\".\n * We do NOT set aria-live explicitly to avoid double-announcements in JAWS.\n */\n private get _role(): string {\n return this._isAssertive ? 'alert' : 'status';\n }\n\n // ─── Lifecycle ───\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Apply ARIA role to the host element for reliable screen reader support across\n // Shadow DOM boundaries. Placing role on a shadow-internal element has inconsistent\n // AT support in JAWS+Chrome and VoiceOver+Safari combinations (particularly pre-2024).\n this.setAttribute('role', this._role);\n if (!this.open) {\n this.setAttribute('aria-hidden', 'true');\n }\n }\n\n protected override updated(changedProperties: Map<PropertyKey, unknown>): void {\n super.updated(changedProperties);\n if (changedProperties.has('variant')) {\n // Keep host ARIA role in sync with variant (assertive vs. polite).\n this.setAttribute('role', this._role);\n }\n if (changedProperties.has('open')) {\n // Manage aria-hidden in addition to display:none for reliable AT exclusion.\n // When open transitions from false→true, removing aria-hidden signals to AT\n // that the live region content should be announced.\n if (this.open) {\n this.removeAttribute('aria-hidden');\n } else {\n this.setAttribute('aria-hidden', 'true');\n }\n }\n }\n\n // ─── Default Icons ───\n\n private _renderInfoIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n <path\n d=\"M10 2a8 8 0 100 16 8 8 0 000-16zm.75 4.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM9.25 9a.75.75 0 011.5 0v4a.75.75 0 01-1.5 0V9z\"\n />\n </svg>`;\n }\n\n private _renderSuccessIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n <path\n d=\"M10 2a8 8 0 100 16 8 8 0 000-16zm3.03 6.28a.75.75 0 00-1.06-1.06L9 10.19 7.78 8.97a.75.75 0 00-1.06 1.06l1.75 1.75a.75.75 0 001.06 0l3.5-3.5z\"\n />\n </svg>`;\n }\n\n private _renderWarningIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n <path\n d=\"M8.49 2.92a1.75 1.75 0 013.02 0l6.25 10.83A1.75 1.75 0 0116.25 16H3.75a1.75 1.75 0 01-1.51-2.25L8.49 2.92zM10 7a.75.75 0 01.75.75v3a.75.75 0 01-1.5 0v-3A.75.75 0 0110 7zm0 7.5a.75.75 0 100-1.5.75.75 0 000 1.5z\"\n />\n </svg>`;\n }\n\n private _renderErrorIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n <path\n d=\"M10 2a8 8 0 100 16 8 8 0 000-16zm-1.72 5.22a.75.75 0 011.06 0L10 7.94l.66-.72a.75.75 0 111.06 1.06L11.06 9l.66.72a.75.75 0 11-1.06 1.06L10 10.06l-.66.72a.75.75 0 01-1.06-1.06L8.94 9l-.66-.72a.75.75 0 010-1.06z\"\n />\n </svg>`;\n }\n\n private _renderDefaultIcon() {\n switch (this.variant) {\n case 'success':\n return this._renderSuccessIcon();\n case 'warning':\n return this._renderWarningIcon();\n case 'error':\n return this._renderErrorIcon();\n case 'info':\n default:\n return this._renderInfoIcon();\n }\n }\n\n private _renderCloseIcon() {\n return html`<svg viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n <path\n d=\"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z\"\n />\n </svg>`;\n }\n\n // ─── Public Methods ───\n\n /**\n * Programmatically dismisses the banner. Sets open=false and dispatches hx-dismiss.\n */\n dismiss(): void {\n this._handleDismiss();\n }\n\n // ─── Event Handling ───\n\n private _handleDismiss(): void {\n this.open = false;\n\n /**\n * Dispatched when the user (or caller) dismisses the banner.\n * @event hx-dismiss\n */\n this.dispatchEvent(\n new CustomEvent('hx-dismiss', {\n bubbles: true,\n composed: true,\n detail: { reason: 'user' },\n }),\n );\n }\n\n // ─── Render ───\n\n override render() {\n const classes = {\n banner: true,\n [`banner--${this.variant}`]: true,\n };\n\n const hasAction = this.actionLabel.length > 0 && this.actionHref.length > 0;\n\n return html`\n <div part=\"banner\" class=${classMap(classes)}>\n <div part=\"icon\" class=\"banner__icon\">${this._renderDefaultIcon()}</div>\n\n <div part=\"message\" class=\"banner__message\">\n <slot></slot>\n </div>\n\n ${hasAction\n ? html`\n <a\n part=\"action\"\n class=\"banner__action\"\n href=${ifDefined(this.actionHref || undefined)}\n aria-label=${this.heading\n ? `${this.actionLabel}: ${this.heading}`\n : this.actionLabel}\n >\n <slot name=\"action\">${this.actionLabel}</slot>\n </a>\n `\n : nothing}\n ${this.dismissible\n ? html`\n <button\n part=\"close-button\"\n class=\"banner__close-button\"\n aria-label=${`Dismiss ${this.heading ? `${this.heading} ` : ''}banner`}\n @click=${this._handleDismiss}\n >\n ${this._renderCloseIcon()}\n </button>\n `\n : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-banner': HelixBanner;\n }\n}\n\nexport type { HelixBanner as HxBanner };\n"],"names":["helixBannerStyles","css","HelixBanner","LitElement","changedProperties","html","classes","hasAction","classMap","ifDefined","nothing","tokenStyles","__decorateClass","property","customElement"],"mappings":";;;;;AAEO,MAAMA,IAAoBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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