@helixui/library 2.0.0 → 2.1.0-next.34
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/dist/base/styles.d.ts +12 -2
- package/dist/base/styles.d.ts.map +1 -1
- package/dist/components/hx-accordion/hx-accordion-item.d.ts.map +1 -1
- 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.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.map +1 -1
- package/dist/components/hx-badge/index.js +1 -1
- package/dist/components/hx-banner/hx-banner.d.ts.map +1 -1
- package/dist/components/hx-banner/index.js +1 -1
- package/dist/components/hx-breadcrumb/hx-breadcrumb-item.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/components/hx-button/index.js +1 -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-card/hx-card.d.ts.map +1 -1
- package/dist/components/hx-card/index.js +1 -1
- package/dist/components/hx-carousel/hx-carousel-item.d.ts.map +1 -1
- package/dist/components/hx-carousel/hx-carousel.d.ts.map +1 -1
- package/dist/components/hx-carousel/index.js +1 -1
- package/dist/components/hx-checkbox/hx-checkbox.d.ts.map +1 -1
- package/dist/components/hx-checkbox/index.js +1 -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-clinical-status/hx-clinical-status.d.ts.map +1 -1
- package/dist/components/hx-clinical-status/index.js +1 -1
- 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.map +1 -1
- package/dist/components/hx-color-picker/index.js +1 -1
- package/dist/components/hx-combobox/hx-combobox.d.ts.map +1 -1
- package/dist/components/hx-combobox/index.js +1 -1
- package/dist/components/hx-container/hx-container.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.map +1 -1
- package/dist/components/hx-copy-button/index.js +1 -1
- package/dist/components/hx-counter/hx-counter.d.ts.map +1 -1
- package/dist/components/hx-counter/index.js +1 -1
- package/dist/components/hx-data-table/hx-data-table.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.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/index.js +1 -1
- package/dist/components/hx-divider/hx-divider.d.ts.map +1 -1
- package/dist/components/hx-divider/index.js +1 -1
- package/dist/components/hx-drawer/hx-drawer.d.ts.map +1 -1
- package/dist/components/hx-drawer/index.js +1 -1
- 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.map +1 -1
- package/dist/components/hx-field/index.js +1 -1
- package/dist/components/hx-field-label/hx-field-label.d.ts.map +1 -1
- package/dist/components/hx-field-label/index.js +1 -1
- package/dist/components/hx-file-upload/hx-file-upload.d.ts.map +1 -1
- package/dist/components/hx-file-upload/index.js +1 -1
- package/dist/components/hx-format-date/hx-format-date.d.ts.map +1 -1
- package/dist/components/hx-format-date/index.js +1 -1
- package/dist/components/hx-grid/hx-grid.d.ts.map +1 -1
- package/dist/components/hx-grid/index.js +1 -1
- package/dist/components/hx-help-text/hx-help-text.d.ts.map +1 -1
- package/dist/components/hx-help-text/index.js +1 -1
- package/dist/components/hx-icon/hx-icon.d.ts.map +1 -1
- package/dist/components/hx-icon/index.js +1 -1
- package/dist/components/hx-icon-button/hx-icon-button.d.ts.map +1 -1
- package/dist/components/hx-icon-button/index.js +1 -1
- package/dist/components/hx-image/hx-image.d.ts.map +1 -1
- package/dist/components/hx-image/index.js +1 -1
- package/dist/components/hx-link/hx-link.d.ts.map +1 -1
- package/dist/components/hx-link/index.js +1 -1
- package/dist/components/hx-list/hx-list-item.d.ts.map +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-divider.d.ts.map +1 -1
- package/dist/components/hx-menu/hx-menu-item.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/components/hx-meter/index.js +1 -1
- package/dist/components/hx-nav/hx-nav.d.ts.map +1 -1
- package/dist/components/hx-nav/index.js +1 -1
- package/dist/components/hx-number-input/hx-number-input.d.ts.map +1 -1
- package/dist/components/hx-number-input/index.js +1 -1
- package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts.map +1 -1
- package/dist/components/hx-overflow-menu/index.js +1 -1
- package/dist/components/hx-pagination/hx-pagination.d.ts.map +1 -1
- package/dist/components/hx-pagination/index.js +1 -1
- package/dist/components/hx-patient-banner/hx-patient-banner.d.ts.map +1 -1
- package/dist/components/hx-patient-banner/index.js +1 -1
- package/dist/components/hx-phi-field/hx-phi-field.d.ts.map +1 -1
- package/dist/components/hx-phi-field/index.js +1 -1
- package/dist/components/hx-popover/hx-popover.d.ts.map +1 -1
- package/dist/components/hx-popover/index.js +1 -1
- package/dist/components/hx-popup/hx-popup.d.ts.map +1 -1
- package/dist/components/hx-popup/index.js +1 -1
- 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.map +1 -1
- package/dist/components/hx-radio-group/hx-radio.d.ts.map +1 -1
- package/dist/components/hx-radio-group/index.js +1 -1
- package/dist/components/hx-rating/hx-rating.d.ts.map +1 -1
- package/dist/components/hx-rating/index.js +1 -1
- package/dist/components/hx-select/hx-select.d.ts.map +1 -1
- package/dist/components/hx-select/index.js +1 -1
- package/dist/components/hx-side-nav/hx-nav-item.d.ts.map +1 -1
- package/dist/components/hx-side-nav/hx-side-nav.d.ts.map +1 -1
- package/dist/components/hx-side-nav/index.js +1 -1
- package/dist/components/hx-skeleton/hx-skeleton.d.ts.map +1 -1
- package/dist/components/hx-skeleton/index.js +1 -1
- package/dist/components/hx-slider/hx-slider.d.ts.map +1 -1
- package/dist/components/hx-slider/index.js +1 -1
- package/dist/components/hx-spinner/hx-spinner.d.ts.map +1 -1
- package/dist/components/hx-spinner/index.js +1 -1
- 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.map +1 -1
- package/dist/components/hx-split-panel/index.js +1 -1
- 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-stat/hx-stat.d.ts.map +1 -1
- package/dist/components/hx-stat/index.js +1 -1
- package/dist/components/hx-status-indicator/hx-status-indicator.d.ts.map +1 -1
- package/dist/components/hx-status-indicator/index.js +1 -1
- package/dist/components/hx-steps/hx-step.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/components/hx-structured-list/index.js +1 -1
- package/dist/components/hx-style-scope/hx-style-scope.d.ts.map +1 -1
- package/dist/components/hx-style-scope/index.js +1 -1
- 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.map +1 -1
- package/dist/components/hx-table/hx-tbody.d.ts.map +1 -1
- package/dist/components/hx-table/hx-td.d.ts.map +1 -1
- package/dist/components/hx-table/hx-tfoot.d.ts.map +1 -1
- package/dist/components/hx-table/hx-th.d.ts.map +1 -1
- package/dist/components/hx-table/hx-thead.d.ts.map +1 -1
- package/dist/components/hx-table/hx-tr.d.ts.map +1 -1
- package/dist/components/hx-table/index.js +1 -1
- package/dist/components/hx-tabs/hx-tab-panel.d.ts.map +1 -1
- package/dist/components/hx-tabs/hx-tab.d.ts.map +1 -1
- package/dist/components/hx-tabs/hx-tabs.d.ts.map +1 -1
- package/dist/components/hx-tabs/index.js +1 -1
- package/dist/components/hx-tag/hx-tag.d.ts.map +1 -1
- package/dist/components/hx-tag/index.js +1 -1
- package/dist/components/hx-text/hx-text.d.ts.map +1 -1
- package/dist/components/hx-text/index.js +1 -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.map +1 -1
- package/dist/components/hx-textarea/index.js +1 -1
- package/dist/components/hx-theme/hx-theme.d.ts.map +1 -1
- package/dist/components/hx-theme/index.js +1 -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.map +1 -1
- package/dist/components/hx-toast/hx-toast.d.ts.map +1 -1
- package/dist/components/hx-toast/index.js +1 -1
- 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.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.map +1 -1
- 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/components/hx-visually-hidden/hx-visually-hidden.d.ts.map +1 -1
- package/dist/components/hx-visually-hidden/index.js +1 -1
- package/dist/css/index.css +1 -1
- package/dist/css/manifest.json +1 -1
- package/dist/index.d.ts +1 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +191 -189
- package/dist/index.js.map +1 -1
- package/dist/shared/document-token-adoption-DuYNKd4k.js +21 -0
- package/dist/shared/document-token-adoption-DuYNKd4k.js.map +1 -0
- package/dist/shared/{hx-accordion-_KeulaQR.js → hx-accordion-CpfO0YQo.js} +21 -21
- package/dist/shared/hx-accordion-CpfO0YQo.js.map +1 -0
- package/dist/shared/{hx-action-bar-vGFnNwNY.js → hx-action-bar-BpY1Z1UV.js} +12 -12
- package/dist/shared/hx-action-bar-BpY1Z1UV.js.map +1 -0
- package/dist/shared/{hx-alert-DRZYP0Oo.js → hx-alert-CHOjTBds.js} +7 -7
- package/dist/shared/hx-alert-CHOjTBds.js.map +1 -0
- package/dist/shared/{hx-avatar-CZfA9KEl.js → hx-avatar-an-WsuLl.js} +7 -7
- package/dist/shared/hx-avatar-an-WsuLl.js.map +1 -0
- package/dist/shared/{hx-badge-Xg7zoh4Q.js → hx-badge-DDXTLoWi.js} +7 -7
- package/dist/shared/hx-badge-DDXTLoWi.js.map +1 -0
- package/dist/shared/{hx-banner-2RS7Nux4.js → hx-banner-B-WEDiq7.js} +7 -7
- package/dist/shared/hx-banner-B-WEDiq7.js.map +1 -0
- package/dist/shared/{hx-breadcrumb-item-CObc-WJl.js → hx-breadcrumb-item-DzLyeL5Z.js} +14 -14
- package/dist/shared/hx-breadcrumb-item-DzLyeL5Z.js.map +1 -0
- package/dist/shared/{hx-button-CC1YH9RZ.js → hx-button-DoN8jjQT.js} +11 -11
- package/dist/shared/hx-button-DoN8jjQT.js.map +1 -0
- package/dist/shared/{hx-button-group-ChTQsnQj.js → hx-button-group-BXlMQTt_.js} +12 -12
- package/dist/shared/hx-button-group-BXlMQTt_.js.map +1 -0
- package/dist/shared/{hx-card-dIKdcMhr.js → hx-card-BgXZXDuc.js} +7 -7
- package/dist/shared/hx-card-BgXZXDuc.js.map +1 -0
- package/dist/shared/{hx-carousel-item-Cm8a1nAi.js → hx-carousel-item-Dwt9Pphz.js} +23 -23
- package/dist/shared/hx-carousel-item-Dwt9Pphz.js.map +1 -0
- package/dist/shared/{hx-checkbox-_WUiuTo9.js → hx-checkbox-CTEZ9IFq.js} +16 -16
- package/dist/shared/hx-checkbox-CTEZ9IFq.js.map +1 -0
- package/dist/shared/{hx-checkbox-group-B-ci-dxp.js → hx-checkbox-group-DThZeN5d.js} +23 -23
- package/dist/shared/hx-checkbox-group-DThZeN5d.js.map +1 -0
- package/dist/shared/{hx-clinical-status-D6eaplvs.js → hx-clinical-status-m4soOOwg.js} +11 -11
- package/dist/shared/hx-clinical-status-m4soOOwg.js.map +1 -0
- package/dist/shared/{hx-code-snippet-CQsyvthi.js → hx-code-snippet-CoLYvX1Z.js} +7 -7
- package/dist/shared/hx-code-snippet-CoLYvX1Z.js.map +1 -0
- package/dist/shared/{hx-color-picker-Dk2Myvaf.js → hx-color-picker-DhOaNe6-.js} +13 -13
- package/dist/shared/hx-color-picker-DhOaNe6-.js.map +1 -0
- package/dist/shared/{hx-combobox-CNAJXIxo.js → hx-combobox-BJ4lQocO.js} +9 -9
- package/dist/shared/hx-combobox-BJ4lQocO.js.map +1 -0
- package/dist/shared/{hx-container-7j16VuQE.js → hx-container-31QT9KV_.js} +8 -8
- package/dist/shared/hx-container-31QT9KV_.js.map +1 -0
- package/dist/shared/{hx-copy-button-B_ZHYO7_.js → hx-copy-button-BoM0WsMd.js} +19 -19
- package/dist/shared/hx-copy-button-BoM0WsMd.js.map +1 -0
- package/dist/shared/{hx-counter-D_B7L9Pi.js → hx-counter-CP42cSVK.js} +7 -7
- package/dist/shared/hx-counter-CP42cSVK.js.map +1 -0
- package/dist/shared/{hx-data-table-B1j4n4bm.js → hx-data-table-D5Ne-goy.js} +37 -37
- package/dist/shared/hx-data-table-D5Ne-goy.js.map +1 -0
- package/dist/shared/{hx-date-picker-R-0kWFwr.js → hx-date-picker-Cd3I3WkX.js} +9 -9
- package/dist/shared/hx-date-picker-Cd3I3WkX.js.map +1 -0
- package/dist/shared/{hx-dialog-U5d3s0Ps.js → hx-dialog-D4ubstxx.js} +9 -9
- package/dist/shared/hx-dialog-D4ubstxx.js.map +1 -0
- package/dist/shared/{hx-divider-DdAN-_jB.js → hx-divider-BBtOLHRP.js} +13 -13
- package/dist/shared/hx-divider-BBtOLHRP.js.map +1 -0
- package/dist/shared/{hx-drawer-e0qeGxAD.js → hx-drawer--WDLuWtS.js} +46 -46
- package/dist/shared/hx-drawer--WDLuWtS.js.map +1 -0
- package/dist/shared/{hx-dropdown-DP_DNpEb.js → hx-dropdown-n5-XSmiV.js} +12 -12
- package/dist/shared/hx-dropdown-n5-XSmiV.js.map +1 -0
- package/dist/shared/{hx-field-COM4KvMQ.js → hx-field-CwT9tki1.js} +15 -15
- package/dist/shared/hx-field-CwT9tki1.js.map +1 -0
- package/dist/shared/{hx-field-label-BtZ9H9Yy.js → hx-field-label-CcOK9VU3.js} +7 -7
- package/dist/shared/hx-field-label-CcOK9VU3.js.map +1 -0
- package/dist/shared/{hx-file-upload-DbECypLe.js → hx-file-upload-Dwtu3WcB.js} +9 -9
- package/dist/shared/hx-file-upload-Dwtu3WcB.js.map +1 -0
- package/dist/shared/{hx-format-date-C030ThSm.js → hx-format-date-B7L9odbA.js} +7 -7
- package/dist/shared/hx-format-date-B7L9odbA.js.map +1 -0
- package/dist/shared/{hx-grid-DE8KM5Gf.js → hx-grid-BIAR5h9m.js} +14 -14
- package/dist/shared/hx-grid-BIAR5h9m.js.map +1 -0
- package/dist/shared/{hx-help-text-BAcEGRUE.js → hx-help-text-Bmb80bP4.js} +13 -13
- package/dist/shared/hx-help-text-Bmb80bP4.js.map +1 -0
- package/dist/shared/{hx-icon-dYvrzvsO.js → hx-icon-BKHs3OLu.js} +9 -9
- package/dist/shared/hx-icon-BKHs3OLu.js.map +1 -0
- package/dist/shared/{hx-icon-button-Et9wq79n.js → hx-icon-button-CJuy9xbw.js} +7 -7
- package/dist/shared/hx-icon-button-CJuy9xbw.js.map +1 -0
- package/dist/shared/{hx-image-DUsEi-oN.js → hx-image-ztiXumZB.js} +11 -11
- package/dist/shared/hx-image-ztiXumZB.js.map +1 -0
- package/dist/shared/{hx-link-Peg2LzOD.js → hx-link-IVsXmsKx.js} +24 -24
- package/dist/shared/hx-link-IVsXmsKx.js.map +1 -0
- package/dist/shared/{hx-list-DwInEX2H.js → hx-list-CoTDMp19.js} +12 -12
- package/dist/shared/hx-list-CoTDMp19.js.map +1 -0
- package/dist/shared/{hx-menu-divider-puPmRAdN.js → hx-menu-divider-DRT8yHRZ.js} +24 -24
- package/dist/shared/hx-menu-divider-DRT8yHRZ.js.map +1 -0
- package/dist/shared/{hx-meter-CVs4A649.js → hx-meter-BvSJoqDp.js} +7 -7
- package/dist/shared/hx-meter-BvSJoqDp.js.map +1 -0
- package/dist/shared/{hx-nav-item-tM_6bolB.js → hx-nav-item-CJN4VDrf.js} +17 -17
- package/dist/shared/hx-nav-item-CJN4VDrf.js.map +1 -0
- package/dist/shared/{hx-nav-CiyqaW2I.js → hx-nav-l0Rp7WPW.js} +6 -6
- package/dist/shared/hx-nav-l0Rp7WPW.js.map +1 -0
- package/dist/shared/{hx-number-input-BPgrlMLN.js → hx-number-input-0Waw7Z7u.js} +9 -9
- package/dist/shared/hx-number-input-0Waw7Z7u.js.map +1 -0
- package/dist/shared/{hx-overflow-menu-Bz02LPPk.js → hx-overflow-menu-DElwFSCd.js} +12 -12
- package/dist/shared/hx-overflow-menu-DElwFSCd.js.map +1 -0
- package/dist/shared/{hx-pagination-Cb9UEWXz.js → hx-pagination-BNtx-LG6.js} +7 -7
- package/dist/shared/hx-pagination-BNtx-LG6.js.map +1 -0
- package/dist/shared/{hx-patient-banner-wk4qWmsH.js → hx-patient-banner-BKiN7nIE.js} +7 -7
- package/dist/shared/hx-patient-banner-BKiN7nIE.js.map +1 -0
- package/dist/shared/{hx-phi-field-DX9z3nu0.js → hx-phi-field-BiJH3V-k.js} +7 -7
- package/dist/shared/hx-phi-field-BiJH3V-k.js.map +1 -0
- package/dist/shared/{hx-popover-D6kYQkt3.js → hx-popover-D63RXn5H.js} +14 -14
- package/dist/shared/hx-popover-D63RXn5H.js.map +1 -0
- package/dist/shared/{hx-popup-RQb6HUXc.js → hx-popup-BQWMhvMO.js} +14 -14
- package/dist/shared/hx-popup-BQWMhvMO.js.map +1 -0
- package/dist/shared/{hx-progress-bar-ByEmxq1V.js → hx-progress-bar-Cm0VihTN.js} +7 -7
- package/dist/shared/hx-progress-bar-Cm0VihTN.js.map +1 -0
- package/dist/shared/{hx-progress-ring-CtVnNRQx.js → hx-progress-ring-BJeiDr3q.js} +7 -7
- package/dist/shared/hx-progress-ring-BJeiDr3q.js.map +1 -0
- package/dist/shared/{hx-radio-jgeW92SV.js → hx-radio-f8c5ggHG.js} +18 -18
- package/dist/shared/hx-radio-f8c5ggHG.js.map +1 -0
- package/dist/shared/{hx-rating-g_iy-DW_.js → hx-rating-qRJZXskm.js} +7 -7
- package/dist/shared/hx-rating-qRJZXskm.js.map +1 -0
- package/dist/shared/{hx-select-BWzxWZs_.js → hx-select-B5wq9Swh.js} +13 -13
- package/dist/shared/hx-select-B5wq9Swh.js.map +1 -0
- package/dist/shared/{hx-skeleton-BHvALyd7.js → hx-skeleton-e5K9Qaxq.js} +6 -6
- package/dist/shared/hx-skeleton-e5K9Qaxq.js.map +1 -0
- package/dist/shared/{hx-slider-7Q-e0_pc.js → hx-slider-BvXtvxmN.js} +11 -11
- package/dist/shared/hx-slider-BvXtvxmN.js.map +1 -0
- package/dist/shared/{hx-spinner-DEgrKsUo.js → hx-spinner-Dyese1Tb.js} +13 -13
- package/dist/shared/hx-spinner-Dyese1Tb.js.map +1 -0
- package/dist/shared/{hx-split-button-BA7P_ly5.js → hx-split-button-CPndTJlC.js} +9 -9
- package/dist/shared/hx-split-button-CPndTJlC.js.map +1 -0
- package/dist/shared/{hx-split-panel-Bss54UN8.js → hx-split-panel-Dx72NaET.js} +7 -7
- package/dist/shared/hx-split-panel-Dx72NaET.js.map +1 -0
- package/dist/shared/{hx-stack-BStY1RmV.js → hx-stack-B76_1O6g.js} +9 -9
- package/dist/shared/hx-stack-B76_1O6g.js.map +1 -0
- package/dist/shared/{hx-stat-CmkCUI8v.js → hx-stat-DKD2E7An.js} +15 -15
- package/dist/shared/hx-stat-DKD2E7An.js.map +1 -0
- package/dist/shared/{hx-status-indicator-Dl3Y34mc.js → hx-status-indicator-ClWpK6zz.js} +7 -7
- package/dist/shared/hx-status-indicator-ClWpK6zz.js.map +1 -0
- package/dist/shared/{hx-step-CmNwfcJx.js → hx-step-C2Jk4mHa.js} +14 -14
- package/dist/shared/hx-step-C2Jk4mHa.js.map +1 -0
- package/dist/shared/{hx-structured-list-Db9rwLI_.js → hx-structured-list-DKlrv7kS.js} +11 -11
- package/dist/shared/hx-structured-list-DKlrv7kS.js.map +1 -0
- package/dist/shared/{hx-style-scope-BroUu83L.js → hx-style-scope-CsQ2Phf_.js} +7 -6
- package/dist/shared/{hx-style-scope-BroUu83L.js.map → hx-style-scope-CsQ2Phf_.js.map} +1 -1
- package/dist/shared/{hx-switch-C0Lp5RGy.js → hx-switch-BzMN37PV.js} +7 -7
- package/dist/shared/hx-switch-BzMN37PV.js.map +1 -0
- package/dist/shared/{hx-tab-panel-Dnt8aA74.js → hx-tab-panel-J58zOSjq.js} +30 -30
- package/dist/shared/hx-tab-panel-J58zOSjq.js.map +1 -0
- package/dist/shared/{hx-tag-K5fCjfqQ.js → hx-tag-F0ZcYj9b.js} +7 -7
- package/dist/shared/hx-tag-F0ZcYj9b.js.map +1 -0
- package/dist/shared/{hx-td-DZuILY3s.js → hx-td-CNCvzBwY.js} +25 -25
- package/dist/shared/hx-td-CNCvzBwY.js.map +1 -0
- package/dist/shared/{hx-text-DoEVOf47.js → hx-text-DcWBqZwx.js} +12 -12
- package/dist/shared/hx-text-DcWBqZwx.js.map +1 -0
- package/dist/shared/{hx-text-input-DTKWPVdy.js → hx-text-input-Scyeefec.js} +18 -18
- package/dist/shared/hx-text-input-Scyeefec.js.map +1 -0
- package/dist/shared/{hx-textarea-BkSiU8oM.js → hx-textarea-BfSJJtA1.js} +9 -9
- package/dist/shared/hx-textarea-BfSJJtA1.js.map +1 -0
- package/dist/shared/{hx-theme-Aag8QJvT.js → hx-theme-pc1V7dyL.js} +2 -1
- package/dist/shared/hx-theme-pc1V7dyL.js.map +1 -0
- package/dist/shared/{hx-time-picker-BpCRsh_z.js → hx-time-picker-CZvmihHD.js} +41 -41
- package/dist/shared/hx-time-picker-CZvmihHD.js.map +1 -0
- package/dist/shared/{hx-toggle-button-CPFqs3eQ.js → hx-toggle-button-BZUQUULm.js} +7 -7
- package/dist/shared/hx-toggle-button-BZUQUULm.js.map +1 -0
- package/dist/shared/{hx-tooltip-CrO4vzeX.js → hx-tooltip-Ny4i1Idj.js} +12 -12
- package/dist/shared/hx-tooltip-Ny4i1Idj.js.map +1 -0
- package/dist/shared/{hx-top-nav-DYlnzDaU.js → hx-top-nav-CC4FW2Hp.js} +7 -7
- package/dist/shared/hx-top-nav-CC4FW2Hp.js.map +1 -0
- package/dist/shared/{hx-tree-item-C1PhX-HE.js → hx-tree-item-CPQ9dJiK.js} +16 -16
- package/dist/shared/hx-tree-item-CPQ9dJiK.js.map +1 -0
- package/dist/shared/{hx-visually-hidden-CCTQTjbR.js → hx-visually-hidden-vKX8QjeX.js} +13 -13
- package/dist/shared/hx-visually-hidden-vKX8QjeX.js.map +1 -0
- package/dist/shared/{toast-factory-f184Gi70.js → toast-factory-CEMNOt1T.js} +18 -18
- package/dist/shared/toast-factory-CEMNOt1T.js.map +1 -0
- package/dist/utilities/document-token-adoption.d.ts +10 -0
- package/dist/utilities/document-token-adoption.d.ts.map +1 -0
- package/package.json +4 -2
- package/dist/shared/hx-accordion-_KeulaQR.js.map +0 -1
- package/dist/shared/hx-action-bar-vGFnNwNY.js.map +0 -1
- package/dist/shared/hx-alert-DRZYP0Oo.js.map +0 -1
- package/dist/shared/hx-avatar-CZfA9KEl.js.map +0 -1
- package/dist/shared/hx-badge-Xg7zoh4Q.js.map +0 -1
- package/dist/shared/hx-banner-2RS7Nux4.js.map +0 -1
- package/dist/shared/hx-breadcrumb-item-CObc-WJl.js.map +0 -1
- package/dist/shared/hx-button-CC1YH9RZ.js.map +0 -1
- package/dist/shared/hx-button-group-ChTQsnQj.js.map +0 -1
- package/dist/shared/hx-card-dIKdcMhr.js.map +0 -1
- package/dist/shared/hx-carousel-item-Cm8a1nAi.js.map +0 -1
- package/dist/shared/hx-checkbox-_WUiuTo9.js.map +0 -1
- package/dist/shared/hx-checkbox-group-B-ci-dxp.js.map +0 -1
- package/dist/shared/hx-clinical-status-D6eaplvs.js.map +0 -1
- package/dist/shared/hx-code-snippet-CQsyvthi.js.map +0 -1
- package/dist/shared/hx-color-picker-Dk2Myvaf.js.map +0 -1
- package/dist/shared/hx-combobox-CNAJXIxo.js.map +0 -1
- package/dist/shared/hx-container-7j16VuQE.js.map +0 -1
- package/dist/shared/hx-copy-button-B_ZHYO7_.js.map +0 -1
- package/dist/shared/hx-counter-D_B7L9Pi.js.map +0 -1
- package/dist/shared/hx-data-table-B1j4n4bm.js.map +0 -1
- package/dist/shared/hx-date-picker-R-0kWFwr.js.map +0 -1
- package/dist/shared/hx-dialog-U5d3s0Ps.js.map +0 -1
- package/dist/shared/hx-divider-DdAN-_jB.js.map +0 -1
- package/dist/shared/hx-drawer-e0qeGxAD.js.map +0 -1
- package/dist/shared/hx-dropdown-DP_DNpEb.js.map +0 -1
- package/dist/shared/hx-field-COM4KvMQ.js.map +0 -1
- package/dist/shared/hx-field-label-BtZ9H9Yy.js.map +0 -1
- package/dist/shared/hx-file-upload-DbECypLe.js.map +0 -1
- package/dist/shared/hx-format-date-C030ThSm.js.map +0 -1
- package/dist/shared/hx-grid-DE8KM5Gf.js.map +0 -1
- package/dist/shared/hx-help-text-BAcEGRUE.js.map +0 -1
- package/dist/shared/hx-icon-button-Et9wq79n.js.map +0 -1
- package/dist/shared/hx-icon-dYvrzvsO.js.map +0 -1
- package/dist/shared/hx-image-DUsEi-oN.js.map +0 -1
- package/dist/shared/hx-link-Peg2LzOD.js.map +0 -1
- package/dist/shared/hx-list-DwInEX2H.js.map +0 -1
- package/dist/shared/hx-menu-divider-puPmRAdN.js.map +0 -1
- package/dist/shared/hx-meter-CVs4A649.js.map +0 -1
- package/dist/shared/hx-nav-CiyqaW2I.js.map +0 -1
- package/dist/shared/hx-nav-item-tM_6bolB.js.map +0 -1
- package/dist/shared/hx-number-input-BPgrlMLN.js.map +0 -1
- package/dist/shared/hx-overflow-menu-Bz02LPPk.js.map +0 -1
- package/dist/shared/hx-pagination-Cb9UEWXz.js.map +0 -1
- package/dist/shared/hx-patient-banner-wk4qWmsH.js.map +0 -1
- package/dist/shared/hx-phi-field-DX9z3nu0.js.map +0 -1
- package/dist/shared/hx-popover-D6kYQkt3.js.map +0 -1
- package/dist/shared/hx-popup-RQb6HUXc.js.map +0 -1
- package/dist/shared/hx-progress-bar-ByEmxq1V.js.map +0 -1
- package/dist/shared/hx-progress-ring-CtVnNRQx.js.map +0 -1
- package/dist/shared/hx-radio-jgeW92SV.js.map +0 -1
- package/dist/shared/hx-rating-g_iy-DW_.js.map +0 -1
- package/dist/shared/hx-select-BWzxWZs_.js.map +0 -1
- package/dist/shared/hx-skeleton-BHvALyd7.js.map +0 -1
- package/dist/shared/hx-slider-7Q-e0_pc.js.map +0 -1
- package/dist/shared/hx-spinner-DEgrKsUo.js.map +0 -1
- package/dist/shared/hx-split-button-BA7P_ly5.js.map +0 -1
- package/dist/shared/hx-split-panel-Bss54UN8.js.map +0 -1
- package/dist/shared/hx-stack-BStY1RmV.js.map +0 -1
- package/dist/shared/hx-stat-CmkCUI8v.js.map +0 -1
- package/dist/shared/hx-status-indicator-Dl3Y34mc.js.map +0 -1
- package/dist/shared/hx-step-CmNwfcJx.js.map +0 -1
- package/dist/shared/hx-structured-list-Db9rwLI_.js.map +0 -1
- package/dist/shared/hx-switch-C0Lp5RGy.js.map +0 -1
- package/dist/shared/hx-tab-panel-Dnt8aA74.js.map +0 -1
- package/dist/shared/hx-tag-K5fCjfqQ.js.map +0 -1
- package/dist/shared/hx-td-DZuILY3s.js.map +0 -1
- package/dist/shared/hx-text-DoEVOf47.js.map +0 -1
- package/dist/shared/hx-text-input-DTKWPVdy.js.map +0 -1
- package/dist/shared/hx-textarea-BkSiU8oM.js.map +0 -1
- package/dist/shared/hx-theme-Aag8QJvT.js.map +0 -1
- package/dist/shared/hx-time-picker-BpCRsh_z.js.map +0 -1
- package/dist/shared/hx-toggle-button-CPFqs3eQ.js.map +0 -1
- package/dist/shared/hx-tooltip-CrO4vzeX.js.map +0 -1
- package/dist/shared/hx-top-nav-DYlnzDaU.js.map +0 -1
- package/dist/shared/hx-tree-item-C1PhX-HE.js.map +0 -1
- package/dist/shared/hx-visually-hidden-CCTQTjbR.js.map +0 -1
- package/dist/shared/toast-factory-f184Gi70.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-format-date-B7L9odbA.js","sources":["../../src/components/hx-format-date/hx-format-date.styles.ts","../../src/components/hx-format-date/hx-format-date.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixFormatDateStyles = css`\n :host {\n display: inline;\n }\n\n [part='base'] {\n display: inline;\n font: inherit;\n color: inherit;\n }\n`;\n","import { LitElement, html } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport { helixFormatDateStyles } from './hx-format-date.styles.js';\n\n/**\n * Formats and displays a date/time value using the browser's `Intl.DateTimeFormat`\n * (or `Intl.RelativeTimeFormat` when `relative` is set). Renders as an inline\n * `<time>` element — machine-readable via `datetime`, human-readable via formatted text.\n *\n * No external dependencies. Uses native Intl APIs only.\n *\n * @summary Inline date/time formatter using Intl APIs with semantic `<time>` output.\n *\n * @tag hx-format-date\n *\n * @csspart base - The inner `<time>` element.\n */\n@customElement('hx-format-date')\nexport class HelixFormatDate extends LitElement {\n static override styles = [helixFormatDateStyles];\n\n // ─── Intl formatter caches (keyed by locale+options fingerprint) ───\n /** @internal */\n private static _dtfCache = new Map<string, Intl.DateTimeFormat>();\n /** @internal */\n private static _rtfCache = new Map<string, Intl.RelativeTimeFormat>();\n\n /**\n * The date/time value to format. Accepts an ISO string, a Unix timestamp (ms), or\n * a `Date` object. Defaults to the current date/time when empty.\n * @attr date\n */\n @property()\n date: string | number | Date = '';\n\n /**\n * BCP 47 locale tag used for formatting (e.g. `\"en-US\"`, `\"de\"`, `\"ja\"`).\n * Defaults to `document.documentElement.lang`, then `navigator.language`.\n * @attr lang\n */\n @property()\n override lang = '';\n\n /**\n * Month display format.\n * @attr month\n */\n @property()\n month: 'narrow' | 'short' | 'long' | 'numeric' | '2-digit' | undefined = undefined;\n\n /**\n * Year display format.\n * @attr year\n */\n @property()\n year: 'numeric' | '2-digit' | undefined = undefined;\n\n /**\n * Day display format.\n * @attr day\n */\n @property()\n day: 'numeric' | '2-digit' | undefined = undefined;\n\n /**\n * Weekday display format.\n * @attr weekday\n */\n @property()\n weekday: 'narrow' | 'short' | 'long' | undefined = undefined;\n\n /**\n * Hour display format.\n * @attr hour\n */\n @property()\n hour: 'numeric' | '2-digit' | undefined = undefined;\n\n /**\n * Minute display format.\n * @attr minute\n */\n @property()\n minute: 'numeric' | '2-digit' | undefined = undefined;\n\n /**\n * Second display format.\n * @attr second\n */\n @property()\n second: 'numeric' | '2-digit' | undefined = undefined;\n\n /**\n * Time zone name display format. Accepts all values supported by\n * `Intl.DateTimeFormatOptions.timeZoneName` including `'short'`, `'long'`,\n * `'shortOffset'`, `'longOffset'`, `'shortGeneric'`, and `'longGeneric'`.\n * @attr time-zone-name\n */\n @property({ attribute: 'time-zone-name' })\n timeZoneName: Intl.DateTimeFormatOptions['timeZoneName'] = undefined;\n\n /**\n * IANA time zone identifier (e.g. `\"America/New_York\"`, `\"UTC\"`).\n * @attr time-zone\n */\n @property({ attribute: 'time-zone' })\n timeZone: string | undefined = undefined;\n\n /**\n * Whether to use 12-hour or 24-hour clock. `\"auto\"` defers to locale default.\n * @attr hour-format\n */\n @property({ attribute: 'hour-format' })\n hourFormat: 'auto' | '12' | '24' = 'auto';\n\n /**\n * Controls whether `Intl.RelativeTimeFormat` always shows numeric output\n * (`\"always\"`) or uses natural language when possible (`\"auto\"`, e.g. \"yesterday\").\n * Only used when `relative` is true.\n * @attr numeric\n */\n @property()\n numeric: 'always' | 'auto' = 'auto';\n\n /**\n * When true, displays a relative time string such as \"2 hours ago\" or \"in 3 days\"\n * using `Intl.RelativeTimeFormat`.\n *\n * **Important:** The relative time string is computed once at render time and does\n * not auto-update. If the displayed text must stay current (e.g. a live \"X minutes\n * ago\" counter), the consuming component must re-set the `date` property on its own\n * interval to trigger a re-render.\n * @attr relative\n */\n @property({ type: Boolean })\n relative = false;\n\n // ─── Private helpers ───\n\n /** @internal */\n private _getDate(): Date {\n const val = this.date;\n if (val === '') return new Date();\n if (val instanceof Date) {\n return isNaN(val.getTime()) ? new Date() : val;\n }\n if (typeof val === 'number') {\n const d = new Date(val);\n return isNaN(d.getTime()) ? new Date() : d;\n }\n // Numeric strings (e.g. Unix timestamps set via HTML attribute) must be\n // converted to a number before passing to Date — new Date(\"1718462400000\")\n // returns Invalid Date in most JS engines.\n const asNumber = Number(val);\n if (!isNaN(asNumber)) {\n const d = new Date(asNumber);\n return isNaN(d.getTime()) ? new Date() : d;\n }\n const parsed = new Date(val);\n return isNaN(parsed.getTime()) ? new Date() : parsed;\n }\n\n /** @internal */\n private _getLocale(): string {\n if (this.lang) return this.lang;\n const docLang = typeof document !== 'undefined' ? document.documentElement.lang : '';\n const navLang = typeof navigator !== 'undefined' ? navigator.language : '';\n return docLang || navLang || 'en';\n }\n\n /** @internal */\n private _getHour12(): boolean | undefined {\n if (this.hourFormat === '12') return true;\n if (this.hourFormat === '24') return false;\n return undefined;\n }\n\n /**\n * Returns the `datetime` attribute value. When `timeZone` is set, returns a\n * timezone-offset ISO string (e.g. `2024-09-20T05:00:00-04:00`) so that\n * assistive technology reads the same local time as the visual display.\n */\n /** @internal */\n private _getDatetimeAttr(date: Date): string {\n if (!this.timeZone) return date.toISOString();\n try {\n const fmtOpts: Intl.DateTimeFormatOptions = {\n timeZone: this.timeZone,\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false,\n };\n const reduceParts = (parts: Intl.DateTimeFormatPart[]) =>\n parts.reduce<Record<string, string>>((acc, p) => {\n if (p.type !== 'literal') acc[p.type] = p.value;\n return acc;\n }, {});\n\n const tzParts = reduceParts(new Intl.DateTimeFormat('en-CA', fmtOpts).formatToParts(date));\n const utcParts = reduceParts(\n new Intl.DateTimeFormat('en-CA', { ...fmtOpts, timeZone: 'UTC' }).formatToParts(date),\n );\n\n const toMs = (p: Record<string, string>) =>\n Date.UTC(\n parseInt(p['year'] ?? '0'),\n parseInt(p['month'] ?? '1') - 1,\n parseInt(p['day'] ?? '1'),\n parseInt(p['hour'] === '24' ? '0' : (p['hour'] ?? '0')),\n parseInt(p['minute'] ?? '0'),\n parseInt(p['second'] ?? '0'),\n );\n\n const offsetMin = Math.round((toMs(tzParts) - toMs(utcParts)) / 60000);\n const sign = offsetMin >= 0 ? '+' : '-';\n const absMin = Math.abs(offsetMin);\n const hh = String(Math.floor(absMin / 60)).padStart(2, '0');\n const mm = String(absMin % 60).padStart(2, '0');\n const h = tzParts['hour'] === '24' ? '00' : (tzParts['hour'] ?? '00');\n return `${tzParts['year']}-${tzParts['month']}-${tzParts['day']}T${h}:${tzParts['minute']}:${tzParts['second']}${sign}${hh}:${mm}`;\n } catch {\n return date.toISOString();\n }\n }\n\n /** @internal */\n private _formatRelative(date: Date): string {\n const now = new Date();\n const diffMs = date.getTime() - now.getTime();\n const diffSec = Math.round(diffMs / 1000);\n const absSec = Math.abs(diffSec);\n const diffMin = Math.round(diffSec / 60);\n const absMin = Math.abs(diffMin);\n const diffHour = Math.round(diffSec / 3600);\n const absHour = Math.abs(diffHour);\n const diffDay = Math.round(diffSec / 86400);\n const absDay = Math.abs(diffDay);\n const diffMonth = Math.round(diffDay / 30);\n const absMonth = Math.abs(diffMonth);\n const diffYear = Math.round(diffDay / 365);\n\n const locale = this._getLocale();\n const cacheKey = `${locale}|${this.numeric}`;\n let rtf = HelixFormatDate._rtfCache.get(cacheKey);\n if (!rtf) {\n try {\n rtf = new Intl.RelativeTimeFormat(locale, { numeric: this.numeric });\n HelixFormatDate._rtfCache.set(cacheKey, rtf);\n } catch {\n return '';\n }\n }\n\n try {\n if (absSec < 60) return rtf.format(diffSec, 'second');\n if (absMin < 60) return rtf.format(diffMin, 'minute');\n if (absHour < 24) return rtf.format(diffHour, 'hour');\n if (absDay < 30) return rtf.format(diffDay, 'day');\n if (absMonth < 12) return rtf.format(diffMonth, 'month');\n return rtf.format(diffYear, 'year');\n } catch {\n return '';\n }\n }\n\n /** @internal */\n private _formatAbsolute(date: Date): string {\n const options: Intl.DateTimeFormatOptions = {};\n\n if (this.month !== undefined) options.month = this.month;\n if (this.year !== undefined) options.year = this.year;\n if (this.day !== undefined) options.day = this.day;\n if (this.weekday !== undefined) options.weekday = this.weekday;\n if (this.hour !== undefined) options.hour = this.hour;\n if (this.minute !== undefined) options.minute = this.minute;\n if (this.second !== undefined) options.second = this.second;\n if (this.timeZoneName !== undefined) options.timeZoneName = this.timeZoneName;\n if (this.timeZone !== undefined) options.timeZone = this.timeZone;\n\n const hour12 = this._getHour12();\n if (hour12 !== undefined) options.hour12 = hour12;\n\n // Fall back to a sensible default when no format options are specified\n if (Object.keys(options).length === 0) {\n options.year = 'numeric';\n options.month = 'long';\n options.day = 'numeric';\n }\n\n const locale = this._getLocale();\n const cacheKey = `${locale}|${JSON.stringify(options)}`;\n let dtf = HelixFormatDate._dtfCache.get(cacheKey);\n if (!dtf) {\n try {\n dtf = new Intl.DateTimeFormat(locale, options);\n HelixFormatDate._dtfCache.set(cacheKey, dtf);\n } catch {\n // Invalid options (e.g. unknown timeZone) — return empty string\n return '';\n }\n }\n\n try {\n return dtf.format(date);\n } catch {\n return '';\n }\n }\n\n // ─── Render ───\n\n override render() {\n const date = this._getDate();\n const datetimeAttr = this._getDatetimeAttr(date);\n const formattedText = this.relative ? this._formatRelative(date) : this._formatAbsolute(date);\n\n return html`<time part=\"base\" datetime=${datetimeAttr}>${formattedText}</time>`;\n }\n}\n\nexport type HxFormatDate = HelixFormatDate;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-format-date': HelixFormatDate;\n }\n}\n"],"names":["helixFormatDateStyles","css","HelixFormatDate","LitElement","val","d","asNumber","parsed","docLang","navLang","date","fmtOpts","reduceParts","parts","acc","p","tzParts","utcParts","toMs","offsetMin","sign","absMin","hh","mm","h","now","diffMs","diffSec","absSec","diffMin","diffHour","absHour","diffDay","absDay","diffMonth","absMonth","diffYear","locale","cacheKey","rtf","options","hour12","dtf","datetimeAttr","formattedText","html","__decorateClass","property","customElement"],"mappings":";;;AAEO,MAAMA,IAAwBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;ACiB9B,IAAMC,IAAN,cAA8BC,EAAW;AAAA,EAAzC,cAAA;AAAA,UAAA,GAAA,SAAA,GAeL,KAAA,OAA+B,IAQ/B,KAAS,OAAO,IAOhB,KAAA,QAAyE,QAOzE,KAAA,OAA0C,QAO1C,KAAA,MAAyC,QAOzC,KAAA,UAAmD,QAOnD,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,EADCC,EAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GApHhB7C,EAqHX,WAAA,YAAA,CAAA;AArHWA,IAAN4C,EAAA;AAAA,EADNE,EAAc,gBAAgB;AAAA,GAClB9C,CAAA;"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { css as
|
|
1
|
+
import { css as m, LitElement as c, html as d } from "lit";
|
|
2
|
+
import "./document-token-adoption-DuYNKd4k.js";
|
|
2
3
|
import { property as s, customElement as g } from "lit/decorators.js";
|
|
3
|
-
import { styleMap as
|
|
4
|
-
|
|
5
|
-
const v = h`
|
|
4
|
+
import { styleMap as y } from "lit/directives/style-map.js";
|
|
5
|
+
const f = m`
|
|
6
6
|
:host {
|
|
7
7
|
display: block;
|
|
8
8
|
box-sizing: border-box;
|
|
9
9
|
width: 100%;
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`, v = m`
|
|
12
12
|
:host {
|
|
13
13
|
display: block;
|
|
14
14
|
min-width: 0;
|
|
15
15
|
min-height: 0;
|
|
16
16
|
}
|
|
17
17
|
`;
|
|
18
|
-
var
|
|
19
|
-
for (var o = p > 1 ? void 0 : p ?
|
|
18
|
+
var x = Object.defineProperty, G = Object.getOwnPropertyDescriptor, e = (t, l, a, p) => {
|
|
19
|
+
for (var o = p > 1 ? void 0 : p ? G(l, a) : l, n = t.length - 1, u; n >= 0; n--)
|
|
20
20
|
(u = t[n]) && (o = (p ? u(l, a, o) : u(o)) || o);
|
|
21
|
-
return p && o &&
|
|
21
|
+
return p && o && x(l, a, o), o;
|
|
22
22
|
};
|
|
23
|
-
const
|
|
23
|
+
const h = {
|
|
24
24
|
none: "0",
|
|
25
25
|
xs: "var(--hx-space-1, 0.25rem)",
|
|
26
26
|
sm: "var(--hx-space-2, 0.5rem)",
|
|
@@ -39,7 +39,7 @@ let r = class extends c {
|
|
|
39
39
|
}
|
|
40
40
|
/** @internal */
|
|
41
41
|
_resolveGap(t) {
|
|
42
|
-
return
|
|
42
|
+
return h[t] ?? h.md;
|
|
43
43
|
}
|
|
44
44
|
/** @internal */
|
|
45
45
|
_computedRowGap() {
|
|
@@ -62,13 +62,13 @@ let r = class extends c {
|
|
|
62
62
|
}
|
|
63
63
|
render() {
|
|
64
64
|
return d`
|
|
65
|
-
<div part="base" role="presentation" style=${
|
|
65
|
+
<div part="base" role="presentation" style=${y(this._baseStyleMap())}>
|
|
66
66
|
<slot></slot>
|
|
67
67
|
</div>
|
|
68
68
|
`;
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
r.styles = [
|
|
71
|
+
r.styles = [f];
|
|
72
72
|
e([
|
|
73
73
|
s({ reflect: !0 })
|
|
74
74
|
], r.prototype, "columns", 2);
|
|
@@ -105,7 +105,7 @@ let i = class extends c {
|
|
|
105
105
|
return d`<slot></slot>`;
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
i.styles = [
|
|
108
|
+
i.styles = [v];
|
|
109
109
|
e([
|
|
110
110
|
s({ reflect: !0 })
|
|
111
111
|
], i.prototype, "column", 2);
|
|
@@ -122,4 +122,4 @@ export {
|
|
|
122
122
|
r as H,
|
|
123
123
|
i as a
|
|
124
124
|
};
|
|
125
|
-
//# sourceMappingURL=hx-grid-
|
|
125
|
+
//# sourceMappingURL=hx-grid-BIAR5h9m.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-grid-BIAR5h9m.js","sources":["../../src/components/hx-grid/hx-grid.styles.ts","../../src/components/hx-grid/hx-grid.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixGridStyles = css`\n :host {\n display: block;\n box-sizing: border-box;\n width: 100%;\n }\n`;\n\nexport const helixGridItemStyles = css`\n :host {\n display: block;\n min-width: 0;\n min-height: 0;\n }\n`;\n","import { LitElement, html, type PropertyValues } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { helixGridStyles, helixGridItemStyles } from './hx-grid.styles.js';\n\ntype GapSize = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nconst GAP_TOKENS: Record<GapSize, string> = {\n none: '0',\n xs: 'var(--hx-space-1, 0.25rem)',\n sm: 'var(--hx-space-2, 0.5rem)',\n md: 'var(--hx-space-4, 1rem)',\n lg: 'var(--hx-space-6, 1.5rem)',\n xl: 'var(--hx-space-8, 2rem)',\n};\n\n/**\n * A CSS Grid layout wrapper with design-token-based column and gap system.\n *\n * @summary CSS Grid layout primitive for building responsive grid layouts.\n *\n * @tag hx-grid\n *\n * @slot - Default slot for grid content (use `hx-grid-item` for precise placement).\n *\n * @csspart base - The grid container element.\n *\n * @cssprop [--hx-grid-columns] - Override the computed grid-template-columns.\n * @cssprop [--hx-grid-gap] - Override the computed gap.\n * @cssprop [--hx-grid-row-gap] - Override the computed row-gap.\n * @cssprop [--hx-grid-column-gap] - Override the computed column-gap.\n */\n@customElement('hx-grid')\nexport class HelixGrid extends LitElement {\n static override styles = [helixGridStyles];\n\n /**\n * Number of equal columns (`repeat(N, 1fr)`) or a CSS grid-template-columns string.\n * @attr columns\n */\n @property({ reflect: true })\n columns: number | string = 1;\n\n /**\n * Gap size applied to both row and column gaps.\n * @attr gap\n */\n @property({ reflect: true })\n gap: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'md';\n\n /**\n * Row gap override. When set, takes precedence over `gap` for row spacing.\n * @attr row-gap\n */\n @property({ attribute: 'row-gap', reflect: true })\n rowGap: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | undefined;\n\n /**\n * Column gap override. When set, takes precedence over `gap` for column spacing.\n * @attr column-gap\n */\n @property({ attribute: 'column-gap', reflect: true })\n columnGap: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | undefined;\n\n /**\n * Aligns grid items along the block axis (align-items).\n * @attr align\n */\n @property({ reflect: true })\n align: 'start' | 'center' | 'end' | 'stretch' = 'stretch';\n\n /**\n * Justifies grid items along the inline axis (justify-items).\n * @attr justify\n */\n @property({ reflect: true })\n justify: 'start' | 'center' | 'end' | 'stretch' = 'stretch';\n\n /** @internal */\n private _gridTemplateColumns(): string {\n const cols = this.columns;\n if (typeof cols === 'number' || /^\\d+$/.test(String(cols))) {\n return `var(--hx-grid-columns, repeat(${cols}, 1fr))`;\n }\n return `var(--hx-grid-columns, ${cols})`;\n }\n\n /** @internal */\n private _resolveGap(size: GapSize): string {\n return GAP_TOKENS[size] ?? GAP_TOKENS.md;\n }\n\n /** @internal */\n private _computedRowGap(): string {\n if (this.rowGap) {\n return `var(--hx-grid-row-gap, ${this._resolveGap(this.rowGap)})`;\n }\n return `var(--hx-grid-row-gap, var(--hx-grid-gap, ${this._resolveGap(this.gap)}))`;\n }\n\n /** @internal */\n private _computedColumnGap(): string {\n if (this.columnGap) {\n return `var(--hx-grid-column-gap, ${this._resolveGap(this.columnGap)})`;\n }\n return `var(--hx-grid-column-gap, var(--hx-grid-gap, ${this._resolveGap(this.gap)}))`;\n }\n\n /** @internal */\n private _baseStyleMap(): Record<string, string> {\n return {\n display: 'grid',\n 'grid-template-columns': this._gridTemplateColumns(),\n 'row-gap': this._computedRowGap(),\n 'column-gap': this._computedColumnGap(),\n 'align-items': this.align,\n 'justify-items': this.justify,\n };\n }\n\n override render() {\n return html`\n <div part=\"base\" role=\"presentation\" style=${styleMap(this._baseStyleMap())}>\n <slot></slot>\n </div>\n `;\n }\n}\n\n/**\n * Optional companion element for precise grid item placement.\n * Applies grid-column and grid-row directly to the host element\n * so it participates correctly in the parent CSS grid layout.\n *\n * @summary Grid item with explicit column/row placement.\n *\n * @tag hx-grid-item\n *\n * @slot - Default slot for item content.\n */\n@customElement('hx-grid-item')\nexport class HelixGridItem extends LitElement {\n static override styles = [helixGridItemStyles];\n\n /**\n * CSS grid-column value (e.g., \"1 / 3\", \"span 2\").\n * @attr column\n */\n @property({ reflect: true })\n column: string | undefined;\n\n /**\n * CSS grid-row value (e.g., \"1 / 2\").\n * @attr row\n */\n @property({ reflect: true })\n row: string | undefined;\n\n /**\n * Column span shorthand — equivalent to setting `column: \"span N\"`.\n * @attr span\n */\n @property({ type: Number, reflect: true })\n span: number | undefined;\n\n override updated(changed: PropertyValues<this>): void {\n super.updated(changed);\n if (changed.has('column') || changed.has('row') || changed.has('span')) {\n this._applyHostGridStyles();\n }\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this._applyHostGridStyles();\n }\n\n /** @internal */\n private _applyHostGridStyles(): void {\n if (this.column) {\n this.style.gridColumn = this.column;\n } else if (this.span !== undefined) {\n this.style.gridColumn = `span ${this.span}`;\n } else {\n this.style.gridColumn = '';\n }\n if (this.row) {\n this.style.gridRow = this.row;\n } else {\n this.style.gridRow = '';\n }\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-grid': HelixGrid;\n 'hx-grid-item': HelixGridItem;\n }\n}\n"],"names":["helixGridStyles","css","helixGridItemStyles","GAP_TOKENS","HelixGrid","LitElement","cols","size","html","styleMap","__decorateClass","property","customElement","HelixGridItem","changed"],"mappings":";;;;AAEO,MAAMA,IAAkBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQlBC,IAAsBD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;ACFnC,MAAME,IAAsC;AAAA,EAC1C,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAmBO,IAAMC,IAAN,cAAwBC,EAAW;AAAA,EAAnC,cAAA;AAAA,UAAA,GAAA,SAAA,GAQL,KAAA,UAA2B,GAO3B,KAAA,MAAiD,MAqBjD,KAAA,QAAgD,WAOhD,KAAA,UAAkD;AAAA,EAAA;AAAA;AAAA,EAG1C,uBAA+B;AACrC,UAAMC,IAAO,KAAK;AAClB,WAAI,OAAOA,KAAS,YAAY,QAAQ,KAAK,OAAOA,CAAI,CAAC,I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as n } from "lit";
|
|
2
|
+
import "./document-token-adoption-DuYNKd4k.js";
|
|
2
3
|
import { property as f, customElement as u } from "lit/decorators.js";
|
|
3
4
|
import { classMap as d } from "lit/directives/class-map.js";
|
|
4
5
|
import { ifDefined as h } from "lit/directives/if-defined.js";
|
|
5
|
-
|
|
6
|
-
const g = p`
|
|
6
|
+
const m = p`
|
|
7
7
|
:host {
|
|
8
8
|
display: block;
|
|
9
9
|
}
|
|
@@ -54,12 +54,12 @@ const g = p`
|
|
|
54
54
|
--hx-help-text-color: var(--hx-color-success-700, #15803d);
|
|
55
55
|
}
|
|
56
56
|
`;
|
|
57
|
-
var
|
|
58
|
-
for (var t = r > 1 ? void 0 : r ?
|
|
57
|
+
var g = Object.defineProperty, w = Object.getOwnPropertyDescriptor, x = (l, e, o, r) => {
|
|
58
|
+
for (var t = r > 1 ? void 0 : r ? w(e, o) : e, s = l.length - 1, a; s >= 0; s--)
|
|
59
59
|
(a = l[s]) && (t = (r ? a(e, o, t) : a(t)) || t);
|
|
60
|
-
return r && t &&
|
|
60
|
+
return r && t && g(e, o, t), t;
|
|
61
61
|
};
|
|
62
|
-
const
|
|
62
|
+
const y = n`<svg viewBox="0 0 16 16" aria-hidden="true" width="1em" height="1em">
|
|
63
63
|
<circle cx="8" cy="8" r="7" stroke="currentColor" stroke-width="1.5" fill="none" />
|
|
64
64
|
<line
|
|
65
65
|
x1="8"
|
|
@@ -88,7 +88,7 @@ const k = n`<svg viewBox="0 0 16 16" aria-hidden="true" width="1em" height="1em"
|
|
|
88
88
|
stroke-linecap="round"
|
|
89
89
|
/>
|
|
90
90
|
<circle cx="8" cy="11" r="0.625" fill="currentColor" />
|
|
91
|
-
</svg>`,
|
|
91
|
+
</svg>`, k = n`<svg viewBox="0 0 16 16" aria-hidden="true" width="1em" height="1em">
|
|
92
92
|
<circle cx="8" cy="8" r="7" stroke="currentColor" stroke-width="1.5" fill="none" />
|
|
93
93
|
<path
|
|
94
94
|
d="M5.25 8.25l1.75 1.75 3.75-3.75"
|
|
@@ -98,11 +98,11 @@ const k = n`<svg viewBox="0 0 16 16" aria-hidden="true" width="1em" height="1em"
|
|
|
98
98
|
stroke-linejoin="round"
|
|
99
99
|
fill="none"
|
|
100
100
|
/>
|
|
101
|
-
</svg>`,
|
|
101
|
+
</svg>`, C = {
|
|
102
102
|
default: c,
|
|
103
|
-
error:
|
|
103
|
+
error: y,
|
|
104
104
|
warning: _,
|
|
105
|
-
success:
|
|
105
|
+
success: k
|
|
106
106
|
};
|
|
107
107
|
let i = class extends v {
|
|
108
108
|
constructor() {
|
|
@@ -112,7 +112,7 @@ let i = class extends v {
|
|
|
112
112
|
const l = {
|
|
113
113
|
"help-text": !0,
|
|
114
114
|
[`help-text--${this.variant}`]: !0
|
|
115
|
-
}, e =
|
|
115
|
+
}, e = C[this.variant], o = this.variant === "error" ? "alert" : void 0, r = this.variant === "warning" || this.variant === "success" ? "polite" : void 0;
|
|
116
116
|
return n`<span
|
|
117
117
|
part="base"
|
|
118
118
|
class=${d(l)}
|
|
@@ -122,7 +122,7 @@ let i = class extends v {
|
|
|
122
122
|
</span>`;
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
|
-
i.styles = [m
|
|
125
|
+
i.styles = [m];
|
|
126
126
|
x([
|
|
127
127
|
f({ type: String, reflect: !0 })
|
|
128
128
|
], i.prototype, "variant", 2);
|
|
@@ -132,4 +132,4 @@ i = x([
|
|
|
132
132
|
export {
|
|
133
133
|
i as H
|
|
134
134
|
};
|
|
135
|
-
//# sourceMappingURL=hx-help-text-
|
|
135
|
+
//# sourceMappingURL=hx-help-text-Bmb80bP4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-help-text-Bmb80bP4.js","sources":["../../src/components/hx-help-text/hx-help-text.styles.ts","../../src/components/hx-help-text/hx-help-text.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixHelpTextStyles = css`\n :host {\n display: block;\n }\n\n .help-text {\n display: inline-flex;\n align-items: baseline;\n gap: var(--hx-help-text-icon-gap, 0.375rem);\n font-family: var(--hx-help-text-font-family, var(--hx-font-family-sans, sans-serif));\n font-size: var(--hx-help-text-font-size, var(--hx-font-size-sm, 0.875rem));\n font-weight: var(--hx-help-text-font-weight, var(--hx-font-weight-normal, 400));\n line-height: var(--hx-help-text-line-height, var(--hx-line-height-normal, 1.5));\n color: var(--hx-help-text-color, var(--hx-color-neutral-500, #6b7280));\n margin: 0;\n }\n\n .help-text__icon {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n }\n\n .help-text__text {\n min-width: 0;\n }\n\n /* ─── Variant: default ─── */\n\n .help-text--default {\n --hx-help-text-color: var(--hx-color-neutral-500, #6b7280);\n }\n\n /* ─── Variant: error ─── */\n\n .help-text--error {\n --hx-help-text-color: var(--hx-color-error-600, #dc2626);\n }\n\n /* ─── Variant: warning ─── */\n\n .help-text--warning {\n --hx-help-text-color: var(--hx-color-warning-700, #b45309);\n }\n\n /* ─── Variant: success ─── */\n\n .help-text--success {\n --hx-help-text-color: var(--hx-color-success-700, #15803d);\n }\n`;\n","import { LitElement, html, nothing } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { helixHelpTextStyles } from './hx-help-text.styles.js';\n\n/** Icon SVG for error variant (circle with exclamation mark). */\nconst errorIcon = html`<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\" width=\"1em\" height=\"1em\">\n <circle cx=\"8\" cy=\"8\" r=\"7\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\" />\n <line\n x1=\"8\"\n y1=\"4.5\"\n x2=\"8\"\n y2=\"8.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n <circle cx=\"8\" cy=\"11\" r=\"0.75\" fill=\"currentColor\" />\n</svg>`;\n\n/** Icon SVG for warning variant (triangle with exclamation mark). */\nconst warningIcon = html`<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\" width=\"1em\" height=\"1em\">\n <path\n d=\"M7.134 2.5a1 1 0 011.732 0l5.196 9a1 1 0 01-.866 1.5H2.804a1 1 0 01-.866-1.5l5.196-9z\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n fill=\"none\"\n />\n <line\n x1=\"8\"\n y1=\"6\"\n x2=\"8\"\n y2=\"9\"\n stroke=\"currentColor\"\n stroke-width=\"1.25\"\n stroke-linecap=\"round\"\n />\n <circle cx=\"8\" cy=\"11\" r=\"0.625\" fill=\"currentColor\" />\n</svg>`;\n\n/** Icon SVG for success variant (circle with checkmark). */\nconst successIcon = html`<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\" width=\"1em\" height=\"1em\">\n <circle cx=\"8\" cy=\"8\" r=\"7\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\" />\n <path\n d=\"M5.25 8.25l1.75 1.75 3.75-3.75\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n fill=\"none\"\n />\n</svg>`;\n\n/** Map of variant to icon template. Default has no icon. */\nconst variantIcons = {\n default: nothing,\n error: errorIcon,\n warning: warningIcon,\n success: successIcon,\n} as const;\n\n/**\n * Standardized help/hint text displayed below form fields.\n * Used by hx-field as a consistent sub-component for guidance and validation messages.\n *\n * Non-default variants render an inline icon alongside the text to satisfy\n * WCAG 1.4.1 (color is not the sole visual indicator). The `error` variant\n * uses `role=\"alert\"` for immediate screen-reader announcement; `warning`\n * and `success` use `aria-live=\"polite\"` for non-intrusive announcements.\n *\n * @summary Help text displayed below form controls for guidance or validation feedback.\n *\n * @tag hx-help-text\n *\n * @slot - The help text content.\n *\n * @csspart base - The root element of the help text.\n * @csspart icon - The icon wrapper (only rendered for non-default variants).\n * @csspart text - The text wrapper around the default slot.\n *\n * @cssprop [--hx-help-text-color=var(--hx-color-neutral-500)] - Text color.\n * @cssprop [--hx-help-text-font-family=var(--hx-font-family-sans)] - Font family.\n * @cssprop [--hx-help-text-font-size=var(--hx-font-size-sm)] - Font size.\n * @cssprop [--hx-help-text-font-weight=var(--hx-font-weight-normal)] - Font weight.\n * @cssprop [--hx-help-text-line-height=var(--hx-line-height-normal)] - Line height.\n * @cssprop [--hx-help-text-icon-gap=0.375rem] - Gap between icon and text.\n */\n@customElement('hx-help-text')\nexport class HelixHelpText extends LitElement {\n static override styles = [helixHelpTextStyles];\n\n /**\n * Visual variant that determines the text color and icon.\n * Use `error` for validation errors, `warning` for cautions, `success` for confirmation.\n * @attr variant\n */\n @property({ type: String, reflect: true })\n variant: 'default' | 'error' | 'warning' | 'success' = 'default';\n\n override render() {\n const classes = {\n 'help-text': true,\n [`help-text--${this.variant}`]: true,\n };\n\n const icon = variantIcons[this.variant];\n const role = this.variant === 'error' ? 'alert' : undefined;\n const ariaLive =\n this.variant === 'warning' || this.variant === 'success' ? 'polite' : undefined;\n\n return html`<span\n part=\"base\"\n class=${classMap(classes)}\n role=${ifDefined(role)}\n aria-live=${ifDefined(ariaLive)}\n >${icon !== nothing\n ? html`<span part=\"icon\" class=\"help-text__icon\">${icon}</span>`\n : nothing}<span part=\"text\" class=\"help-text__text\"><slot></slot></span>\n </span>`;\n }\n}\n\n/** Canonical type alias for the hx-help-text component. */\nexport type HxHelpText = HelixHelpText;\n\n/** @deprecated Use {@link HxHelpText} instead. The `Wc` prefix was a legacy naming convention. */\nexport type WcHelpText = HelixHelpText;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-help-text': HelixHelpText;\n }\n}\n"],"names":["helixHelpTextStyles","css","errorIcon","html","warningIcon","successIcon","variantIcons","nothing","HelixHelpText","LitElement","classes","icon","role","ariaLive","classMap","ifDefined","__decorateClass","property","customElement"],"mappings":";;;;;AAEO,MAAMA,IAAsBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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,SAAS,IAAM;AAAA,GAR9BT,EASX,WAAA,WAAA,CAAA;AATWA,IAANQ,EAAA;AAAA,EADNE,EAAc,cAAc;AAAA,GAChBV,CAAA;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css as _, LitElement as S, nothing as n, html as m } from "lit";
|
|
2
|
+
import "./document-token-adoption-DuYNKd4k.js";
|
|
2
3
|
import { property as f, state as g, customElement as x } from "lit/decorators.js";
|
|
3
|
-
import { unsafeHTML as
|
|
4
|
-
|
|
5
|
-
const w = _`
|
|
4
|
+
import { unsafeHTML as b } from "lit/directives/unsafe-html.js";
|
|
5
|
+
const y = _`
|
|
6
6
|
:host {
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
align-items: center;
|
|
@@ -76,10 +76,10 @@ const w = _`
|
|
|
76
76
|
display: block;
|
|
77
77
|
}
|
|
78
78
|
`;
|
|
79
|
-
var
|
|
80
|
-
for (var t = o > 1 ? void 0 : o ?
|
|
79
|
+
var w = Object.defineProperty, z = Object.getOwnPropertyDescriptor, h = (e, i, r, o) => {
|
|
80
|
+
for (var t = o > 1 ? void 0 : o ? z(i, r) : i, a = e.length - 1, c; a >= 0; a--)
|
|
81
81
|
(c = e[a]) && (t = (o ? c(i, r, t) : c(t)) || t);
|
|
82
|
-
return o && t &&
|
|
82
|
+
return o && t && w(i, r, t), t;
|
|
83
83
|
};
|
|
84
84
|
let s = class extends S {
|
|
85
85
|
constructor() {
|
|
@@ -199,7 +199,7 @@ let s = class extends S {
|
|
|
199
199
|
aria-label=${e ? n : this.label}
|
|
200
200
|
aria-hidden=${e ? "true" : n}
|
|
201
201
|
>
|
|
202
|
-
${
|
|
202
|
+
${b(this._inlineSvg)}
|
|
203
203
|
</span>
|
|
204
204
|
`;
|
|
205
205
|
}
|
|
@@ -208,7 +208,7 @@ let s = class extends S {
|
|
|
208
208
|
return typeof this.src == "string" && this.src.trim().length > 0 ? this._renderInline() : this.name ? this._renderSprite() : n;
|
|
209
209
|
}
|
|
210
210
|
};
|
|
211
|
-
s.styles = [
|
|
211
|
+
s.styles = [y];
|
|
212
212
|
h([
|
|
213
213
|
f({ type: String })
|
|
214
214
|
], s.prototype, "name", 2);
|
|
@@ -237,4 +237,4 @@ const v = /* @__PURE__ */ new Map();
|
|
|
237
237
|
export {
|
|
238
238
|
s as H
|
|
239
239
|
};
|
|
240
|
-
//# sourceMappingURL=hx-icon-
|
|
240
|
+
//# sourceMappingURL=hx-icon-BKHs3OLu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-icon-BKHs3OLu.js","sources":["../../src/components/hx-icon/hx-icon.styles.ts","../../src/components/hx-icon/hx-icon.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixIconStyles = css`\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n /* vertical-align: middle ensures the icon aligns to the visual centre of\n adjacent inline text rather than the text baseline. */\n vertical-align: middle;\n /* overflow: hidden prevents malformed or oversized icons from painting\n outside the component boundary. The inner SVG may still set\n overflow: visible for its own viewBox content. */\n overflow: hidden;\n width: var(--hx-icon-size, var(--hx-size-6, 1.5rem));\n height: var(--hx-icon-size, var(--hx-size-6, 1.5rem));\n color: var(--hx-icon-color, currentColor);\n flex-shrink: 0;\n }\n\n /* ─── Size Variants ───\n Fallback pixel values mirror the design token values at time of writing.\n If token values are updated the fallbacks should be updated to match. */\n\n :host([hx-size='xs']) {\n --hx-icon-size: var(--hx-size-4, 1rem);\n }\n\n :host([hx-size='sm']) {\n --hx-icon-size: var(--hx-size-5, 1.25rem);\n }\n\n :host([hx-size='md']) {\n --hx-icon-size: var(--hx-size-6, 1.5rem);\n }\n\n :host([hx-size='lg']) {\n --hx-icon-size: var(--hx-size-8, 2rem);\n }\n\n :host([hx-size='xl']) {\n --hx-icon-size: var(--hx-size-10, 2.5rem);\n }\n\n /* ─── SVG (sprite mode) ───\n In sprite mode [part=\"svg\"] is an actual <svg> element. The selector\n targets it specifically. In inline mode the part is applied to a <span>\n wrapper — see .icon__inline below. */\n\n svg[part='svg'] {\n width: 100%;\n height: 100%;\n fill: currentColor;\n display: block;\n overflow: visible;\n }\n\n /* ─── Inline SVG wrapper ───\n In inline mode [part=\"svg\"] is a <span> that wraps the fetched SVG.\n The inner <svg> is sized to fill the wrapper. */\n\n .icon__inline {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n }\n\n .icon__inline svg {\n width: 100%;\n height: 100%;\n fill: currentColor;\n display: block;\n }\n`;\n","import { LitElement, html, nothing, type PropertyValues } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { helixIconStyles } from './hx-icon.styles.js';\n\n/**\n * An icon component that supports inline SVG fetching and SVG sprite sheet references.\n * Decorative icons are automatically hidden from assistive technology.\n * When a label is provided the icon is announced as an image with that label.\n *\n * **Render modes:**\n * - **Sprite mode** (recommended for Drupal/SSR): Set `name` and optionally `sprite-url`.\n * Renders an `<svg><use href=\"...#name\">` — works server-side without JavaScript.\n * - **Inline mode**: Set `src` to a URL of a standalone SVG file. The component fetches,\n * sanitizes, and embeds the SVG markup. Requires JavaScript; not server-side renderable.\n * For Drupal/Twig templates use sprite mode to avoid content shift before hydration.\n *\n * @summary SVG icon with sprite and inline fetch modes for healthcare applications.\n *\n * @tag hx-icon\n *\n * @csspart svg - The SVG element rendered in sprite mode, or the inline SVG container\n * in inline mode. In sprite mode this is an `<svg>` element; in inline mode it is a\n * `<span>` element wrapping the fetched SVG. Both expose the same `part` name for\n * consistent external styling via `::part(svg)`.\n *\n * @cssprop [--hx-icon-size=var(--hx-size-6,1.5rem)] - Width and height of the icon.\n * @cssprop [--hx-icon-color=currentColor] - Icon color.\n */\n@customElement('hx-icon')\nexport class HelixIcon extends LitElement {\n static override styles = [helixIconStyles];\n\n /**\n * Icon name used as the fragment identifier when referencing a sprite sheet.\n * For sprite mode provide the bare symbol id (e.g. `check`). The component\n * will build the full href as `${spriteUrl}#${name}`. If `name` already\n * starts with `#` it is used as-is (inline sprite reference without a base\n * URL).\n * @attr name\n */\n @property({ type: String })\n name = '';\n\n /**\n * URL of a standalone SVG file to fetch and render inline. Takes precedence\n * over sprite mode when both `src` and `spriteUrl`/`name` are set.\n *\n * **Note:** Inline mode requires browser JavaScript (`fetch` + `DOMParser`).\n * It is not server-side renderable. For Drupal/Twig use sprite mode instead.\n * @attr src\n */\n @property({ type: String })\n src: string | undefined = undefined;\n\n /**\n * Base URL of the SVG sprite sheet. Used together with `name` to construct\n * the `<use>` href: `${spriteUrl}#${name}`.\n * @attr sprite-url\n */\n @property({ type: String, attribute: 'sprite-url' })\n spriteUrl: string | undefined = undefined;\n\n /**\n * Size variant of the icon.\n *\n * Set via the `hx-size` HTML attribute (e.g. `hx-size=\"lg\"`) or via the\n * `size` JavaScript property (e.g. `el.size = 'lg'`). Both are equivalent —\n * the `attribute: 'hx-size'` mapping is used to avoid colliding with the\n * native `<input>` `size` attribute in Drupal attribute-passthrough scenarios.\n * The CEM exposes both the JS property name (`size`) and the HTML attribute\n * name (`hx-size`).\n *\n * @attr hx-size\n */\n @property({ type: String, reflect: true, attribute: 'hx-size' })\n size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'md';\n\n /**\n * Accessible label for the icon. When non-empty, `role=\"img\"` and\n * `aria-label` are applied so assistive technology announces the icon.\n * When empty the icon is treated as decorative and `aria-hidden=\"true\"` is\n * applied.\n * @attr label\n */\n @property({ type: String })\n label = '';\n\n /**\n * Stores the sanitized inner markup of an externally fetched SVG.\n * @internal\n */\n @state()\n private _inlineSvg = '';\n\n /**\n * Tracks the `src` URL that was last successfully fetched so that we only\n * refetch when it genuinely changes.\n * @internal\n */\n @state()\n private _fetchedSrc: string | undefined = undefined;\n\n /**\n * Monotonically-increasing sequence number. Incremented before each fetch so\n * that stale out-of-order responses can be discarded.\n */\n /** @internal */\n private _fetchSeq = 0;\n\n // ─── Lifecycle ───\n\n override updated(changed: PropertyValues<this>): void {\n super.updated(changed);\n if (changed.has('src') && this.src !== this._fetchedSrc) {\n void this._fetchInlineSvg(this.src);\n }\n }\n\n // ─── Inline SVG Fetch ───\n\n /** @internal */\n private async _fetchInlineSvg(url: string | undefined): Promise<void> {\n const seq = ++this._fetchSeq;\n\n if (!url) {\n this._inlineSvg = '';\n this._fetchedSrc = undefined;\n return;\n }\n\n // Use module-level cache to avoid duplicate network requests for the same URL.\n // Multiple hx-icon instances sharing the same src will share one in-flight fetch.\n try {\n let pending = _svgCache.get(url);\n if (!pending) {\n pending = fetch(url).then(async (response) => {\n if (!response.ok) {\n _svgCache.delete(url);\n return '';\n }\n return response.text();\n });\n _svgCache.set(url, pending);\n }\n\n const text = await pending;\n if (seq !== this._fetchSeq) return;\n\n if (!text) {\n this._inlineSvg = '';\n this._fetchedSrc = undefined;\n return;\n }\n\n const sanitized = this._sanitizeSvg(text);\n this._inlineSvg = sanitized;\n this._fetchedSrc = url;\n } catch {\n if (seq !== this._fetchSeq) return;\n _svgCache.delete(url);\n this._inlineSvg = '';\n this._fetchedSrc = undefined;\n }\n }\n\n /**\n * Parses the raw SVG text, strips dangerous content (script elements,\n * foreignObject, on* event-handler attributes, javascript:/data: URIs,\n * and style attributes that could carry CSS injection payloads), and\n * returns the outer SVG markup safe for rendering via `unsafeHTML`.\n *\n * Additionally injects `focusable=\"false\"` on the root SVG element to\n * prevent IE11/old-Edge from making the SVG keyboard-focusable, and strips\n * any ARIA attributes from the inner SVG to prevent conflicts with the\n * wrapper's own ARIA semantics.\n */\n /** @internal */\n private _sanitizeSvg(raw: string): string {\n const parser = new DOMParser();\n const doc = parser.parseFromString(raw, 'image/svg+xml');\n\n const parseError = doc.querySelector('parsererror');\n if (parseError) {\n return '';\n }\n\n const svgEl = doc.querySelector('svg');\n if (!svgEl) {\n return '';\n }\n\n // Remove dangerous embedded elements.\n svgEl.querySelectorAll('script, foreignObject').forEach((s) => {\n s.remove();\n });\n\n // URL-bearing attributes that can carry javascript:/data: payloads.\n const urlAttrs = new Set(['href', 'xlink:href', 'src', 'action', 'formaction']);\n\n // ARIA attributes that may conflict with the wrapper element's own semantics.\n // The wrapper <span part=\"svg\"> owns role/aria-label/aria-hidden — the inner\n // SVG must not duplicate or contradict these.\n const ariaAttrs = new Set(['role', 'aria-label', 'aria-labelledby', 'aria-hidden']);\n\n // Sanitize every element including the root svg.\n const allElements: Element[] = [svgEl, ...Array.from(svgEl.querySelectorAll('*'))];\n allElements.forEach((el) => {\n const attrs = Array.from(el.attributes);\n attrs.forEach((attr) => {\n const attrName = attr.name.toLowerCase();\n // Strip event-handler attributes.\n if (attrName.startsWith('on')) {\n el.removeAttribute(attr.name);\n return;\n }\n // Strip style attributes — CSS can carry injection payloads via\n // url(javascript:...), expression(), or external filter/clip-path references.\n if (attrName === 'style') {\n el.removeAttribute(attr.name);\n return;\n }\n // Strip javascript: and data: URIs from URL-bearing attributes.\n if (urlAttrs.has(attrName)) {\n const val = attr.value.replace(/\\s/g, '').toLowerCase();\n if (val.startsWith('javascript:') || val.startsWith('data:')) {\n el.removeAttribute(attr.name);\n }\n }\n });\n });\n\n // Strip ARIA attributes from the root SVG only — they conflict with the\n // wrapper element's ARIA. Child elements' ARIA is left intact.\n ariaAttrs.forEach((a) => svgEl.removeAttribute(a));\n\n // Inject focusable=\"false\" so IE11/old-Edge do not tab into the SVG.\n svgEl.setAttribute('focusable', 'false');\n\n return svgEl.outerHTML;\n }\n\n // ─── Render Helpers ───\n\n /**\n * Returns the href used in the `<use>` element for sprite mode.\n * If `name` already begins with `#` it is treated as an inline reference.\n */\n /** @internal */\n private _spriteHref(): string {\n const n = this.name;\n if (n.startsWith('#')) {\n return n;\n }\n const base = this.spriteUrl ?? '';\n return base ? `${base}#${n}` : `#${n}`;\n }\n\n /** @internal */\n private _renderSprite() {\n const isDecorative = !this.label.trim();\n\n return html`\n <svg\n part=\"svg\"\n class=\"icon__svg\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=${isDecorative ? nothing : 'img'}\n aria-label=${isDecorative ? nothing : this.label}\n aria-hidden=${isDecorative ? 'true' : nothing}\n focusable=\"false\"\n >\n ${isDecorative ? nothing : html`<title>${this.label}</title>`}\n <use href=${this._spriteHref()}></use>\n </svg>\n `;\n }\n\n /** @internal */\n private _renderInline() {\n if (!this._inlineSvg) {\n return nothing;\n }\n\n const isDecorative = !this.label.trim();\n\n // The fetched SVG is rendered inside a wrapper span that carries the\n // csspart and ARIA semantics. The inner SVG from unsafeHTML fills the\n // container via the `.icon__inline svg` CSS rule. ARIA attributes and\n // focusable=\"false\" are injected into the inner SVG by _sanitizeSvg.\n return html`\n <span\n part=\"svg\"\n class=\"icon__inline\"\n role=${isDecorative ? nothing : 'img'}\n aria-label=${isDecorative ? nothing : this.label}\n aria-hidden=${isDecorative ? 'true' : nothing}\n >\n ${unsafeHTML(this._inlineSvg)}\n </span>\n `;\n }\n\n // ─── Render ───\n\n override render() {\n // Inline fetch mode takes precedence when src is a non-empty string.\n if (typeof this.src === 'string' && this.src.trim().length > 0) {\n return this._renderInline();\n }\n\n // Sprite mode: requires at least a name.\n if (this.name) {\n return this._renderSprite();\n }\n\n return nothing;\n }\n}\n\n/**\n * Module-level SVG fetch cache. Shared across all `hx-icon` instances so that\n * multiple icons sharing the same `src` URL issue only one network request.\n * The cache stores in-flight `Promise<string>` values — resolved entries remain\n * cached for the lifetime of the page to prevent redundant re-fetches.\n */\nconst _svgCache = new Map<string, Promise<string>>();\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-icon': HelixIcon;\n }\n}\n"],"names":["helixIconStyles","css","HelixIcon","LitElement","changed","url","seq","pending","_svgCache","response","text","sanitized","raw","doc","svgEl","s","urlAttrs","ariaAttrs","el","attr","attrName","val","a","n","base","isDecorative","html","nothing","unsafeHTML","__decorateClass","property","state","customElement"],"mappings":";;;;AAEO,MAAMA,IAAkBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AEhB,WAAI,OAAO,KAAK,OAAQ,YAAY,KAAK,IAAI,KAAA,EAAO,SAAS,IACpD,KAAK,cAAA,IAIV,KAAK,OACA,KAAK,cAAA,IAGPD;AAAA,EACT;AACF;AAjSazB,EACK,SAAS,CAACF,CAAe;AAWzC6B,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAXf5B,EAYX,WAAA,QAAA,CAAA;AAWA2B,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAtBf5B,EAuBX,WAAA,OAAA,CAAA;AAQA2B,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,GA9BxC5B,EA+BX,WAAA,aAAA,CAAA;AAeA2B,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM,WAAW,WAAW;AAAA,GA7CpD5B,EA8CX,WAAA,QAAA,CAAA;AAUA2B,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAvDf5B,EAwDX,WAAA,SAAA,CAAA;AAOQ2B,EAAA;AAAA,EADPE,EAAA;AAAM,GA9DI7B,EA+DH,WAAA,cAAA,CAAA;AAQA2B,EAAA;AAAA,EADPE,EAAA;AAAM,GAtEI7B,EAuEH,WAAA,eAAA,CAAA;AAvEGA,IAAN2B,EAAA;AAAA,EADNG,EAAc,SAAS;AAAA,GACX9B,CAAA;AAySb,MAAMM,wBAAgB,IAAA;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { css as v, LitElement as p, html as c, nothing as u } from "lit";
|
|
2
|
+
import "./document-token-adoption-DuYNKd4k.js";
|
|
2
3
|
import { property as e, customElement as x } from "lit/decorators.js";
|
|
3
4
|
import { classMap as d } from "lit/directives/class-map.js";
|
|
4
5
|
import { ifDefined as b } from "lit/directives/if-defined.js";
|
|
5
|
-
|
|
6
|
-
const f = v`
|
|
6
|
+
const m = v`
|
|
7
7
|
:host {
|
|
8
8
|
display: inline-block;
|
|
9
9
|
}
|
|
@@ -156,10 +156,10 @@ const f = v`
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
`;
|
|
159
|
-
var
|
|
160
|
-
for (var i = a > 1 ? void 0 : a ?
|
|
159
|
+
var f = Object.defineProperty, g = Object.getOwnPropertyDescriptor, o = (t, n, s, a) => {
|
|
160
|
+
for (var i = a > 1 ? void 0 : a ? g(n, s) : n, h = t.length - 1, l; h >= 0; h--)
|
|
161
161
|
(l = t[h]) && (i = (a ? l(n, s, i) : l(i)) || i);
|
|
162
|
-
return a && i &&
|
|
162
|
+
return a && i && f(n, s, i), i;
|
|
163
163
|
};
|
|
164
164
|
let r = class extends p {
|
|
165
165
|
constructor() {
|
|
@@ -244,7 +244,7 @@ let r = class extends p {
|
|
|
244
244
|
` : u;
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
|
-
r.styles = [m
|
|
247
|
+
r.styles = [m];
|
|
248
248
|
r.formAssociated = !0;
|
|
249
249
|
o([
|
|
250
250
|
e({ type: String })
|
|
@@ -276,4 +276,4 @@ r = o([
|
|
|
276
276
|
export {
|
|
277
277
|
r as H
|
|
278
278
|
};
|
|
279
|
-
//# sourceMappingURL=hx-icon-button-
|
|
279
|
+
//# sourceMappingURL=hx-icon-button-CJuy9xbw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-icon-button-CJuy9xbw.js","sources":["../../src/components/hx-icon-button/hx-icon-button.styles.ts","../../src/components/hx-icon-button/hx-icon-button.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixIconButtonStyles = css`\n :host {\n display: inline-block;\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: var(--hx-opacity-disabled);\n }\n\n .button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border: var(--hx-border-width-thin) solid var(--hx-icon-button-border-color);\n border-radius: var(--hx-icon-button-border-radius, var(--hx-border-radius-md));\n background-color: var(--hx-icon-button-bg);\n color: var(--hx-icon-button-color, var(--hx-color-primary-500));\n cursor: pointer;\n transition:\n background-color var(--hx-transition-fast),\n color var(--hx-transition-fast),\n border-color var(--hx-transition-fast),\n box-shadow var(--hx-transition-fast);\n text-decoration: none;\n user-select: none;\n -webkit-user-select: none;\n flex-shrink: 0;\n }\n\n .button:focus-visible {\n outline: var(--hx-focus-ring-width) solid\n var(--hx-icon-button-focus-ring-color, var(--hx-focus-ring-color));\n outline-offset: var(--hx-focus-ring-offset);\n }\n\n .button:active {\n filter: brightness(var(--hx-filter-brightness-active, 0.8));\n }\n\n /* ─── Size Variants ─── */\n\n /* WCAG 2.5.5 (healthcare mandate): minimum 44x44px touch target for all sizes.\n min-width/min-height override the explicit size tokens when they fall below\n the 2.75rem (44px) threshold, preserving the visual icon size via font-size. */\n\n .button--sm {\n padding: var(--hx-space-1);\n width: var(--hx-icon-button-size, var(--hx-size-8));\n height: var(--hx-icon-button-size, var(--hx-size-8));\n min-width: var(--hx-touch-target-min, 2.75rem);\n min-height: var(--hx-touch-target-min, 2.75rem);\n font-size: var(--hx-font-size-sm);\n }\n\n .button--md {\n padding: var(--hx-space-2);\n width: var(--hx-icon-button-size, var(--hx-size-10));\n height: var(--hx-icon-button-size, var(--hx-size-10));\n min-width: var(--hx-touch-target-min, 2.75rem);\n min-height: var(--hx-touch-target-min, 2.75rem);\n font-size: var(--hx-font-size-md);\n }\n\n .button--lg {\n padding: var(--hx-space-3);\n width: var(--hx-icon-button-size, var(--hx-size-12));\n height: var(--hx-icon-button-size, var(--hx-size-12));\n min-width: var(--hx-touch-target-min, 2.75rem);\n min-height: var(--hx-touch-target-min, 2.75rem);\n font-size: var(--hx-font-size-lg);\n }\n\n /* ─── Style Variants ─── */\n\n .button--primary {\n --hx-icon-button-bg: var(--hx-color-primary-500);\n --hx-icon-button-color: var(--hx-color-neutral-0);\n --hx-icon-button-border-color: transparent;\n }\n\n .button--primary:hover {\n --hx-icon-button-bg: var(--hx-color-primary-600);\n }\n\n .button--secondary {\n --hx-icon-button-bg: transparent;\n --hx-icon-button-color: var(--hx-color-primary-500);\n --hx-icon-button-border-color: var(--hx-color-primary-500);\n }\n\n .button--secondary:hover {\n --hx-icon-button-bg: var(--hx-color-primary-50);\n }\n\n .button--tertiary {\n --hx-icon-button-bg: transparent;\n --hx-icon-button-color: var(--hx-color-neutral-700);\n --hx-icon-button-border-color: var(--hx-color-neutral-300);\n }\n\n .button--tertiary:hover {\n --hx-icon-button-bg: var(--hx-color-neutral-100);\n }\n\n .button--danger {\n --hx-icon-button-bg: var(--hx-color-error-500);\n --hx-icon-button-color: var(--hx-color-neutral-0);\n --hx-icon-button-border-color: transparent;\n }\n\n .button--danger:hover {\n --hx-icon-button-bg: var(--hx-color-error-600);\n }\n\n .button--ghost {\n --hx-icon-button-bg: transparent;\n --hx-icon-button-color: var(--hx-color-primary-500);\n --hx-icon-button-border-color: transparent;\n }\n\n .button--ghost:hover {\n --hx-icon-button-bg: var(--hx-color-neutral-100);\n }\n\n /* ─── Icon Container ─── */\n\n .icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1em;\n height: 1em;\n line-height: 1;\n pointer-events: none;\n }\n\n /* ─── Disabled ─── */\n\n .button[disabled] {\n cursor: not-allowed;\n /* P1-02 fix: opacity is set only on :host([disabled]) above to prevent\n multiplicative stacking (0.5 * 0.5 = 0.25). Do not add opacity here. */\n }\n\n /* ─── Reduced Motion ─── */\n\n @media (prefers-reduced-motion: reduce) {\n .button {\n transition: none;\n }\n }\n`;\n","import { LitElement, html, nothing } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { helixIconButtonStyles } from './hx-icon-button.styles.js';\nimport { devWarn } from '../../utils/dev-warn.js';\n\n/**\n * An icon-only button component for compact, accessible actions.\n * Renders a square button or anchor element containing a single icon.\n * The `label` property is required and provides the accessible name\n * via `aria-label` and a native tooltip via the `title` attribute.\n *\n * @summary Icon-only action button with full accessibility support.\n *\n * @tag hx-icon-button\n *\n * @slot - Icon element to display (hx-icon, svg, or img).\n *\n * @fires {CustomEvent<{originalEvent: MouseEvent}>} hx-click - Dispatched when the button is clicked (not disabled).\n *\n * @csspart button - The native button or anchor element.\n * @csspart icon - The icon container span wrapping the default slot.\n *\n * @cssprop [--hx-icon-button-bg=transparent] - Button background color.\n * @cssprop [--hx-icon-button-color=var(--hx-color-primary-500)] - Icon color.\n * @cssprop [--hx-icon-button-border-color=transparent] - Button border color.\n * @cssprop [--hx-icon-button-border-radius=var(--hx-border-radius-md)] - Button border radius.\n * @cssprop [--hx-icon-button-size] - Explicit width and height override for the button.\n * @cssprop [--hx-icon-button-focus-ring-color=var(--hx-focus-ring-color)] - Focus ring color.\n */\n@customElement('hx-icon-button')\nexport class HelixIconButton extends LitElement {\n static override styles = [helixIconButtonStyles];\n\n /**\n * Accessible name for the button. Required. Rendered as `aria-label` and\n * `title` on the underlying element. The component renders nothing when absent,\n * and a console warning is emitted to alert developers during authoring.\n * @attr label\n */\n @property({ type: String })\n label = '';\n\n /**\n * Visual style variant of the button.\n * @attr variant\n */\n @property({ type: String, reflect: true })\n variant: 'primary' | 'secondary' | 'tertiary' | 'danger' | 'ghost' = 'ghost';\n\n /**\n * Size of the button.\n * @attr hx-size\n */\n @property({ type: String, reflect: true, attribute: 'hx-size' })\n size: 'sm' | 'md' | 'lg' = 'md';\n\n /**\n * The type attribute for the underlying button element.\n * Has no effect when `href` is set.\n * @attr type\n */\n @property({ type: String })\n type: 'button' | 'submit' | 'reset' = 'button';\n\n /**\n * Whether the button is disabled.\n * @attr disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * When set, renders an `<a>` element instead of a `<button>`.\n * @attr href\n */\n @property({ type: String })\n href: string | undefined = undefined;\n\n /**\n * Name submitted with form data. Only applicable when rendering as a button.\n * @attr name\n */\n @property({ type: String })\n name: string | undefined = undefined;\n\n /**\n * Value submitted with form data. Only applicable when rendering as a button.\n * @attr value\n */\n @property({ type: String })\n value: string | undefined = undefined;\n\n // ─── Form Association via ElementInternals ───\n\n /** @internal */\n static formAssociated = true;\n\n /** @internal */\n private _internals: ElementInternals;\n\n constructor() {\n super();\n /** @internal */\n this._internals = this.attachInternals();\n }\n\n /** Returns the associated form element, if any. */\n get form(): HTMLFormElement | null {\n return this._internals.form;\n }\n\n /** @internal */\n formResetCallback(): void {\n // hx-icon-button does not submit a value; no state to reset.\n }\n\n /** @internal */\n formStateRestoreCallback(\n _state: string | File | FormData | null,\n _mode: 'restore' | 'autocomplete',\n ): void {\n // hx-icon-button does not submit a value; no state to restore.\n }\n\n /** @internal */\n formDisabledCallback(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n // ─── Event Handling ───\n\n /** @internal */\n private _handleClick(e: MouseEvent): void {\n if (this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n /**\n * Dispatched when the button is clicked.\n * @event hx-click\n */\n this.dispatchEvent(\n new CustomEvent<{ originalEvent: MouseEvent }>('hx-click', {\n bubbles: true,\n composed: true,\n detail: { originalEvent: e },\n }),\n );\n\n // Handle form submission/reset if form-associated and not in href/link mode\n if (!this.href) {\n if (this.type === 'submit' && this._internals.form) {\n this._internals.form.requestSubmit();\n } else if (this.type === 'reset' && this._internals.form) {\n this._internals.form.reset();\n }\n }\n }\n\n // ─── Render Helpers ───\n\n /** @internal */\n private _normalizedLabel(): string {\n return this.label.trim();\n }\n\n /** @internal */\n private _classes() {\n return {\n button: true,\n [`button--${this.variant}`]: true,\n [`button--${this.size}`]: true,\n };\n }\n\n /** @internal */\n private _iconSlot() {\n return html`<span part=\"icon\" class=\"icon\"><slot></slot></span>`;\n }\n\n // ─── Render ───\n\n override render() {\n const normalizedLabel = this._normalizedLabel();\n if (!normalizedLabel) {\n devWarn(\n 'hx-icon-button',\n 'The `label` property is required for accessibility. Render suppressed.',\n );\n return nothing;\n }\n\n if (this.href !== undefined) {\n // P1-03 fix: disabled anchor must set tabindex=\"-1\" explicitly — an <a>\n // without href is non-focusable by default in most browsers, but this is\n // browser-dependent. Explicit tabindex=\"-1\" guarantees keyboard exclusion\n // across all conforming browsers.\n // P1-07 note: aria-disabled IS required on the anchor branch because\n // <a> elements have no native disabled attribute; aria-disabled is the\n // only AT signal available.\n return html`\n <a\n part=\"button\"\n class=${classMap(this._classes())}\n href=${ifDefined(this.disabled ? undefined : this.href)}\n aria-label=${normalizedLabel}\n title=${normalizedLabel}\n aria-disabled=${this.disabled ? 'true' : nothing}\n tabindex=${this.disabled ? '-1' : nothing}\n @click=${this._handleClick}\n >\n ${this._iconSlot()}\n </a>\n `;\n }\n\n // P1-07 fix: aria-disabled is redundant on a natively disabled <button>.\n // The native disabled attribute already exposes aria-disabled=\"true\"\n // implicitly in the accessibility tree. Duplicate explicit aria-disabled\n // creates ambiguity about design intent. Keep only native ?disabled.\n return html`\n <button\n part=\"button\"\n class=${classMap(this._classes())}\n ?disabled=${this.disabled}\n type=${this.type}\n aria-label=${normalizedLabel}\n title=${normalizedLabel}\n name=${ifDefined(this.name)}\n value=${ifDefined(this.value)}\n @click=${this._handleClick}\n >\n ${this._iconSlot()}\n </button>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-icon-button': HelixIconButton;\n }\n}\n"],"names":["helixIconButtonStyles","css","HelixIconButton","LitElement","_state","_mode","disabled","e","html","normalizedLabel","classMap","ifDefined","nothing","__decorateClass","property","customElement"],"mappings":";;;;;AAEO,MAAMA,IAAwBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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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AA,gBACnBA,EAAU,KAAK,KAAK,CAAC;AAAA,iBACpB,KAAK,YAAY;AAAA;AAAA,UAExB,KAAK,WAAW;AAAA;AAAA,QA3CbC;AAAA,EA8CX;AACF;AAhNaV,EACK,SAAS,CAACF,CAAqB;AADpCE,EAiEJ,iBAAiB;AAvDxBW,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GATfZ,EAUX,WAAA,SAAA,CAAA;AAOAW,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAhB9BZ,EAiBX,WAAA,WAAA,CAAA;AAOAW,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM,WAAW,WAAW;AAAA,GAvBpDZ,EAwBX,WAAA,QAAA,CAAA;AAQAW,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA/BfZ,EAgCX,WAAA,QAAA,CAAA;AAOAW,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAtC/BZ,EAuCX,WAAA,YAAA,CAAA;AAOAW,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA7CfZ,EA8CX,WAAA,QAAA,CAAA;AAOAW,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GApDfZ,EAqDX,WAAA,QAAA,CAAA;AAOAW,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA3DfZ,EA4DX,WAAA,SAAA,CAAA;AA5DWA,IAANW,EAAA;AAAA,EADNE,EAAc,gBAAgB;AAAA,GAClBb,CAAA;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { css as g, LitElement as f, html as d, nothing as l } from "lit";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import "./document-token-adoption-DuYNKd4k.js";
|
|
3
|
+
import { property as r, state as p, customElement as _ } from "lit/decorators.js";
|
|
4
|
+
import { classMap as m } from "lit/directives/class-map.js";
|
|
4
5
|
import { styleMap as u } from "lit/directives/style-map.js";
|
|
5
|
-
|
|
6
|
-
const y = g`
|
|
6
|
+
const v = g`
|
|
7
7
|
:host {
|
|
8
8
|
display: block;
|
|
9
9
|
}
|
|
@@ -45,10 +45,10 @@ const y = g`
|
|
|
45
45
|
display: block;
|
|
46
46
|
}
|
|
47
47
|
`;
|
|
48
|
-
var
|
|
49
|
-
for (var i = h > 1 ? void 0 : h ?
|
|
48
|
+
var y = Object.defineProperty, b = Object.getOwnPropertyDescriptor, e = (s, o, a, h) => {
|
|
49
|
+
for (var i = h > 1 ? void 0 : h ? b(o, a) : o, n = s.length - 1, c; n >= 0; n--)
|
|
50
50
|
(c = s[n]) && (i = (h ? c(o, a, i) : c(i)) || i);
|
|
51
|
-
return h && i &&
|
|
51
|
+
return h && i && y(o, a, i), i;
|
|
52
52
|
};
|
|
53
53
|
let t = class extends f {
|
|
54
54
|
constructor() {
|
|
@@ -117,7 +117,7 @@ let t = class extends f {
|
|
|
117
117
|
/>
|
|
118
118
|
<figcaption
|
|
119
119
|
part="caption"
|
|
120
|
-
class=${
|
|
120
|
+
class=${m({ image__caption: !0, "image__caption--visible": h })}
|
|
121
121
|
>
|
|
122
122
|
<slot name="caption" @slotchange=${this._onCaptionSlotChange}></slot>
|
|
123
123
|
</figcaption>
|
|
@@ -125,7 +125,7 @@ let t = class extends f {
|
|
|
125
125
|
`;
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
|
-
t.styles = [v
|
|
128
|
+
t.styles = [v];
|
|
129
129
|
e([
|
|
130
130
|
r({ type: String, reflect: !0 })
|
|
131
131
|
], t.prototype, "src", 2);
|
|
@@ -172,9 +172,9 @@ e([
|
|
|
172
172
|
p()
|
|
173
173
|
], t.prototype, "_hasCaptionSlot", 2);
|
|
174
174
|
t = e([
|
|
175
|
-
|
|
175
|
+
_("hx-image")
|
|
176
176
|
], t);
|
|
177
177
|
export {
|
|
178
178
|
t as H
|
|
179
179
|
};
|
|
180
|
-
//# sourceMappingURL=hx-image-
|
|
180
|
+
//# sourceMappingURL=hx-image-ztiXumZB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-image-ztiXumZB.js","sources":["../../src/components/hx-image/hx-image.styles.ts","../../src/components/hx-image/hx-image.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixImageStyles = css`\n :host {\n display: block;\n }\n\n .image__container {\n position: relative;\n display: block;\n overflow: hidden;\n margin: 0;\n padding: 0;\n aspect-ratio: var(--_ratio, var(--hx-image-aspect-ratio));\n border-radius: var(--_radius, var(--hx-image-border-radius, 0));\n }\n\n .image__container--error {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: var(--hx-image-fallback-min-height, 3rem);\n background-color: var(--hx-color-neutral-100, #f3f4f6);\n color: var(--hx-color-neutral-500, #6b7280);\n }\n\n .image__img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: var(--_fit, var(--hx-image-object-fit, cover));\n }\n\n .image__caption {\n display: none;\n padding: var(--hx-image-caption-padding, 0.5rem 0 0);\n color: var(--hx-image-caption-color, var(--hx-color-neutral-600, #4b5563));\n font-size: var(--hx-image-caption-font-size, 0.875rem);\n }\n\n .image__caption--visible {\n display: block;\n }\n`;\n","import { LitElement, html, nothing } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { helixImageStyles } from './hx-image.styles.js';\nimport { devWarn } from '../../utils/dev-warn.js';\n\n/**\n * An accessible image wrapper with lazy loading, fallback support, aspect ratio control,\n * responsive image (srcset/sizes) support, and optional caption.\n *\n * @summary Accessible image wrapper with lazy loading, fallback, srcset, and aspect ratio control.\n *\n * @tag hx-image\n *\n * @slot fallback - Custom content shown when the image fails to load and no fallback-src is set.\n * @slot caption - Optional caption content rendered in a figcaption element below the image.\n *\n * @csspart base - The inner img element.\n * @csspart caption - The figcaption element (visible only when caption content is present).\n *\n * @cssprop [--hx-image-object-fit] - Controls how the image fills its container. Maps to object-fit.\n * @cssprop [--hx-image-border-radius] - Border radius of the image. Overridden by the `rounded` prop.\n * @cssprop [--hx-image-aspect-ratio] - Aspect ratio of the image container. Overridden by the `ratio` prop.\n * @cssprop [--hx-image-caption-color] - Text color for the caption.\n * @cssprop [--hx-image-caption-font-size] - Font size for the caption.\n * @cssprop [--hx-image-caption-padding] - Padding for the caption.\n * @cssprop [--hx-image-fallback-min-height] - Minimum height of the error/fallback container.\n *\n * @fires hx-load - Dispatched when the image has successfully loaded.\n * @fires hx-error - Dispatched when the image fails to load (including after fallback-src also fails).\n */\n@customElement('hx-image')\nexport class HelixImage extends LitElement {\n static override styles = [helixImageStyles];\n\n /**\n * The URL of the image to display.\n * @attr src\n */\n @property({ type: String, reflect: true })\n src = '';\n\n /**\n * Accessible text description of the image.\n * Required for informative images. Use the `decorative` prop for decorative images\n * instead of setting this to an empty string — explicit decorative intent is preferred.\n * @attr alt\n */\n @property({ type: String, reflect: true })\n alt: string | undefined = undefined;\n\n /**\n * Marks the image as decorative (hidden from screen readers).\n * Use this instead of `alt=\"\"` to make decorative intent explicit in markup.\n * When set, the inner img receives `alt=\"\"` and `role=\"presentation\"`.\n * @attr decorative\n */\n @property({ type: Boolean, reflect: true })\n decorative = false;\n\n /**\n * Width of the image element.\n * @attr width\n */\n @property({ reflect: true })\n width: number | string | undefined = undefined;\n\n /**\n * Height of the image element.\n * @attr height\n */\n @property({ reflect: true })\n height: number | string | undefined = undefined;\n\n /**\n * Loading strategy for the image.\n * @attr loading\n */\n @property({ type: String, reflect: true })\n loading: 'lazy' | 'eager' = 'lazy';\n\n /**\n * How the image should be resized to fit its container.\n * Maps to CSS object-fit.\n * @attr fit\n */\n @property({ type: String, reflect: true })\n fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down' | undefined = undefined;\n\n /**\n * CSS aspect-ratio value (e.g. \"16/9\", \"1\", \"4/3\").\n * When set, the container maintains this ratio.\n * @attr ratio\n */\n @property({ type: String, reflect: true })\n ratio: string | undefined = undefined;\n\n /**\n * Border radius for the image.\n * Boolean attribute (or `true`) applies the theme's medium radius token.\n * A string value is used directly as a CSS border-radius value (e.g. \"1rem\", \"50%\").\n *\n * Note: When set as an HTML attribute (`<hx-image rounded>`), Lit receives the value as\n * an empty string (`''`). When set programmatically (`el.rounded = true`), it receives\n * a boolean. Both forms apply the theme radius token.\n *\n * @attr rounded\n */\n @property({ type: String, reflect: true })\n rounded: boolean | string | undefined = undefined;\n\n /**\n * Fallback image URL shown when the primary src fails to load.\n * @attr fallback-src\n */\n @property({ type: String, attribute: 'fallback-src', reflect: true })\n fallbackSrc: string | undefined = undefined;\n\n /**\n * A comma-separated list of image candidates for responsive images.\n * Passed directly to the inner img's srcset attribute.\n * Enables Drupal responsive image styles and browser-native image selection.\n * @attr srcset\n */\n @property({ type: String, reflect: true })\n srcset: string | undefined = undefined;\n\n /**\n * Media conditions indicating which image size to use alongside srcset.\n * Works in conjunction with the `srcset` attribute.\n * @attr sizes\n */\n @property({ type: String, reflect: true })\n sizes: string | undefined = undefined;\n\n /** @internal */\n @state()\n private _error = false;\n\n /** @internal */\n @state()\n private _usedFallbackSrc = false;\n\n /** @internal */\n @state()\n private _hasCaptionSlot = false;\n\n /** @internal */\n private _handleLoad(): void {\n this.dispatchEvent(new CustomEvent<void>('hx-load', { bubbles: true, composed: true }));\n }\n\n /** @internal */\n private _handleError(): void {\n if (!this._error && this.fallbackSrc && !this._usedFallbackSrc) {\n // Try the fallback-src before showing the fallback slot\n this._usedFallbackSrc = true;\n return;\n }\n this._error = true;\n this.dispatchEvent(new CustomEvent<void>('hx-error', { bubbles: true, composed: true }));\n }\n\n /** @internal */\n private _onCaptionSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasCaptionSlot = slot.assignedNodes({ flatten: true }).length > 0;\n }\n\n /** @internal */\n private _computeBorderRadius(): string | undefined {\n if (this.rounded === true || this.rounded === '' || this.rounded === 'true') {\n return 'var(--hx-border-radius-md, 0.375rem)';\n }\n if (typeof this.rounded === 'string' && this.rounded.length > 0 && this.rounded !== 'false') {\n return this.rounded;\n }\n return undefined;\n }\n\n /** @internal */\n private _currentSrc(): string {\n if (this._usedFallbackSrc && this.fallbackSrc) {\n return this.fallbackSrc;\n }\n return this.src;\n }\n\n override render() {\n if (!this.decorative && !this.alt) {\n devWarn(\n 'hx-image',\n 'Informative images require an `alt` attribute for accessibility (WCAG 1.1.1). ' +\n 'Provide a descriptive `alt` value, or set the `decorative` attribute if the image is decorative.',\n );\n }\n const isDecorative = this.decorative || this.alt === '';\n const altText = isDecorative ? '' : (this.alt ?? '');\n const borderRadius = this._computeBorderRadius();\n const showCaption = this._hasCaptionSlot;\n\n const containerStyles = {\n ...(this.ratio ? { '--_ratio': this.ratio } : {}),\n ...(this.fit ? { '--_fit': this.fit } : {}),\n ...(borderRadius ? { '--_radius': borderRadius } : {}),\n ...(this.width != null\n ? { width: typeof this.width === 'number' ? `${this.width}px` : this.width }\n : {}),\n ...(this.height != null\n ? { height: typeof this.height === 'number' ? `${this.height}px` : this.height }\n : {}),\n };\n\n if (this._error) {\n return html`\n <figure\n class=\"image__container image__container--error\"\n style=${styleMap(containerStyles)}\n role=\"alert\"\n >\n <slot name=\"fallback\"></slot>\n </figure>\n `;\n }\n\n return html`\n <figure class=\"image__container\" style=${styleMap(containerStyles)}>\n <img\n part=\"base\"\n class=\"image__img\"\n src=${this._currentSrc() || nothing}\n alt=${altText}\n role=${isDecorative ? 'presentation' : nothing}\n loading=${this.loading}\n width=${this.width != null ? this.width : nothing}\n height=${this.height != null ? this.height : nothing}\n srcset=${this.srcset ?? nothing}\n sizes=${this.sizes ?? nothing}\n @load=${this._handleLoad}\n @error=${this._handleError}\n />\n <figcaption\n part=\"caption\"\n class=${classMap({ image__caption: true, 'image__caption--visible': showCaption })}\n >\n <slot name=\"caption\" @slotchange=${this._onCaptionSlotChange}></slot>\n </figcaption>\n </figure>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-image': HelixImage;\n }\n}\n"],"names":["helixImageStyles","css","HelixImage","LitElement","e","slot","isDecorative","altText","borderRadius","showCaption","containerStyles","html","styleMap","nothing","classMap","__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;;;;;;ACgCzB,IAAMC,IAAN,cAAyBC,EAAW;AAAA,EAApC,cAAA;AAAA,UAAA,GAAA,SAAA,GAQL,KAAA,MAAM,IASN,KAAA,MAA0B,QAS1B,KAAA,aAAa,IAOb,KAAA,QAAqC,QAOrC,KAAA,SAAsC,QAOtC,KAAA,UAA4B,QAQ5B,KAAA,MAAwE,QAQxE,KAAA,QAA4B,QAc5B,KAAA,UAAwC,QAOxC,KAAA,cAAkC,QASlC,KAAA,SAA6B,QAQ7B,KAAA,QAA4B,QAI5B,KAAQ,SAAS,IAIjB,KAAQ,mBAAmB,IAI3B,KAAQ,kBAAkB;AAAA,EAAA;AAAA;AAAA,EAGlB,cAAoB;AAC1B,SAAK,cAAc,IAAI,YAAkB,WAAW,EAAE,SAAS,IAAM,UAAU,GAAA,CAAM,CAAC;AAAA,EACxF;AAAA;AAAA,EAGQ,eAAqB;AAC3B,QAAI,CAAC,KAAK,UAAU,KAAK,eAAe,CAAC,KAAK,kBAAkB;AAE9D,WAAK,mBAAmB;AACxB;AAAA,IACF;AACA,SAAK,SAAS,IACd,KAAK,cAAc,IAAI,YAAkB,YAAY,EAAE,SAA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AQ,SAAS,IAAM;AAAA,GAtD9Bd,EAuDX,WAAA,OAAA,CAAA;AAQAa,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GA9D9Bd,EA+DX,WAAA,SAAA,CAAA;AAcAa,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GA5E9Bd,EA6EX,WAAA,WAAA,CAAA;AAOAa,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,gBAAgB,SAAS,IAAM;AAAA,GAnFzDd,EAoFX,WAAA,eAAA,CAAA;AASAa,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GA5F9Bd,EA6FX,WAAA,UAAA,CAAA;AAQAa,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GApG9Bd,EAqGX,WAAA,SAAA,CAAA;AAIQa,EAAA;AAAA,EADPE,EAAA;AAAM,GAxGIf,EAyGH,WAAA,UAAA,CAAA;AAIAa,EAAA;AAAA,EADPE,EAAA;AAAM,GA5GIf,EA6GH,WAAA,oBAAA,CAAA;AAIAa,EAAA;AAAA,EADPE,EAAA;AAAM,GAhHIf,EAiHH,WAAA,mBAAA,CAAA;AAjHGA,IAANa,EAAA;AAAA,EADNG,EAAc,UAAU;AAAA,GACZhB,CAAA;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { css as v, LitElement as x, nothing as
|
|
2
|
-
import
|
|
1
|
+
import { css as v, LitElement as x, nothing as u, svg as f, html as c } from "lit";
|
|
2
|
+
import "./document-token-adoption-DuYNKd4k.js";
|
|
3
|
+
import { property as o, customElement as k } from "lit/decorators.js";
|
|
3
4
|
import { classMap as p } from "lit/directives/class-map.js";
|
|
4
5
|
import { ifDefined as a } from "lit/directives/if-defined.js";
|
|
5
|
-
|
|
6
|
-
const g = v`
|
|
6
|
+
const m = v`
|
|
7
7
|
:host {
|
|
8
8
|
display: inline;
|
|
9
9
|
}
|
|
@@ -109,10 +109,10 @@ const g = v`
|
|
|
109
109
|
border: 0;
|
|
110
110
|
}
|
|
111
111
|
`;
|
|
112
|
-
var
|
|
113
|
-
for (var t = l > 1 ? void 0 : l ?
|
|
112
|
+
var g = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (r, n, s, l) => {
|
|
113
|
+
for (var t = l > 1 ? void 0 : l ? y(n, s) : n, h = r.length - 1, d; h >= 0; h--)
|
|
114
114
|
(d = r[h]) && (t = (l ? d(n, s, t) : d(t)) || t);
|
|
115
|
-
return l && t &&
|
|
115
|
+
return l && t && g(n, s, t), t;
|
|
116
116
|
};
|
|
117
117
|
let e = class extends x {
|
|
118
118
|
constructor() {
|
|
@@ -141,7 +141,7 @@ let e = class extends x {
|
|
|
141
141
|
}
|
|
142
142
|
/** @internal */
|
|
143
143
|
_renderExternalIcon() {
|
|
144
|
-
return this.target !== "_blank" ?
|
|
144
|
+
return this.target !== "_blank" ? u : c`
|
|
145
145
|
<svg
|
|
146
146
|
class="link__external-icon"
|
|
147
147
|
part="external-icon"
|
|
@@ -153,7 +153,7 @@ let e = class extends x {
|
|
|
153
153
|
stroke-linecap="round"
|
|
154
154
|
stroke-linejoin="round"
|
|
155
155
|
>
|
|
156
|
-
${
|
|
156
|
+
${f`<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" /><polyline points="15 3 21 3 21 9" /><line x1="10" y1="14" x2="21" y2="3" />`}
|
|
157
157
|
</svg>
|
|
158
158
|
<span class="sr-only">(opens in new tab)</span>
|
|
159
159
|
`;
|
|
@@ -191,29 +191,29 @@ let e = class extends x {
|
|
|
191
191
|
`;
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
|
-
e.styles = [m
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
e.styles = [m];
|
|
195
|
+
i([
|
|
196
|
+
o({ type: String })
|
|
197
197
|
], e.prototype, "href", 2);
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
i([
|
|
199
|
+
o({ type: String })
|
|
200
200
|
], e.prototype, "target", 2);
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
i([
|
|
202
|
+
o({ type: String, reflect: !0 })
|
|
203
203
|
], e.prototype, "variant", 2);
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
i([
|
|
205
|
+
o({ type: Boolean, reflect: !0 })
|
|
206
206
|
], e.prototype, "disabled", 2);
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
i([
|
|
208
|
+
o({ type: String })
|
|
209
209
|
], e.prototype, "download", 2);
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
i([
|
|
211
|
+
o({ type: String })
|
|
212
212
|
], e.prototype, "rel", 2);
|
|
213
|
-
e =
|
|
213
|
+
e = i([
|
|
214
214
|
k("hx-link")
|
|
215
215
|
], e);
|
|
216
216
|
export {
|
|
217
217
|
e as H
|
|
218
218
|
};
|
|
219
|
-
//# sourceMappingURL=hx-link-
|
|
219
|
+
//# sourceMappingURL=hx-link-IVsXmsKx.js.map
|