@pine-ds/core 4.7.2 → 4.9.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/components/attributes.js +1 -1
- package/components/floating-ui.dom.js +1 -1
- package/components/index.js +1 -1
- package/components/index2.js +1 -1
- package/components/keep-hydrated.js +1 -0
- package/components/mock-pds-modal.js +1 -1
- package/components/pds-alert.js +1 -1
- package/components/pds-avatar.js +1 -1
- package/components/pds-box2.js +1 -1
- package/components/pds-button2.js +1 -1
- package/components/pds-checkbox2.js +1 -1
- package/components/pds-chip2.js +1 -1
- package/components/pds-combobox.js +1 -1
- package/components/pds-container.js +1 -1
- package/components/pds-copytext.js +1 -1
- package/components/pds-datepicker.js +1 -1
- package/components/pds-divider.js +1 -1
- package/components/pds-drawer-content.js +1 -1
- package/components/pds-drawer-footer.js +1 -1
- package/components/pds-drawer-header.js +1 -1
- package/components/pds-drawer.js +1 -1
- package/components/pds-dropdown-menu-item.js +1 -1
- package/components/pds-dropdown-menu-separator.js +1 -1
- package/components/pds-dropdown-menu.js +1 -1
- package/components/pds-filter.js +1 -1
- package/components/pds-filters.js +1 -1
- package/components/pds-image.js +1 -1
- package/components/pds-input2.js +1 -1
- package/components/pds-link2.js +1 -1
- package/components/pds-loader2.js +1 -1
- package/components/pds-modal-content.js +1 -1
- package/components/pds-modal-footer.js +1 -1
- package/components/pds-modal-header.js +1 -1
- package/components/pds-modal2.js +1 -1
- package/components/pds-multiselect.js +1 -1
- package/components/pds-popover.js +1 -1
- package/components/pds-progress.js +1 -1
- package/components/pds-property.js +1 -1
- package/components/pds-radio-group.js +1 -1
- package/components/pds-radio.js +1 -1
- package/components/pds-row.js +1 -1
- package/components/pds-select.js +1 -1
- package/components/pds-sortable-item.js +1 -1
- package/components/pds-sortable.js +2 -2
- package/components/pds-switch.js +1 -1
- package/components/pds-table-body.js +1 -1
- package/components/pds-table-cell2.js +1 -1
- package/components/pds-table-head-cell2.js +1 -1
- package/components/pds-table-head.js +1 -1
- package/components/pds-table-row.js +1 -1
- package/components/pds-tabpanel.js +1 -1
- package/components/pds-tabs.js +1 -1
- package/components/pds-text2.js +1 -1
- package/components/pds-textarea.js +1 -1
- package/components/pds-toast.js +1 -1
- package/components/pds-tooltip.js +1 -1
- package/components/tabbable.js +1 -0
- package/components/truncation-tooltip.js +1 -1
- package/dist/cjs/{attributes-BJ7KBHql.js → attributes-CW49XqaL.js} +1 -1
- package/dist/cjs/{floating-ui.dom-Dc8Anyel.js → floating-ui.dom-Dw41zbyY.js} +1 -0
- package/dist/cjs/{index-jl_Q819j.js → index-BsWY_xEJ.js} +1 -1
- package/dist/cjs/{index-5Azb8EQG.js → index-Do70atou.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{keep-hydrated-CiXgkEYd.js → keep-hydrated-AKoh0DG4.js} +1 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/mock-pds-modal.cjs.entry.js +3 -3
- package/dist/cjs/pds-accordion.cjs.entry.js +3 -3
- package/dist/cjs/pds-alert.cjs.entry.js +17 -4
- package/dist/cjs/pds-avatar.cjs.entry.js +23 -13
- package/dist/cjs/pds-box.cjs.entry.js +4 -4
- package/dist/cjs/pds-button.cjs.entry.js +80 -45
- package/dist/cjs/pds-checkbox.cjs.entry.js +16 -8
- package/dist/cjs/pds-chip.cjs.entry.js +8 -8
- package/dist/cjs/pds-combobox.cjs.entry.js +43 -13
- package/dist/cjs/pds-container.cjs.entry.js +3 -3
- package/dist/cjs/pds-copytext.cjs.entry.js +7 -7
- package/dist/cjs/pds-datepicker.cjs.entry.js +6 -6
- package/dist/cjs/pds-divider.cjs.entry.js +3 -3
- package/dist/cjs/pds-drawer-content.cjs.entry.js +3 -3
- package/dist/cjs/pds-drawer-footer.cjs.entry.js +3 -3
- package/dist/cjs/pds-drawer-header.cjs.entry.js +3 -3
- package/dist/cjs/pds-drawer.cjs.entry.js +4 -4
- package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +34 -5
- package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +3 -3
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +8 -8
- package/dist/cjs/pds-filter.cjs.entry.js +4 -4
- package/dist/cjs/pds-filters.cjs.entry.js +3 -3
- package/dist/cjs/pds-icon.cjs.entry.js +2 -2
- package/dist/cjs/pds-image.cjs.entry.js +4 -4
- package/dist/cjs/pds-input.cjs.entry.js +6 -6
- package/dist/cjs/pds-link.cjs.entry.js +15 -6
- package/dist/cjs/pds-loader.cjs.entry.js +4 -4
- package/dist/cjs/pds-modal-content.cjs.entry.js +34 -32
- package/dist/cjs/pds-modal-footer.cjs.entry.js +3 -3
- package/dist/cjs/pds-modal-header.cjs.entry.js +3 -3
- package/dist/cjs/pds-modal.cjs.entry.js +9 -89
- package/dist/cjs/pds-multiselect.cjs.entry.js +9 -9
- package/dist/cjs/pds-popover.cjs.entry.js +416 -163
- package/dist/cjs/pds-progress.cjs.entry.js +4 -4
- package/dist/cjs/pds-property.cjs.entry.js +3 -3
- package/dist/cjs/pds-radio-group.cjs.entry.js +6 -6
- package/dist/cjs/pds-radio.cjs.entry.js +24 -11
- package/dist/cjs/pds-row.cjs.entry.js +4 -4
- package/dist/cjs/pds-select.cjs.entry.js +132 -21
- package/dist/cjs/pds-sortable-item.cjs.entry.js +5 -5
- package/dist/cjs/pds-sortable.cjs.entry.js +4 -4
- package/dist/cjs/pds-switch.cjs.entry.js +7 -7
- package/dist/cjs/pds-tab.cjs.entry.js +3 -3
- package/dist/cjs/pds-table-body.cjs.entry.js +3 -3
- package/dist/cjs/pds-table-cell.cjs.entry.js +6 -6
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +5 -5
- package/dist/cjs/pds-table-head.cjs.entry.js +3 -3
- package/dist/cjs/pds-table-row.cjs.entry.js +3 -3
- package/dist/cjs/pds-table.cjs.entry.js +2 -2
- package/dist/cjs/pds-tabpanel.cjs.entry.js +4 -4
- package/dist/cjs/pds-tabs.cjs.entry.js +4 -4
- package/dist/cjs/pds-text.cjs.entry.js +5 -5
- package/dist/cjs/pds-textarea.cjs.entry.js +8 -8
- package/dist/cjs/pds-toast.cjs.entry.js +14 -8
- package/dist/cjs/pds-tooltip.cjs.entry.js +115 -44
- package/dist/cjs/pine-core.cjs.js +3 -3
- package/dist/cjs/tabbable-CddSt_Hi.js +85 -0
- package/dist/cjs/{truncation-tooltip-DO9xli2e.js → truncation-tooltip-O5nQmXPw.js} +32 -7
- package/dist/collection/components/pds-alert/pds-alert.css +13 -0
- package/dist/collection/components/pds-alert/pds-alert.js +36 -1
- package/dist/collection/components/pds-alert/stories/pds-alert.stories.js +4 -0
- package/dist/collection/components/pds-avatar/pds-avatar.js +42 -10
- package/dist/collection/components/pds-avatar/stories/pds-avatar.stories.js +2 -0
- package/dist/collection/components/pds-box/pds-box.js +1 -1
- package/dist/collection/components/pds-button/pds-button.js +36 -44
- package/dist/collection/components/pds-button/stories/pds-button.stories.js +3 -3
- package/dist/collection/components/pds-checkbox/pds-checkbox.css +79 -0
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +36 -5
- package/dist/collection/components/pds-checkbox/stories/pds-checkbox.stories.js +38 -0
- package/dist/collection/components/pds-chip/pds-chip.js +2 -2
- package/dist/collection/components/pds-combobox/pds-combobox.css +33 -0
- package/dist/collection/components/pds-combobox/pds-combobox.js +62 -9
- package/dist/collection/components/pds-combobox/stories/pds-combobox.stories.js +44 -0
- package/dist/collection/components/pds-container/pds-container.js +1 -1
- package/dist/collection/components/pds-copytext/pds-copytext.js +1 -1
- package/dist/collection/components/pds-datepicker/pds-datepicker.js +2 -2
- package/dist/collection/components/pds-datepicker/stories/pds-datepicker.stories.js +1 -1
- package/dist/collection/components/pds-divider/pds-divider.js +1 -1
- package/dist/collection/components/pds-drawer/pds-drawer-content/pds-drawer-content.js +1 -1
- package/dist/collection/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.js +1 -1
- package/dist/collection/components/pds-drawer/pds-drawer-header/pds-drawer-header.js +1 -1
- package/dist/collection/components/pds-drawer/pds-drawer.js +2 -2
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.css +8 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +81 -7
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.js +1 -1
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +4 -4
- package/dist/collection/components/pds-dropdown-menu/stories/pds-dropdown-menu.stories.js +39 -0
- package/dist/collection/components/pds-filters/pds-filter/pds-filter.js +1 -1
- package/dist/collection/components/pds-filters/pds-filters.js +1 -1
- package/dist/collection/components/pds-image/pds-image.js +2 -2
- package/dist/collection/components/pds-input/pds-input.js +2 -2
- package/dist/collection/components/pds-input/stories/pds-input.stories.js +6 -6
- package/dist/collection/components/pds-link/pds-link.js +34 -3
- package/dist/collection/components/pds-link/stories/pds-link.stories.js +3 -2
- package/dist/collection/components/pds-loader/pds-loader.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js +32 -30
- package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal.js +5 -85
- package/dist/collection/components/pds-modal/test/mock-pds-modal.js +1 -1
- package/dist/collection/components/pds-multiselect/pds-multiselect.js +5 -5
- package/dist/collection/components/pds-popover/pds-popover.css +6 -0
- package/dist/collection/components/pds-popover/pds-popover.js +465 -159
- package/dist/collection/components/pds-popover/stories/pds-popover.stories.js +31 -0
- package/dist/collection/components/pds-progress/pds-progress.js +1 -1
- package/dist/collection/components/pds-property/pds-property.js +1 -1
- package/dist/collection/components/pds-radio/pds-radio.css +57 -0
- package/dist/collection/components/pds-radio/pds-radio.js +45 -9
- package/dist/collection/components/pds-radio/stories/pds-radio.stories.js +15 -0
- package/dist/collection/components/pds-radio-group/pds-radio-group.js +3 -3
- package/dist/collection/components/pds-radio-group/stories/pds-radio-group.stories.js +45 -0
- package/dist/collection/components/pds-row/pds-row.js +1 -1
- package/dist/collection/components/pds-select/pds-select.js +128 -17
- package/dist/collection/components/pds-select/stories/pds-select.stories.js +2 -2
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +1 -1
- package/dist/collection/components/pds-sortable/pds-sortable.js +1 -1
- package/dist/collection/components/pds-switch/pds-switch.js +3 -3
- package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +1 -1
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +2 -2
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +1 -1
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +2 -2
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +1 -1
- package/dist/collection/components/pds-table/stories/pds-table.stories.js +4 -4
- package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +1 -1
- package/dist/collection/components/pds-tabs/pds-tabs.js +1 -1
- package/dist/collection/components/pds-text/pds-text.js +1 -1
- package/dist/collection/components/pds-text/stories/pds-text.stories.js +1 -1
- package/dist/collection/components/pds-textarea/pds-textarea.js +4 -4
- package/dist/collection/components/pds-textarea/stories/pds-textarea.stories.js +2 -2
- package/dist/collection/components/pds-toast/pds-toast.css +13 -0
- package/dist/collection/components/pds-toast/pds-toast.js +33 -5
- package/dist/collection/components/pds-toast/stories/pds-toast.stories.js +4 -1
- package/dist/collection/components/pds-tooltip/pds-tooltip.js +113 -41
- package/dist/collection/utils/aria-references.js +42 -0
- package/dist/collection/utils/tabbable.js +81 -0
- package/dist/collection/utils/truncation-tooltip.js +31 -6
- package/dist/docs.json +367 -13
- package/dist/esm/{attributes-WXw_I_uJ.js → attributes-DkeVeN0g.js} +1 -1
- package/dist/esm/{floating-ui.dom-BPqJgIq6.js → floating-ui.dom-Cuc0DYlm.js} +1 -1
- package/dist/esm/{index-Cw9J31qd.js → index-BFSwd-GQ.js} +1 -1
- package/dist/esm/{index-BJXk71tO.js → index-m3pqpeWg.js} +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/{keep-hydrated-BLG6RDBt.js → keep-hydrated-BgNaWLoS.js} +1 -1
- package/dist/esm/loader.js +4 -4
- package/dist/esm/mock-pds-modal.entry.js +3 -3
- package/dist/esm/pds-accordion.entry.js +3 -3
- package/dist/esm/pds-alert.entry.js +17 -4
- package/dist/esm/pds-avatar.entry.js +23 -13
- package/dist/esm/pds-box.entry.js +4 -4
- package/dist/esm/pds-button.entry.js +80 -45
- package/dist/esm/pds-checkbox.entry.js +16 -8
- package/dist/esm/pds-chip.entry.js +8 -8
- package/dist/esm/pds-combobox.entry.js +43 -13
- package/dist/esm/pds-container.entry.js +3 -3
- package/dist/esm/pds-copytext.entry.js +7 -7
- package/dist/esm/pds-datepicker.entry.js +6 -6
- package/dist/esm/pds-divider.entry.js +3 -3
- package/dist/esm/pds-drawer-content.entry.js +3 -3
- package/dist/esm/pds-drawer-footer.entry.js +3 -3
- package/dist/esm/pds-drawer-header.entry.js +3 -3
- package/dist/esm/pds-drawer.entry.js +4 -4
- package/dist/esm/pds-dropdown-menu-item.entry.js +34 -5
- package/dist/esm/pds-dropdown-menu-separator.entry.js +3 -3
- package/dist/esm/pds-dropdown-menu.entry.js +8 -8
- package/dist/esm/pds-filter.entry.js +4 -4
- package/dist/esm/pds-filters.entry.js +3 -3
- package/dist/esm/pds-icon.entry.js +2 -2
- package/dist/esm/pds-image.entry.js +4 -4
- package/dist/esm/pds-input.entry.js +6 -6
- package/dist/esm/pds-link.entry.js +15 -6
- package/dist/esm/pds-loader.entry.js +4 -4
- package/dist/esm/pds-modal-content.entry.js +34 -32
- package/dist/esm/pds-modal-footer.entry.js +3 -3
- package/dist/esm/pds-modal-header.entry.js +3 -3
- package/dist/esm/pds-modal.entry.js +7 -87
- package/dist/esm/pds-multiselect.entry.js +9 -9
- package/dist/esm/pds-popover.entry.js +416 -163
- package/dist/esm/pds-progress.entry.js +4 -4
- package/dist/esm/pds-property.entry.js +3 -3
- package/dist/esm/pds-radio-group.entry.js +6 -6
- package/dist/esm/pds-radio.entry.js +24 -11
- package/dist/esm/pds-row.entry.js +4 -4
- package/dist/esm/pds-select.entry.js +132 -21
- package/dist/esm/pds-sortable-item.entry.js +5 -5
- package/dist/esm/pds-sortable.entry.js +4 -4
- package/dist/esm/pds-switch.entry.js +7 -7
- package/dist/esm/pds-tab.entry.js +3 -3
- package/dist/esm/pds-table-body.entry.js +3 -3
- package/dist/esm/pds-table-cell.entry.js +6 -6
- package/dist/esm/pds-table-head-cell.entry.js +5 -5
- package/dist/esm/pds-table-head.entry.js +3 -3
- package/dist/esm/pds-table-row.entry.js +3 -3
- package/dist/esm/pds-table.entry.js +2 -2
- package/dist/esm/pds-tabpanel.entry.js +4 -4
- package/dist/esm/pds-tabs.entry.js +4 -4
- package/dist/esm/pds-text.entry.js +5 -5
- package/dist/esm/pds-textarea.entry.js +8 -8
- package/dist/esm/pds-toast.entry.js +14 -8
- package/dist/esm/pds-tooltip.entry.js +115 -44
- package/dist/esm/pine-core.js +4 -4
- package/dist/esm/tabbable-DCKBKRUy.js +83 -0
- package/dist/esm/{truncation-tooltip-DRXsdKk1.js → truncation-tooltip-D_gvhB9r.js} +32 -7
- package/dist/esm-es5/{attributes-WXw_I_uJ.js → attributes-DkeVeN0g.js} +1 -1
- package/dist/esm-es5/{floating-ui.dom-BPqJgIq6.js → floating-ui.dom-Cuc0DYlm.js} +1 -1
- package/dist/esm-es5/{index-Cw9J31qd.js → index-BFSwd-GQ.js} +2 -2
- package/dist/esm-es5/{index-BJXk71tO.js → index-m3pqpeWg.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{keep-hydrated-BLG6RDBt.js → keep-hydrated-BgNaWLoS.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mock-pds-modal.entry.js +1 -1
- package/dist/esm-es5/pds-accordion.entry.js +1 -1
- package/dist/esm-es5/pds-alert.entry.js +1 -1
- package/dist/esm-es5/pds-avatar.entry.js +1 -1
- package/dist/esm-es5/pds-box.entry.js +1 -1
- package/dist/esm-es5/pds-button.entry.js +1 -1
- package/dist/esm-es5/pds-checkbox.entry.js +1 -1
- package/dist/esm-es5/pds-chip.entry.js +1 -1
- package/dist/esm-es5/pds-combobox.entry.js +2 -2
- package/dist/esm-es5/pds-container.entry.js +1 -1
- package/dist/esm-es5/pds-copytext.entry.js +1 -1
- package/dist/esm-es5/pds-datepicker.entry.js +1 -1
- package/dist/esm-es5/pds-divider.entry.js +1 -1
- package/dist/esm-es5/pds-drawer-content.entry.js +1 -1
- package/dist/esm-es5/pds-drawer-footer.entry.js +1 -1
- package/dist/esm-es5/pds-drawer-header.entry.js +1 -1
- package/dist/esm-es5/pds-drawer.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu-item.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu-separator.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
- package/dist/esm-es5/pds-filter.entry.js +1 -1
- package/dist/esm-es5/pds-filters.entry.js +1 -1
- package/dist/esm-es5/pds-icon.entry.js +1 -1
- package/dist/esm-es5/pds-image.entry.js +1 -1
- package/dist/esm-es5/pds-input.entry.js +1 -1
- package/dist/esm-es5/pds-link.entry.js +1 -1
- package/dist/esm-es5/pds-loader.entry.js +1 -1
- package/dist/esm-es5/pds-modal-content.entry.js +1 -1
- package/dist/esm-es5/pds-modal-footer.entry.js +1 -1
- package/dist/esm-es5/pds-modal-header.entry.js +1 -1
- package/dist/esm-es5/pds-modal.entry.js +1 -1
- package/dist/esm-es5/pds-multiselect.entry.js +1 -1
- package/dist/esm-es5/pds-popover.entry.js +1 -1
- package/dist/esm-es5/pds-progress.entry.js +1 -1
- package/dist/esm-es5/pds-property.entry.js +1 -1
- package/dist/esm-es5/pds-radio-group.entry.js +1 -1
- package/dist/esm-es5/pds-radio.entry.js +1 -1
- package/dist/esm-es5/pds-row.entry.js +1 -1
- package/dist/esm-es5/pds-select.entry.js +1 -1
- package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
- package/dist/esm-es5/pds-sortable.entry.js +2 -2
- package/dist/esm-es5/pds-switch.entry.js +1 -1
- package/dist/esm-es5/pds-tab.entry.js +1 -1
- package/dist/esm-es5/pds-table-body.entry.js +1 -1
- package/dist/esm-es5/pds-table-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
- package/dist/esm-es5/pds-table-head.entry.js +1 -1
- package/dist/esm-es5/pds-table-row.entry.js +1 -1
- package/dist/esm-es5/pds-table.entry.js +1 -1
- package/dist/esm-es5/pds-tabpanel.entry.js +1 -1
- package/dist/esm-es5/pds-tabs.entry.js +1 -1
- package/dist/esm-es5/pds-text.entry.js +1 -1
- package/dist/esm-es5/pds-textarea.entry.js +1 -1
- package/dist/esm-es5/pds-toast.entry.js +1 -1
- package/dist/esm-es5/pds-tooltip.entry.js +1 -1
- package/dist/esm-es5/pine-core.js +1 -1
- package/dist/esm-es5/tabbable-DCKBKRUy.js +1 -0
- package/dist/esm-es5/truncation-tooltip-D_gvhB9r.js +1 -0
- package/dist/pine-core/index.esm.js +1 -1
- package/dist/pine-core/p-001d4b86.entry.js +1 -0
- package/dist/pine-core/p-06279b93.system.entry.js +1 -0
- package/dist/pine-core/{p-b75b0d09.system.entry.js → p-0790dd0d.system.entry.js} +1 -1
- package/dist/pine-core/p-079c39d1.entry.js +1 -0
- package/dist/pine-core/p-07b4524e.entry.js +1 -0
- package/dist/pine-core/{p-b60ac7eb.system.entry.js → p-08bbd3e6.system.entry.js} +1 -1
- package/dist/pine-core/{p-c5c9ed36.system.entry.js → p-0bd61097.system.entry.js} +1 -1
- package/dist/pine-core/p-0c60f577.system.entry.js +1 -0
- package/dist/pine-core/{p-6d603d16.system.entry.js → p-110b4051.system.entry.js} +1 -1
- package/dist/pine-core/p-11e7d660.entry.js +1 -0
- package/dist/pine-core/p-14d872d3.entry.js +1 -0
- package/dist/pine-core/p-17fc76e7.system.entry.js +1 -0
- package/dist/pine-core/{p-0913f696.system.entry.js → p-1e5648bf.system.entry.js} +1 -1
- package/dist/pine-core/{p-e803f629.system.entry.js → p-22ae92f7.system.entry.js} +1 -1
- package/dist/pine-core/p-239774c9.entry.js +1 -0
- package/dist/pine-core/{p-0b71ecb6.system.entry.js → p-25bf2f26.system.entry.js} +2 -2
- package/dist/pine-core/{p-e7a95a49.system.entry.js → p-272b24ad.system.entry.js} +1 -1
- package/dist/pine-core/{p-d2c91e7a.entry.js → p-2c0047cd.entry.js} +1 -1
- package/dist/pine-core/p-2d5b1deb.entry.js +1 -0
- package/dist/pine-core/{p-e8cb76e8.entry.js → p-3556f6ad.entry.js} +1 -1
- package/dist/pine-core/{p-BGLP3keB.js → p-35s7h-dk.js} +1 -1
- package/dist/pine-core/{p-080cb087.system.entry.js → p-38b87aa2.system.entry.js} +1 -1
- package/dist/pine-core/{p-355e4cf9.entry.js → p-3afb1208.entry.js} +1 -1
- package/dist/pine-core/p-3b5b8f73.entry.js +1 -0
- package/dist/pine-core/{p-8c8cc079.system.entry.js → p-3cc19ea8.system.entry.js} +1 -1
- package/dist/pine-core/{p-bd67156b.system.entry.js → p-3ce7e72e.system.entry.js} +1 -1
- package/dist/pine-core/p-3f62581a.system.entry.js +1 -0
- package/dist/pine-core/p-414faecf.entry.js +1 -0
- package/dist/pine-core/p-463a29fa.entry.js +1 -0
- package/dist/pine-core/{p-f029b7da.system.entry.js → p-4ee44585.system.entry.js} +1 -1
- package/dist/pine-core/p-50af67ea.system.entry.js +1 -0
- package/dist/pine-core/p-5133e8be.system.entry.js +1 -0
- package/dist/pine-core/p-55fce29e.entry.js +1 -0
- package/dist/pine-core/{p-77395d62.system.entry.js → p-568a9a79.system.entry.js} +1 -1
- package/dist/pine-core/p-5967d9fa.system.entry.js +1 -0
- package/dist/pine-core/{p-5870b092.system.entry.js → p-5c46553f.system.entry.js} +1 -1
- package/dist/pine-core/{p-f0d24298.system.entry.js → p-5ce5836e.system.entry.js} +1 -1
- package/dist/pine-core/p-5f3242c8.system.entry.js +1 -0
- package/dist/pine-core/{p-80e6f3a0.system.entry.js → p-60d27247.system.entry.js} +1 -1
- package/dist/pine-core/{p-bd26a5e8.entry.js → p-60e3b1af.entry.js} +1 -1
- package/dist/pine-core/{p-ca0a8f5c.entry.js → p-64283f7b.entry.js} +1 -1
- package/dist/pine-core/p-6602b4d0.entry.js +1 -0
- package/dist/pine-core/p-6845867f.system.entry.js +1 -0
- package/dist/pine-core/{p-1ee86d87.system.entry.js → p-68fdfb8f.system.entry.js} +1 -1
- package/dist/pine-core/p-6b6ae1be.entry.js +1 -0
- package/dist/pine-core/{p-e5420660.entry.js → p-6d64e6c7.entry.js} +1 -1
- package/dist/pine-core/{p-3a959459.system.entry.js → p-6dad76cb.system.entry.js} +1 -1
- package/dist/pine-core/p-6f34ad9c.entry.js +1 -0
- package/dist/pine-core/{p-55224683.entry.js → p-7073146f.entry.js} +1 -1
- package/dist/pine-core/{p-f1702281.entry.js → p-735b3631.entry.js} +1 -1
- package/dist/pine-core/p-7a14473e.entry.js +1 -0
- package/dist/pine-core/{p-9880d251.system.entry.js → p-7a19477e.system.entry.js} +1 -1
- package/dist/pine-core/{p-88ff1604.entry.js → p-7d3a20ba.entry.js} +1 -1
- package/dist/pine-core/{p-a939b471.entry.js → p-7fcf3d37.entry.js} +1 -1
- package/dist/pine-core/{p-26642718.entry.js → p-87642228.entry.js} +1 -1
- package/dist/pine-core/p-89fefe36.entry.js +1 -0
- package/dist/pine-core/p-8b97dd57.system.entry.js +1 -0
- package/dist/pine-core/{p-0092444c.system.entry.js → p-9201b497.system.entry.js} +1 -1
- package/dist/pine-core/{p-ebd0bff2.entry.js → p-92a8cf7d.entry.js} +1 -1
- package/dist/pine-core/{p-e836a041.entry.js → p-94597b73.entry.js} +1 -1
- package/dist/pine-core/p-9713d6a5.system.entry.js +1 -0
- package/dist/pine-core/p-97be00f4.system.entry.js +1 -0
- package/dist/pine-core/{p-2ac2457b.system.entry.js → p-98843402.system.entry.js} +1 -1
- package/dist/pine-core/{p-b914dde8.entry.js → p-98cc327b.entry.js} +2 -2
- package/dist/pine-core/p-9a8971e2.system.entry.js +1 -0
- package/dist/pine-core/p-9a8d2985.system.entry.js +3 -0
- package/dist/pine-core/{p-cfc52b95.system.entry.js → p-9dbc017f.system.entry.js} +1 -1
- package/dist/pine-core/p-9fbcba0d.entry.js +1 -0
- package/dist/pine-core/p-9fe4a64a.entry.js +1 -0
- package/dist/pine-core/{p-COtCa1Md.system.js → p-BNTlHhoO.system.js} +1 -1
- package/dist/pine-core/p-BZ1l3LGl.system.js +1 -0
- package/dist/pine-core/p-BgNaWLoS.js +1 -0
- package/dist/pine-core/{p-CmSJytt1.js → p-BplEmwUQ.js} +2 -2
- package/dist/pine-core/{p-Cy8cvR7I.system.js → p-CANeE7Ss.system.js} +1 -1
- package/dist/pine-core/{p-XW4H0W6i.system.js → p-CNXspDYs.system.js} +1 -1
- package/dist/pine-core/{p-JtdHT_W5.js → p-CirzxZ33.js} +1 -1
- package/dist/pine-core/{p-CGRdQc49.system.js → p-CjRCtzPD.system.js} +2 -2
- package/dist/pine-core/{p-BPqJgIq6.js → p-Cuc0DYlm.js} +1 -1
- package/dist/pine-core/p-D52aRqFx.system.js +1 -0
- package/dist/pine-core/p-DCKBKRUy.js +1 -0
- package/dist/pine-core/p-DXO1yd32.system.js +1 -0
- package/dist/pine-core/{p-n3_ytl_p.system.js → p-DaCT2ssj.system.js} +1 -1
- package/dist/pine-core/p-a2078add.entry.js +1 -0
- package/dist/pine-core/{p-97d0b89e.system.entry.js → p-a48b025a.system.entry.js} +1 -1
- package/dist/pine-core/{p-9713fb36.entry.js → p-a7d25143.entry.js} +1 -1
- package/dist/pine-core/{p-9dcd2cdb.entry.js → p-ad3b1ec3.entry.js} +1 -1
- package/dist/pine-core/p-b017eb99.system.entry.js +1 -0
- package/dist/pine-core/p-b037dcbd.system.entry.js +1 -0
- package/dist/pine-core/{p-db17c626.system.entry.js → p-b243767b.system.entry.js} +1 -1
- package/dist/pine-core/{p-341c38f1.system.entry.js → p-b33ad96e.system.entry.js} +1 -1
- package/dist/pine-core/p-b6edfdfe.entry.js +2 -0
- package/dist/pine-core/{p-8191498f.system.entry.js → p-b7cbd913.system.entry.js} +1 -1
- package/dist/pine-core/{p-8f531063.entry.js → p-b9d71b76.entry.js} +1 -1
- package/dist/pine-core/p-bcf57566.entry.js +1 -0
- package/dist/pine-core/{p-4fd454f6.entry.js → p-bda7e3be.entry.js} +1 -1
- package/dist/pine-core/p-bdde1e53.entry.js +1 -0
- package/dist/pine-core/{p-cb6a3e4c.system.entry.js → p-be3b4f12.system.entry.js} +1 -1
- package/dist/pine-core/{p-b1548a20.entry.js → p-bfdfbe9f.entry.js} +1 -1
- package/dist/pine-core/p-c02a32ec.entry.js +1 -0
- package/dist/pine-core/p-c1da80e5.entry.js +1 -0
- package/dist/pine-core/{p-d8570b4b.system.entry.js → p-c233866c.system.entry.js} +1 -1
- package/dist/pine-core/{p-fc25b956.system.entry.js → p-cb560aab.system.entry.js} +1 -1
- package/dist/pine-core/{p-02088776.entry.js → p-ce554098.entry.js} +1 -1
- package/dist/pine-core/p-ced6a814.system.entry.js +1 -0
- package/dist/pine-core/{p-0a84d220.entry.js → p-d7930540.entry.js} +1 -1
- package/dist/pine-core/{p-11d98408.system.entry.js → p-d7db749a.system.entry.js} +1 -1
- package/dist/pine-core/{p-7a5b21d2.system.entry.js → p-d8bedb58.system.entry.js} +1 -1
- package/dist/pine-core/{p-1dc5a7e0.system.entry.js → p-d9243653.system.entry.js} +1 -1
- package/dist/pine-core/{p-9ab95438.entry.js → p-d94ebe84.entry.js} +1 -1
- package/dist/pine-core/{p-9109b90a.entry.js → p-de176bd9.entry.js} +1 -1
- package/dist/pine-core/{p-57a2f927.entry.js → p-dea2a254.entry.js} +1 -1
- package/dist/pine-core/p-dfadfcd1.entry.js +1 -0
- package/dist/pine-core/{p-1437585e.system.entry.js → p-e1fdd53a.system.entry.js} +1 -1
- package/dist/pine-core/{p-4435fff6.system.entry.js → p-e70cb112.system.entry.js} +1 -1
- package/dist/pine-core/{p-01aa382c.system.entry.js → p-e9a53a88.system.entry.js} +1 -1
- package/dist/pine-core/p-eb93cc6e.entry.js +1 -0
- package/dist/pine-core/{p-4d03d1e2.system.entry.js → p-ebf0c51b.system.entry.js} +1 -1
- package/dist/pine-core/p-ebf74c43.system.entry.js +1 -0
- package/dist/pine-core/{p-cde8eb81.entry.js → p-ee449a4b.entry.js} +1 -1
- package/dist/pine-core/p-ef4d8fea.entry.js +1 -0
- package/dist/pine-core/p-f09f27ab.system.entry.js +1 -0
- package/dist/pine-core/{p-ff3de72e.entry.js → p-f2c487e6.entry.js} +1 -1
- package/dist/pine-core/p-f549f2bc.entry.js +1 -0
- package/dist/pine-core/p-fc743f6e.entry.js +1 -0
- package/dist/pine-core/{p-BJXk71tO.js → p-m3pqpeWg.js} +1 -1
- package/dist/pine-core/p-wXfuz0Bd.system.js +1 -0
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/pine-core/pine-core.js +1 -1
- package/dist/types/components/pds-alert/pds-alert.d.ts +10 -0
- package/dist/types/components/pds-avatar/pds-avatar.d.ts +8 -0
- package/dist/types/components/pds-button/pds-button.d.ts +5 -6
- package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +7 -1
- package/dist/types/components/pds-combobox/pds-combobox.d.ts +9 -0
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.d.ts +20 -3
- package/dist/types/components/pds-link/pds-link.d.ts +8 -0
- package/dist/types/components/pds-modal/pds-modal-content/pds-modal-content.d.ts +2 -0
- package/dist/types/components/pds-popover/pds-popover.d.ts +87 -21
- package/dist/types/components/pds-radio/pds-radio.d.ts +9 -3
- package/dist/types/components/pds-select/pds-select.d.ts +32 -4
- package/dist/types/components/pds-toast/pds-toast.d.ts +9 -0
- package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +31 -0
- package/dist/types/components.d.ts +139 -18
- package/dist/types/utils/aria-references.d.ts +24 -0
- package/dist/types/utils/tabbable.d.ts +2 -0
- package/dist/types/utils/truncation-tooltip.d.ts +4 -4
- package/dist/types/utils/types.d.ts +1 -0
- package/dist/vscode.html-data.json +129 -14
- package/hydrate/index.js +1040 -416
- package/hydrate/index.mjs +1040 -416
- package/package.json +2 -2
- package/dist/esm-es5/truncation-tooltip-DRXsdKk1.js +0 -1
- package/dist/pine-core/p-049f126a.entry.js +0 -1
- package/dist/pine-core/p-153ba77b.entry.js +0 -1
- package/dist/pine-core/p-208c7dbf.entry.js +0 -1
- package/dist/pine-core/p-258770cf.system.entry.js +0 -1
- package/dist/pine-core/p-2cb5483a.system.entry.js +0 -1
- package/dist/pine-core/p-432d5ec7.entry.js +0 -1
- package/dist/pine-core/p-5442d983.system.entry.js +0 -1
- package/dist/pine-core/p-576cf904.system.entry.js +0 -1
- package/dist/pine-core/p-5c90091e.system.entry.js +0 -1
- package/dist/pine-core/p-602c197f.entry.js +0 -1
- package/dist/pine-core/p-645a482b.system.entry.js +0 -1
- package/dist/pine-core/p-72865997.entry.js +0 -1
- package/dist/pine-core/p-75ee0403.entry.js +0 -1
- package/dist/pine-core/p-7a287635.system.entry.js +0 -1
- package/dist/pine-core/p-7bf6563a.system.entry.js +0 -1
- package/dist/pine-core/p-7fa66cad.entry.js +0 -1
- package/dist/pine-core/p-80a698ae.entry.js +0 -1
- package/dist/pine-core/p-82cf4ec6.entry.js +0 -1
- package/dist/pine-core/p-86040cac.system.entry.js +0 -1
- package/dist/pine-core/p-875b0436.system.entry.js +0 -1
- package/dist/pine-core/p-8cc302aa.system.entry.js +0 -1
- package/dist/pine-core/p-8d292b48.entry.js +0 -1
- package/dist/pine-core/p-92ae6082.entry.js +0 -1
- package/dist/pine-core/p-94593f20.system.entry.js +0 -1
- package/dist/pine-core/p-993d1043.entry.js +0 -1
- package/dist/pine-core/p-99459e27.entry.js +0 -1
- package/dist/pine-core/p-BLG6RDBt.js +0 -1
- package/dist/pine-core/p-BR5nujVX.system.js +0 -1
- package/dist/pine-core/p-CuSNnuFu.system.js +0 -1
- package/dist/pine-core/p-a0960b3d.system.entry.js +0 -1
- package/dist/pine-core/p-a1230a74.system.entry.js +0 -1
- package/dist/pine-core/p-a19cd59c.entry.js +0 -1
- package/dist/pine-core/p-a787b34a.system.entry.js +0 -1
- package/dist/pine-core/p-a826f290.entry.js +0 -1
- package/dist/pine-core/p-aa032a5e.system.entry.js +0 -1
- package/dist/pine-core/p-acce8eb2.entry.js +0 -1
- package/dist/pine-core/p-b69f04b7.entry.js +0 -1
- package/dist/pine-core/p-bb68431a.entry.js +0 -1
- package/dist/pine-core/p-bb73ad66.entry.js +0 -2
- package/dist/pine-core/p-beb23781.entry.js +0 -1
- package/dist/pine-core/p-bf30dec0.entry.js +0 -1
- package/dist/pine-core/p-c36b490e.entry.js +0 -1
- package/dist/pine-core/p-c81d8ac8.entry.js +0 -1
- package/dist/pine-core/p-ca0d48e8.entry.js +0 -1
- package/dist/pine-core/p-cfd012d4.entry.js +0 -1
- package/dist/pine-core/p-e0917a26.entry.js +0 -1
- package/dist/pine-core/p-e836f3ec.system.entry.js +0 -3
- package/dist/pine-core/p-ea4d4741.system.entry.js +0 -1
- package/dist/pine-core/p-f2c253d8.entry.js +0 -1
- package/dist/pine-core/p-f474d7de.entry.js +0 -1
- package/dist/pine-core/p-f77905aa.system.entry.js +0 -1
- package/dist/pine-core/p-qhdoK1Jp.system.js +0 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { hasShadowDom } from "../../utils/utils";
|
|
3
|
+
import { ARIA_REFERENCE_ATTRIBUTES, forwardAriaReferences } from "../../utils/aria-references";
|
|
3
4
|
import { caretDown, addCircle } from "@pine-ds/icons/icons";
|
|
5
|
+
const FORWARDED_ARIA_ATTRIBUTES = ['aria-current', 'aria-expanded', 'aria-haspopup', 'aria-label', 'aria-pressed'];
|
|
4
6
|
/**
|
|
5
7
|
* @part button - Exposes the underlying button (or anchor) element for styling, including custom size, shape, or surface on icon-only placements (e.g. a compact square or inverse icon button).
|
|
6
8
|
* @part button-content - Exposes the button content for styling.
|
|
@@ -57,12 +59,22 @@ export class PdsButton {
|
|
|
57
59
|
this.variant = 'primary';
|
|
58
60
|
this.hasStartContent = false;
|
|
59
61
|
this.hasEndContent = false;
|
|
60
|
-
this.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
this.
|
|
62
|
+
this.forwardedAria = {};
|
|
63
|
+
// Copied rather than moved: frameworks and DOM morphs put host attributes back on every update,
|
|
64
|
+
// so taking them off the host would fight each one.
|
|
65
|
+
this.syncHostAria = () => {
|
|
66
|
+
const forwarded = {};
|
|
67
|
+
FORWARDED_ARIA_ATTRIBUTES.forEach((name) => (forwarded[name] = this.el.getAttribute(name)));
|
|
68
|
+
// A new object always re-renders, and frameworks re-set unchanged attributes on every render of their own.
|
|
69
|
+
if (FORWARDED_ARIA_ATTRIBUTES.some((name) => forwarded[name] !== this.forwardedAria[name])) {
|
|
70
|
+
this.forwardedAria = forwarded;
|
|
71
|
+
}
|
|
72
|
+
this.forwardAriaReferences();
|
|
73
|
+
};
|
|
74
|
+
// A hint added after the button, or replaced by a framework or a DOM morph, is picked up by the
|
|
75
|
+
// time focus reaches the button and it's announced.
|
|
76
|
+
this.handleFocusIn = () => {
|
|
77
|
+
this.forwardAriaReferences();
|
|
66
78
|
};
|
|
67
79
|
this.handleStartSlotChange = (event) => {
|
|
68
80
|
this.hasStartContent = event.target.assignedElements({ flatten: true }).length > 0;
|
|
@@ -99,22 +111,22 @@ export class PdsButton {
|
|
|
99
111
|
};
|
|
100
112
|
}
|
|
101
113
|
connectedCallback() {
|
|
102
|
-
this.
|
|
114
|
+
this.syncHostAria();
|
|
103
115
|
if (typeof MutationObserver === 'undefined')
|
|
104
116
|
return;
|
|
105
|
-
//
|
|
106
|
-
this.
|
|
107
|
-
this.
|
|
108
|
-
attributeFilter:
|
|
117
|
+
// Consumers, popovers and menus set these on the host, often after render, but only the inner element is announced.
|
|
118
|
+
this.hostAriaObserver = new MutationObserver(this.syncHostAria);
|
|
119
|
+
this.hostAriaObserver.observe(this.el, {
|
|
120
|
+
attributeFilter: FORWARDED_ARIA_ATTRIBUTES.concat(ARIA_REFERENCE_ATTRIBUTES),
|
|
109
121
|
});
|
|
110
122
|
}
|
|
111
123
|
disconnectedCallback() {
|
|
112
124
|
var _a;
|
|
113
|
-
(_a = this.
|
|
114
|
-
this.
|
|
125
|
+
(_a = this.hostAriaObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
126
|
+
this.hostAriaObserver = undefined;
|
|
115
127
|
}
|
|
116
128
|
componentDidRender() {
|
|
117
|
-
this.
|
|
129
|
+
this.forwardAriaReferences();
|
|
118
130
|
}
|
|
119
131
|
/**
|
|
120
132
|
* Listen for Enter key presses on form inputs to trigger submit
|
|
@@ -165,25 +177,9 @@ export class PdsButton {
|
|
|
165
177
|
}
|
|
166
178
|
}
|
|
167
179
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (!this.contentEl || !('ariaControlsElements' in this.contentEl))
|
|
172
|
-
return;
|
|
173
|
-
const ids = (_b = (_a = this.el.getAttribute('aria-controls')) === null || _a === void 0 ? void 0 : _a.split(/\s+/).filter(Boolean)) !== null && _b !== void 0 ? _b : [];
|
|
174
|
-
const controlled = ids.map((id) => this.findInAncestorRoots(id)).filter((el) => el !== null);
|
|
175
|
-
this.contentEl.ariaControlsElements = controlled.length > 0 ? controlled : null;
|
|
176
|
-
}
|
|
177
|
-
// A trigger inside another component's shadow root still controls a popover portal on document.body.
|
|
178
|
-
findInAncestorRoots(id) {
|
|
179
|
-
let root = this.el.getRootNode();
|
|
180
|
-
while (root instanceof ShadowRoot) {
|
|
181
|
-
const found = root.getElementById(id);
|
|
182
|
-
if (found)
|
|
183
|
-
return found;
|
|
184
|
-
root = root.host.getRootNode();
|
|
185
|
-
}
|
|
186
|
-
return root instanceof Document ? root.getElementById(id) : null;
|
|
180
|
+
forwardAriaReferences() {
|
|
181
|
+
if (this.contentEl)
|
|
182
|
+
forwardAriaReferences(this.el, this.contentEl);
|
|
187
183
|
}
|
|
188
184
|
classNames() {
|
|
189
185
|
const classNames = ['pds-button'];
|
|
@@ -229,16 +225,13 @@ export class PdsButton {
|
|
|
229
225
|
}
|
|
230
226
|
render() {
|
|
231
227
|
// Common props for both button and anchor elements
|
|
232
|
-
const commonProps = {
|
|
233
|
-
'aria-expanded': this.triggerExpanded,
|
|
234
|
-
'aria-haspopup': this.triggerHasPopup,
|
|
235
|
-
class: this.classNames(),
|
|
236
|
-
part: 'button',
|
|
237
|
-
ref: (el) => (this.contentEl = el),
|
|
238
|
-
};
|
|
228
|
+
const commonProps = Object.assign(Object.assign({}, this.forwardedAria), { class: this.classNames(), part: 'button', ref: (el) => (this.contentEl = el) });
|
|
239
229
|
const attributes = () => {
|
|
240
230
|
if (this.href) {
|
|
241
|
-
return Object.assign(Object.assign({}, commonProps), {
|
|
231
|
+
return Object.assign(Object.assign({}, commonProps), {
|
|
232
|
+
// ARIA allows aria-pressed only on buttons, so a link never gets it.
|
|
233
|
+
'aria-pressed': null, download: this.download, href: this.disabled ? null : this.href, target: this.target
|
|
234
|
+
});
|
|
242
235
|
}
|
|
243
236
|
return Object.assign(Object.assign({}, commonProps), { 'aria-busy': this.loading ? 'true' : null, 'aria-live': this.loading ? 'polite' : null, 'disabled': this.disabled, 'name': this.name, 'type': this.type, 'value': this.value });
|
|
244
237
|
};
|
|
@@ -246,7 +239,7 @@ export class PdsButton {
|
|
|
246
239
|
// Hide text when loading or iconOnly is true
|
|
247
240
|
const hideText = this.loading || this.iconOnly;
|
|
248
241
|
const content = (h("div", { class: "pds-button__content", part: "button-content" }, this.renderStartContent(), h("span", { class: `pds-button__text ${hideText ? 'pds-button__text--hidden' : ''}`, part: "button-text" }, h("slot", null)), this.loading && (h("span", { class: "pds-button__loader" }, h("pds-loader", { "is-loading": true, size: "var(--pine-font-size-body-2xl)", variant: "spinner", exportparts: "loader-svg" }, "Loading..."))), this.renderEndContent()));
|
|
249
|
-
return (h(Host, Object.assign({ "aria-disabled": this.disabled ? 'true' : null }, (this.componentId != null ? { id: this.componentId } : {}), { onClick: this.handleClick, variant: this.variant }), h(ContentElement, Object.assign({}, attributes()), content)));
|
|
242
|
+
return (h(Host, Object.assign({ "aria-disabled": this.disabled ? 'true' : null }, (this.componentId != null ? { id: this.componentId } : {}), { onClick: this.handleClick, onFocusin: this.handleFocusIn, variant: this.variant }), h(ContentElement, Object.assign({}, attributes()), content)));
|
|
250
243
|
}
|
|
251
244
|
static get is() { return "pds-button"; }
|
|
252
245
|
static get encapsulation() { return "shadow"; }
|
|
@@ -567,8 +560,7 @@ export class PdsButton {
|
|
|
567
560
|
return {
|
|
568
561
|
"hasStartContent": {},
|
|
569
562
|
"hasEndContent": {},
|
|
570
|
-
"
|
|
571
|
-
"triggerHasPopup": {}
|
|
563
|
+
"forwardedAria": {}
|
|
572
564
|
};
|
|
573
565
|
}
|
|
574
566
|
static get events() {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
import { customArgsWithIconControl } from '../../../stories/_helpers';
|
|
@@ -31,6 +32,7 @@ export default {
|
|
|
31
32
|
|
|
32
33
|
const BaseTemplate = (args) => html`
|
|
33
34
|
<pds-button
|
|
35
|
+
aria-label=${ifDefined(args.ariaLabel)}
|
|
34
36
|
component-id=${args.componentId}
|
|
35
37
|
?disabled=${args.disabled}
|
|
36
38
|
?full-width=${args.fullWidth}
|
|
@@ -135,14 +137,12 @@ Disclosure.parameters = {
|
|
|
135
137
|
|
|
136
138
|
export const IconOnly = BaseTemplate.bind();
|
|
137
139
|
IconOnly.args = {
|
|
140
|
+
ariaLabel: 'Favorite',
|
|
138
141
|
disabled: false,
|
|
139
142
|
fullWidth: false,
|
|
140
143
|
icon: 'favorite',
|
|
141
144
|
iconOnly: true,
|
|
142
145
|
loading: false,
|
|
143
|
-
slot: {
|
|
144
|
-
default: 'Icon Only',
|
|
145
|
-
},
|
|
146
146
|
type: 'button',
|
|
147
147
|
variant: 'secondary',
|
|
148
148
|
};
|
|
@@ -155,4 +155,83 @@ label {
|
|
|
155
155
|
}
|
|
156
156
|
.pds-checkbox__message--error pds-icon {
|
|
157
157
|
margin-block-start: var(--pine-dimension-025);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
:host(.pds-checkbox--pill) {
|
|
161
|
+
position: relative;
|
|
162
|
+
}
|
|
163
|
+
:host(.pds-checkbox--pill) label {
|
|
164
|
+
align-items: center;
|
|
165
|
+
background: var(--pine-color-background-container);
|
|
166
|
+
border: var(--pine-border);
|
|
167
|
+
border-radius: var(--pine-border-radius-full);
|
|
168
|
+
box-sizing: border-box;
|
|
169
|
+
color: var(--pine-color-text-active);
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
font: var(--pine-typography-body);
|
|
172
|
+
min-block-size: var(--pine-dimension-xl);
|
|
173
|
+
padding: 0 var(--pine-dimension-sm);
|
|
174
|
+
transition: border-color var(--pine-motion-duration-fast) ease;
|
|
175
|
+
}
|
|
176
|
+
:host(.pds-checkbox--pill) label span {
|
|
177
|
+
min-width: 0;
|
|
178
|
+
overflow-wrap: anywhere;
|
|
179
|
+
}
|
|
180
|
+
:host(.pds-checkbox--pill) label:hover {
|
|
181
|
+
border-color: var(--pine-color-text);
|
|
182
|
+
}
|
|
183
|
+
:host(.pds-checkbox--pill) label:has(input:checked) {
|
|
184
|
+
border-color: var(--pine-color-text-active);
|
|
185
|
+
box-shadow: inset 0 0 0 var(--pine-border-width) var(--pine-color-text-active);
|
|
186
|
+
}
|
|
187
|
+
:host(.pds-checkbox--pill) label:has(input:focus-visible) {
|
|
188
|
+
outline: var(--pine-outline-focus);
|
|
189
|
+
outline-offset: var(--pine-border-width-thick);
|
|
190
|
+
}
|
|
191
|
+
:host(.pds-checkbox--pill) label:has(input:disabled) {
|
|
192
|
+
background: var(--pine-color-background-container-disabled);
|
|
193
|
+
border-color: var(--pine-color-border-disabled);
|
|
194
|
+
color: var(--pine-color-text-disabled);
|
|
195
|
+
cursor: not-allowed;
|
|
196
|
+
}
|
|
197
|
+
:host(.pds-checkbox--pill) label:has(input:disabled:checked) {
|
|
198
|
+
border-color: var(--pine-color-text-disabled);
|
|
199
|
+
box-shadow: inset 0 0 0 var(--pine-border-width) var(--pine-color-text-disabled);
|
|
200
|
+
}
|
|
201
|
+
@media (forced-colors: active) {
|
|
202
|
+
:host(.pds-checkbox--pill) label:has(input:disabled) {
|
|
203
|
+
border-color: GrayText;
|
|
204
|
+
}
|
|
205
|
+
:host(.pds-checkbox--pill) label:has(input:checked) {
|
|
206
|
+
border-color: Highlight;
|
|
207
|
+
border-width: var(--pine-border-width-thick);
|
|
208
|
+
padding-inline: calc(var(--pine-dimension-sm) - (var(--pine-border-width-thick) - var(--pine-border-width)));
|
|
209
|
+
}
|
|
210
|
+
:host(.pds-checkbox--pill) label:has(input:disabled:checked) {
|
|
211
|
+
border-color: GrayText;
|
|
212
|
+
border-width: var(--pine-border-width-thick);
|
|
213
|
+
padding-inline: calc(var(--pine-dimension-sm) - (var(--pine-border-width-thick) - var(--pine-border-width)));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
:host(.pds-checkbox--pill) .pds-checkbox__message {
|
|
217
|
+
margin-inline-start: 0;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:host(.pds-checkbox--pill.is-invalid:not(.is-disabled)) label {
|
|
221
|
+
border-color: var(--pine-color-border-danger);
|
|
222
|
+
color: var(--pine-color-text-active);
|
|
223
|
+
}
|
|
224
|
+
:host(.pds-checkbox--pill.is-invalid:not(.is-disabled)) label:has(input:checked) {
|
|
225
|
+
border-color: var(--pine-color-border-danger);
|
|
226
|
+
box-shadow: inset 0 0 0 var(--pine-border-width) var(--pine-color-border-danger);
|
|
227
|
+
}
|
|
228
|
+
:host(.pds-checkbox--pill.is-invalid:not(.is-disabled)) label:has(input:focus-visible) {
|
|
229
|
+
outline: var(--pine-outline-focus-danger);
|
|
230
|
+
}
|
|
231
|
+
@media (forced-colors: active) {
|
|
232
|
+
:host(.pds-checkbox--pill.is-invalid:not(.is-disabled)) label:has(input:checked) {
|
|
233
|
+
border-color: Highlight;
|
|
234
|
+
border-width: var(--pine-border-width-thick);
|
|
235
|
+
padding-inline: calc(var(--pine-dimension-sm) - (var(--pine-border-width-thick) - var(--pine-border-width)));
|
|
236
|
+
}
|
|
158
237
|
}
|
|
@@ -15,6 +15,11 @@ export class PdsCheckbox {
|
|
|
15
15
|
* It determines whether or not the checkbox is checked.
|
|
16
16
|
*/
|
|
17
17
|
this.checked = false;
|
|
18
|
+
/**
|
|
19
|
+
* Sets the style variant of the checkbox. `pill` renders the label as a pill-shaped choice; the native input still handles keyboard, form, and screen reader behavior.
|
|
20
|
+
* @defaultValue default
|
|
21
|
+
*/
|
|
22
|
+
this.variant = 'default';
|
|
18
23
|
this.handleCheckboxChange = (e) => {
|
|
19
24
|
if (this.disabled) {
|
|
20
25
|
return;
|
|
@@ -54,6 +59,9 @@ export class PdsCheckbox {
|
|
|
54
59
|
if (this.hasLabelSlot) {
|
|
55
60
|
classNames.push('has-label-slot');
|
|
56
61
|
}
|
|
62
|
+
if (this.variant === 'pill') {
|
|
63
|
+
classNames.push('pds-checkbox--pill');
|
|
64
|
+
}
|
|
57
65
|
return classNames.join(' ');
|
|
58
66
|
}
|
|
59
67
|
connectedCallback() {
|
|
@@ -116,9 +124,9 @@ export class PdsCheckbox {
|
|
|
116
124
|
render() {
|
|
117
125
|
const hostClass = this.classNames();
|
|
118
126
|
this.hostKeeper.record(hostClass);
|
|
119
|
-
return (h(Host, { key: '
|
|
120
|
-
h("div", { key: '
|
|
121
|
-
h("div", { key: '
|
|
127
|
+
return (h(Host, { key: '8e9185653796f250ad425350b9adc1f65fd047c1', class: hostClass }, h("label", { key: 'e17bab4b96b4ffc716e311ecea488a3025e1551c', htmlFor: this.componentId }, h("input", Object.assign({ key: '8af9bbc3dbe18409532e95b4b490eab4aabc8762', type: "checkbox", "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage, this.errorMessage), "aria-invalid": this.invalid ? "true" : undefined, id: this.componentId, indeterminate: this.indeterminate, name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onChange: this.handleCheckboxChange, onInput: this.handleInput, class: this.variant === 'pill' ? 'visually-hidden' : undefined }, this.inheritedAttributes)), h("span", { key: '1e4d9a826b6b5ec429ae47096d4aede3af43d110', class: this.hideLabel && this.variant !== 'pill' ? 'visually-hidden' : '' }, h("slot", { key: '7b10c7d1e018be4afe019cb56e82a5ec7a638de8', name: "label", onSlotchange: this.updateHasLabelSlot }), !this.hasLabelSlot && this.label)), this.helperMessage &&
|
|
128
|
+
h("div", { key: 'c5455322eb07bf73805a17c28bf6acc1b5384337', class: 'pds-checkbox__message', id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
|
|
129
|
+
h("div", { key: '0f7c8ec00362c31b1c5bd11c185c6e7bfc177f22', class: `pds-checkbox__message pds-checkbox__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: 'f6eccfaac90505903aee379f2fc28b5735d8c4a9', "aria-hidden": "true", icon: danger, size: "small" }), this.errorMessage)));
|
|
122
130
|
}
|
|
123
131
|
static get is() { return "pds-checkbox"; }
|
|
124
132
|
static get encapsulation() { return "shadow"; }
|
|
@@ -243,7 +251,7 @@ export class PdsCheckbox {
|
|
|
243
251
|
"optional": false,
|
|
244
252
|
"docs": {
|
|
245
253
|
"tags": [],
|
|
246
|
-
"text": "If `true`, the checkbox will visually appear as indeterminate.\nOnly JavaScript can set the objects `indeterminate` property. See [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes)
|
|
254
|
+
"text": "If `true`, the checkbox will visually appear as indeterminate.\nOnly JavaScript can set the objects `indeterminate` property. See [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes).\nHas no visual style when `variant` is `pill`."
|
|
247
255
|
},
|
|
248
256
|
"getter": false,
|
|
249
257
|
"setter": false,
|
|
@@ -300,7 +308,7 @@ export class PdsCheckbox {
|
|
|
300
308
|
"optional": false,
|
|
301
309
|
"docs": {
|
|
302
310
|
"tags": [],
|
|
303
|
-
"text": "Visually hides the label text for instances where only the checkbox should be displayed. Label remains accessible to assistive technology such as screen readers."
|
|
311
|
+
"text": "Visually hides the label text for instances where only the checkbox should be displayed. Label remains accessible to assistive technology such as screen readers. Ignored when `variant` is `pill`."
|
|
304
312
|
},
|
|
305
313
|
"getter": false,
|
|
306
314
|
"setter": false,
|
|
@@ -363,6 +371,29 @@ export class PdsCheckbox {
|
|
|
363
371
|
"setter": false,
|
|
364
372
|
"reflect": false,
|
|
365
373
|
"attribute": "value"
|
|
374
|
+
},
|
|
375
|
+
"variant": {
|
|
376
|
+
"type": "string",
|
|
377
|
+
"mutable": false,
|
|
378
|
+
"complexType": {
|
|
379
|
+
"original": "'default' | 'pill'",
|
|
380
|
+
"resolved": "\"default\" | \"pill\"",
|
|
381
|
+
"references": {}
|
|
382
|
+
},
|
|
383
|
+
"required": false,
|
|
384
|
+
"optional": false,
|
|
385
|
+
"docs": {
|
|
386
|
+
"tags": [{
|
|
387
|
+
"name": "defaultValue",
|
|
388
|
+
"text": "default"
|
|
389
|
+
}],
|
|
390
|
+
"text": "Sets the style variant of the checkbox. `pill` renders the label as a pill-shaped choice; the native input still handles keyboard, form, and screen reader behavior."
|
|
391
|
+
},
|
|
392
|
+
"getter": false,
|
|
393
|
+
"setter": false,
|
|
394
|
+
"reflect": false,
|
|
395
|
+
"attribute": "variant",
|
|
396
|
+
"defaultValue": "'default'"
|
|
366
397
|
}
|
|
367
398
|
};
|
|
368
399
|
}
|
|
@@ -8,6 +8,13 @@ export default {
|
|
|
8
8
|
invalid: false,
|
|
9
9
|
hideLabel: false,
|
|
10
10
|
required: false,
|
|
11
|
+
variant: 'default',
|
|
12
|
+
},
|
|
13
|
+
argTypes: {
|
|
14
|
+
variant: {
|
|
15
|
+
control: { type: 'select' },
|
|
16
|
+
options: ['default', 'pill'],
|
|
17
|
+
},
|
|
11
18
|
},
|
|
12
19
|
component: 'pds-checkbox',
|
|
13
20
|
parameters: {},
|
|
@@ -28,6 +35,7 @@ const BaseTemplate = (args) =>
|
|
|
28
35
|
name=${args.name}
|
|
29
36
|
?required=${args.required}
|
|
30
37
|
value=${args.value}
|
|
38
|
+
variant=${args.variant}
|
|
31
39
|
/>`;
|
|
32
40
|
|
|
33
41
|
export const Default = BaseTemplate.bind();
|
|
@@ -72,3 +80,33 @@ Invalid.args = {
|
|
|
72
80
|
label: 'Label text',
|
|
73
81
|
invalid: true,
|
|
74
82
|
};
|
|
83
|
+
|
|
84
|
+
export const Pill = BaseTemplate.bind();
|
|
85
|
+
Pill.args = {
|
|
86
|
+
componentId: 'pill',
|
|
87
|
+
label: 'Label text',
|
|
88
|
+
variant: 'pill',
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const PillGroupTemplate = (args) =>
|
|
92
|
+
html`<fieldset style="border: 0; margin: 0; padding: 0;">
|
|
93
|
+
<legend style="font: var(--pine-typography-body-medium); margin-block-end: var(--pine-dimension-xs); padding: 0;">Send to</legend>
|
|
94
|
+
<pds-box wrap gap="xs">
|
|
95
|
+
<pds-checkbox component-id="pill-email" name="channels" value="email" label="Email" variant="pill" checked ?disabled=${args.disabled} ?invalid=${args.invalid}></pds-checkbox>
|
|
96
|
+
<pds-checkbox component-id="pill-sms" name="channels" value="sms" label="SMS" variant="pill" ?disabled=${args.disabled} ?invalid=${args.invalid}></pds-checkbox>
|
|
97
|
+
<pds-checkbox component-id="pill-push" name="channels" value="push" label="Push notification" variant="pill" ?disabled=${args.disabled} ?invalid=${args.invalid}></pds-checkbox>
|
|
98
|
+
</pds-box>
|
|
99
|
+
</fieldset>`;
|
|
100
|
+
|
|
101
|
+
export const PillGroup = PillGroupTemplate.bind();
|
|
102
|
+
PillGroup.args = {};
|
|
103
|
+
|
|
104
|
+
export const PillDisabled = PillGroupTemplate.bind();
|
|
105
|
+
PillDisabled.args = {
|
|
106
|
+
disabled: true,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const PillInvalid = PillGroupTemplate.bind();
|
|
110
|
+
PillInvalid.args = {
|
|
111
|
+
invalid: true,
|
|
112
|
+
};
|
|
@@ -234,13 +234,13 @@ export class PdsChip {
|
|
|
234
234
|
'aria-label': this.dismissLabel,
|
|
235
235
|
};
|
|
236
236
|
};
|
|
237
|
-
return (h(CloseElement, Object.assign({}, closeAttributes(), { onClick: this.handleCloseClick }), h("pds-icon", { icon: remove, size: this.iconSize })));
|
|
237
|
+
return (h(CloseElement, Object.assign({}, closeAttributes(), { onClick: this.handleCloseClick }), h("pds-icon", { icon: remove, size: this.iconSize, "aria-hidden": "true" })));
|
|
238
238
|
}
|
|
239
239
|
render() {
|
|
240
240
|
const hostClass = this.classNames();
|
|
241
241
|
const hostStyles = this.hostStyles;
|
|
242
242
|
this.hostKeeper.record(hostClass, hostStyles);
|
|
243
|
-
return (h(Host, { key: '
|
|
243
|
+
return (h(Host, { key: '0e67ea3700e8a8e1ad3049b6eafced6934262335', class: hostClass, id: this.componentId, style: hostStyles }, this.setChipContent(), this.effectiveVariant === 'tag' && this.renderCloseButton()));
|
|
244
244
|
}
|
|
245
245
|
static get is() { return "pds-chip"; }
|
|
246
246
|
static get encapsulation() { return "shadow"; }
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
display: block;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
:host([truncate]) {
|
|
6
|
+
display: block;
|
|
7
|
+
min-width: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
:host([aria-disabled=true]) .pds-combobox__input-icon {
|
|
6
11
|
color: var(--pine-color-text-disabled);
|
|
7
12
|
pointer-events: none;
|
|
@@ -184,6 +189,14 @@
|
|
|
184
189
|
flex-shrink: 0;
|
|
185
190
|
}
|
|
186
191
|
|
|
192
|
+
.pds-combobox__listbox--truncate .pds-combobox__option-label {
|
|
193
|
+
flex: 1 1 auto;
|
|
194
|
+
overflow-wrap: normal;
|
|
195
|
+
}
|
|
196
|
+
.pds-combobox__listbox--truncate .pds-combobox__option-check {
|
|
197
|
+
flex-shrink: 0;
|
|
198
|
+
}
|
|
199
|
+
|
|
187
200
|
.pds-combobox__option-check {
|
|
188
201
|
color: currentColor;
|
|
189
202
|
font-size: var(--pine-dimension-150);
|
|
@@ -530,6 +543,26 @@
|
|
|
530
543
|
flex-shrink: 0;
|
|
531
544
|
}
|
|
532
545
|
|
|
546
|
+
.pds-combobox__button-trigger--truncate {
|
|
547
|
+
max-width: 100%;
|
|
548
|
+
}
|
|
549
|
+
.pds-combobox__button-trigger--truncate .pds-combobox__button-trigger-label {
|
|
550
|
+
overflow-wrap: normal;
|
|
551
|
+
}
|
|
552
|
+
.pds-combobox__button-trigger--truncate .pds-combobox__button-trigger-chevron {
|
|
553
|
+
flex-shrink: 0;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.pds-combobox__button-trigger-text,
|
|
557
|
+
.pds-combobox__listbox--truncate .pds-combobox__option-text {
|
|
558
|
+
display: block;
|
|
559
|
+
flex: 1 1 auto;
|
|
560
|
+
min-width: 0;
|
|
561
|
+
overflow: hidden;
|
|
562
|
+
text-overflow: ellipsis;
|
|
563
|
+
white-space: nowrap;
|
|
564
|
+
}
|
|
565
|
+
|
|
533
566
|
.pds-combobox__button-trigger--input-shape {
|
|
534
567
|
border-radius: var(--pine-dimension-125);
|
|
535
568
|
font: var(--pine-typography-body);
|
|
@@ -140,6 +140,13 @@ export class PdsCombobox {
|
|
|
140
140
|
* @default 'pill'
|
|
141
141
|
*/
|
|
142
142
|
this.triggerShape = 'pill';
|
|
143
|
+
/**
|
|
144
|
+
* Determines whether the button trigger's label and the option labels should truncate and display with an ellipsis.
|
|
145
|
+
* When a label overflows, a `title` showing the full label will appear on hover.
|
|
146
|
+
* Chip options, custom layouts and group rows aren't affected.
|
|
147
|
+
* @defaultValue false
|
|
148
|
+
*/
|
|
149
|
+
this.truncate = false;
|
|
143
150
|
/**
|
|
144
151
|
* The sentiment for the chip trigger. Matches Pine chip sentiments.
|
|
145
152
|
* @default 'neutral'
|
|
@@ -436,10 +443,15 @@ export class PdsCombobox {
|
|
|
436
443
|
if (this.usesPanelSearch)
|
|
437
444
|
this.restoreFocusToTrigger();
|
|
438
445
|
};
|
|
446
|
+
this.onButtonTriggerMouseEnter = (event) => {
|
|
447
|
+
this.syncTitle(event.currentTarget, '.pds-combobox__button-trigger-text');
|
|
448
|
+
};
|
|
439
449
|
// Event handler for mouse enter on option
|
|
440
450
|
this.onOptionMouseEnter = (event) => {
|
|
441
|
-
const
|
|
442
|
-
this.
|
|
451
|
+
const row = event.currentTarget;
|
|
452
|
+
if (this.truncate)
|
|
453
|
+
this.syncTitle(row, '.pds-combobox__option-text');
|
|
454
|
+
this.highlightedIndex = Number(row.getAttribute('data-option-index'));
|
|
443
455
|
this.keyboardNavigating = false;
|
|
444
456
|
};
|
|
445
457
|
this.onGroupRowMouseEnter = (event) => {
|
|
@@ -729,6 +741,19 @@ export class PdsCombobox {
|
|
|
729
741
|
this.focusPanel(panelFocusEl);
|
|
730
742
|
}
|
|
731
743
|
}
|
|
744
|
+
// A `title` only while the text is cut, measured on hover. On the span, not the option or trigger,
|
|
745
|
+
// so it isn't read again as their description.
|
|
746
|
+
syncTitle(el, selector) {
|
|
747
|
+
const text = el.querySelector(selector);
|
|
748
|
+
if (!text)
|
|
749
|
+
return;
|
|
750
|
+
if (text.scrollWidth > text.clientWidth) {
|
|
751
|
+
text.title = text.textContent || '';
|
|
752
|
+
}
|
|
753
|
+
else {
|
|
754
|
+
text.removeAttribute('title');
|
|
755
|
+
}
|
|
756
|
+
}
|
|
732
757
|
/**
|
|
733
758
|
* Scrolls just enough to show `el`, as `scrollIntoView({ block: 'nearest' })` does. In the drill-in
|
|
734
759
|
* panel it scrolls the list alone, and never sideways: while a drill-in slide offsets a row past
|
|
@@ -2131,6 +2156,7 @@ export class PdsCombobox {
|
|
|
2131
2156
|
'pds-combobox__listbox--drill-in': this.drillDirection === 'in',
|
|
2132
2157
|
'pds-combobox__listbox--drill-out': this.drillDirection === 'out',
|
|
2133
2158
|
'pds-combobox__listbox--pointer-hover': this.pointerCanHover,
|
|
2159
|
+
'pds-combobox__listbox--truncate': this.truncate,
|
|
2134
2160
|
}, onAnimationEnd: this.onDrillAnimationEnd, onPointerMove: this.onPanelPointer, onPointerDown: this.onPanelPointer, role: this.showsGroupedPanel ? 'tree' : 'listbox', id: this.listboxId, "aria-label": this.label || 'Options', "aria-multiselectable": "false",
|
|
2135
2161
|
// Focusable but out of the tab order with panel search, so it can take focus when a
|
|
2136
2162
|
// drilled-in group hides the field. Dropping it while focused would blur the list and close.
|
|
@@ -2297,14 +2323,15 @@ export class PdsCombobox {
|
|
|
2297
2323
|
'pds-combobox__option--layout': isLayout,
|
|
2298
2324
|
'pds-combobox__option--chip': isChip,
|
|
2299
2325
|
'pds-combobox__option--disabled': isDisabled,
|
|
2300
|
-
}, "data-option-index": index, onMouseDown: this.onOptionMouseDown, onClick: this.onOptionClick, onMouseEnter: this.onOptionMouseEnter, onKeyDown: this.onOptionKeyDown }, isLayout ? (h("pds-box", { class: "pds-combobox__option-layout-wrapper", innerHTML: this.getOptionLayoutContent(option) })) : isChip ? (this.renderOptionChip(option)) : (this.renderOptionLabel(option)), isSelected && h("pds-icon", { icon: "check", size: "regular", class: "pds-combobox__option-check" })));
|
|
2326
|
+
}, "data-option-index": index, onMouseDown: this.onOptionMouseDown, onClick: this.onOptionClick, onMouseEnter: this.onOptionMouseEnter, onKeyDown: this.onOptionKeyDown }, isLayout ? (h("pds-box", { class: "pds-combobox__option-layout-wrapper", innerHTML: this.getOptionLayoutContent(option) })) : isChip ? (this.renderOptionChip(option)) : (this.renderOptionLabel(option)), isSelected && h("pds-icon", { icon: "check", size: "regular", "aria-hidden": "true", class: "pds-combobox__option-check" })));
|
|
2301
2327
|
}
|
|
2302
2328
|
/** An option's text, after its `data-icon` when it has one. */
|
|
2303
2329
|
renderOptionLabel(option) {
|
|
2304
2330
|
const icon = optionIconOf(option);
|
|
2331
|
+
const label = this.truncate ? (h("span", { key: this.getOptionLabel(option), class: "pds-combobox__option-text" }, this.getOptionLabel(option))) : this.getOptionLabel(option);
|
|
2305
2332
|
if (icon === null)
|
|
2306
|
-
return
|
|
2307
|
-
return (h("span", { class: "pds-combobox__option-label" }, h("pds-icon", { name: icon, size: "regular", "aria-hidden": "true", class: "pds-combobox__option-icon" }),
|
|
2333
|
+
return label;
|
|
2334
|
+
return (h("span", { class: "pds-combobox__option-label" }, h("pds-icon", { name: icon, size: "regular", "aria-hidden": "true", class: "pds-combobox__option-icon" }), label));
|
|
2308
2335
|
}
|
|
2309
2336
|
/** The grouped panel's rows, in the order the panel draws them and the keyboard moves through. */
|
|
2310
2337
|
panelEntries() {
|
|
@@ -2392,7 +2419,9 @@ export class PdsCombobox {
|
|
|
2392
2419
|
'pds-combobox__button-trigger-label--with-icon': icon !== null,
|
|
2393
2420
|
} }, icon !== null && (
|
|
2394
2421
|
// `name`, not `icon`: `icon` also loads URLs and data: SVGs, unsanitized.
|
|
2395
|
-
h("pds-icon", { name: icon, size: "regular", "aria-hidden": "true", class: "pds-combobox__button-trigger-icon" })), this.
|
|
2422
|
+
h("pds-icon", { name: icon, size: "regular", "aria-hidden": "true", class: "pds-combobox__button-trigger-icon" })), this.truncate ? (
|
|
2423
|
+
// Keyed so a new label drops a stale `title`.
|
|
2424
|
+
h("span", { key: this.selectedLabel || this.placeholder, class: "pds-combobox__button-trigger-text" }, this.selectedLabel || this.placeholder)) : (this.selectedLabel || this.placeholder)));
|
|
2396
2425
|
}
|
|
2397
2426
|
/** The selection's icon for the button trigger: the option's own, or else its group's. */
|
|
2398
2427
|
get selectedIcon() {
|
|
@@ -2496,7 +2525,7 @@ export class PdsCombobox {
|
|
|
2496
2525
|
}
|
|
2497
2526
|
// Helper method to render chip trigger default content
|
|
2498
2527
|
renderChipTriggerDefaultContent() {
|
|
2499
|
-
return (h("span", { class: "pds-combobox__chip-trigger-label" }, this.selectedChipIcon && h("pds-icon", { icon: this.selectedChipIcon, class: "pds-combobox__chip-trigger-icon" }), this.selectedLabel || this.placeholder));
|
|
2528
|
+
return (h("span", { class: "pds-combobox__chip-trigger-label" }, this.selectedChipIcon && h("pds-icon", { icon: this.selectedChipIcon, "aria-hidden": "true", class: "pds-combobox__chip-trigger-icon" }), this.selectedLabel || this.placeholder));
|
|
2500
2529
|
}
|
|
2501
2530
|
// Helper method to render option as chip (new automatic approach)
|
|
2502
2531
|
renderOptionChip(option) {
|
|
@@ -2524,16 +2553,17 @@ export class PdsCombobox {
|
|
|
2524
2553
|
'pds-combobox__button-trigger',
|
|
2525
2554
|
`pds-combobox__button-trigger--${this.triggerVariant}`,
|
|
2526
2555
|
this.triggerShape === 'input' && 'pds-combobox__button-trigger--input-shape',
|
|
2556
|
+
this.truncate && 'pds-combobox__button-trigger--truncate',
|
|
2527
2557
|
]
|
|
2528
2558
|
.filter(Boolean)
|
|
2529
2559
|
.join(' ');
|
|
2530
|
-
return (h(Host, { key: '
|
|
2560
|
+
return (h(Host, { key: '2786062989bc490e87ea382b5c80f7e2758c1a8a', "aria-disabled": this.disabled ? 'true' : null }, h("div", { key: 'b3b272a99528d725a52d3092a3650efacaf54b34', class: "pds-combobox", tabIndex: -1, onFocusout: this.onComboboxFocusOut, part: "combobox" }, this.hasVisibleLabel && (h("label", { key: '8e2e0021e1f60cddfe41b918406c7d76659fbff1', htmlFor: this.trigger === 'input' ? this.componentId : undefined, id: this.labelId, class: "pds-combobox__label", onClick: this.onLabelClick }, this.label)), this.trigger === 'input' ? (h("div", { class: "pds-combobox__input-wrapper", style: { width: this.triggerWidth } }, h("input", { ref: el => {
|
|
2531
2561
|
this.inputEl = el;
|
|
2532
2562
|
this.triggerEl = el;
|
|
2533
2563
|
}, class: {
|
|
2534
2564
|
'pds-combobox__input': true,
|
|
2535
2565
|
'pds-combobox__input--invalid': this.isInvalid(),
|
|
2536
|
-
}, type: "text", role: "combobox", "aria-autocomplete": "list", "aria-haspopup": this.inputPopupRole === 'tree' ? 'tree' : undefined, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.hideLabel ? this.label : undefined, id: this.componentId, value: this.displayText, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, onClick: this.handleInputClick, onKeyDown: this.handleKeyDown, autocomplete: "off", part: "input" }), h("pds-icon", { icon: "enlarge", "aria-hidden": "true", class: "pds-combobox__input-icon" }))) : this.trigger === 'chip' ? (h("div", { class: this.getChipTriggerClass(), style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "chip-trigger" }, this.renderChipTriggerContent())) : (h("div", { class: triggerClass, style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "button-trigger" }, this.renderButtonTriggerContent())), this.renderMessages(), h("div", { key: '
|
|
2566
|
+
}, type: "text", role: "combobox", "aria-autocomplete": "list", "aria-haspopup": this.inputPopupRole === 'tree' ? 'tree' : undefined, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.hideLabel ? this.label : undefined, id: this.componentId, value: this.displayText, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, onClick: this.handleInputClick, onKeyDown: this.handleKeyDown, autocomplete: "off", part: "input" }), h("pds-icon", { icon: "enlarge", "aria-hidden": "true", class: "pds-combobox__input-icon" }))) : this.trigger === 'chip' ? (h("div", { class: this.getChipTriggerClass(), style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "chip-trigger" }, this.renderChipTriggerContent())) : (h("div", { class: triggerClass, style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, onMouseEnter: this.truncate ? this.onButtonTriggerMouseEnter : undefined, ref: el => (this.triggerEl = el), part: "button-trigger" }, this.renderButtonTriggerContent())), this.renderMessages(), h("div", { key: '2216779564fa3f4efd1b4d0972ac045fa0851078', style: { display: 'none' } }, h("slot", { key: '77b344d7301193f435949cbe2be2b28e1d7f6602', onSlotchange: () => this.updateOptions() })), this.renderDropdown(), this.groupDisplay !== 'inline' && [
|
|
2537
2567
|
h("span", { key: "drill-status", class: "visually-hidden", role: "status", "aria-live": "polite" }, this.isOpen && this.effectiveGroupDisplay === 'drill-in' && this.openGroup !== null ? this.openGroup.label : ''),
|
|
2538
2568
|
// Its own region: sharing one, revealing a row then opening it would leave the text the
|
|
2539
2569
|
// same, and opening the group would go unannounced.
|
|
@@ -3161,6 +3191,29 @@ export class PdsCombobox {
|
|
|
3161
3191
|
"attribute": "trigger-shape",
|
|
3162
3192
|
"defaultValue": "'pill'"
|
|
3163
3193
|
},
|
|
3194
|
+
"truncate": {
|
|
3195
|
+
"type": "boolean",
|
|
3196
|
+
"mutable": false,
|
|
3197
|
+
"complexType": {
|
|
3198
|
+
"original": "boolean",
|
|
3199
|
+
"resolved": "boolean",
|
|
3200
|
+
"references": {}
|
|
3201
|
+
},
|
|
3202
|
+
"required": false,
|
|
3203
|
+
"optional": false,
|
|
3204
|
+
"docs": {
|
|
3205
|
+
"tags": [{
|
|
3206
|
+
"name": "defaultValue",
|
|
3207
|
+
"text": "false"
|
|
3208
|
+
}],
|
|
3209
|
+
"text": "Determines whether the button trigger's label and the option labels should truncate and display with an ellipsis.\nWhen a label overflows, a `title` showing the full label will appear on hover.\nChip options, custom layouts and group rows aren't affected."
|
|
3210
|
+
},
|
|
3211
|
+
"getter": false,
|
|
3212
|
+
"setter": false,
|
|
3213
|
+
"reflect": true,
|
|
3214
|
+
"attribute": "truncate",
|
|
3215
|
+
"defaultValue": "false"
|
|
3216
|
+
},
|
|
3164
3217
|
"chipSentiment": {
|
|
3165
3218
|
"type": "string",
|
|
3166
3219
|
"mutable": false,
|