@helixui/library 3.6.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +2633 -805
- package/dist/components/hx-action-bar/hx-action-bar.d.ts +18 -0
- package/dist/components/hx-action-bar/hx-action-bar.d.ts.map +1 -1
- package/dist/components/hx-action-bar/hx-action-bar.styles.d.ts.map +1 -1
- package/dist/components/hx-action-bar/index.js +1 -1
- package/dist/components/hx-alert/hx-alert.d.ts +18 -0
- package/dist/components/hx-alert/hx-alert.d.ts.map +1 -1
- package/dist/components/hx-badge/index.js +1 -1
- package/dist/components/hx-banner/hx-banner.d.ts +19 -0
- package/dist/components/hx-banner/hx-banner.d.ts.map +1 -1
- package/dist/components/hx-breadcrumb/hx-breadcrumb-item.d.ts.map +1 -1
- package/dist/components/hx-breadcrumb/hx-breadcrumb-item.styles.d.ts.map +1 -1
- package/dist/components/hx-breadcrumb/hx-breadcrumb.d.ts +18 -0
- package/dist/components/hx-breadcrumb/hx-breadcrumb.d.ts.map +1 -1
- package/dist/components/hx-breadcrumb/index.js +1 -1
- package/dist/components/hx-button/hx-button.d.ts +18 -0
- package/dist/components/hx-button/hx-button.d.ts.map +1 -1
- package/dist/components/hx-button/hx-button.styles.d.ts.map +1 -1
- package/dist/components/hx-button/index.js +1 -1
- package/dist/components/hx-button-group/hx-button-group.d.ts +47 -0
- package/dist/components/hx-button-group/hx-button-group.d.ts.map +1 -1
- package/dist/components/hx-button-group/index.js +1 -1
- package/dist/components/hx-checkbox/hx-checkbox.d.ts +18 -0
- package/dist/components/hx-checkbox/hx-checkbox.d.ts.map +1 -1
- package/dist/components/hx-checkbox/hx-checkbox.styles.d.ts.map +1 -1
- package/dist/components/hx-checkbox/index.js +1 -1
- package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts +36 -0
- package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts.map +1 -1
- package/dist/components/hx-checkbox-group/hx-checkbox-group.styles.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 +19 -0
- package/dist/components/hx-clinical-status/hx-clinical-status.d.ts.map +1 -1
- package/dist/components/hx-color-picker/hx-color-picker.d.ts +18 -0
- package/dist/components/hx-color-picker/hx-color-picker.d.ts.map +1 -1
- package/dist/components/hx-color-picker/hx-color-picker.styles.d.ts.map +1 -1
- package/dist/components/hx-color-picker/index.js +1 -1
- package/dist/components/hx-combobox/hx-combobox.d.ts +18 -0
- package/dist/components/hx-combobox/hx-combobox.d.ts.map +1 -1
- package/dist/components/hx-copy-button/hx-copy-button.d.ts +18 -0
- package/dist/components/hx-copy-button/hx-copy-button.d.ts.map +1 -1
- package/dist/components/hx-copy-button/hx-copy-button.styles.d.ts.map +1 -1
- package/dist/components/hx-copy-button/index.js +1 -1
- package/dist/components/hx-date-picker/hx-date-picker.d.ts +18 -0
- package/dist/components/hx-date-picker/hx-date-picker.d.ts.map +1 -1
- package/dist/components/hx-date-picker/hx-date-picker.styles.d.ts.map +1 -1
- package/dist/components/hx-date-picker/index.js +1 -1
- package/dist/components/hx-dialog/hx-dialog.d.ts +18 -0
- package/dist/components/hx-dialog/hx-dialog.d.ts.map +1 -1
- package/dist/components/hx-drawer/hx-drawer.d.ts +18 -0
- package/dist/components/hx-drawer/hx-drawer.d.ts.map +1 -1
- package/dist/components/hx-dropdown/hx-dropdown.d.ts +18 -0
- package/dist/components/hx-dropdown/hx-dropdown.d.ts.map +1 -1
- package/dist/components/hx-dropdown/hx-dropdown.styles.d.ts.map +1 -1
- package/dist/components/hx-dropdown/index.js +1 -1
- package/dist/components/hx-field/hx-field.d.ts +17 -0
- package/dist/components/hx-field/hx-field.d.ts.map +1 -1
- package/dist/components/hx-field-label/hx-field-label.d.ts +17 -0
- package/dist/components/hx-field-label/hx-field-label.d.ts.map +1 -1
- package/dist/components/hx-file-upload/hx-file-upload.d.ts +18 -0
- package/dist/components/hx-file-upload/hx-file-upload.d.ts.map +1 -1
- package/dist/components/hx-form/hx-form.d.ts +19 -0
- package/dist/components/hx-form/hx-form.d.ts.map +1 -1
- package/dist/components/hx-help-text/hx-help-text.d.ts +17 -0
- package/dist/components/hx-help-text/hx-help-text.d.ts.map +1 -1
- package/dist/components/hx-icon-button/hx-icon-button.d.ts +18 -0
- package/dist/components/hx-icon-button/hx-icon-button.d.ts.map +1 -1
- package/dist/components/hx-icon-button/hx-icon-button.styles.d.ts.map +1 -1
- package/dist/components/hx-icon-button/index.js +1 -1
- package/dist/components/hx-menu/hx-menu.d.ts +18 -0
- package/dist/components/hx-menu/hx-menu.d.ts.map +1 -1
- package/dist/components/hx-nav/hx-nav.d.ts +18 -0
- package/dist/components/hx-nav/hx-nav.d.ts.map +1 -1
- package/dist/components/hx-nav/hx-nav.styles.d.ts.map +1 -1
- package/dist/components/hx-nav/index.js +1 -1
- package/dist/components/hx-number-input/hx-number-input.d.ts +18 -0
- package/dist/components/hx-number-input/hx-number-input.d.ts.map +1 -1
- package/dist/components/hx-number-input/index.js +1 -1
- package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts +18 -0
- package/dist/components/hx-overflow-menu/hx-overflow-menu.d.ts.map +1 -1
- package/dist/components/hx-pagination/hx-pagination.styles.d.ts.map +1 -1
- package/dist/components/hx-pagination/index.js +1 -1
- package/dist/components/hx-popover/hx-popover.d.ts +18 -0
- package/dist/components/hx-popover/hx-popover.d.ts.map +1 -1
- package/dist/components/hx-popover/hx-popover.styles.d.ts.map +1 -1
- package/dist/components/hx-popover/index.js +1 -1
- package/dist/components/hx-popup/hx-popup.d.ts +18 -0
- package/dist/components/hx-popup/hx-popup.d.ts.map +1 -1
- package/dist/components/hx-popup/hx-popup.styles.d.ts.map +1 -1
- package/dist/components/hx-popup/index.js +1 -1
- package/dist/components/hx-radio-group/hx-radio-group.d.ts +18 -0
- package/dist/components/hx-radio-group/hx-radio-group.d.ts.map +1 -1
- package/dist/components/hx-radio-group/hx-radio-group.styles.d.ts.map +1 -1
- package/dist/components/hx-radio-group/hx-radio.styles.d.ts.map +1 -1
- package/dist/components/hx-radio-group/index.js +1 -1
- package/dist/components/hx-rating/hx-rating.d.ts +19 -0
- package/dist/components/hx-rating/hx-rating.d.ts.map +1 -1
- package/dist/components/hx-select/hx-select.d.ts +18 -0
- package/dist/components/hx-select/hx-select.d.ts.map +1 -1
- package/dist/components/hx-side-nav/hx-side-nav.d.ts +18 -0
- package/dist/components/hx-side-nav/hx-side-nav.d.ts.map +1 -1
- package/dist/components/hx-side-nav/hx-side-nav.styles.d.ts.map +1 -1
- package/dist/components/hx-side-nav/index.js +1 -1
- package/dist/components/hx-slider/hx-slider.d.ts +19 -0
- package/dist/components/hx-slider/hx-slider.d.ts.map +1 -1
- package/dist/components/hx-split-button/hx-split-button.d.ts +18 -0
- package/dist/components/hx-split-button/hx-split-button.d.ts.map +1 -1
- package/dist/components/hx-split-button/hx-split-button.styles.d.ts.map +1 -1
- package/dist/components/hx-split-button/index.js +1 -1
- package/dist/components/hx-steps/index.js +1 -1
- package/dist/components/hx-switch/hx-switch.d.ts +18 -0
- package/dist/components/hx-switch/hx-switch.d.ts.map +1 -1
- package/dist/components/hx-switch/hx-switch.styles.d.ts.map +1 -1
- package/dist/components/hx-switch/index.js +1 -1
- package/dist/components/hx-tabs/hx-tab.styles.d.ts.map +1 -1
- package/dist/components/hx-tabs/hx-tabs.d.ts +18 -0
- package/dist/components/hx-tabs/hx-tabs.d.ts.map +1 -1
- package/dist/components/hx-tabs/index.js +1 -1
- package/dist/components/hx-text-input/hx-text-input.d.ts +18 -0
- package/dist/components/hx-text-input/hx-text-input.d.ts.map +1 -1
- package/dist/components/hx-text-input/hx-text-input.styles.d.ts.map +1 -1
- package/dist/components/hx-text-input/index.js +1 -1
- package/dist/components/hx-textarea/hx-textarea.d.ts +18 -0
- package/dist/components/hx-textarea/hx-textarea.d.ts.map +1 -1
- package/dist/components/hx-time-picker/hx-time-picker.d.ts +18 -0
- package/dist/components/hx-time-picker/hx-time-picker.d.ts.map +1 -1
- package/dist/components/hx-time-picker/hx-time-picker.styles.d.ts.map +1 -1
- package/dist/components/hx-time-picker/index.js +1 -1
- package/dist/components/hx-toast/hx-toast.d.ts +19 -0
- package/dist/components/hx-toast/hx-toast.d.ts.map +1 -1
- package/dist/components/hx-toggle-button/hx-toggle-button.d.ts +18 -0
- package/dist/components/hx-toggle-button/hx-toggle-button.d.ts.map +1 -1
- package/dist/components/hx-toggle-button/hx-toggle-button.styles.d.ts.map +1 -1
- package/dist/components/hx-toggle-button/index.js +1 -1
- package/dist/components/hx-tooltip/hx-tooltip.d.ts +18 -0
- package/dist/components/hx-tooltip/hx-tooltip.d.ts.map +1 -1
- package/dist/components/hx-tooltip/hx-tooltip.styles.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 +18 -0
- package/dist/components/hx-top-nav/hx-top-nav.d.ts.map +1 -1
- package/dist/components/hx-top-nav/hx-top-nav.styles.d.ts.map +1 -1
- package/dist/components/hx-top-nav/index.js +1 -1
- package/dist/css/helix-all.css +298 -64
- package/dist/css/helix-core.css +24 -15
- package/dist/css/helix-forms.css +133 -32
- package/dist/css/helix-navigation.css +49 -5
- package/dist/css/helix-overlay.css +53 -0
- package/dist/css/helix-tokens.css +15 -13
- package/dist/css/helix-utility.css +39 -12
- package/dist/css/hx-action-bar.css +12 -0
- package/dist/css/hx-badge.css +5 -5
- package/dist/css/hx-button.css +15 -5
- package/dist/css/hx-checkbox-group.css +11 -0
- package/dist/css/hx-checkbox.css +20 -4
- package/dist/css/hx-color-picker.css +14 -1
- package/dist/css/hx-copy-button.css +5 -2
- package/dist/css/hx-date-picker.css +11 -3
- package/dist/css/hx-dropdown.css +13 -0
- package/dist/css/hx-icon-button.css +4 -5
- package/dist/css/hx-nav.css +24 -2
- package/dist/css/hx-number-input.css +8 -8
- package/dist/css/hx-pagination.css +6 -3
- package/dist/css/hx-popover.css +13 -0
- package/dist/css/hx-popup.css +14 -0
- package/dist/css/hx-radio-group.css +10 -0
- package/dist/css/hx-side-nav.css +7 -0
- package/dist/css/hx-split-button.css +22 -10
- package/dist/css/hx-switch.css +19 -1
- package/dist/css/hx-text-input.css +4 -1
- package/dist/css/hx-time-picker.css +7 -2
- package/dist/css/hx-toggle-button.css +29 -12
- package/dist/css/hx-tooltip.css +13 -0
- package/dist/css/hx-top-nav.css +12 -0
- package/dist/css/index.css +1 -1
- package/dist/css/manifest.json +57 -20
- package/dist/index.js +28 -28
- package/dist/shared/{hx-action-bar-CitgcpGv.js → hx-action-bar-BlEG4aZv.js} +41 -29
- package/dist/shared/hx-action-bar-BlEG4aZv.js.map +1 -0
- package/dist/shared/hx-alert-Bto8-TIi.js.map +1 -1
- package/dist/shared/{hx-badge-JlFtAdxS.js → hx-badge-DFL35nzi.js} +16 -16
- package/dist/shared/hx-badge-DFL35nzi.js.map +1 -0
- package/dist/shared/hx-banner-fpRnciIO.js.map +1 -1
- package/dist/shared/{hx-breadcrumb-item-3tKppF9h.js → hx-breadcrumb-item-D8xYqe3s.js} +56 -43
- package/dist/shared/hx-breadcrumb-item-D8xYqe3s.js.map +1 -0
- package/dist/shared/{hx-button-BOwAEcF1.js → hx-button-DOZTZnz-.js} +29 -19
- package/dist/shared/hx-button-DOZTZnz-.js.map +1 -0
- package/dist/shared/hx-button-group-D3QUmSzl.js +248 -0
- package/dist/shared/hx-button-group-D3QUmSzl.js.map +1 -0
- package/dist/shared/{hx-checkbox-CYd0YV_u.js → hx-checkbox-DcgyGS9V.js} +27 -11
- package/dist/shared/hx-checkbox-DcgyGS9V.js.map +1 -0
- package/dist/shared/{hx-checkbox-group-D5piJLY8.js → hx-checkbox-group-C0q6HDqn.js} +101 -58
- package/dist/shared/hx-checkbox-group-C0q6HDqn.js.map +1 -0
- package/dist/shared/hx-clinical-status-D3XQIOqX.js.map +1 -1
- package/dist/shared/{hx-color-picker-DBwJzT5f.js → hx-color-picker-CYjx8i8R.js} +97 -84
- package/dist/shared/hx-color-picker-CYjx8i8R.js.map +1 -0
- package/dist/shared/hx-combobox-NgJaLbs2.js.map +1 -1
- package/dist/shared/{hx-copy-button-sUVuikyH.js → hx-copy-button-DJirFCUL.js} +18 -15
- package/dist/shared/hx-copy-button-DJirFCUL.js.map +1 -0
- package/dist/shared/{hx-date-picker-B49yo4Vm.js → hx-date-picker-0PtEav0K.js} +71 -63
- package/dist/shared/hx-date-picker-0PtEav0K.js.map +1 -0
- package/dist/shared/hx-dialog-B4weoj_1.js.map +1 -1
- package/dist/shared/hx-drawer-CM_upadk.js.map +1 -1
- package/dist/shared/{hx-dropdown-D626S2ZG.js → hx-dropdown-xHwTJecv.js} +44 -31
- package/dist/shared/hx-dropdown-xHwTJecv.js.map +1 -0
- package/dist/shared/hx-field-label-BVRyyKeh.js.map +1 -1
- package/dist/shared/hx-field-zw0U1KVi.js.map +1 -1
- package/dist/shared/hx-file-upload-D3rKROK5.js.map +1 -1
- package/dist/shared/hx-form-CkChEATa.js.map +1 -1
- package/dist/shared/hx-help-text-Xb2Yr8x2.js.map +1 -1
- package/dist/shared/{hx-icon-button-a6OpeQz5.js → hx-icon-button-B2BdVdyK.js} +10 -11
- package/dist/shared/hx-icon-button-B2BdVdyK.js.map +1 -0
- package/dist/shared/hx-menu-divider-A6Guuzi_.js.map +1 -1
- package/dist/shared/{hx-nav-ldFM3Fle.js → hx-nav-ChMTfn7o.js} +66 -44
- package/dist/shared/hx-nav-ChMTfn7o.js.map +1 -0
- package/dist/shared/{hx-nav-item-CODtUlew.js → hx-nav-item-ClN17f1y.js} +62 -55
- package/dist/shared/hx-nav-item-ClN17f1y.js.map +1 -0
- package/dist/shared/{hx-number-input-yUzFOSC1.js → hx-number-input-MggsT7F0.js} +13 -13
- package/dist/shared/hx-number-input-MggsT7F0.js.map +1 -0
- package/dist/shared/hx-overflow-menu-DFjJAziP.js.map +1 -1
- package/dist/shared/{hx-pagination-C7y8GVyU.js → hx-pagination-D726PyTM.js} +7 -4
- package/dist/shared/hx-pagination-D726PyTM.js.map +1 -0
- package/dist/shared/{hx-popover-BAlAFOH9.js → hx-popover-BjB0nkcq.js} +51 -38
- package/dist/shared/hx-popover-BjB0nkcq.js.map +1 -0
- package/dist/shared/{hx-popup-COUXXZ9X.js → hx-popup-BiV_2evC.js} +59 -45
- package/dist/shared/hx-popup-BiV_2evC.js.map +1 -0
- package/dist/shared/{hx-radio-C7eTj5YI.js → hx-radio-BY4zpwdh.js} +81 -63
- package/dist/shared/hx-radio-BY4zpwdh.js.map +1 -0
- package/dist/shared/hx-rating-C3QP53k9.js.map +1 -1
- package/dist/shared/hx-select-DahFehiZ.js.map +1 -1
- package/dist/shared/hx-slider-Blmv_rwS.js.map +1 -1
- package/dist/shared/{hx-split-button-Ddle8iVx.js → hx-split-button-CdNz1XAu.js} +62 -50
- package/dist/shared/hx-split-button-CdNz1XAu.js.map +1 -0
- package/dist/shared/{hx-step-R2rjp1fT.js → hx-step-CUzliIK_.js} +3 -3
- package/dist/shared/hx-step-CUzliIK_.js.map +1 -0
- package/dist/shared/{hx-switch-TvKGvZJz.js → hx-switch-BCXuNxEH.js} +42 -24
- package/dist/shared/hx-switch-BCXuNxEH.js.map +1 -0
- package/dist/shared/{hx-tab-panel-DzsX8BHV.js → hx-tab-panel-BfisavKo.js} +47 -32
- package/dist/shared/hx-tab-panel-BfisavKo.js.map +1 -0
- package/dist/shared/{hx-text-input-D6FlOZM-.js → hx-text-input-V5sQOpDh.js} +5 -2
- package/dist/shared/hx-text-input-V5sQOpDh.js.map +1 -0
- package/dist/shared/hx-textarea-CNG590KY.js.map +1 -1
- package/dist/shared/{hx-time-picker-Bo7FWzmf.js → hx-time-picker-DfJkBwcX.js} +41 -36
- package/dist/shared/hx-time-picker-DfJkBwcX.js.map +1 -0
- package/dist/shared/{hx-toggle-button-DwBers3A.js → hx-toggle-button-xNVYeA3X.js} +64 -47
- package/dist/shared/hx-toggle-button-xNVYeA3X.js.map +1 -0
- package/dist/shared/{hx-tooltip-DVqtKPCD.js → hx-tooltip-CamO-9nd.js} +24 -11
- package/dist/shared/hx-tooltip-CamO-9nd.js.map +1 -0
- package/dist/shared/{hx-top-nav-DP6OFS8C.js → hx-top-nav-CsTxOtVI.js} +26 -14
- package/dist/shared/hx-top-nav-CsTxOtVI.js.map +1 -0
- package/dist/shared/toast-factory-Dht3pVsw.js.map +1 -1
- package/figma-inventory.json +1258 -386
- package/package.json +2 -2
- package/dist/shared/hx-action-bar-CitgcpGv.js.map +0 -1
- package/dist/shared/hx-badge-JlFtAdxS.js.map +0 -1
- package/dist/shared/hx-breadcrumb-item-3tKppF9h.js.map +0 -1
- package/dist/shared/hx-button-BOwAEcF1.js.map +0 -1
- package/dist/shared/hx-button-group-4NUBpkyC.js +0 -181
- package/dist/shared/hx-button-group-4NUBpkyC.js.map +0 -1
- package/dist/shared/hx-checkbox-CYd0YV_u.js.map +0 -1
- package/dist/shared/hx-checkbox-group-D5piJLY8.js.map +0 -1
- package/dist/shared/hx-color-picker-DBwJzT5f.js.map +0 -1
- package/dist/shared/hx-copy-button-sUVuikyH.js.map +0 -1
- package/dist/shared/hx-date-picker-B49yo4Vm.js.map +0 -1
- package/dist/shared/hx-dropdown-D626S2ZG.js.map +0 -1
- package/dist/shared/hx-icon-button-a6OpeQz5.js.map +0 -1
- package/dist/shared/hx-nav-item-CODtUlew.js.map +0 -1
- package/dist/shared/hx-nav-ldFM3Fle.js.map +0 -1
- package/dist/shared/hx-number-input-yUzFOSC1.js.map +0 -1
- package/dist/shared/hx-pagination-C7y8GVyU.js.map +0 -1
- package/dist/shared/hx-popover-BAlAFOH9.js.map +0 -1
- package/dist/shared/hx-popup-COUXXZ9X.js.map +0 -1
- package/dist/shared/hx-radio-C7eTj5YI.js.map +0 -1
- package/dist/shared/hx-split-button-Ddle8iVx.js.map +0 -1
- package/dist/shared/hx-step-R2rjp1fT.js.map +0 -1
- package/dist/shared/hx-switch-TvKGvZJz.js.map +0 -1
- package/dist/shared/hx-tab-panel-DzsX8BHV.js.map +0 -1
- package/dist/shared/hx-text-input-D6FlOZM-.js.map +0 -1
- package/dist/shared/hx-time-picker-Bo7FWzmf.js.map +0 -1
- package/dist/shared/hx-toggle-button-DwBers3A.js.map +0 -1
- package/dist/shared/hx-tooltip-DVqtKPCD.js.map +0 -1
- package/dist/shared/hx-top-nav-DP6OFS8C.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { css as u, html as
|
|
1
|
+
import { css as u, html as s, nothing as p } from "lit";
|
|
2
2
|
import { property as i, state as d, customElement as b } from "lit/decorators.js";
|
|
3
3
|
import { classMap as f } from "lit/directives/class-map.js";
|
|
4
|
-
import { f as
|
|
5
|
-
import { H as
|
|
4
|
+
import { f as m } from "./forced-colors-CTEDFRGa.js";
|
|
5
|
+
import { H as v } from "./helix-element-BNEYeiys.js";
|
|
6
6
|
const x = u`
|
|
7
7
|
:host {
|
|
8
8
|
display: inline-block;
|
|
@@ -60,10 +60,13 @@ const x = u`
|
|
|
60
60
|
font-size: var(--hx-font-size-sm);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
/* md — WCAG 2.5.5 AAA Target Size (Enhanced): 44×44 minimum.
|
|
64
|
+
Bound to --hx-touch-target-min so the default md variant clears the
|
|
65
|
+
AAA-strict floor without requiring consumers to opt into sm or lg. */
|
|
63
66
|
.button--md {
|
|
64
67
|
padding: var(--hx-space-2);
|
|
65
|
-
min-width: var(--hx-
|
|
66
|
-
height: var(--hx-
|
|
68
|
+
min-width: var(--hx-touch-target-min, 2.75rem);
|
|
69
|
+
min-height: var(--hx-touch-target-min, 2.75rem);
|
|
67
70
|
font-size: var(--hx-font-size-md);
|
|
68
71
|
}
|
|
69
72
|
|
|
@@ -156,13 +159,13 @@ const x = u`
|
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
`;
|
|
159
|
-
var y = Object.defineProperty, g = Object.getOwnPropertyDescriptor, o = (e, n, c,
|
|
160
|
-
for (var r =
|
|
161
|
-
(h = e[l]) && (r = (
|
|
162
|
-
return
|
|
162
|
+
var y = Object.defineProperty, g = Object.getOwnPropertyDescriptor, o = (e, n, c, a) => {
|
|
163
|
+
for (var r = a > 1 ? void 0 : a ? g(n, c) : n, l = e.length - 1, h; l >= 0; l--)
|
|
164
|
+
(h = e[l]) && (r = (a ? h(n, c, r) : h(r)) || r);
|
|
165
|
+
return a && r && y(n, c, r), r;
|
|
163
166
|
};
|
|
164
167
|
const _ = 300, w = /* @__PURE__ */ new Set(["sm", "md", "lg"]);
|
|
165
|
-
let t = class extends
|
|
168
|
+
let t = class extends v {
|
|
166
169
|
constructor() {
|
|
167
170
|
super(...arguments), this.value = "", this.label = "Copy to clipboard", this.feedbackDuration = 2e3, this.size = "md", this.disabled = !1, this.labelCopied = "Copied", this.labelError = "Copy failed", this._copied = !1, this._announcement = "", this._feedbackTimer = null;
|
|
168
171
|
}
|
|
@@ -241,16 +244,16 @@ let t = class extends m {
|
|
|
241
244
|
}
|
|
242
245
|
/** @internal */
|
|
243
246
|
_renderIcon() {
|
|
244
|
-
return
|
|
247
|
+
return s`
|
|
245
248
|
<span part="icon" class="icon">
|
|
246
|
-
${this._copied ?
|
|
249
|
+
${this._copied ? s`<slot name="success-icon"></slot>` : s`<slot name="copy-icon"></slot>`}
|
|
247
250
|
</span>
|
|
248
251
|
`;
|
|
249
252
|
}
|
|
250
253
|
// ─── Render ───
|
|
251
254
|
render() {
|
|
252
255
|
const e = this._copied ? `${this.label} — ${this.labelCopied}` : this.label;
|
|
253
|
-
return
|
|
256
|
+
return s`
|
|
254
257
|
<button
|
|
255
258
|
part="button"
|
|
256
259
|
class=${f(this._buttonClasses())}
|
|
@@ -270,7 +273,7 @@ let t = class extends m {
|
|
|
270
273
|
`;
|
|
271
274
|
}
|
|
272
275
|
};
|
|
273
|
-
t.styles = [x,
|
|
276
|
+
t.styles = [x, m];
|
|
274
277
|
o([
|
|
275
278
|
i({ type: String })
|
|
276
279
|
], t.prototype, "value", 2);
|
|
@@ -304,4 +307,4 @@ t = o([
|
|
|
304
307
|
export {
|
|
305
308
|
t as H
|
|
306
309
|
};
|
|
307
|
-
//# sourceMappingURL=hx-copy-button-
|
|
310
|
+
//# sourceMappingURL=hx-copy-button-DJirFCUL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hx-copy-button-DJirFCUL.js","sources":["../../src/components/hx-copy-button/hx-copy-button.styles.ts","../../src/components/hx-copy-button/hx-copy-button.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixCopyButtonStyles = css`\n :host {\n display: inline-block;\n }\n\n :host([disabled]) {\n pointer-events: none;\n }\n\n .button {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--hx-space-2);\n border: var(--hx-border-width-thin) solid var(--hx-copy-button-border-color, transparent);\n border-radius: var(--hx-copy-button-border-radius, var(--hx-border-radius-md));\n background-color: var(--hx-copy-button-bg, transparent);\n color: var(--hx-copy-button-color, var(--hx-color-primary-500, #429797));\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 font-family: var(--hx-copy-button-font-family, var(--hx-font-family-sans));\n font-weight: var(--hx-font-weight-medium);\n white-space: nowrap;\n }\n\n .button:focus-visible {\n outline: var(--hx-focus-ring-width) solid\n var(--hx-copy-button-focus-ring-color, var(--hx-focus-ring-color));\n outline-offset: var(--hx-focus-ring-offset);\n }\n\n .button:hover {\n filter: brightness(var(--hx-filter-brightness-hover, 0.9));\n }\n\n .button:active {\n filter: brightness(var(--hx-filter-brightness-active, 0.8));\n }\n\n /* ─── Size Variants ─── */\n\n .button--sm {\n padding: var(--hx-space-1);\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 /* md — WCAG 2.5.5 AAA Target Size (Enhanced): 44×44 minimum.\n Bound to --hx-touch-target-min so the default md variant clears the\n AAA-strict floor without requiring consumers to opt into sm or lg. */\n .button--md {\n padding: var(--hx-space-2);\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 min-width: var(--hx-size-12);\n height: var(--hx-size-12);\n font-size: var(--hx-font-size-lg);\n }\n\n /* ─── Copied / Success State ─── */\n\n .button--copied {\n color: var(\n --hx-copy-button-copied-color,\n var(--hx-color-success-text, var(--hx-color-success-700, #146831))\n );\n /* Secondary non-color indicator required per WCAG 1.4.1 (use of color).\n A border provides visual differentiation for users with color blindness. */\n border-color: var(--hx-copy-button-copied-border-color, var(--hx-color-success-500, #3b9e58));\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 flex-shrink: 0;\n }\n\n /* ─── Disabled ─── */\n\n .button[disabled] {\n cursor: not-allowed;\n opacity: var(--hx-opacity-disabled);\n }\n\n /* ─── Screen Reader Only ─── */\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n }\n\n /* ─── Reduced Motion ─── */\n\n @media (prefers-reduced-motion: reduce) {\n .button {\n transition: none;\n }\n }\n\n /* ─── High Contrast Mode (forced-colors) ─── */\n\n @media (forced-colors: active) {\n .button {\n forced-color-adjust: none;\n background-color: ButtonFace;\n color: ButtonText;\n border: 2px solid ButtonText;\n }\n\n .button:focus-visible {\n outline: 3px solid Highlight;\n outline-offset: 2px;\n }\n\n .button[disabled] {\n background-color: ButtonFace;\n color: GrayText;\n border-color: GrayText;\n opacity: 1;\n }\n\n .button--copied {\n border-color: Highlight;\n color: Highlight;\n }\n }\n`;\n","import { 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 { HelixElement } from '../../base/index.js';\nimport { helixCopyButtonStyles } from './hx-copy-button.styles.js';\nimport { forcedColorsInteractive } from '../../styles/forced-colors.js';\n\n/** Minimum allowed value for feedbackDuration (ms). */\nconst MIN_FEEDBACK_DURATION = 300;\n\n/** Allowed size values for runtime validation. */\nconst VALID_SIZES = new Set(['sm', 'md', 'lg']);\n\n/**\n * A clipboard copy button component that writes a given value to the system\n * clipboard. Provides idle and success states with configurable feedback\n * duration, slot-based icon overrides, and an accessible live region that\n * announces copy completion to screen reader users.\n *\n * The `aria-label` reflects the current copy state: idle shows `label`,\n * copied state appends \" — Copied\" so screen reader users who re-focus the\n * button after copy receive an accurate accessible name.\n *\n * Note: `aria-pressed` is intentionally NOT used. This is not a toggle button;\n * copied is a transient feedback state, not a persistent on/off toggle.\n *\n * @summary One-click clipboard copy with accessible success feedback.\n *\n * @tag hx-copy-button\n *\n * @slot - Optional label text rendered inside the button alongside the icon.\n * @slot copy-icon - Icon shown in the idle (pre-copy) state.\n * @slot success-icon - Icon shown after a successful clipboard write.\n *\n * @fires {CustomEvent<{value: string}>} hx-copy - Dispatched after the value\n * has been successfully written to the clipboard.\n * @fires {CustomEvent<{value: string; error: Error}>} hx-copy-error - Dispatched\n * when the clipboard write fails (permission denied, iframe restriction, etc.).\n * The `error` detail contains the caught error for diagnostic use.\n *\n * @csspart button - The native button element.\n * @csspart icon - The icon container span wrapping the active icon slot.\n *\n * @cssprop [--hx-copy-button-bg=transparent] - Button background color.\n * @cssprop [--hx-copy-button-color=var(--hx-color-primary-500)] - Icon and text color.\n * @cssprop [--hx-copy-button-border-color=transparent] - Button border color.\n * @cssprop [--hx-copy-button-border-radius=var(--hx-border-radius-md)] - Button border radius.\n * @cssprop [--hx-copy-button-focus-ring-color=var(--hx-focus-ring-color)] - Focus ring color.\n * @cssprop [--hx-border-radius-md] - CSS custom property.\n * @cssprop [--hx-border-width-thin] - Width.\n * @cssprop [--hx-color-primary-500] - Color.\n * @cssprop [--hx-color-success-500] - Color.\n * @cssprop [--hx-color-success-text] - Color.\n * @cssprop [--hx-copy-button-font-family=var(--hx-font-family-sans)] - CSS custom property.\n * @cssprop [--hx-filter-brightness-active] - CSS filter.\n * @cssprop [--hx-filter-brightness-hover] - CSS filter.\n * @cssprop [--hx-focus-ring-color] - Color.\n * @cssprop [--hx-focus-ring-offset] - CSS custom property.\n * @cssprop [--hx-focus-ring-width] - Width.\n * @cssprop [--hx-font-family-sans] - Font family.\n * @cssprop [--hx-font-size-lg] - Font size.\n * @cssprop [--hx-font-size-md] - Font size.\n * @cssprop [--hx-font-size-sm] - Font size.\n * @cssprop [--hx-font-weight-medium] - Font weight.\n * @cssprop [--hx-opacity-disabled] - Opacity.\n * @cssprop [--hx-size-10] - Size token.\n * @cssprop [--hx-size-12] - Size token.\n * @cssprop [--hx-space-1] - Spacing token.\n * @cssprop [--hx-space-2] - Spacing token.\n * @cssprop [--hx-space-3] - Spacing token.\n * @cssprop [--hx-touch-target-min] - Minimum touch target size.\n * @cssprop [--hx-transition-fast] - Transition timing.\n * @aaa-certified 2026-05-08\n * @aaa-criteria 1.4.6, 1.4.9, 2.1.3, 2.3.3, 2.4.12, 2.4.13, 2.5.5, 3.2.5, 3.3.6, forced-colors, apg-keyboard\n * @aaa-audit src/components/hx-copy-button/AAA-AUDIT.md\n * @keyboard-contract activate=Enter,Space; disabled-suppresses=true\n * @aria-pattern button\n * @aria-pattern-source https://www.w3.org/WAI/ARIA/apg/patterns/button/\n * @forced-colors-supported true\n * @stability stable\n * @since 3.7.0\n * @form-associated false\n * @theme-aware true\n * @brand-aware true\n * @drupal-sdc-eligible true\n * @react-wrapper-status complete\n * @figma-component-name hx-copy-button\n * @priority-tier P0\n * @phi-handles false\n * @clinical-context none\n */\n@customElement('hx-copy-button')\nexport class HelixCopyButton extends HelixElement {\n static override styles = [helixCopyButtonStyles, forcedColorsInteractive];\n\n // ─── Public Properties ───\n\n /**\n * The text value to write to the clipboard on click. Required for the\n * component to perform a copy operation.\n * @attr value\n */\n @property({ type: String })\n value = '';\n\n /**\n * Accessible label applied as `aria-label` and `title` on the button.\n * @attr label\n */\n @property({ type: String })\n label = 'Copy to clipboard';\n\n /**\n * Duration in milliseconds to display the success (copied) state before\n * reverting to the idle state. Values below 300 ms are clamped to 300 ms\n * to ensure the success announcement remains visible long enough for\n * assistive technology and human perception.\n * @attr feedback-duration\n */\n @property({ type: Number, attribute: 'feedback-duration' })\n feedbackDuration = 2000;\n\n /**\n * Visual size of the button. Maps to fixed height and padding tokens.\n * Accepts: 'sm' | 'md' | 'lg'. Invalid values are silently coerced to 'md'.\n *\n * **Accessibility (WCAG 2.5.8):** The `sm` variant uses `--hx-size-8` for\n * its minimum width and height. Ensure this token resolves to at least 24×24 px\n * (WCAG 2.5.8 AA minimum target size). For touch-primary interfaces such as\n * mobile clinical apps, prefer `md` or `lg` to meet the 44×44 px recommended\n * target size (WCAG 2.5.5 AAA / Apple HIG / Android guidelines).\n *\n * @attr hx-size\n */\n @property({ type: String, reflect: true, attribute: 'hx-size' })\n size: 'sm' | 'md' | 'lg' = 'md';\n\n /**\n * Whether the button is disabled. When true, click events are suppressed\n * and clipboard writes do not occur.\n * @attr disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Text announced to screen readers and appended to aria-label after a\n * successful copy. Also used as the content of the aria-live announcement.\n * @attr label-copied\n */\n @property({ type: String, attribute: 'label-copied' })\n labelCopied = 'Copied';\n\n /**\n * Accessible label announced when copy fails. Override for i18n.\n * @attr label-error\n */\n @property({ type: String, attribute: 'label-error' })\n labelError = 'Copy failed';\n\n // ─── Private State ───\n\n /** True while the success feedback window is active. */\n /** @internal */\n @state() private _copied = false;\n\n /** Non-empty string shown in the aria-live region; cleared when not active. */\n /** @internal */\n @state() private _announcement = '';\n\n /** Timeout handle used to revert the copied state. */\n /** @internal */\n private _feedbackTimer: ReturnType<typeof setTimeout> | null = null;\n\n // ─── Lifecycle ───\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._clearFeedbackTimer();\n }\n\n // ─── Private Helpers ───\n\n /**\n * Returns the effective feedback duration, clamped to the minimum allowed\n * value. Prevents zero/negative timeouts that would cause the success state\n * to immediately revert with no visible or audible feedback.\n */\n /** @internal */\n private _effectiveDuration(): number {\n return Math.max(this.feedbackDuration, MIN_FEEDBACK_DURATION);\n }\n\n /**\n * Returns the effective size, falling back to 'md' if the runtime value is\n * not in the set of valid sizes. Prevents `button--xl` and similar class\n * names that have no matching CSS rule.\n */\n /** @internal */\n private _effectiveSize(): 'sm' | 'md' | 'lg' {\n return VALID_SIZES.has(this.size) ? this.size : 'md';\n }\n\n /** @internal */\n private _clearFeedbackTimer(): void {\n if (this._feedbackTimer !== null) {\n clearTimeout(this._feedbackTimer);\n this._feedbackTimer = null;\n }\n }\n\n /** @internal */\n private async _copyToClipboard(): Promise<void> {\n await navigator?.clipboard?.writeText(this.value);\n }\n\n // ─── Event Handling ───\n\n /** @internal */\n private _handleClick(): void {\n if (this.disabled) {\n return;\n }\n\n void this._performCopy();\n }\n\n /** @internal */\n private async _performCopy(): Promise<void> {\n try {\n await this._copyToClipboard();\n } catch (error: unknown) {\n // Clipboard write failed — notify consumers and announce failure.\n this._announcement = this.labelError;\n\n /**\n * Dispatched when the clipboard write fails (permission denied, iframe\n * restriction, browser security policy, etc.).\n * @event hx-copy-error\n */\n this.dispatchEvent(\n new CustomEvent<{ value: string; error: Error }>('hx-copy-error', {\n bubbles: true,\n composed: true,\n detail: {\n value: this.value,\n error: error instanceof Error ? error : new Error(String(error)),\n },\n }),\n );\n return;\n }\n\n this._clearFeedbackTimer();\n this._copied = true;\n this._announcement = this.labelCopied;\n\n /**\n * Dispatched after the value has been successfully written to the\n * clipboard.\n * @event hx-copy\n */\n this.dispatchEvent(\n new CustomEvent<{ value: string }>('hx-copy', {\n bubbles: true,\n composed: true,\n detail: { value: this.value },\n }),\n );\n\n this._feedbackTimer = setTimeout(() => {\n this._copied = false;\n this._announcement = '';\n this._feedbackTimer = null;\n }, this._effectiveDuration());\n }\n\n // ─── Render Helpers ───\n\n /** @internal */\n private _buttonClasses() {\n const size = this._effectiveSize();\n return {\n button: true,\n [`button--${size}`]: true,\n 'button--copied': this._copied,\n };\n }\n\n /** @internal */\n private _renderIcon() {\n // Show success-icon slot when copied, copy-icon slot otherwise.\n return html`\n <span part=\"icon\" class=\"icon\">\n ${this._copied\n ? html`<slot name=\"success-icon\"></slot>`\n : html`<slot name=\"copy-icon\"></slot>`}\n </span>\n `;\n }\n\n // ─── Render ───\n\n override render() {\n // Reflect copied state in aria-label so re-focused button has an accurate\n // accessible name (WCAG 1.3.1). The live region handles the initial\n // announcement; this covers re-focus scenarios.\n const ariaLabel = this._copied ? `${this.label} — ${this.labelCopied}` : this.label;\n\n return html`\n <button\n part=\"button\"\n class=${classMap(this._buttonClasses())}\n type=\"button\"\n ?disabled=${this.disabled}\n aria-label=${ariaLabel}\n title=${this.label}\n @click=${this._handleClick}\n >\n ${this._renderIcon()}\n <slot></slot>\n </button>\n\n <span aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">\n ${this._announcement || nothing}\n </span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-copy-button': HelixCopyButton;\n }\n}\n"],"names":["helixCopyButtonStyles","css","MIN_FEEDBACK_DURATION","VALID_SIZES","HelixCopyButton","HelixElement","_a","error","html","ariaLabel","classMap","nothing","forcedColorsInteractive","__decorateClass","property","state","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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AAA;AAQAS,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,gBAAgB;AAAA,GA1D1CV,EA2DX,WAAA,eAAA,CAAA;AAOAS,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,eAAe;AAAA,GAjEzCV,EAkEX,WAAA,cAAA,CAAA;AAMiBS,EAAA;AAAA,EAAhBE,EAAA;AAAM,GAxEIX,EAwEM,WAAA,WAAA,CAAA;AAIAS,EAAA;AAAA,EAAhBE,EAAA;AAAM,GA5EIX,EA4EM,WAAA,iBAAA,CAAA;AA5ENA,IAANS,EAAA;AAAA,EADNG,EAAc,gBAAgB;AAAA,GAClBZ,CAAA;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { css as z, html as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as z, html as m, nothing as D } from "lit";
|
|
2
|
+
import { property as d, state as _, query as N, customElement as W } from "lit/decorators.js";
|
|
3
3
|
import { F as G } from "./FormMixin-B8PXk5RQ.js";
|
|
4
4
|
import { classMap as B } from "lit/directives/class-map.js";
|
|
5
5
|
import { ifDefined as U } from "lit/directives/if-defined.js";
|
|
@@ -115,7 +115,8 @@ const J = z`
|
|
|
115
115
|
font-size: var(--hx-font-size-md, 1rem);
|
|
116
116
|
color: var(--hx-date-picker-color, var(--hx-color-text-strong, #202b39));
|
|
117
117
|
line-height: var(--hx-line-height-normal, 1.5);
|
|
118
|
-
|
|
118
|
+
/* WCAG 2.5.5 (Enhanced) AAA — primary input surface must meet 44×44. */
|
|
119
|
+
min-height: var(--hx-touch-target-min, 2.75rem);
|
|
119
120
|
width: 100%;
|
|
120
121
|
cursor: default;
|
|
121
122
|
}
|
|
@@ -136,6 +137,10 @@ const J = z`
|
|
|
136
137
|
display: flex;
|
|
137
138
|
align-items: center;
|
|
138
139
|
justify-content: center;
|
|
140
|
+
/* WCAG 2.5.5 (Enhanced) AAA — calendar trigger must clear 44×44.
|
|
141
|
+
Without min-width the icon button collapses to ~41 px wide. */
|
|
142
|
+
min-width: var(--hx-touch-target-min, 2.75rem);
|
|
143
|
+
min-height: var(--hx-touch-target-min, 2.75rem);
|
|
139
144
|
padding: 0 var(--hx-space-3, 0.75rem);
|
|
140
145
|
border: none;
|
|
141
146
|
border-left: var(--hx-border-width-thin, 1px) solid
|
|
@@ -309,13 +314,16 @@ const J = z`
|
|
|
309
314
|
}
|
|
310
315
|
|
|
311
316
|
.calendar__day--selected {
|
|
312
|
-
background-color: var(--hx-date-picker-selected-bg, var(--hx-color-primary-
|
|
317
|
+
background-color: var(--hx-date-picker-selected-bg, var(--hx-color-action-primary-bg, #0f7078));
|
|
313
318
|
color: var(--hx-date-picker-selected-color, var(--hx-color-text-on-primary, #ffffff));
|
|
314
319
|
font-weight: var(--hx-font-weight-semibold, 600);
|
|
315
320
|
}
|
|
316
321
|
|
|
317
322
|
.calendar__day--selected:hover {
|
|
318
|
-
background-color: var(
|
|
323
|
+
background-color: var(
|
|
324
|
+
--hx-date-picker-selected-hover-bg,
|
|
325
|
+
var(--hx-color-action-primary-bg-hover, #0f6363)
|
|
326
|
+
);
|
|
319
327
|
}
|
|
320
328
|
|
|
321
329
|
.calendar__day--today:not(.calendar__day--selected) {
|
|
@@ -545,8 +553,8 @@ let l = class extends G(K) {
|
|
|
545
553
|
if (s.nodeType === Node.ELEMENT_NODE) {
|
|
546
554
|
const o = s;
|
|
547
555
|
if (r.push(o), o.getAttribute("aria-hidden") === "true") continue;
|
|
548
|
-
const
|
|
549
|
-
|
|
556
|
+
const h = k(o);
|
|
557
|
+
h && a.push(h);
|
|
550
558
|
} else if (s.nodeType === Node.TEXT_NODE) {
|
|
551
559
|
const o = (s.textContent ?? "").trim();
|
|
552
560
|
o && a.push(o);
|
|
@@ -657,42 +665,42 @@ let l = class extends G(K) {
|
|
|
657
665
|
this._invalid !== u && (this._invalid = u);
|
|
658
666
|
return;
|
|
659
667
|
}
|
|
660
|
-
const r = this.getAttribute("aria-label"), a = r !== null && r.trim() || "", i = ((H = this.shadowRoot) == null ? void 0 : H.getElementById(this._labelId)) ?? null, s = this._slottedLabelEls, o = ((F = this.shadowRoot) == null ? void 0 : F.getElementById(this._helpTextId)) ?? null,
|
|
668
|
+
const r = this.getAttribute("aria-label"), a = r !== null && r.trim() || "", i = ((H = this.shadowRoot) == null ? void 0 : H.getElementById(this._labelId)) ?? null, s = this._slottedLabelEls, o = ((F = this.shadowRoot) == null ? void 0 : F.getElementById(this._helpTextId)) ?? null, h = ((Y = this.shadowRoot) == null ? void 0 : Y.getElementById(this._errorId)) ?? null, c = this.getAttribute("aria-labelledby");
|
|
661
669
|
this._consumerLabelledBy = c;
|
|
662
670
|
const p = this.getAttribute("aria-describedby");
|
|
663
671
|
this._consumerDescribedBy = p;
|
|
664
|
-
const f = q(this, this._consumerLabelledBy), w = f.length > 0,
|
|
665
|
-
this._installExternalRefsObserver([...f, ...
|
|
672
|
+
const f = q(this, this._consumerLabelledBy), w = f.length > 0, y = q(this, this._consumerDescribedBy);
|
|
673
|
+
this._installExternalRefsObserver([...f, ...y]);
|
|
666
674
|
const v = !!(this.error || this._hasErrorSlot), L = !t.validity.valid || v;
|
|
667
675
|
this._invalid !== L && (this._invalid = L);
|
|
668
676
|
const x = typeof this.accessibleLabel == "string" && this.accessibleLabel.trim().length > 0 ? this.accessibleLabel : null, O = (u) => u.getAttribute("aria-hidden") !== "true" && !u.hasAttribute("hidden"), S = [];
|
|
669
677
|
x || (S.push(...f.filter(O)), !w && !a && (this._labelSource === "slot" && s.length > 0 ? S.push(...s.filter(O)) : this._labelSource === "string" && i && S.push(i)));
|
|
670
|
-
const
|
|
671
|
-
if (o && !v && this._hasHelpSlot &&
|
|
678
|
+
const E = [...y.filter(O)];
|
|
679
|
+
if (o && !v && this._hasHelpSlot && E.push(o), h && v && E.push(h), this._supportsIdrefRefs) {
|
|
672
680
|
const u = t;
|
|
673
|
-
u.ariaLabelledByElements = S.length > 0 ? S : null, u.ariaDescribedByElements =
|
|
681
|
+
u.ariaLabelledByElements = S.length > 0 ? S : null, u.ariaDescribedByElements = E.length > 0 ? E : null, x ? t.ariaLabel = x : t.ariaLabel = null;
|
|
674
682
|
}
|
|
675
|
-
const
|
|
676
|
-
let b = null,
|
|
677
|
-
if (!x && w && (
|
|
683
|
+
const A = (u) => u.filter(O).map((C) => k(C)).filter((C) => C.length > 0).join(" ");
|
|
684
|
+
let b = null, M = null, I = "";
|
|
685
|
+
if (!x && w && (I = A(f)), x)
|
|
678
686
|
b = x;
|
|
679
|
-
else if (
|
|
680
|
-
b =
|
|
687
|
+
else if (I)
|
|
688
|
+
b = I;
|
|
681
689
|
else if (a)
|
|
682
690
|
b = a;
|
|
683
691
|
else if (this._labelSource === "slot") {
|
|
684
692
|
if (this._labelSlotText)
|
|
685
693
|
b = this._labelSlotText;
|
|
686
694
|
else if (s.length > 0) {
|
|
687
|
-
const u =
|
|
695
|
+
const u = A(s);
|
|
688
696
|
u && (b = u);
|
|
689
697
|
}
|
|
690
|
-
} else this._labelSource === "string" && (i != null && i.id ?
|
|
691
|
-
|
|
692
|
-
const
|
|
693
|
-
|
|
698
|
+
} else this._labelSource === "string" && (i != null && i.id ? M = i.id : this.label && (b = this.label));
|
|
699
|
+
M ? (e.getAttribute("aria-labelledby") !== M && e.setAttribute("aria-labelledby", M), e.hasAttribute("aria-label") && e.removeAttribute("aria-label")) : b ? (e.getAttribute("aria-label") !== b && e.setAttribute("aria-label", b), e.hasAttribute("aria-labelledby") && e.removeAttribute("aria-labelledby")) : (e.hasAttribute("aria-label") && e.removeAttribute("aria-label"), e.hasAttribute("aria-labelledby") && e.removeAttribute("aria-labelledby"));
|
|
700
|
+
const T = ((R = this.shadowRoot) == null ? void 0 : R.getElementById(this._consumerDescId)) ?? null, $ = A(y);
|
|
701
|
+
T && T.textContent !== $ && (T.textContent = $);
|
|
694
702
|
const g = [];
|
|
695
|
-
if (
|
|
703
|
+
if ($ && T && g.push(this._consumerDescId), o && !v && this._hasHelpSlot && g.push(this._helpTextId), h && v && g.push(this._errorId), !this._hasHelpSlot && this.helpText && !v && o && !g.includes(this._helpTextId) && g.push(this._helpTextId), g.length > 0) {
|
|
696
704
|
const u = g.join(" ");
|
|
697
705
|
e.getAttribute("aria-describedby") !== u && e.setAttribute("aria-describedby", u);
|
|
698
706
|
} else e.hasAttribute("aria-describedby") && e.removeAttribute("aria-describedby");
|
|
@@ -999,15 +1007,15 @@ let l = class extends G(K) {
|
|
|
999
1007
|
return;
|
|
1000
1008
|
}
|
|
1001
1009
|
if (e === "Home") {
|
|
1002
|
-
const o = new Date(this._viewYear, this._viewMonth, r).getDay(),
|
|
1003
|
-
|
|
1010
|
+
const o = new Date(this._viewYear, this._viewMonth, r).getDay(), h = r - o;
|
|
1011
|
+
h >= 1 && (this._focusedDay = h, this.updateComplete.then(() => {
|
|
1004
1012
|
var c, p;
|
|
1005
|
-
(p = (c = this._calendar) == null ? void 0 : c.querySelector(`[data-day="${
|
|
1013
|
+
(p = (c = this._calendar) == null ? void 0 : c.querySelector(`[data-day="${h}"]`)) == null || p.focus();
|
|
1006
1014
|
}));
|
|
1007
1015
|
return;
|
|
1008
1016
|
}
|
|
1009
1017
|
if (e === "End") {
|
|
1010
|
-
const
|
|
1018
|
+
const h = 6 - new Date(this._viewYear, this._viewMonth, r).getDay(), c = r + h;
|
|
1011
1019
|
c <= a && (this._focusedDay = c, this.updateComplete.then(() => {
|
|
1012
1020
|
var p, f;
|
|
1013
1021
|
(f = (p = this._calendar) == null ? void 0 : p.querySelector(`[data-day="${c}"]`)) == null || f.focus();
|
|
@@ -1019,18 +1027,18 @@ let l = class extends G(K) {
|
|
|
1019
1027
|
this._prevMonth();
|
|
1020
1028
|
const s = new Date(this._viewYear, this._viewMonth + 1, 0).getDate();
|
|
1021
1029
|
this._focusedDay = s + i, this.updateComplete.then(() => {
|
|
1022
|
-
var
|
|
1030
|
+
var h, c;
|
|
1023
1031
|
const o = this._focusedDay;
|
|
1024
|
-
(c = (
|
|
1032
|
+
(c = (h = this._calendar) == null ? void 0 : h.querySelector(`[data-day="${o}"]`)) == null || c.focus();
|
|
1025
1033
|
});
|
|
1026
1034
|
return;
|
|
1027
1035
|
}
|
|
1028
1036
|
if (i > a) {
|
|
1029
1037
|
const s = i - a;
|
|
1030
1038
|
this._nextMonth(), this._focusedDay = s, this.updateComplete.then(() => {
|
|
1031
|
-
var
|
|
1039
|
+
var h, c;
|
|
1032
1040
|
const o = this._focusedDay;
|
|
1033
|
-
(c = (
|
|
1041
|
+
(c = (h = this._calendar) == null ? void 0 : h.querySelector(`[data-day="${o}"]`)) == null || c.focus();
|
|
1034
1042
|
});
|
|
1035
1043
|
return;
|
|
1036
1044
|
}
|
|
@@ -1068,11 +1076,11 @@ let l = class extends G(K) {
|
|
|
1068
1076
|
/** @internal */
|
|
1069
1077
|
_renderWeekdayHeaders() {
|
|
1070
1078
|
const e = this._getWeekdayNames().map(
|
|
1071
|
-
(r) =>
|
|
1079
|
+
(r) => m`<div class="calendar__weekday" role="columnheader" aria-label=${r}>
|
|
1072
1080
|
${r.slice(0, 2)}
|
|
1073
1081
|
</div>`
|
|
1074
1082
|
);
|
|
1075
|
-
return
|
|
1083
|
+
return m`<div class="calendar__row" role="row">${e}</div>`;
|
|
1076
1084
|
}
|
|
1077
1085
|
/** @internal */
|
|
1078
1086
|
_renderDayGrid() {
|
|
@@ -1080,12 +1088,12 @@ let l = class extends G(K) {
|
|
|
1080
1088
|
for (let i = 0; i < t.length; i += 7) {
|
|
1081
1089
|
const s = t.slice(i, i + 7).map((o) => {
|
|
1082
1090
|
if (o === null)
|
|
1083
|
-
return
|
|
1084
|
-
const
|
|
1085
|
-
return
|
|
1091
|
+
return m`<div class="calendar__day-cell" role="gridcell" aria-hidden="true"></div>`;
|
|
1092
|
+
const h = e ? this._isSameDay(o, e) : !1, c = this._isSameDay(o, r), p = this._isDateDisabled(o), f = this._focusedDay === o.getDate(), w = o.getDate(), y = this._toISO(o), v = this._dayAriaLabels.get(y) ?? y;
|
|
1093
|
+
return m`<div
|
|
1086
1094
|
class="calendar__day-cell"
|
|
1087
1095
|
role="gridcell"
|
|
1088
|
-
aria-selected=${
|
|
1096
|
+
aria-selected=${h ? "true" : "false"}
|
|
1089
1097
|
aria-disabled=${p ? "true" : D}
|
|
1090
1098
|
aria-current=${c ? "date" : D}
|
|
1091
1099
|
>
|
|
@@ -1093,13 +1101,13 @@ let l = class extends G(K) {
|
|
|
1093
1101
|
part="day"
|
|
1094
1102
|
class=${B({
|
|
1095
1103
|
calendar__day: !0,
|
|
1096
|
-
"calendar__day--selected":
|
|
1104
|
+
"calendar__day--selected": h,
|
|
1097
1105
|
"calendar__day--today": c,
|
|
1098
1106
|
"calendar__day--disabled": p
|
|
1099
1107
|
})}
|
|
1100
1108
|
type="button"
|
|
1101
1109
|
data-day=${w}
|
|
1102
|
-
data-date=${
|
|
1110
|
+
data-date=${y}
|
|
1103
1111
|
aria-label=${v}
|
|
1104
1112
|
tabindex=${f ? "0" : "-1"}
|
|
1105
1113
|
?disabled=${p}
|
|
@@ -1108,7 +1116,7 @@ let l = class extends G(K) {
|
|
|
1108
1116
|
</button>
|
|
1109
1117
|
</div>`;
|
|
1110
1118
|
});
|
|
1111
|
-
a.push(
|
|
1119
|
+
a.push(m`<div class="calendar__row" role="row">${s}</div>`);
|
|
1112
1120
|
}
|
|
1113
1121
|
return a;
|
|
1114
1122
|
}
|
|
@@ -1120,15 +1128,15 @@ let l = class extends G(K) {
|
|
|
1120
1128
|
"field--disabled": this.disabled,
|
|
1121
1129
|
"field--required": this.required
|
|
1122
1130
|
};
|
|
1123
|
-
return
|
|
1131
|
+
return m`
|
|
1124
1132
|
<div part="field" class=${B(a)}>
|
|
1125
1133
|
<!-- Label -->
|
|
1126
1134
|
<div class="field__label-wrapper">
|
|
1127
1135
|
<slot name="label" @slotchange=${this._handleLabelSlotChange}>
|
|
1128
|
-
${this.label ?
|
|
1136
|
+
${this.label ? m`
|
|
1129
1137
|
<label part="label" id=${this._labelId} class="field__label" for=${this._inputId}>
|
|
1130
1138
|
${this.label}
|
|
1131
|
-
${this.required ?
|
|
1139
|
+
${this.required ? m`<span class="field__required-marker" aria-hidden="true">*</span>` : D}
|
|
1132
1140
|
</label>
|
|
1133
1141
|
` : D}
|
|
1134
1142
|
</slot>
|
|
@@ -1288,58 +1296,58 @@ l.styles = [J, V];
|
|
|
1288
1296
|
l.formAssociated = !0;
|
|
1289
1297
|
l.__testSupportsIdrefRefsOverride = null;
|
|
1290
1298
|
n([
|
|
1291
|
-
|
|
1299
|
+
d({ type: String, reflect: !0 })
|
|
1292
1300
|
], l.prototype, "name", 2);
|
|
1293
1301
|
n([
|
|
1294
|
-
|
|
1302
|
+
d({ type: String })
|
|
1295
1303
|
], l.prototype, "value", 2);
|
|
1296
1304
|
n([
|
|
1297
|
-
|
|
1305
|
+
d({ type: String })
|
|
1298
1306
|
], l.prototype, "min", 2);
|
|
1299
1307
|
n([
|
|
1300
|
-
|
|
1308
|
+
d({ type: String })
|
|
1301
1309
|
], l.prototype, "max", 2);
|
|
1302
1310
|
n([
|
|
1303
|
-
|
|
1311
|
+
d({ type: String })
|
|
1304
1312
|
], l.prototype, "label", 2);
|
|
1305
1313
|
n([
|
|
1306
|
-
|
|
1314
|
+
d({ type: Boolean, reflect: !0 })
|
|
1307
1315
|
], l.prototype, "required", 2);
|
|
1308
1316
|
n([
|
|
1309
|
-
|
|
1317
|
+
d({ type: Boolean, reflect: !0 })
|
|
1310
1318
|
], l.prototype, "disabled", 2);
|
|
1311
1319
|
n([
|
|
1312
|
-
|
|
1320
|
+
d({ type: String })
|
|
1313
1321
|
], l.prototype, "error", 2);
|
|
1314
1322
|
n([
|
|
1315
|
-
|
|
1323
|
+
d({ type: String, attribute: "help-text" })
|
|
1316
1324
|
], l.prototype, "helpText", 2);
|
|
1317
1325
|
n([
|
|
1318
|
-
|
|
1326
|
+
d({ type: String })
|
|
1319
1327
|
], l.prototype, "format", 2);
|
|
1320
1328
|
n([
|
|
1321
|
-
|
|
1329
|
+
d({ type: String })
|
|
1322
1330
|
], l.prototype, "locale", 2);
|
|
1323
1331
|
n([
|
|
1324
|
-
|
|
1332
|
+
d({ type: String, attribute: "required-message" })
|
|
1325
1333
|
], l.prototype, "requiredMessage", 2);
|
|
1326
1334
|
n([
|
|
1327
|
-
|
|
1335
|
+
d({ type: String, attribute: "choose-date-label" })
|
|
1328
1336
|
], l.prototype, "chooseDateLabel", 2);
|
|
1329
1337
|
n([
|
|
1330
|
-
|
|
1338
|
+
d({ type: String, attribute: "open-calendar-label" })
|
|
1331
1339
|
], l.prototype, "openCalendarLabel", 2);
|
|
1332
1340
|
n([
|
|
1333
|
-
|
|
1341
|
+
d({ type: String, attribute: "close-calendar-label" })
|
|
1334
1342
|
], l.prototype, "closeCalendarLabel", 2);
|
|
1335
1343
|
n([
|
|
1336
|
-
|
|
1344
|
+
d({ type: String, attribute: "previous-month-label" })
|
|
1337
1345
|
], l.prototype, "previousMonthLabel", 2);
|
|
1338
1346
|
n([
|
|
1339
|
-
|
|
1347
|
+
d({ type: String, attribute: "next-month-label" })
|
|
1340
1348
|
], l.prototype, "nextMonthLabel", 2);
|
|
1341
1349
|
n([
|
|
1342
|
-
|
|
1350
|
+
d({ type: String, attribute: "accessible-label" })
|
|
1343
1351
|
], l.prototype, "accessibleLabel", 2);
|
|
1344
1352
|
n([
|
|
1345
1353
|
_()
|
|
@@ -1395,4 +1403,4 @@ l = n([
|
|
|
1395
1403
|
export {
|
|
1396
1404
|
l as H
|
|
1397
1405
|
};
|
|
1398
|
-
//# sourceMappingURL=hx-date-picker-
|
|
1406
|
+
//# sourceMappingURL=hx-date-picker-0PtEav0K.js.map
|