@pine-ds/core 4.8.0 → 4.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-icon2.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/portal-target.js +1 -0
- 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-Do70atou.js → index-BDnbr0DK.js} +1 -1
- package/dist/cjs/{index-jl_Q819j.js → index-D9iJuJCP.js} +13 -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 +4 -4
- 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 +22 -12
- package/dist/cjs/pds-box.cjs.entry.js +4 -4
- package/dist/cjs/pds-button.cjs.entry.js +58 -26
- package/dist/cjs/pds-checkbox.cjs.entry.js +16 -8
- package/dist/cjs/pds-chip.cjs.entry.js +9 -11
- package/dist/cjs/pds-combobox.cjs.entry.js +41 -11
- package/dist/cjs/pds-container.cjs.entry.js +3 -3
- package/dist/cjs/pds-copytext.cjs.entry.js +8 -7
- package/dist/cjs/pds-datepicker.cjs.entry.js +8 -45
- 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 +4 -4
- package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +3 -3
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +5 -5
- 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 +55 -22
- 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 +16 -7
- package/dist/cjs/pds-loader.cjs.entry.js +4 -4
- package/dist/cjs/pds-modal-content.cjs.entry.js +4 -4
- 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 +13 -7
- package/dist/cjs/pds-popover.cjs.entry.js +230 -153
- 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 +67 -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 +7 -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 +31 -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 +128 -46
- package/dist/cjs/pine-core.cjs.js +3 -3
- package/dist/cjs/portal-target-e8WQ6dLx.js +70 -0
- package/dist/cjs/tabbable-BrrrGvdG.js +86 -0
- package/dist/cjs/{truncation-tooltip-BtuiXLV0.js → truncation-tooltip-DdB78RIe.js} +44 -4
- 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 +41 -9
- 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 +13 -23
- 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 -5
- package/dist/collection/components/pds-combobox/pds-combobox.css +33 -0
- package/dist/collection/components/pds-combobox/pds-combobox.js +60 -7
- 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/calendar-portal.js +1 -38
- package/dist/collection/components/pds-datepicker/pds-datepicker.js +2 -2
- 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.js +24 -2
- 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 +1 -1
- 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.css +1 -1
- package/dist/collection/components/pds-link/pds-link.js +34 -3
- package/dist/collection/components/pds-link/stories/pds-link.stories.js +51 -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 +2 -2
- 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.css +1 -1
- package/dist/collection/components/pds-modal/pds-modal.js +4 -84
- package/dist/collection/components/pds-modal/test/mock-pds-modal.js +1 -1
- package/dist/collection/components/pds-multiselect/pds-multiselect.js +9 -3
- package/dist/collection/components/pds-popover/pds-popover.css +6 -0
- package/dist/collection/components/pds-popover/pds-popover.js +226 -149
- 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 +65 -4
- 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 +3 -3
- 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 +28 -3
- package/dist/collection/components/pds-text/stories/pds-text.stories.js +16 -0
- 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.css +11 -0
- package/dist/collection/components/pds-tooltip/pds-tooltip.js +125 -42
- package/dist/collection/components/pds-tooltip/stories/pds-tooltip.stories.js +30 -0
- package/dist/collection/utils/aria-references.js +42 -0
- package/dist/collection/utils/portal-target.js +64 -0
- package/dist/collection/utils/tabbable.js +82 -0
- package/dist/collection/utils/truncation-tooltip.js +42 -3
- package/dist/docs.json +245 -8
- 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-4_RRPJTO.js} +13 -2
- package/dist/esm/{index-BWDu62Mo.js → index-DvN3tyZp.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 +4 -4
- 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 +22 -12
- package/dist/esm/pds-box.entry.js +4 -4
- package/dist/esm/pds-button.entry.js +58 -26
- package/dist/esm/pds-checkbox.entry.js +16 -8
- package/dist/esm/pds-chip.entry.js +8 -10
- package/dist/esm/pds-combobox.entry.js +41 -11
- package/dist/esm/pds-container.entry.js +3 -3
- package/dist/esm/pds-copytext.entry.js +8 -7
- package/dist/esm/pds-datepicker.entry.js +7 -44
- 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 +4 -4
- package/dist/esm/pds-dropdown-menu-separator.entry.js +3 -3
- package/dist/esm/pds-dropdown-menu.entry.js +5 -5
- 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 +55 -22
- 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 +16 -7
- package/dist/esm/pds-loader.entry.js +4 -4
- package/dist/esm/pds-modal-content.entry.js +4 -4
- 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 +13 -7
- package/dist/esm/pds-popover.entry.js +230 -153
- 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 +67 -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 +7 -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 +31 -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 +128 -46
- package/dist/esm/pine-core.js +4 -4
- package/dist/esm/portal-target-CKRzRKdO.js +66 -0
- package/dist/esm/tabbable-C6ZWpp3v.js +84 -0
- package/dist/esm/{truncation-tooltip-FaW67DiY.js → truncation-tooltip-CRSdYzpA.js} +44 -5
- 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-4_RRPJTO.js} +2 -2
- package/dist/esm-es5/{index-BWDu62Mo.js → index-DvN3tyZp.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/portal-target-CKRzRKdO.js +1 -0
- package/dist/esm-es5/tabbable-C6ZWpp3v.js +1 -0
- package/dist/esm-es5/truncation-tooltip-CRSdYzpA.js +1 -0
- package/dist/pine-core/index.esm.js +1 -1
- package/dist/pine-core/{p-9880d251.system.entry.js → p-01f1cdaf.system.entry.js} +1 -1
- package/dist/pine-core/{p-138b278b.entry.js → p-07323107.entry.js} +1 -1
- package/dist/pine-core/p-08b8e941.entry.js +1 -0
- package/dist/pine-core/p-0d5f0ab5.system.entry.js +1 -0
- package/dist/pine-core/{p-8c8cc079.system.entry.js → p-1415c988.system.entry.js} +1 -1
- package/dist/pine-core/{p-9109b90a.entry.js → p-143b33a6.entry.js} +1 -1
- package/dist/pine-core/{p-b9d145f8.system.entry.js → p-14dedf01.system.entry.js} +1 -1
- package/dist/pine-core/{p-80e6f3a0.system.entry.js → p-19cf1d91.system.entry.js} +1 -1
- package/dist/pine-core/p-1ca8d183.entry.js +1 -0
- package/dist/pine-core/p-1cc39908.system.entry.js +1 -0
- package/dist/pine-core/p-1e3ef425.entry.js +1 -0
- package/dist/pine-core/{p-b914dde8.entry.js → p-1f62bb71.entry.js} +2 -2
- package/dist/pine-core/p-20079552.system.entry.js +1 -0
- package/dist/pine-core/p-2a18852f.entry.js +1 -0
- package/dist/pine-core/{p-ca4ee736.system.entry.js → p-2b9622c1.system.entry.js} +1 -1
- package/dist/pine-core/p-2dd30d12.entry.js +1 -0
- package/dist/pine-core/{p-cccfe60f.system.entry.js → p-3306dc5a.system.entry.js} +1 -1
- package/dist/pine-core/{p-BGLP3keB.js → p-35s7h-dk.js} +1 -1
- package/dist/pine-core/{p-8c588ca0.entry.js → p-3610cb3b.entry.js} +1 -1
- package/dist/pine-core/p-37718637.entry.js +1 -0
- package/dist/pine-core/p-383d84f4.entry.js +2 -0
- package/dist/pine-core/p-39276663.entry.js +1 -0
- package/dist/pine-core/{p-62433f32.entry.js → p-39e57657.entry.js} +1 -1
- package/dist/pine-core/p-3c229091.entry.js +1 -0
- package/dist/pine-core/p-3d34b967.system.entry.js +1 -0
- package/dist/pine-core/p-3e30a761.entry.js +1 -0
- package/dist/pine-core/{p-7a5b21d2.system.entry.js → p-3f8bd3fb.system.entry.js} +1 -1
- package/dist/pine-core/p-42d43c3f.system.entry.js +1 -0
- package/dist/pine-core/{p-f029b7da.system.entry.js → p-42f70f93.system.entry.js} +1 -1
- package/dist/pine-core/{p-d3d69ca4.system.entry.js → p-4a90b9c8.system.entry.js} +1 -1
- package/dist/pine-core/{p-ca0a8f5c.entry.js → p-4cfe922b.entry.js} +1 -1
- package/dist/pine-core/p-4d1a8803.entry.js +1 -0
- package/dist/pine-core/p-4d47023c.system.entry.js +1 -0
- package/dist/pine-core/p-4d98bc0c.system.entry.js +1 -0
- package/dist/pine-core/{p-c97bfac9.entry.js → p-50ddadbf.entry.js} +1 -1
- package/dist/pine-core/{p-0913f696.system.entry.js → p-548bce53.system.entry.js} +1 -1
- package/dist/pine-core/p-54f1e86f.system.entry.js +1 -0
- package/dist/pine-core/{p-631f5bcc.entry.js → p-590df41a.entry.js} +1 -1
- package/dist/pine-core/p-5946203c.entry.js +1 -0
- package/dist/pine-core/{p-11d98408.system.entry.js → p-5f181694.system.entry.js} +1 -1
- package/dist/pine-core/p-60a30975.system.entry.js +1 -0
- package/dist/pine-core/{p-9ab95438.entry.js → p-61cfdbb2.entry.js} +1 -1
- package/dist/pine-core/p-62aa6a78.system.entry.js +1 -0
- package/dist/pine-core/{p-ecc7a531.system.entry.js → p-63f85859.system.entry.js} +1 -1
- package/dist/pine-core/p-64bcb378.entry.js +1 -0
- package/dist/pine-core/{p-bdac8f2b.entry.js → p-67999353.entry.js} +1 -1
- package/dist/pine-core/{p-cb6a3e4c.system.entry.js → p-67f795d5.system.entry.js} +1 -1
- package/dist/pine-core/p-6a1aa8d3.entry.js +1 -0
- package/dist/pine-core/p-6f4ab1ea.system.entry.js +1 -0
- package/dist/pine-core/{p-acca5f7b.system.entry.js → p-724baba3.system.entry.js} +1 -1
- package/dist/pine-core/p-72659a0e.system.entry.js +1 -0
- package/dist/pine-core/{p-4bfc8b3e.system.entry.js → p-73efb1ed.system.entry.js} +1 -1
- package/dist/pine-core/p-7a51f15e.entry.js +1 -0
- package/dist/pine-core/p-7b978fff.system.entry.js +1 -0
- package/dist/pine-core/p-8436cbfb.entry.js +1 -0
- package/dist/pine-core/p-849ec281.system.entry.js +1 -0
- package/dist/pine-core/p-87a32ded.system.entry.js +1 -0
- package/dist/pine-core/p-89d38a82.system.entry.js +1 -0
- package/dist/pine-core/p-8ade17ce.entry.js +1 -0
- package/dist/pine-core/{p-4d03d1e2.system.entry.js → p-8afd5f5b.system.entry.js} +1 -1
- package/dist/pine-core/p-8e7f75e6.entry.js +1 -0
- package/dist/pine-core/{p-8f531063.entry.js → p-8fb520df.entry.js} +1 -1
- package/dist/pine-core/{p-9df5e204.entry.js → p-92115e88.entry.js} +1 -1
- package/dist/pine-core/p-93fd7dd8.system.entry.js +1 -0
- package/dist/pine-core/p-947582e1.entry.js +1 -0
- package/dist/pine-core/{p-2ac2457b.system.entry.js → p-94c9b7d1.system.entry.js} +1 -1
- package/dist/pine-core/p-973c3ac0.entry.js +1 -0
- package/dist/pine-core/p-97653e60.entry.js +1 -0
- package/dist/pine-core/{p-55224683.entry.js → p-97b73359.entry.js} +1 -1
- package/dist/pine-core/{p-b1548a20.entry.js → p-99530cb5.entry.js} +1 -1
- package/dist/pine-core/p-9a776443.entry.js +1 -0
- package/dist/pine-core/p-9b32727a.system.entry.js +1 -0
- package/dist/pine-core/{p-CGRdQc49.system.js → p-BK1sLRfg.system.js} +2 -2
- 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-C6ZWpp3v.js +1 -0
- package/dist/pine-core/{p-Cy8cvR7I.system.js → p-CANeE7Ss.system.js} +1 -1
- package/dist/pine-core/p-CKRzRKdO.js +1 -0
- package/dist/pine-core/{p-XW4H0W6i.system.js → p-CNXspDYs.system.js} +1 -1
- package/dist/pine-core/{p-BPqJgIq6.js → p-Cuc0DYlm.js} +1 -1
- package/dist/pine-core/p-DQyF6v9Q.system.js +1 -0
- package/dist/pine-core/{p-BWDu62Mo.js → p-DvN3tyZp.js} +1 -1
- package/dist/pine-core/p-DwQ5Tjis.js +1 -0
- package/dist/pine-core/{p-CmSJytt1.js → p-M31tvpDN.js} +2 -2
- package/dist/pine-core/p-XK45dzWR.system.js +1 -0
- package/dist/pine-core/{p-1dc5a7e0.system.entry.js → p-a09c9c5e.system.entry.js} +1 -1
- package/dist/pine-core/p-a4ce12ef.entry.js +1 -0
- package/dist/pine-core/{p-57a2f927.entry.js → p-a594c41f.entry.js} +1 -1
- package/dist/pine-core/p-a9d96e22.entry.js +1 -0
- package/dist/pine-core/{p-047433a4.system.entry.js → p-ad5208a4.system.entry.js} +1 -1
- package/dist/pine-core/p-b3d4f97a.system.entry.js +3 -0
- package/dist/pine-core/{p-0b71ecb6.system.entry.js → p-bcc378ba.system.entry.js} +2 -2
- package/dist/pine-core/p-bd7dc317.system.entry.js +1 -0
- package/dist/pine-core/p-beb7a430.entry.js +1 -0
- package/dist/pine-core/p-bfa34194.entry.js +1 -0
- package/dist/pine-core/{p-5870b092.system.entry.js → p-c2afe4f3.system.entry.js} +1 -1
- package/dist/pine-core/p-c5e1eb3c.system.entry.js +1 -0
- package/dist/pine-core/p-c7a53c4f.entry.js +1 -0
- package/dist/pine-core/{p-5cfd4d41.system.entry.js → p-c8a0b562.system.entry.js} +1 -1
- package/dist/pine-core/{p-f1702281.entry.js → p-c9ae7964.entry.js} +1 -1
- package/dist/pine-core/{p-db17c626.system.entry.js → p-cb9baf78.system.entry.js} +1 -1
- package/dist/pine-core/{p-e5420660.entry.js → p-ce9fa14b.entry.js} +1 -1
- package/dist/pine-core/{p-332590c7.system.entry.js → p-d018dc60.system.entry.js} +1 -1
- package/dist/pine-core/p-d47b2a6a.system.entry.js +1 -0
- package/dist/pine-core/{p-b75b0d09.system.entry.js → p-d48fe5a0.system.entry.js} +1 -1
- package/dist/pine-core/p-d6f338e0.entry.js +1 -0
- package/dist/pine-core/{p-8191498f.system.entry.js → p-d920d759.system.entry.js} +1 -1
- package/dist/pine-core/{p-26642718.entry.js → p-d9719e37.entry.js} +1 -1
- package/dist/pine-core/{p-c483997a.entry.js → p-db7fb5a3.entry.js} +1 -1
- package/dist/pine-core/{p-9713fb36.entry.js → p-e1d1b5d8.entry.js} +1 -1
- package/dist/pine-core/p-e3de6a1d.entry.js +1 -0
- package/dist/pine-core/{p-d2c91e7a.entry.js → p-e7002cee.entry.js} +1 -1
- package/dist/pine-core/{p-86040cac.system.entry.js → p-e82f758f.system.entry.js} +1 -1
- package/dist/pine-core/p-e84fa9ed.entry.js +1 -0
- package/dist/pine-core/{p-ee0e30bf.system.entry.js → p-eb4f0daa.system.entry.js} +1 -1
- package/dist/pine-core/p-eeYeEogd.system.js +1 -0
- package/dist/pine-core/{p-0af0d752.system.entry.js → p-eecd9ad8.system.entry.js} +1 -1
- package/dist/pine-core/p-ef0eba9b.system.entry.js +1 -0
- package/dist/pine-core/p-ef3a855f.system.entry.js +1 -0
- package/dist/pine-core/{p-717323e4.entry.js → p-f018af99.entry.js} +1 -1
- package/dist/pine-core/{p-121612a7.system.entry.js → p-f11cce27.system.entry.js} +1 -1
- package/dist/pine-core/{p-4fd454f6.entry.js → p-f6f4fd42.entry.js} +1 -1
- package/dist/pine-core/{p-a939b471.entry.js → p-f71d71ca.entry.js} +1 -1
- package/dist/pine-core/p-f9063262.system.entry.js +1 -0
- package/dist/pine-core/p-f99bd77f.entry.js +1 -0
- package/dist/pine-core/{p-ClDiSG97.system.js → p-vFsJv75D.system.js} +1 -1
- package/dist/pine-core/p-wB2y8gR7.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 +2 -2
- 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-datepicker/calendar-portal.d.ts +0 -7
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.d.ts +7 -0
- package/dist/types/components/pds-link/pds-link.d.ts +8 -0
- package/dist/types/components/pds-popover/pds-popover.d.ts +44 -20
- package/dist/types/components/pds-radio/pds-radio.d.ts +9 -3
- package/dist/types/components/pds-radio-group/pds-radio-group.d.ts +8 -0
- package/dist/types/components/pds-select/pds-select.d.ts +32 -4
- package/dist/types/components/pds-text/pds-text.d.ts +4 -0
- package/dist/types/components/pds-toast/pds-toast.d.ts +9 -0
- package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +32 -0
- package/dist/types/components.d.ts +98 -10
- package/dist/types/utils/aria-references.d.ts +24 -0
- package/dist/types/utils/portal-target.d.ts +17 -0
- package/dist/types/utils/tabbable.d.ts +2 -0
- package/dist/types/utils/truncation-tooltip.d.ts +5 -2
- package/dist/vscode.html-data.json +82 -10
- package/hydrate/index.js +971 -408
- package/hydrate/index.mjs +971 -408
- package/package.json +2 -2
- package/dist/esm-es5/truncation-tooltip-FaW67DiY.js +0 -1
- package/dist/pine-core/p-0092444c.system.entry.js +0 -1
- package/dist/pine-core/p-00a50de5.system.entry.js +0 -3
- package/dist/pine-core/p-049f126a.entry.js +0 -1
- package/dist/pine-core/p-089c3e60.entry.js +0 -1
- package/dist/pine-core/p-158b2f51.entry.js +0 -1
- package/dist/pine-core/p-17f97f1a.entry.js +0 -1
- package/dist/pine-core/p-19ba2788.system.entry.js +0 -1
- package/dist/pine-core/p-208c7dbf.entry.js +0 -1
- package/dist/pine-core/p-25ea48d1.entry.js +0 -1
- package/dist/pine-core/p-295f64ea.entry.js +0 -1
- package/dist/pine-core/p-29cd4113.system.entry.js +0 -1
- package/dist/pine-core/p-2cb5483a.system.entry.js +0 -1
- package/dist/pine-core/p-36cb4bf6.entry.js +0 -1
- package/dist/pine-core/p-3c977d8d.system.entry.js +0 -1
- package/dist/pine-core/p-3d51891a.entry.js +0 -1
- package/dist/pine-core/p-432d5ec7.entry.js +0 -1
- package/dist/pine-core/p-44f546ae.entry.js +0 -1
- package/dist/pine-core/p-5442d983.system.entry.js +0 -1
- package/dist/pine-core/p-5833a072.system.entry.js +0 -1
- package/dist/pine-core/p-602c197f.entry.js +0 -1
- package/dist/pine-core/p-719542e1.system.entry.js +0 -1
- package/dist/pine-core/p-73f931a1.entry.js +0 -1
- package/dist/pine-core/p-75ee0403.entry.js +0 -1
- package/dist/pine-core/p-77395d62.system.entry.js +0 -1
- package/dist/pine-core/p-7a287635.system.entry.js +0 -1
- package/dist/pine-core/p-875b0436.system.entry.js +0 -1
- package/dist/pine-core/p-884cb31d.system.entry.js +0 -1
- package/dist/pine-core/p-8987fd45.system.entry.js +0 -1
- package/dist/pine-core/p-8cc302aa.system.entry.js +0 -1
- package/dist/pine-core/p-8e3ff75d.entry.js +0 -1
- package/dist/pine-core/p-90d5edc6.entry.js +0 -1
- package/dist/pine-core/p-91f60173.entry.js +0 -1
- package/dist/pine-core/p-9265497e.system.entry.js +0 -1
- package/dist/pine-core/p-94593f20.system.entry.js +0 -1
- package/dist/pine-core/p-99459e27.entry.js +0 -1
- package/dist/pine-core/p-99fdf70f.entry.js +0 -1
- package/dist/pine-core/p-9aaedded.entry.js +0 -1
- package/dist/pine-core/p-9dcd2cdb.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-D04W0cAO.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-a826f290.entry.js +0 -1
- package/dist/pine-core/p-acce8eb2.entry.js +0 -1
- package/dist/pine-core/p-aff411d0.entry.js +0 -1
- package/dist/pine-core/p-b182f806.entry.js +0 -2
- package/dist/pine-core/p-bb68431a.entry.js +0 -1
- package/dist/pine-core/p-be9b6e63.system.entry.js +0 -1
- package/dist/pine-core/p-bf30dec0.entry.js +0 -1
- package/dist/pine-core/p-c4e12f0a.entry.js +0 -1
- package/dist/pine-core/p-e0917a26.entry.js +0 -1
- package/dist/pine-core/p-e836a041.entry.js +0 -1
- package/dist/pine-core/p-ea340c55.system.entry.js +0 -1
- package/dist/pine-core/p-ea4d4741.system.entry.js +0 -1
- package/dist/pine-core/p-ea8f5d29.entry.js +0 -1
- package/dist/pine-core/p-eaf85be6.system.entry.js +0 -1
- package/dist/pine-core/p-ef13f665.system.entry.js +0 -1
- package/dist/pine-core/p-f3067d90.system.entry.js +0 -1
- package/dist/pine-core/p-jrkGLEPe.js +0 -1
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var floatingUi_dom = require('./floating-ui.dom-
|
|
3
|
+
var floatingUi_dom = require('./floating-ui.dom-Dw41zbyY.js');
|
|
4
|
+
var portalTarget = require('./portal-target-e8WQ6dLx.js');
|
|
4
5
|
|
|
6
|
+
// Controls that clipped text can sit inside that already take focus, so the text adds no tab stop of its own.
|
|
7
|
+
// Not any `[tabindex]`: a focusable scroll region full of chips would show every chip's tooltip at once.
|
|
8
|
+
const FOCUSABLE_WRAPPER = 'a[href], button, summary, pds-button, pds-link, pds-tab, pds-dropdown-menu-item, [role="option"]';
|
|
5
9
|
/** CSS class prefix used for truncation tooltip portal elements */
|
|
6
10
|
const TOOLTIP_CLASS = 'pds-truncation-tooltip';
|
|
7
11
|
/**
|
|
@@ -11,7 +15,8 @@ const TOOLTIP_CLASS = 'pds-truncation-tooltip';
|
|
|
11
15
|
*
|
|
12
16
|
* Z-Index Strategy:
|
|
13
17
|
* Uses --pine-z-index-nuclear (9999) to ensure tooltips appear above all other UI elements.
|
|
14
|
-
* This is necessary because tooltips are portaled to document.body
|
|
18
|
+
* This is necessary because tooltips are portaled to document.body, or into the modal dialog or
|
|
19
|
+
* open popover around the host (the top layer, which no z-index reaches from the body), and must overlay:
|
|
15
20
|
* - Modal dialogs
|
|
16
21
|
* - Dropdown menus
|
|
17
22
|
* - Other floating UI elements
|
|
@@ -51,6 +56,15 @@ function injectStyles() {
|
|
|
51
56
|
opacity: 1;
|
|
52
57
|
visibility: visible;
|
|
53
58
|
}
|
|
59
|
+
:is(dialog, [popover]) > .${TOOLTIP_CLASS} {
|
|
60
|
+
font-style: normal;
|
|
61
|
+
font-weight: normal;
|
|
62
|
+
text-align: start;
|
|
63
|
+
text-indent: 0;
|
|
64
|
+
text-transform: none;
|
|
65
|
+
white-space: normal;
|
|
66
|
+
word-spacing: normal;
|
|
67
|
+
}
|
|
54
68
|
`;
|
|
55
69
|
document.head.appendChild(style);
|
|
56
70
|
}
|
|
@@ -77,7 +91,8 @@ function isFocusVisible(el) {
|
|
|
77
91
|
*
|
|
78
92
|
* When the element's text overflows, hovering the host element or giving it
|
|
79
93
|
* keyboard focus will display a tooltip showing the full text content. The
|
|
80
|
-
* tooltip is rendered as a portal on document.body
|
|
94
|
+
* tooltip is rendered as a portal on document.body, or in the modal dialog or open popover around
|
|
95
|
+
* the host, and positioned with Floating UI.
|
|
81
96
|
*
|
|
82
97
|
* Also owns the element's `tabindex` while it is clipped — see syncTabIndex.
|
|
83
98
|
*
|
|
@@ -87,6 +102,7 @@ function setupTruncationTooltip(options) {
|
|
|
87
102
|
const { hostEl, contentEl, getTooltipText, placement = 'top', reference = hostEl, manageTabIndex = true, focusEl = hostEl } = options;
|
|
88
103
|
injectStyles();
|
|
89
104
|
let portalEl = null;
|
|
105
|
+
let stopWatchingPortalHost = null;
|
|
90
106
|
let isHovering = false;
|
|
91
107
|
let isHoveringPortal = false;
|
|
92
108
|
let isFocused = false;
|
|
@@ -165,7 +181,11 @@ function setupTruncationTooltip(options) {
|
|
|
165
181
|
contentDiv.className = `${TOOLTIP_CLASS}__content`;
|
|
166
182
|
contentDiv.textContent = text.trim();
|
|
167
183
|
portalEl.appendChild(contentDiv);
|
|
168
|
-
|
|
184
|
+
const portalHost = portalTarget.findPortalTarget(hostEl, portalTarget.isTopLayerInDocument);
|
|
185
|
+
portalHost.appendChild(portalEl);
|
|
186
|
+
// Closing that host moves no pointer, so a tooltip opened by touch would outlive it unseen.
|
|
187
|
+
if (portalHost !== document.body)
|
|
188
|
+
stopWatchingPortalHost = portalTarget.onTopLayerClose(portalHost, closeWithPortalHost);
|
|
169
189
|
// Allow the user to hover into the tooltip to select/copy text
|
|
170
190
|
portalEl.addEventListener('mouseenter', handlePortalMouseEnter);
|
|
171
191
|
portalEl.addEventListener('mouseleave', handlePortalMouseLeave);
|
|
@@ -204,6 +224,10 @@ function setupTruncationTooltip(options) {
|
|
|
204
224
|
}
|
|
205
225
|
}
|
|
206
226
|
function removePortal() {
|
|
227
|
+
if (stopWatchingPortalHost !== null) {
|
|
228
|
+
stopWatchingPortalHost();
|
|
229
|
+
stopWatchingPortalHost = null;
|
|
230
|
+
}
|
|
207
231
|
if (portalEl) {
|
|
208
232
|
portalEl.removeEventListener('mouseenter', handlePortalMouseEnter);
|
|
209
233
|
portalEl.removeEventListener('mouseleave', handlePortalMouseLeave);
|
|
@@ -237,6 +261,14 @@ function setupTruncationTooltip(options) {
|
|
|
237
261
|
return;
|
|
238
262
|
removePortal();
|
|
239
263
|
}
|
|
264
|
+
// Hover and focus can't outlast a host that's no longer shown, so none of them keeps it open.
|
|
265
|
+
function closeWithPortalHost() {
|
|
266
|
+
isHovering = false;
|
|
267
|
+
isHoveringPortal = false;
|
|
268
|
+
isFocused = false;
|
|
269
|
+
cancelHideTimeout();
|
|
270
|
+
removePortal();
|
|
271
|
+
}
|
|
240
272
|
/**
|
|
241
273
|
* Schedules tooltip removal after a short delay.
|
|
242
274
|
*
|
|
@@ -268,11 +300,18 @@ function setupTruncationTooltip(options) {
|
|
|
268
300
|
isHoveringPortal = false;
|
|
269
301
|
scheduleHide();
|
|
270
302
|
}
|
|
303
|
+
// A second tab stop inside focusEl, such as another clipped text, bubbles its focus here too. Its event.target is
|
|
304
|
+
// retargeted to the stop's outermost element in focusEl's tree, which sits beside hostEl rather than around or in it.
|
|
305
|
+
function isFocusForHost(target) {
|
|
306
|
+
return focusEl === hostEl || target === focusEl || target.contains(hostEl) || hostEl.contains(target);
|
|
307
|
+
}
|
|
271
308
|
// Keyboard focus only: focus from a click would pin the tooltip open after the pointer leaves.
|
|
272
309
|
// Events from inside a shadow root arrive retargeted to its host, so test the innermost target.
|
|
273
310
|
function showForVisibleFocus(event) {
|
|
274
311
|
if (!isFocusVisible(event.composedPath()[0]))
|
|
275
312
|
return;
|
|
313
|
+
if (!isFocusForHost(event.target))
|
|
314
|
+
return;
|
|
276
315
|
isFocused = true;
|
|
277
316
|
showTooltip();
|
|
278
317
|
}
|
|
@@ -318,4 +357,5 @@ function setupTruncationTooltip(options) {
|
|
|
318
357
|
};
|
|
319
358
|
}
|
|
320
359
|
|
|
360
|
+
exports.FOCUSABLE_WRAPPER = FOCUSABLE_WRAPPER;
|
|
321
361
|
exports.setupTruncationTooltip = setupTruncationTooltip;
|
|
@@ -128,4 +128,17 @@
|
|
|
128
128
|
flex-shrink: 0;
|
|
129
129
|
margin-inline-start: auto;
|
|
130
130
|
white-space: nowrap;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.visually-hidden {
|
|
134
|
+
border: 0;
|
|
135
|
+
clip: rect(0 0 0 0);
|
|
136
|
+
clip-path: polygon(0 0, 0 0, 0 0);
|
|
137
|
+
height: 1px;
|
|
138
|
+
margin: -1px;
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
padding: 0;
|
|
141
|
+
position: absolute;
|
|
142
|
+
white-space: nowrap;
|
|
143
|
+
width: 1px;
|
|
131
144
|
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
// What each variant announces when `severityLabel` isn't set. The `default`
|
|
3
|
+
// variant has no severity.
|
|
4
|
+
const SEVERITY_LABELS = {
|
|
5
|
+
danger: 'Error',
|
|
6
|
+
info: 'Info',
|
|
7
|
+
success: 'Success',
|
|
8
|
+
warning: 'Warning',
|
|
9
|
+
};
|
|
2
10
|
/**
|
|
3
11
|
* @slot actions - Slot for alert actions.
|
|
4
12
|
* @part dismiss
|
|
@@ -50,7 +58,12 @@ export class PdsAlert {
|
|
|
50
58
|
}
|
|
51
59
|
return (h("div", null, h("pds-text", { class: "pds-alert__description", color: "var(--pds-alert-color-text)", tag: "p" }, h("slot", null)), this.hasActionsContent && this.renderActions(false)));
|
|
52
60
|
}
|
|
61
|
+
severityText() {
|
|
62
|
+
var _a;
|
|
63
|
+
return (_a = this.severityLabel) !== null && _a !== void 0 ? _a : SEVERITY_LABELS[this.variant];
|
|
64
|
+
}
|
|
53
65
|
render() {
|
|
66
|
+
const severity = this.severityText();
|
|
54
67
|
const iconMap = {
|
|
55
68
|
danger: 'warning-filled',
|
|
56
69
|
default: 'info-circle-filled',
|
|
@@ -60,7 +73,7 @@ export class PdsAlert {
|
|
|
60
73
|
};
|
|
61
74
|
// Get the icon name based on the current variant
|
|
62
75
|
const iconName = iconMap[this.variant] || iconMap.default;
|
|
63
|
-
return (h(Host, { key: '
|
|
76
|
+
return (h(Host, { key: 'd487419289ef352f63e7861fb21f42aa243ee526', class: "pds-alert", id: this.componentId, variant: this.variant }, h("pds-box", { key: '0ecd6e25d4163d41055be53e88f6d332e56e1ed8', class: `pds-alert__container pds-alert__container--${this.variant}`, "background-color": "var(--pds-alert-background)", "border-color": "var(--pds-alert-border-color)", "border-radius": "md", border: true, display: "block" }, h("pds-box", { key: '4cca87bd3b9758e9830eddec25c9fd3e8c06a44d', gap: "sm", display: "flex", "align-items": this.small ? "center" : undefined }, severity && h("span", { key: 'b076475ed4a0bc2db09df84d6530db0e4e098daf', class: "visually-hidden" }, severity), !this.hideIcon && (h("pds-icon", { key: 'e8efc683c4f84e22fac8729c0c476c817b33f3e6', class: `pds-alert__icon ${this.small ? 'pds-alert__icon--small' : ''}`, color: "var(--pds-alert-color-icon)", icon: iconName, size: "var(--pds-alert-icon-size)", "aria-hidden": "true" })), h("pds-box", { key: 'f3ff29ce778f2e8bfb0d0a3e6a732714ce22e8ad', class: "pds-alert__content-wrapper", direction: "column", gap: "xs", flex: "grow" }, this.heading && !this.small && (h("pds-text", { key: 'c00d44fe496e8aae699ac740428e6e523c0c8d0a', class: "pds-alert__heading", color: "var(--pds-alert-color-text)", size: "h5", tag: "h3", weight: "medium" }, this.heading)), this.renderContent()), this.dismissible && (h("button", { key: 'd770590cecc3b27e1dd2750bbdfa07209dbb017d', class: "pds-alert__dismiss", type: "button", part: "dismiss", "aria-label": this.dismissLabel, onClick: this.handleCloseClick }, h("pds-icon", { key: '9d79c27c829662dbeecb30dfad806f345eeb6c67', icon: "remove", size: "var(--pds-alert-icon-size)", "aria-hidden": "true", color: "var(--pds-alert-color-dismiss)" })))))));
|
|
64
77
|
}
|
|
65
78
|
static get is() { return "pds-alert"; }
|
|
66
79
|
static get encapsulation() { return "shadow"; }
|
|
@@ -225,6 +238,28 @@ export class PdsAlert {
|
|
|
225
238
|
"reflect": false,
|
|
226
239
|
"attribute": "dismiss-label",
|
|
227
240
|
"defaultValue": "'Dismiss alert'"
|
|
241
|
+
},
|
|
242
|
+
"severityLabel": {
|
|
243
|
+
"type": "string",
|
|
244
|
+
"mutable": false,
|
|
245
|
+
"complexType": {
|
|
246
|
+
"original": "string",
|
|
247
|
+
"resolved": "string",
|
|
248
|
+
"references": {}
|
|
249
|
+
},
|
|
250
|
+
"required": false,
|
|
251
|
+
"optional": true,
|
|
252
|
+
"docs": {
|
|
253
|
+
"tags": [{
|
|
254
|
+
"name": "defaultValue",
|
|
255
|
+
"text": "undefined"
|
|
256
|
+
}],
|
|
257
|
+
"text": "Accessible label announcing the alert's severity, read before the heading\nand message. Pass a translated string to localize it; defaults to English\nfor each variant (`Error`, `Info`, `Success`, `Warning`). The `default`\nvariant has no severity and announces none unless this is set; pass an\nempty string to announce none for any variant."
|
|
258
|
+
},
|
|
259
|
+
"getter": false,
|
|
260
|
+
"setter": false,
|
|
261
|
+
"reflect": false,
|
|
262
|
+
"attribute": "severity-label"
|
|
228
263
|
}
|
|
229
264
|
};
|
|
230
265
|
}
|
|
@@ -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
|
export default {
|
|
@@ -15,6 +16,7 @@ const BaseTemplate = (args) => html` <pds-alert
|
|
|
15
16
|
?small=${args.small}
|
|
16
17
|
?dismissible=${args.dismissible}
|
|
17
18
|
?hide-icon=${args.hideIcon}
|
|
19
|
+
severity-label=${ifDefined(args.severityLabel)}
|
|
18
20
|
>${args.description}</pds-alert>`;
|
|
19
21
|
|
|
20
22
|
const ActionsTemplate = (args) => html` <pds-alert
|
|
@@ -24,6 +26,7 @@ const ActionsTemplate = (args) => html` <pds-alert
|
|
|
24
26
|
?small=${args.small}
|
|
25
27
|
?dismissible=${args.dismissible}
|
|
26
28
|
?hide-icon=${args.hideIcon}
|
|
29
|
+
severity-label=${ifDefined(args.severityLabel)}
|
|
27
30
|
>
|
|
28
31
|
${args.description}
|
|
29
32
|
<pds-button slot="actions" variant="primary">Button</pds-button>
|
|
@@ -37,6 +40,7 @@ const SmallActionsTemplate = (args) => html` <pds-alert
|
|
|
37
40
|
?small=${args.small}
|
|
38
41
|
?dismissible=${args.dismissible}
|
|
39
42
|
?hide-icon=${args.hideIcon}
|
|
43
|
+
severity-label=${ifDefined(args.severityLabel)}
|
|
40
44
|
>
|
|
41
45
|
${args.description}
|
|
42
46
|
<pds-link slot="actions" variant="plain" href="#">Link</pds-link>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { checkCircleFilled, userFilled } from "@pine-ds/icons/icons";
|
|
3
3
|
import { restoreReflectedDefault } from "../../utils/reflected-attribute-default";
|
|
4
|
+
// Used when `badgeLabel` is unset; an empty string hides the badge instead.
|
|
5
|
+
const DEFAULT_BADGE_LABEL = 'Verified';
|
|
4
6
|
/**
|
|
5
7
|
* @part asset-wrapper
|
|
6
8
|
* @part button
|
|
@@ -79,14 +81,22 @@ export class PdsAvatar {
|
|
|
79
81
|
:
|
|
80
82
|
this.renderAssetWrapper());
|
|
81
83
|
};
|
|
82
|
-
this.renderBadge = () =>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
this.renderBadge = () => {
|
|
85
|
+
var _a;
|
|
86
|
+
// Inside the dropdown trigger the button's aria-label is the name, so the
|
|
87
|
+
// badge is decorative there, as the status dot is. An empty label is
|
|
88
|
+
// decorative too, rather than an image with no name.
|
|
89
|
+
const badgeLabel = (_a = this.badgeLabel) !== null && _a !== void 0 ? _a : DEFAULT_BADGE_LABEL;
|
|
90
|
+
const label = this.dropdown || badgeLabel === '' ? undefined : badgeLabel;
|
|
91
|
+
return (
|
|
92
|
+
// `badge` and `status` share the bottom-end corner; `status` wins so the
|
|
93
|
+
// presence dot is never painted over the badge.
|
|
94
|
+
this.badge && !this.status
|
|
95
|
+
// Percentage is average size of icon in relation to total avatar size
|
|
96
|
+
// of all preset sizes found in Figma.
|
|
97
|
+
// Used to allow icons to scale to container size
|
|
98
|
+
&& h("pds-icon", { color: "var(--pine-color-purple-600)", class: "pds-avatar__badge", icon: checkCircleFilled, size: "33.53%", "aria-label": label, "aria-hidden": label === undefined ? 'true' : undefined }));
|
|
99
|
+
};
|
|
90
100
|
this.renderStatus = () => {
|
|
91
101
|
var _a;
|
|
92
102
|
if (!this.status)
|
|
@@ -141,7 +151,7 @@ export class PdsAvatar {
|
|
|
141
151
|
}
|
|
142
152
|
}
|
|
143
153
|
render() {
|
|
144
|
-
return (h(Host, { key: '
|
|
154
|
+
return (h(Host, { key: '0942c1fff94d0d8138143cbddf80aea1d09e34a9', id: this.componentId, class: Object.assign({}, this.classNames()) }, this.renderAvatar()));
|
|
145
155
|
}
|
|
146
156
|
static get is() { return "pds-avatar"; }
|
|
147
157
|
static get encapsulation() { return "shadow"; }
|
|
@@ -203,6 +213,28 @@ export class PdsAvatar {
|
|
|
203
213
|
"attribute": "badge",
|
|
204
214
|
"defaultValue": "false"
|
|
205
215
|
},
|
|
216
|
+
"badgeLabel": {
|
|
217
|
+
"type": "string",
|
|
218
|
+
"mutable": false,
|
|
219
|
+
"complexType": {
|
|
220
|
+
"original": "string",
|
|
221
|
+
"resolved": "string",
|
|
222
|
+
"references": {}
|
|
223
|
+
},
|
|
224
|
+
"required": false,
|
|
225
|
+
"optional": true,
|
|
226
|
+
"docs": {
|
|
227
|
+
"tags": [{
|
|
228
|
+
"name": "defaultValue",
|
|
229
|
+
"text": "'Verified'"
|
|
230
|
+
}],
|
|
231
|
+
"text": "Accessible label for the badge icon. Pass a translated string to localize\nit; defaults to English. Pass an empty string to make the badge\ndecorative. Has no effect on dropdown avatars, where the trigger's\n`triggerLabel` owns the accessible name."
|
|
232
|
+
},
|
|
233
|
+
"getter": false,
|
|
234
|
+
"setter": false,
|
|
235
|
+
"reflect": false,
|
|
236
|
+
"attribute": "badge-label"
|
|
237
|
+
},
|
|
206
238
|
"componentId": {
|
|
207
239
|
"type": "string",
|
|
208
240
|
"mutable": false,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
2
3
|
import imgFile from '../assets/demi_wilkinson.jpg';
|
|
3
4
|
|
|
4
5
|
|
|
@@ -22,6 +23,7 @@ export default {
|
|
|
22
23
|
const BaseTemplate = (args) => html`<pds-avatar
|
|
23
24
|
alt="${args.alt}"
|
|
24
25
|
badge="${args.badge}"
|
|
26
|
+
badge-label=${ifDefined(args.badgeLabel)}
|
|
25
27
|
dropdown="${args.dropdown}"
|
|
26
28
|
component-id="${args.componentId}"
|
|
27
29
|
image="${args.image}"
|
|
@@ -153,7 +153,7 @@ export class PdsBox {
|
|
|
153
153
|
const normalizedBorder = normalizeColorValue(this.borderColor);
|
|
154
154
|
const boxInlineStyles = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (normalizedBackground && { '--color-background-box': normalizedBackground })), (normalizedBorder && { '--color-border-box': normalizedBorder })), (this.minHeight && { '--sizing-min-height-box': this.minHeight })), (this.minWidth && { '--sizing-min-width-box': this.minWidth })), (this.flex && !['none', 'grow', 'shrink'].includes(this.flex) && { 'flex': this.flex }));
|
|
155
155
|
this.hostKeeper.record(boxClasses, boxInlineStyles);
|
|
156
|
-
return (h(Host, { key: '
|
|
156
|
+
return (h(Host, { key: 'c791a8d413b47629c619424bebf9d9c4acc4d9f3', class: boxClasses, style: boxInlineStyles }));
|
|
157
157
|
}
|
|
158
158
|
static get is() { return "pds-box"; }
|
|
159
159
|
static get originalStyleUrls() {
|
|
@@ -1,5 +1,6 @@
|
|
|
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";
|
|
4
5
|
const FORWARDED_ARIA_ATTRIBUTES = ['aria-current', 'aria-expanded', 'aria-haspopup', 'aria-label', 'aria-pressed'];
|
|
5
6
|
/**
|
|
@@ -68,7 +69,12 @@ export class PdsButton {
|
|
|
68
69
|
if (FORWARDED_ARIA_ATTRIBUTES.some((name) => forwarded[name] !== this.forwardedAria[name])) {
|
|
69
70
|
this.forwardedAria = forwarded;
|
|
70
71
|
}
|
|
71
|
-
this.
|
|
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();
|
|
72
78
|
};
|
|
73
79
|
this.handleStartSlotChange = (event) => {
|
|
74
80
|
this.hasStartContent = event.target.assignedElements({ flatten: true }).length > 0;
|
|
@@ -111,7 +117,7 @@ export class PdsButton {
|
|
|
111
117
|
// Consumers, popovers and menus set these on the host, often after render, but only the inner element is announced.
|
|
112
118
|
this.hostAriaObserver = new MutationObserver(this.syncHostAria);
|
|
113
119
|
this.hostAriaObserver.observe(this.el, {
|
|
114
|
-
attributeFilter: FORWARDED_ARIA_ATTRIBUTES.concat(
|
|
120
|
+
attributeFilter: FORWARDED_ARIA_ATTRIBUTES.concat(ARIA_REFERENCE_ATTRIBUTES),
|
|
115
121
|
});
|
|
116
122
|
}
|
|
117
123
|
disconnectedCallback() {
|
|
@@ -120,7 +126,7 @@ export class PdsButton {
|
|
|
120
126
|
this.hostAriaObserver = undefined;
|
|
121
127
|
}
|
|
122
128
|
componentDidRender() {
|
|
123
|
-
this.
|
|
129
|
+
this.forwardAriaReferences();
|
|
124
130
|
}
|
|
125
131
|
/**
|
|
126
132
|
* Listen for Enter key presses on form inputs to trigger submit
|
|
@@ -171,25 +177,9 @@ export class PdsButton {
|
|
|
171
177
|
}
|
|
172
178
|
}
|
|
173
179
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (!this.contentEl || !('ariaControlsElements' in this.contentEl))
|
|
178
|
-
return;
|
|
179
|
-
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 : [];
|
|
180
|
-
const controlled = ids.map((id) => this.findInAncestorRoots(id)).filter((el) => el !== null);
|
|
181
|
-
this.contentEl.ariaControlsElements = controlled.length > 0 ? controlled : null;
|
|
182
|
-
}
|
|
183
|
-
// A trigger inside another component's shadow root still controls a popover portal on document.body.
|
|
184
|
-
findInAncestorRoots(id) {
|
|
185
|
-
let root = this.el.getRootNode();
|
|
186
|
-
while (root instanceof ShadowRoot) {
|
|
187
|
-
const found = root.getElementById(id);
|
|
188
|
-
if (found)
|
|
189
|
-
return found;
|
|
190
|
-
root = root.host.getRootNode();
|
|
191
|
-
}
|
|
192
|
-
return root instanceof Document ? root.getElementById(id) : null;
|
|
180
|
+
forwardAriaReferences() {
|
|
181
|
+
if (this.contentEl)
|
|
182
|
+
forwardAriaReferences(this.el, this.contentEl);
|
|
193
183
|
}
|
|
194
184
|
classNames() {
|
|
195
185
|
const classNames = ['pds-button'];
|
|
@@ -249,7 +239,7 @@ export class PdsButton {
|
|
|
249
239
|
// Hide text when loading or iconOnly is true
|
|
250
240
|
const hideText = this.loading || this.iconOnly;
|
|
251
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()));
|
|
252
|
-
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)));
|
|
253
243
|
}
|
|
254
244
|
static get is() { return "pds-button"; }
|
|
255
245
|
static get encapsulation() { return "shadow"; }
|
|
@@ -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
|
+
};
|