@pine-ds/core 3.1.0 → 3.2.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/index.d.ts +20 -0
- package/components/index.js +10 -0
- package/components/index.js.map +1 -1
- package/components/mock-pds-modal.d.ts +11 -0
- package/components/mock-pds-modal.js +108 -0
- package/components/mock-pds-modal.js.map +1 -0
- package/components/pds-alert.d.ts +11 -0
- package/components/pds-alert.js +107 -0
- package/components/pds-alert.js.map +1 -0
- package/components/pds-avatar.js +1 -1
- package/components/pds-box.js +1 -110
- package/components/pds-box.js.map +1 -1
- package/components/pds-box2.js +115 -0
- package/components/pds-box2.js.map +1 -0
- package/components/pds-checkbox2.js +3 -3
- package/components/pds-chip.js +1 -1
- package/components/pds-copytext.js +1 -1
- package/components/pds-divider.js +1 -1
- package/components/pds-dropdown-menu-item.d.ts +11 -0
- package/components/pds-dropdown-menu-item.js +117 -0
- package/components/pds-dropdown-menu-item.js.map +1 -0
- package/components/pds-dropdown-menu-separator.d.ts +11 -0
- package/components/pds-dropdown-menu-separator.js +44 -0
- package/components/pds-dropdown-menu-separator.js.map +1 -0
- package/components/pds-dropdown-menu.d.ts +11 -0
- package/components/pds-dropdown-menu.js +1600 -0
- package/components/pds-dropdown-menu.js.map +1 -0
- package/components/pds-image.js +2 -2
- package/components/pds-input.js +4 -4
- package/components/pds-link.js +1 -67
- package/components/pds-link.js.map +1 -1
- package/components/pds-link2.js +85 -0
- package/components/pds-link2.js.map +1 -0
- package/components/pds-loader2.js +1 -1
- package/components/pds-modal-content.d.ts +11 -0
- package/components/pds-modal-content.js +111 -0
- package/components/pds-modal-content.js.map +1 -0
- package/components/pds-modal-footer.d.ts +11 -0
- package/components/pds-modal-footer.js +35 -0
- package/components/pds-modal-footer.js.map +1 -0
- package/components/pds-modal-header.d.ts +11 -0
- package/components/pds-modal-header.js +35 -0
- package/components/pds-modal-header.js.map +1 -0
- package/components/pds-modal.d.ts +11 -0
- package/components/pds-modal.js +278 -0
- package/components/pds-modal.js.map +1 -0
- package/components/pds-popover.js +33 -1
- package/components/pds-popover.js.map +1 -1
- package/components/pds-progress.js +1 -1
- package/components/pds-radio.js +3 -3
- package/components/pds-row.js +1 -1
- package/components/pds-select.js +2 -2
- package/components/pds-sortable-item.js +1 -1
- package/components/pds-sortable.js +1 -1
- package/components/pds-switch.js +3 -3
- package/components/pds-tab.js +3 -3
- package/components/pds-table-body.js +1 -1
- package/components/pds-table-cell2.js +2 -2
- package/components/pds-table-head-cell2.js +2 -2
- package/components/pds-table-head.js +1 -1
- package/components/pds-table-row.js +1 -1
- package/components/pds-table.js +1 -1
- package/components/pds-tabpanel.js +1 -1
- package/components/pds-tabs.js +1 -1
- package/components/pds-text.js +1 -53
- package/components/pds-text.js.map +1 -1
- package/components/pds-text2.js +58 -0
- package/components/pds-text2.js.map +1 -0
- package/components/pds-textarea.js +4 -4
- package/components/pds-toast.d.ts +11 -0
- package/components/pds-toast.js +137 -0
- package/components/pds-toast.js.map +1 -0
- package/components/pds-tooltip.js +283 -81
- package/components/pds-tooltip.js.map +1 -1
- package/components/utils.js +3 -2
- package/components/utils.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mock-pds-modal.cjs.entry.js +86 -0
- package/dist/cjs/mock-pds-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/mock-pds-modal.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-alert.cjs.entry.js +66 -0
- package/dist/cjs/pds-alert.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-alert.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-avatar.cjs.entry.js +1 -1
- package/dist/cjs/pds-box.cjs.entry.js +2 -2
- package/dist/cjs/pds-box.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-box.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-button.cjs.entry.js +1 -1
- package/dist/cjs/pds-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/pds-chip.cjs.entry.js +1 -1
- package/dist/cjs/pds-copytext.cjs.entry.js +1 -1
- package/dist/cjs/pds-divider.cjs.entry.js +1 -1
- package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +82 -0
- package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-dropdown-menu-item.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +25 -0
- package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-dropdown-menu-separator.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js +1574 -0
- package/dist/cjs/pds-dropdown-menu.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-dropdown-menu.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-image.cjs.entry.js +2 -2
- package/dist/cjs/pds-input.cjs.entry.js +5 -5
- package/dist/cjs/pds-link.cjs.entry.js +15 -3
- package/dist/cjs/pds-link.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-link.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-loader.cjs.entry.js +1 -1
- package/dist/cjs/pds-modal-content.cjs.entry.js +93 -0
- package/dist/cjs/pds-modal-content.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-modal-content.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-modal-footer.cjs.entry.js +20 -0
- package/dist/cjs/pds-modal-footer.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-modal-footer.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-modal-header.cjs.entry.js +20 -0
- package/dist/cjs/pds-modal-header.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-modal-header.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-modal.cjs.entry.js +253 -0
- package/dist/cjs/pds-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-modal.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-popover.cjs.entry.js +33 -1
- package/dist/cjs/pds-popover.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-popover.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-progress.cjs.entry.js +1 -1
- package/dist/cjs/pds-radio.cjs.entry.js +3 -3
- package/dist/cjs/pds-row.cjs.entry.js +1 -1
- package/dist/cjs/pds-select.cjs.entry.js +2 -2
- package/dist/cjs/pds-sortable-item.cjs.entry.js +1 -1
- package/dist/cjs/pds-sortable.cjs.entry.js +1 -1
- package/dist/cjs/pds-switch.cjs.entry.js +3 -3
- package/dist/cjs/pds-tab.cjs.entry.js +3 -3
- package/dist/cjs/pds-table-body.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-cell.cjs.entry.js +2 -2
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +2 -2
- package/dist/cjs/pds-table-head.cjs.entry.js +1 -1
- package/dist/cjs/pds-table-row.cjs.entry.js +1 -1
- package/dist/cjs/pds-table.cjs.entry.js +1 -1
- package/dist/cjs/pds-tabpanel.cjs.entry.js +1 -1
- package/dist/cjs/pds-tabs.cjs.entry.js +1 -1
- package/dist/cjs/pds-text.cjs.entry.js +2 -2
- package/dist/cjs/pds-text.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-text.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-textarea.cjs.entry.js +5 -5
- package/dist/cjs/pds-toast.cjs.entry.js +104 -0
- package/dist/cjs/pds-toast.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-toast.entry.cjs.js.map +1 -0
- package/dist/cjs/pds-tooltip.cjs.entry.js +281 -79
- package/dist/cjs/pds-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-tooltip.entry.cjs.js.map +1 -1
- package/dist/cjs/pine-core.cjs.js +1 -1
- package/dist/cjs/{utils-CQKIgzWg.js → utils-jWx-Mf12.js} +5 -4
- package/dist/cjs/utils-jWx-Mf12.js.map +1 -0
- package/dist/collection/collection-manifest.json +10 -0
- package/dist/collection/components/pds-alert/pds-alert.css +108 -0
- package/dist/collection/components/pds-alert/pds-alert.js +198 -0
- package/dist/collection/components/pds-alert/pds-alert.js.map +1 -0
- package/dist/collection/components/pds-alert/pds-alert.tokens.css +32 -0
- package/dist/collection/components/pds-alert/stories/pds-alert.stories.js +97 -0
- package/dist/collection/components/pds-avatar/pds-avatar.js +1 -1
- package/dist/collection/components/pds-box/pds-box.js +8 -8
- package/dist/collection/components/pds-box/pds-box.js.map +1 -1
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +3 -3
- package/dist/collection/components/pds-chip/pds-chip.js +1 -1
- package/dist/collection/components/pds-chip/stories/pds-chip.stories.js +1 -1
- package/dist/collection/components/pds-copytext/pds-copytext.js +1 -1
- package/dist/collection/components/pds-divider/pds-divider.js +1 -1
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.css +68 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +219 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js.map +1 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.css +4 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.js +72 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.js.map +1 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.css +16 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +328 -0
- package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js.map +1 -0
- package/dist/collection/components/pds-dropdown-menu/stories/pds-dropdown-menu.stories.js +44 -0
- package/dist/collection/components/pds-image/pds-image.js +2 -2
- package/dist/collection/components/pds-input/pds-input.js +4 -4
- package/dist/collection/components/pds-link/pds-link.css +20 -1
- package/dist/collection/components/pds-link/pds-link.js +33 -2
- package/dist/collection/components/pds-link/pds-link.js.map +1 -1
- package/dist/collection/components/pds-link/stories/pds-link.stories.js +15 -2
- package/dist/collection/components/pds-loader/pds-loader.js +1 -1
- package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.css +27 -0
- package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js +125 -0
- package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js.map +1 -0
- package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.css +8 -0
- package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +18 -0
- package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js.map +1 -0
- package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.css +8 -0
- package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +18 -0
- package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js.map +1 -0
- package/dist/collection/components/pds-modal/pds-modal.css +79 -0
- package/dist/collection/components/pds-modal/pds-modal.js +426 -0
- package/dist/collection/components/pds-modal/pds-modal.js.map +1 -0
- package/dist/collection/components/pds-modal/stories/pds-modal.stories.js +415 -0
- package/dist/collection/components/pds-modal/test/mock-pds-modal.js +256 -0
- package/dist/collection/components/pds-modal/test/mock-pds-modal.js.map +1 -0
- package/dist/collection/components/pds-popover/pds-popover.js +33 -1
- package/dist/collection/components/pds-popover/pds-popover.js.map +1 -1
- package/dist/collection/components/pds-progress/pds-progress.js +1 -1
- package/dist/collection/components/pds-radio/pds-radio.js +3 -3
- package/dist/collection/components/pds-row/pds-row.js +1 -1
- package/dist/collection/components/pds-select/pds-select.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/pds-table.js +1 -1
- package/dist/collection/components/pds-tabs/pds-tab/pds-tab.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 +2 -2
- package/dist/collection/components/pds-text/pds-text.js.map +1 -1
- package/dist/collection/components/pds-textarea/pds-textarea.js +4 -4
- package/dist/collection/components/pds-toast/pds-toast.css +153 -0
- package/dist/collection/components/pds-toast/pds-toast.js +263 -0
- package/dist/collection/components/pds-toast/pds-toast.js.map +1 -0
- package/dist/collection/components/pds-toast/stories/pds-toast.stories.js +103 -0
- package/dist/collection/components/pds-tooltip/pds-tooltip.css +2 -12
- package/dist/collection/components/pds-tooltip/pds-tooltip.js +211 -26
- package/dist/collection/components/pds-tooltip/pds-tooltip.js.map +1 -1
- package/dist/collection/components/pds-tooltip/stories/pds-tooltip.stories.js +7 -3
- package/dist/collection/utils/interfaces.js +2 -0
- package/dist/collection/utils/interfaces.js.map +1 -0
- package/dist/collection/utils/overlay.js +66 -49
- package/dist/collection/utils/overlay.js.map +1 -1
- package/dist/collection/utils/utils.js +3 -2
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/docs.json +1638 -266
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mock-pds-modal.entry.js +84 -0
- package/dist/esm/mock-pds-modal.entry.js.map +1 -0
- package/dist/esm/pds-alert.entry.js +64 -0
- package/dist/esm/pds-alert.entry.js.map +1 -0
- package/dist/esm/pds-avatar.entry.js +1 -1
- package/dist/esm/pds-box.entry.js +2 -2
- package/dist/esm/pds-box.entry.js.map +1 -1
- package/dist/esm/pds-button.entry.js +1 -1
- package/dist/esm/pds-checkbox.entry.js +3 -3
- package/dist/esm/pds-chip.entry.js +1 -1
- package/dist/esm/pds-copytext.entry.js +1 -1
- package/dist/esm/pds-divider.entry.js +1 -1
- package/dist/esm/pds-dropdown-menu-item.entry.js +80 -0
- package/dist/esm/pds-dropdown-menu-item.entry.js.map +1 -0
- package/dist/esm/pds-dropdown-menu-separator.entry.js +23 -0
- package/dist/esm/pds-dropdown-menu-separator.entry.js.map +1 -0
- package/dist/esm/pds-dropdown-menu.entry.js +1572 -0
- package/dist/esm/pds-dropdown-menu.entry.js.map +1 -0
- package/dist/esm/pds-image.entry.js +2 -2
- package/dist/esm/pds-input.entry.js +5 -5
- package/dist/esm/pds-link.entry.js +15 -3
- package/dist/esm/pds-link.entry.js.map +1 -1
- package/dist/esm/pds-loader.entry.js +1 -1
- package/dist/esm/pds-modal-content.entry.js +91 -0
- package/dist/esm/pds-modal-content.entry.js.map +1 -0
- package/dist/esm/pds-modal-footer.entry.js +18 -0
- package/dist/esm/pds-modal-footer.entry.js.map +1 -0
- package/dist/esm/pds-modal-header.entry.js +18 -0
- package/dist/esm/pds-modal-header.entry.js.map +1 -0
- package/dist/esm/pds-modal.entry.js +251 -0
- package/dist/esm/pds-modal.entry.js.map +1 -0
- package/dist/esm/pds-popover.entry.js +33 -1
- package/dist/esm/pds-popover.entry.js.map +1 -1
- package/dist/esm/pds-progress.entry.js +1 -1
- package/dist/esm/pds-radio.entry.js +3 -3
- package/dist/esm/pds-row.entry.js +1 -1
- package/dist/esm/pds-select.entry.js +2 -2
- package/dist/esm/pds-sortable-item.entry.js +1 -1
- package/dist/esm/pds-sortable.entry.js +1 -1
- package/dist/esm/pds-switch.entry.js +3 -3
- package/dist/esm/pds-tab.entry.js +3 -3
- package/dist/esm/pds-table-body.entry.js +1 -1
- package/dist/esm/pds-table-cell.entry.js +2 -2
- package/dist/esm/pds-table-head-cell.entry.js +2 -2
- package/dist/esm/pds-table-head.entry.js +1 -1
- package/dist/esm/pds-table-row.entry.js +1 -1
- package/dist/esm/pds-table.entry.js +1 -1
- package/dist/esm/pds-tabpanel.entry.js +1 -1
- package/dist/esm/pds-tabs.entry.js +1 -1
- package/dist/esm/pds-text.entry.js +2 -2
- package/dist/esm/pds-text.entry.js.map +1 -1
- package/dist/esm/pds-textarea.entry.js +5 -5
- package/dist/esm/pds-toast.entry.js +102 -0
- package/dist/esm/pds-toast.entry.js.map +1 -0
- package/dist/esm/pds-tooltip.entry.js +281 -79
- package/dist/esm/pds-tooltip.entry.js.map +1 -1
- package/dist/esm/pine-core.js +1 -1
- package/dist/esm/{utils-Dw9B1JDC.js → utils-DkabwBZT.js} +5 -4
- package/dist/esm/utils-DkabwBZT.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mock-pds-modal.entry.js +2 -0
- package/dist/esm-es5/mock-pds-modal.entry.js.map +1 -0
- package/dist/esm-es5/pds-alert.entry.js +2 -0
- package/dist/esm-es5/pds-alert.entry.js.map +1 -0
- 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-box.entry.js.map +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-copytext.entry.js +1 -1
- package/dist/esm-es5/pds-divider.entry.js +1 -1
- package/dist/esm-es5/pds-dropdown-menu-item.entry.js +2 -0
- package/dist/esm-es5/pds-dropdown-menu-item.entry.js.map +1 -0
- package/dist/esm-es5/pds-dropdown-menu-separator.entry.js +2 -0
- package/dist/esm-es5/pds-dropdown-menu-separator.entry.js.map +1 -0
- package/dist/esm-es5/pds-dropdown-menu.entry.js +2 -0
- package/dist/esm-es5/pds-dropdown-menu.entry.js.map +1 -0
- 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-link.entry.js.map +1 -1
- package/dist/esm-es5/pds-loader.entry.js +1 -1
- package/dist/esm-es5/pds-modal-content.entry.js +2 -0
- package/dist/esm-es5/pds-modal-content.entry.js.map +1 -0
- package/dist/esm-es5/pds-modal-footer.entry.js +2 -0
- package/dist/esm-es5/pds-modal-footer.entry.js.map +1 -0
- package/dist/esm-es5/pds-modal-header.entry.js +2 -0
- package/dist/esm-es5/pds-modal-header.entry.js.map +1 -0
- package/dist/esm-es5/pds-modal.entry.js +2 -0
- package/dist/esm-es5/pds-modal.entry.js.map +1 -0
- package/dist/esm-es5/pds-popover.entry.js +1 -1
- package/dist/esm-es5/pds-popover.entry.js.map +1 -1
- package/dist/esm-es5/pds-progress.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 +1 -1
- 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-text.entry.js.map +1 -1
- package/dist/esm-es5/pds-textarea.entry.js +1 -1
- package/dist/esm-es5/pds-toast.entry.js +2 -0
- package/dist/esm-es5/pds-toast.entry.js.map +1 -0
- package/dist/esm-es5/pds-tooltip.entry.js +1 -1
- package/dist/esm-es5/pds-tooltip.entry.js.map +1 -1
- package/dist/esm-es5/pine-core.js +1 -1
- package/dist/esm-es5/utils-DkabwBZT.js +2 -0
- package/dist/esm-es5/utils-DkabwBZT.js.map +1 -0
- package/dist/pine-core/mock-pds-modal.entry.esm.js.map +1 -0
- package/dist/pine-core/{p-38d2498e.system.entry.js → p-0069abf8.system.entry.js} +2 -2
- package/dist/pine-core/{p-a14c8ab4.system.entry.js → p-03d8cb4c.system.entry.js} +2 -2
- package/dist/pine-core/{p-a952d40c.system.entry.js → p-04df41d7.system.entry.js} +2 -2
- package/dist/pine-core/{p-0486ad57.entry.js → p-0572825b.entry.js} +2 -2
- package/dist/pine-core/{p-d2110923.system.entry.js → p-111e7da2.system.entry.js} +2 -2
- package/dist/pine-core/{p-103b62a1.system.entry.js → p-121e03ad.system.entry.js} +2 -2
- package/dist/pine-core/p-1224c874.entry.js +2 -0
- package/dist/pine-core/{p-82e05dcf.entry.js → p-146fcd44.entry.js} +2 -2
- package/dist/pine-core/{p-e88d58f4.entry.js → p-17d3fa8b.entry.js} +2 -2
- package/dist/pine-core/p-1b109c01.entry.js +2 -0
- package/dist/pine-core/p-1b109c01.entry.js.map +1 -0
- package/dist/pine-core/p-1bd715ee.system.entry.js +2 -0
- package/dist/pine-core/p-1bd715ee.system.entry.js.map +1 -0
- package/dist/pine-core/{p-d8e02aa9.system.entry.js → p-1eec6bea.system.entry.js} +2 -2
- package/dist/pine-core/p-21c3aaeb.entry.js +2 -0
- package/dist/pine-core/{p-f439922f.entry.js → p-2296c34f.entry.js} +2 -2
- package/dist/pine-core/{p-f439922f.entry.js.map → p-2296c34f.entry.js.map} +1 -1
- package/dist/pine-core/{p-5c396e75.entry.js → p-24607f93.entry.js} +2 -2
- package/dist/pine-core/p-28e28f42.system.entry.js +2 -0
- package/dist/pine-core/p-28e28f42.system.entry.js.map +1 -0
- package/dist/pine-core/{p-38246e2f.entry.js → p-29ad0b86.entry.js} +2 -2
- package/dist/pine-core/{p-c0f0b368.system.entry.js → p-30142a25.system.entry.js} +2 -2
- package/dist/pine-core/p-32bd3e33.entry.js +2 -0
- package/dist/pine-core/p-32bd3e33.entry.js.map +1 -0
- package/dist/pine-core/{p-8305cd4d.entry.js → p-367e188f.entry.js} +2 -2
- package/dist/pine-core/{p-6147b1ea.system.entry.js → p-3798a631.system.entry.js} +2 -2
- package/dist/pine-core/p-3D0orTx_.system.js.map +1 -0
- package/dist/pine-core/{p-c838b6ef.system.entry.js → p-3f82ac77.system.entry.js} +2 -2
- package/dist/pine-core/p-4288c861.entry.js +2 -0
- package/dist/pine-core/p-4288c861.entry.js.map +1 -0
- package/dist/pine-core/p-47a7a65b.entry.js +2 -0
- package/dist/pine-core/p-47a7a65b.entry.js.map +1 -0
- package/dist/pine-core/{p-ca09f86a.system.entry.js → p-48e76945.system.entry.js} +2 -2
- package/dist/pine-core/p-49265849.system.entry.js +2 -0
- package/dist/pine-core/p-49265849.system.entry.js.map +1 -0
- package/dist/pine-core/p-513c16c7.entry.js +2 -0
- package/dist/pine-core/p-513c16c7.entry.js.map +1 -0
- package/dist/pine-core/p-5c4aceb7.entry.js +2 -0
- package/dist/pine-core/p-5c4aceb7.entry.js.map +1 -0
- package/dist/pine-core/{p-598ade79.entry.js → p-5e1e7762.entry.js} +2 -2
- package/dist/pine-core/p-624db3d6.system.entry.js +2 -0
- package/dist/pine-core/p-624db3d6.system.entry.js.map +1 -0
- package/dist/pine-core/{p-c7d4f436.system.entry.js → p-6a2296e6.system.entry.js} +2 -2
- package/dist/pine-core/{p-b68cb43d.system.entry.js → p-71265b2a.system.entry.js} +2 -2
- package/dist/pine-core/p-71f01676.system.entry.js +2 -0
- package/dist/pine-core/p-71f01676.system.entry.js.map +1 -0
- package/dist/pine-core/{p-6ad460a7.entry.js → p-722012ac.entry.js} +2 -2
- package/dist/pine-core/{p-98181fa8.system.entry.js → p-730221a8.system.entry.js} +2 -2
- package/dist/pine-core/{p-a97952fc.system.entry.js → p-73412ca9.system.entry.js} +2 -2
- package/dist/pine-core/{p-a97952fc.system.entry.js.map → p-73412ca9.system.entry.js.map} +1 -1
- package/dist/pine-core/{p-8337c77c.entry.js → p-742d4490.entry.js} +2 -2
- package/dist/pine-core/{p-3ce8eb9f.entry.js → p-761946a0.entry.js} +2 -2
- package/dist/pine-core/{p-950427b2.entry.js → p-77c3a10d.entry.js} +2 -2
- package/dist/pine-core/{p-fed4c0c0.system.entry.js → p-78cb1c40.system.entry.js} +2 -2
- package/dist/pine-core/{p-1d92261f.system.entry.js → p-78fb945e.system.entry.js} +2 -2
- package/dist/pine-core/p-7b38e384.system.entry.js +2 -0
- package/dist/pine-core/{p-9d0c1b2e.system.entry.js.map → p-7b38e384.system.entry.js.map} +1 -1
- package/dist/pine-core/{p-d78bec50.system.entry.js → p-7e92ec48.system.entry.js} +2 -2
- package/dist/pine-core/{p-13b9ed06.system.entry.js → p-7ff213bb.system.entry.js} +2 -2
- package/dist/pine-core/{p-4ccd2d5e.entry.js → p-8023086c.entry.js} +2 -2
- package/dist/pine-core/p-83252078.system.entry.js +2 -0
- package/dist/pine-core/{p-f94703c9.entry.js → p-833f08f3.entry.js} +2 -2
- package/dist/pine-core/p-83c632f6.system.entry.js +2 -0
- package/dist/pine-core/p-83c632f6.system.entry.js.map +1 -0
- package/dist/pine-core/p-83ffc1cc.entry.js +2 -0
- package/dist/pine-core/p-83ffc1cc.entry.js.map +1 -0
- package/dist/pine-core/p-85ff1482.entry.js +2 -0
- package/dist/pine-core/{p-d5838288.entry.js.map → p-85ff1482.entry.js.map} +1 -1
- package/dist/pine-core/{p-12bee2e5.entry.js → p-86d388a2.entry.js} +2 -2
- package/dist/pine-core/p-929bb7ab.system.entry.js +2 -0
- package/dist/pine-core/p-929bb7ab.system.entry.js.map +1 -0
- package/dist/pine-core/p-942fa145.system.entry.js +2 -0
- package/dist/pine-core/p-942fa145.system.entry.js.map +1 -0
- package/dist/pine-core/{p-e045e337.system.entry.js → p-984578f8.system.entry.js} +2 -2
- package/dist/pine-core/{p-e281ac09.entry.js → p-99b5e1a5.entry.js} +2 -2
- package/dist/pine-core/{p-BFPxUBwH.system.js.map → p-B-pTdYoP.system.js.map} +1 -1
- package/dist/pine-core/p-B2gfQpwn.system.js.map +1 -0
- package/dist/pine-core/{p-CDhmuxC9.system.js.map → p-B5JFBYFw.system.js.map} +1 -1
- package/dist/pine-core/p-B5LBNcOw.system.js.map +1 -0
- package/dist/pine-core/{p-B46WXJMn.system.js.map → p-BHZ6CSg4.system.js.map} +1 -1
- package/dist/pine-core/{p-Cz3zRtiB.system.js.map → p-BO1OsmVU.system.js.map} +1 -1
- package/dist/pine-core/{p-Cj21y714.system.js.map → p-BOJnNd1p.system.js.map} +1 -1
- package/dist/pine-core/p-BVUeEWjl.system.js.map +1 -0
- package/dist/pine-core/{p-C94EgDFz.system.js → p-BhPuKJbQ.system.js} +2 -2
- package/dist/pine-core/p-BhPuKJbQ.system.js.map +1 -0
- package/dist/pine-core/p-Bo6FQRlR.system.js.map +1 -0
- package/dist/pine-core/{p-kMnJefdU.system.js.map → p-Bs9Nyvj2.system.js.map} +1 -1
- package/dist/pine-core/p-BsL2GDnH.system.js +1 -1
- package/dist/pine-core/{p-BJyPFOn0.system.js.map → p-C-oNYS10.system.js.map} +1 -1
- package/dist/pine-core/{p-Cg0JSYH5.system.js.map → p-CDIHBBTC.system.js.map} +1 -1
- package/dist/pine-core/{p-IK9NvSRG.system.js.map → p-CLNi-hRD.system.js.map} +1 -1
- package/dist/pine-core/{p-BjCOR1Nn.system.js.map → p-CV405yTU.system.js.map} +1 -1
- package/dist/pine-core/p-CWtKi9tV.system.js.map +1 -0
- package/dist/pine-core/{p-BoNavS-S.system.js.map → p-CcsZC7UR.system.js.map} +1 -1
- package/dist/pine-core/{p-DkJgkLjR.system.js.map → p-CiDIFl28.system.js.map} +1 -1
- package/dist/pine-core/{p-Dz6toWDZ.system.js.map → p-Cj2r1nL6.system.js.map} +1 -1
- package/dist/pine-core/{p-w3zTyPF1.system.js.map → p-CnPERKGo.system.js.map} +1 -1
- package/dist/pine-core/p-CsM74dxm.system.js.map +1 -0
- package/dist/pine-core/{p-DFmUOrRG.system.js.map → p-CtAVdPaE.system.js.map} +1 -1
- package/dist/pine-core/{p-9niWVsdd.system.js.map → p-CzKqvFNN.system.js.map} +1 -1
- package/dist/pine-core/{p-CmTz2SvK.system.js.map → p-D-4Xbxlj.system.js.map} +1 -1
- package/dist/pine-core/{p-BVNW4NmT.system.js.map → p-D5vuiRx2.system.js.map} +1 -1
- package/dist/pine-core/p-D8DRYw9w.system.js.map +1 -0
- package/dist/pine-core/{p-DVVPJPOu.system.js.map → p-D9LPgNmN.system.js.map} +1 -1
- package/dist/pine-core/p-DKSZziVY.system.js.map +1 -0
- package/dist/pine-core/{p-YuC61pNM.system.js.map → p-DN9puCWI.system.js.map} +1 -1
- package/dist/pine-core/{p-C0cdB2AV.system.js.map → p-DS7q5AvX.system.js.map} +1 -1
- package/dist/pine-core/{p-BSINexOf.system.js.map → p-DV_GadHU.system.js.map} +1 -1
- package/dist/pine-core/{p-BgcVBzVE.system.js.map → p-DbVkYdnF.system.js.map} +1 -1
- package/dist/pine-core/{p-eKz-xVcI.system.js.map → p-Derxa-nn.system.js.map} +1 -1
- package/dist/pine-core/{p-BW-n3jjz.system.js.map → p-DgOMN0Ur.system.js.map} +1 -1
- package/dist/pine-core/p-DiJV28pi.system.js.map +1 -0
- package/dist/pine-core/p-DkabwBZT.js +2 -0
- package/dist/pine-core/p-DkabwBZT.js.map +1 -0
- package/dist/pine-core/{p-Dv_jWtcr.system.js.map → p-DyQ_s5MV.system.js.map} +1 -1
- package/dist/pine-core/p-HBgo7i_E.system.js.map +1 -0
- package/dist/pine-core/{p-D8WAvG2e.system.js.map → p-M2Hhmwex.system.js.map} +1 -1
- package/dist/pine-core/p-PkSWq78_.system.js.map +1 -0
- package/dist/pine-core/{p-ceb48b05.system.entry.js → p-a2572675.system.entry.js} +2 -2
- package/dist/pine-core/{p-85073252.system.entry.js → p-a394645a.system.entry.js} +2 -2
- package/dist/pine-core/p-a52b1413.entry.js +2 -0
- package/dist/pine-core/p-a52b1413.entry.js.map +1 -0
- package/dist/pine-core/{p-4e7ca704.entry.js → p-abec6606.entry.js} +2 -2
- package/dist/pine-core/p-b2796d3c.system.entry.js +2 -0
- package/dist/pine-core/p-b2796d3c.system.entry.js.map +1 -0
- package/dist/pine-core/{p-1b81a8ec.entry.js → p-b3d05184.entry.js} +2 -2
- package/dist/pine-core/{p-b902f535.entry.js → p-b7ba6316.entry.js} +2 -2
- package/dist/pine-core/p-b9c13f99.entry.js +2 -0
- package/dist/pine-core/p-b9c13f99.entry.js.map +1 -0
- package/dist/pine-core/{p-6a716bff.entry.js → p-bcc4edaa.entry.js} +2 -2
- package/dist/pine-core/{p-1178485a.system.entry.js → p-bd04212c.system.entry.js} +2 -2
- package/dist/pine-core/{p-1178485a.system.entry.js.map → p-bd04212c.system.entry.js.map} +1 -1
- package/dist/pine-core/{p-9cdd57de.entry.js → p-c0f74199.entry.js} +2 -2
- package/dist/pine-core/{p-ed8c3064.system.entry.js → p-c1b0f921.system.entry.js} +2 -2
- package/dist/pine-core/{p-68de979e.entry.js → p-c4294be2.entry.js} +2 -2
- package/dist/pine-core/p-cd2cd116.entry.js +2 -0
- package/dist/pine-core/p-cd2cd116.entry.js.map +1 -0
- package/dist/pine-core/p-d1b222f5.entry.js +2 -0
- package/dist/pine-core/{p-b390c427.entry.js.map → p-d1b222f5.entry.js.map} +1 -1
- package/dist/pine-core/{p-7b6b354a.system.entry.js → p-d2ccda59.system.entry.js} +2 -2
- package/dist/pine-core/p-d6ac2862.system.entry.js +2 -0
- package/dist/pine-core/p-d6ac2862.system.entry.js.map +1 -0
- package/dist/pine-core/{p-6260135d.system.entry.js → p-e09a3682.system.entry.js} +2 -2
- package/dist/pine-core/{p-792355e6.entry.js → p-e2dc81c0.entry.js} +2 -2
- package/dist/pine-core/p-e6d6e103.entry.js +2 -0
- package/dist/pine-core/p-e6d6e103.entry.js.map +1 -0
- package/dist/pine-core/{p-fd9aa739.system.entry.js → p-e9d972db.system.entry.js} +2 -2
- package/dist/pine-core/p-ef9ed75a.system.entry.js +2 -0
- package/dist/pine-core/p-ef9ed75a.system.entry.js.map +1 -0
- package/dist/pine-core/{p-4b59cae8.entry.js → p-f256dd8a.entry.js} +2 -2
- package/dist/pine-core/{p-4b59cae8.entry.js.map → p-f256dd8a.entry.js.map} +1 -1
- package/dist/pine-core/p-f2c807ac.entry.js +2 -0
- package/dist/pine-core/p-f2c807ac.entry.js.map +1 -0
- package/dist/pine-core/{p-eda0dc79.entry.js → p-f47133fd.entry.js} +2 -2
- package/dist/pine-core/p-f4fff209.system.entry.js +2 -0
- package/dist/pine-core/p-f4fff209.system.entry.js.map +1 -0
- package/dist/pine-core/{p-5763df39.system.entry.js → p-f9e01886.system.entry.js} +2 -2
- package/dist/pine-core/{p-Bu94kuQa.system.js.map → p-xgOOHGQo.system.js.map} +1 -1
- package/dist/pine-core/p-yku4NLl6.system.js.map +1 -0
- package/dist/pine-core/pds-alert.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-box.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-dropdown-menu-item.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-dropdown-menu-separator.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-dropdown-menu.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-link.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-modal-content.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-modal-footer.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-modal-header.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-modal.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-popover.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-text.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-toast.entry.esm.js.map +1 -0
- package/dist/pine-core/pds-tooltip.entry.esm.js.map +1 -1
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/types/components/pds-alert/pds-alert.d.ts +39 -0
- package/dist/types/components/pds-box/pds-box.d.ts +6 -6
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.d.ts +43 -0
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.d.ts +13 -0
- package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu.d.ts +33 -0
- package/dist/types/components/pds-link/pds-link.d.ts +5 -0
- package/dist/types/components/pds-modal/pds-modal-content/pds-modal-content.d.ts +25 -0
- package/dist/types/components/pds-modal/pds-modal-footer/pds-modal-footer.d.ts +3 -0
- package/dist/types/components/pds-modal/pds-modal-header/pds-modal-header.d.ts +3 -0
- package/dist/types/components/pds-modal/pds-modal.d.ts +72 -0
- package/dist/types/components/pds-modal/test/mock-pds-modal.d.ts +63 -0
- package/dist/types/components/pds-toast/pds-toast.d.ts +57 -0
- package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +28 -3
- package/dist/types/components.d.ts +539 -14
- package/dist/types/utils/interfaces.d.ts +6 -0
- package/dist/types/utils/overlay.d.ts +3 -3
- package/dist/types/utils/utils.d.ts +1 -1
- package/hydrate/index.js +2897 -261
- package/hydrate/index.mjs +2897 -261
- package/package.json +6 -2
- package/dist/cjs/utils-CQKIgzWg.js.map +0 -1
- package/dist/esm/utils-Dw9B1JDC.js.map +0 -1
- package/dist/esm-es5/utils-Dw9B1JDC.js +0 -2
- package/dist/esm-es5/utils-Dw9B1JDC.js.map +0 -1
- package/dist/pine-core/p-1d690915.entry.js +0 -2
- package/dist/pine-core/p-294f9b1f.entry.js +0 -2
- package/dist/pine-core/p-433c6687.system.entry.js +0 -2
- package/dist/pine-core/p-433c6687.system.entry.js.map +0 -1
- package/dist/pine-core/p-82151ac5.entry.js +0 -2
- package/dist/pine-core/p-82151ac5.entry.js.map +0 -1
- package/dist/pine-core/p-953f619f.system.entry.js +0 -2
- package/dist/pine-core/p-9d0c1b2e.system.entry.js +0 -2
- package/dist/pine-core/p-C94EgDFz.system.js.map +0 -1
- package/dist/pine-core/p-CdkqpuKd.system.js.map +0 -1
- package/dist/pine-core/p-CnoLHUtr.system.js.map +0 -1
- package/dist/pine-core/p-DhwO1z4v.system.js.map +0 -1
- package/dist/pine-core/p-Dw9B1JDC.js +0 -2
- package/dist/pine-core/p-Dw9B1JDC.js.map +0 -1
- package/dist/pine-core/p-b390c427.entry.js +0 -2
- package/dist/pine-core/p-d3ab594c.system.entry.js +0 -2
- package/dist/pine-core/p-d3ab594c.system.entry.js.map +0 -1
- package/dist/pine-core/p-d5838288.entry.js +0 -2
- package/dist/pine-core/p-f4898d4f.entry.js +0 -2
- package/dist/pine-core/p-f4898d4f.entry.js.map +0 -1
- /package/dist/pine-core/{p-38d2498e.system.entry.js.map → p-0069abf8.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-a14c8ab4.system.entry.js.map → p-03d8cb4c.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-a952d40c.system.entry.js.map → p-04df41d7.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-0486ad57.entry.js.map → p-0572825b.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d2110923.system.entry.js.map → p-111e7da2.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-103b62a1.system.entry.js.map → p-121e03ad.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-1d690915.entry.js.map → p-1224c874.entry.js.map} +0 -0
- /package/dist/pine-core/{p-82e05dcf.entry.js.map → p-146fcd44.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e88d58f4.entry.js.map → p-17d3fa8b.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d8e02aa9.system.entry.js.map → p-1eec6bea.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-294f9b1f.entry.js.map → p-21c3aaeb.entry.js.map} +0 -0
- /package/dist/pine-core/{p-5c396e75.entry.js.map → p-24607f93.entry.js.map} +0 -0
- /package/dist/pine-core/{p-38246e2f.entry.js.map → p-29ad0b86.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c0f0b368.system.entry.js.map → p-30142a25.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-8305cd4d.entry.js.map → p-367e188f.entry.js.map} +0 -0
- /package/dist/pine-core/{p-6147b1ea.system.entry.js.map → p-3798a631.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c838b6ef.system.entry.js.map → p-3f82ac77.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-ca09f86a.system.entry.js.map → p-48e76945.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-598ade79.entry.js.map → p-5e1e7762.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c7d4f436.system.entry.js.map → p-6a2296e6.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b68cb43d.system.entry.js.map → p-71265b2a.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-6ad460a7.entry.js.map → p-722012ac.entry.js.map} +0 -0
- /package/dist/pine-core/{p-98181fa8.system.entry.js.map → p-730221a8.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-8337c77c.entry.js.map → p-742d4490.entry.js.map} +0 -0
- /package/dist/pine-core/{p-3ce8eb9f.entry.js.map → p-761946a0.entry.js.map} +0 -0
- /package/dist/pine-core/{p-950427b2.entry.js.map → p-77c3a10d.entry.js.map} +0 -0
- /package/dist/pine-core/{p-fed4c0c0.system.entry.js.map → p-78cb1c40.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-1d92261f.system.entry.js.map → p-78fb945e.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d78bec50.system.entry.js.map → p-7e92ec48.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-13b9ed06.system.entry.js.map → p-7ff213bb.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-4ccd2d5e.entry.js.map → p-8023086c.entry.js.map} +0 -0
- /package/dist/pine-core/{p-953f619f.system.entry.js.map → p-83252078.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-f94703c9.entry.js.map → p-833f08f3.entry.js.map} +0 -0
- /package/dist/pine-core/{p-12bee2e5.entry.js.map → p-86d388a2.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e045e337.system.entry.js.map → p-984578f8.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-e281ac09.entry.js.map → p-99b5e1a5.entry.js.map} +0 -0
- /package/dist/pine-core/{p-ceb48b05.system.entry.js.map → p-a2572675.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-85073252.system.entry.js.map → p-a394645a.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-4e7ca704.entry.js.map → p-abec6606.entry.js.map} +0 -0
- /package/dist/pine-core/{p-1b81a8ec.entry.js.map → p-b3d05184.entry.js.map} +0 -0
- /package/dist/pine-core/{p-b902f535.entry.js.map → p-b7ba6316.entry.js.map} +0 -0
- /package/dist/pine-core/{p-6a716bff.entry.js.map → p-bcc4edaa.entry.js.map} +0 -0
- /package/dist/pine-core/{p-9cdd57de.entry.js.map → p-c0f74199.entry.js.map} +0 -0
- /package/dist/pine-core/{p-ed8c3064.system.entry.js.map → p-c1b0f921.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-68de979e.entry.js.map → p-c4294be2.entry.js.map} +0 -0
- /package/dist/pine-core/{p-7b6b354a.system.entry.js.map → p-d2ccda59.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-6260135d.system.entry.js.map → p-e09a3682.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-792355e6.entry.js.map → p-e2dc81c0.entry.js.map} +0 -0
- /package/dist/pine-core/{p-fd9aa739.system.entry.js.map → p-e9d972db.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-eda0dc79.entry.js.map → p-f47133fd.entry.js.map} +0 -0
- /package/dist/pine-core/{p-5763df39.system.entry.js.map → p-f9e01886.system.entry.js.map} +0 -0
|
@@ -6,6 +6,16 @@ import { positionTooltip } from "../../utils/overlay";
|
|
|
6
6
|
*/
|
|
7
7
|
export class PdsTooltip {
|
|
8
8
|
constructor() {
|
|
9
|
+
/**
|
|
10
|
+
* Internal state: true if the tooltip was opened by user interaction (hover/focus),
|
|
11
|
+
* false if opened via the `opened` prop or currently closed.
|
|
12
|
+
*/
|
|
13
|
+
this._isInteractiveOpen = false;
|
|
14
|
+
this.portalEl = null;
|
|
15
|
+
this.triggerEl = null;
|
|
16
|
+
this.contentDiv = null;
|
|
17
|
+
this.slotMutationObserver = null;
|
|
18
|
+
this.overlayResizeObserver = null;
|
|
9
19
|
/**
|
|
10
20
|
* Determines when the tooltip is open
|
|
11
21
|
* @defaultValue false
|
|
@@ -37,44 +47,80 @@ export class PdsTooltip {
|
|
|
37
47
|
*/
|
|
38
48
|
this.opened = false;
|
|
39
49
|
this.handleHide = () => {
|
|
50
|
+
if (this.opened && !this._isInteractiveOpen) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
40
53
|
this.hideTooltip();
|
|
54
|
+
this._isInteractiveOpen = false;
|
|
41
55
|
};
|
|
42
56
|
this.handleShow = () => {
|
|
57
|
+
if (this.opened && !this._isInteractiveOpen) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this._isInteractiveOpen = true;
|
|
43
61
|
this.showTooltip();
|
|
44
62
|
};
|
|
45
63
|
this.handlePageShow = () => {
|
|
64
|
+
if (this.opened && !this._isInteractiveOpen) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
46
67
|
this.opened = false;
|
|
68
|
+
this._isInteractiveOpen = false;
|
|
69
|
+
};
|
|
70
|
+
this.handleScroll = () => {
|
|
71
|
+
if (this.opened) {
|
|
72
|
+
if (!this._isInteractiveOpen) {
|
|
73
|
+
this.repositionPortal();
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
this.hideTooltip();
|
|
77
|
+
this._isInteractiveOpen = false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
this.handleSpaNavigation = () => {
|
|
82
|
+
if (this.opened && !this._isInteractiveOpen) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
this.hideTooltip();
|
|
86
|
+
this._isInteractiveOpen = false;
|
|
47
87
|
};
|
|
48
88
|
}
|
|
49
|
-
handleOpenToggle() {
|
|
50
|
-
if (
|
|
51
|
-
this.
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
this.handleHide();
|
|
89
|
+
handleOpenToggle(newValue, oldValue) {
|
|
90
|
+
if (newValue === false && oldValue === true) {
|
|
91
|
+
this._isInteractiveOpen = false;
|
|
55
92
|
}
|
|
56
93
|
}
|
|
57
94
|
componentWillLoad() {
|
|
58
|
-
|
|
59
|
-
this.showTooltip();
|
|
60
|
-
}
|
|
61
|
-
this.el.addEventListener('blur', this.handleHide, true);
|
|
62
|
-
this.el.addEventListener('focus', this.handleShow, true);
|
|
95
|
+
this._isInteractiveOpen = false;
|
|
63
96
|
}
|
|
64
97
|
componentDidLoad() {
|
|
65
|
-
// fix for Safari iOS back button issue
|
|
66
98
|
window.addEventListener('pageshow', this.handlePageShow);
|
|
99
|
+
this.triggerEl = this.el.querySelector('.pds-tooltip__trigger');
|
|
100
|
+
const contentSlotWrapper = this.el.querySelector('.pds-tooltip__content-slot-wrapper');
|
|
101
|
+
if (contentSlotWrapper !== null) {
|
|
102
|
+
this.slotMutationObserver = new MutationObserver(() => {
|
|
103
|
+
if (this.opened && this.portalEl !== null) {
|
|
104
|
+
this.removePortal();
|
|
105
|
+
this.createPortal();
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
this.slotMutationObserver.observe(contentSlotWrapper, { childList: true, subtree: false });
|
|
109
|
+
}
|
|
67
110
|
return () => {
|
|
68
111
|
window.removeEventListener('pageshow', this.handlePageShow);
|
|
112
|
+
if (this.slotMutationObserver !== null) {
|
|
113
|
+
this.slotMutationObserver.disconnect();
|
|
114
|
+
}
|
|
69
115
|
};
|
|
70
116
|
}
|
|
71
|
-
componentDidUpdate() {
|
|
72
|
-
if (this.opened) {
|
|
73
|
-
this.showTooltip();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
117
|
componentDidRender() {
|
|
77
|
-
|
|
118
|
+
if (this.opened && this.portalEl === null) {
|
|
119
|
+
this.createPortal();
|
|
120
|
+
}
|
|
121
|
+
else if (!this.opened && this.portalEl !== null) {
|
|
122
|
+
this.removePortal();
|
|
123
|
+
}
|
|
78
124
|
}
|
|
79
125
|
/**
|
|
80
126
|
* Shows the tooltip by enabling the opened property
|
|
@@ -88,17 +134,154 @@ export class PdsTooltip {
|
|
|
88
134
|
async hideTooltip() {
|
|
89
135
|
this.opened = false;
|
|
90
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Determines the most accurate HTML element to use as the anchor for positioning the tooltip.
|
|
139
|
+
* If `htmlContent` is false, it attempts to find the actual element slotted as the trigger.
|
|
140
|
+
* Otherwise, or if no specific element is found, it defaults to the span wrapper around the trigger slot.
|
|
141
|
+
* This helps with precise alignment.
|
|
142
|
+
*/
|
|
143
|
+
determinePositioningAnchor() {
|
|
144
|
+
let positioningAnchor = this.triggerEl;
|
|
145
|
+
if (this.triggerEl !== null) {
|
|
146
|
+
const children = this.triggerEl.childNodes;
|
|
147
|
+
for (let i = 0; i < children.length; i++) {
|
|
148
|
+
const childNode = children[i];
|
|
149
|
+
if (childNode.nodeType === Node.ELEMENT_NODE) {
|
|
150
|
+
positioningAnchor = childNode;
|
|
151
|
+
break; // Found the first element, use it as the anchor
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// If no ELEMENT_NODE is found within this.triggerEl (e.g., if trigger is just text),
|
|
156
|
+
// positioningAnchor will correctly remain this.triggerEl (the span).
|
|
157
|
+
return positioningAnchor;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Centralized method to calculate and apply the tooltip's position.
|
|
161
|
+
* Uses the determined anchor element and the current content dimensions.
|
|
162
|
+
*/
|
|
163
|
+
repositionPortal() {
|
|
164
|
+
const anchor = this.determinePositioningAnchor();
|
|
165
|
+
if (anchor !== null && this.contentDiv !== null) {
|
|
166
|
+
positionTooltip({ elem: anchor, elemPlacement: this.placement, overlay: this.contentDiv });
|
|
167
|
+
const placementParts = this.placement.split('-');
|
|
168
|
+
const primaryPlacement = placementParts[0];
|
|
169
|
+
const isCardinalCenterPlacement = placementParts.length === 1;
|
|
170
|
+
if (isCardinalCenterPlacement) {
|
|
171
|
+
const anchorRect = anchor.getBoundingClientRect();
|
|
172
|
+
const overlayRect = this.contentDiv.getBoundingClientRect();
|
|
173
|
+
if (primaryPlacement === 'left' || primaryPlacement === 'right') {
|
|
174
|
+
const currentOverlayTop = parseFloat(this.contentDiv.style.top || '0');
|
|
175
|
+
const anchorCenterY = anchorRect.top + (anchorRect.height / 2);
|
|
176
|
+
const overlayCenterY = overlayRect.top + (overlayRect.height / 2);
|
|
177
|
+
const adjustmentY = anchorCenterY - overlayCenterY;
|
|
178
|
+
if (Math.abs(adjustmentY) > 0.5) {
|
|
179
|
+
this.contentDiv.style.top = `${currentOverlayTop + adjustmentY}px`;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
else if (primaryPlacement === 'top' || primaryPlacement === 'bottom') {
|
|
183
|
+
const currentOverlayLeft = parseFloat(this.contentDiv.style.left || '0');
|
|
184
|
+
const anchorCenterX = anchorRect.left + (anchorRect.width / 2);
|
|
185
|
+
const overlayCenterX = overlayRect.left + (overlayRect.width / 2);
|
|
186
|
+
const adjustmentX = anchorCenterX - overlayCenterX;
|
|
187
|
+
if (Math.abs(adjustmentX) > 0.5) {
|
|
188
|
+
this.contentDiv.style.left = `${currentOverlayLeft + adjustmentX}px`;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
createPortal() {
|
|
195
|
+
if (this.portalEl !== null)
|
|
196
|
+
return;
|
|
197
|
+
this.portalEl = document.createElement('div');
|
|
198
|
+
this.portalEl.className = `pds-tooltip pds-tooltip--${this.placement} ${this.htmlContent ? 'pds-tooltip--has-html-content' : ''} ${this.opened ? 'pds-tooltip--is-open' : ''} ${this.hasArrow ? '' : 'pds-tooltip--no-arrow'}`;
|
|
199
|
+
this.portalEl.style.position = 'fixed';
|
|
200
|
+
this.portalEl.style.zIndex = '9999';
|
|
201
|
+
if (this.portalEl.id === '') {
|
|
202
|
+
this.portalEl.id = this.componentId || this.el.id || `pds-tooltip-portal-${PdsTooltip.instanceCounter++}`;
|
|
203
|
+
}
|
|
204
|
+
if (this.portalEl.getAttribute('id') !== this.portalEl.id) {
|
|
205
|
+
this.portalEl.setAttribute('id', this.portalEl.id);
|
|
206
|
+
}
|
|
207
|
+
this.portalEl.setAttribute('role', 'tooltip');
|
|
208
|
+
this.portalEl.setAttribute('aria-hidden', this.opened ? 'false' : 'true');
|
|
209
|
+
this.portalEl.setAttribute('aria-live', this.opened ? 'polite' : 'off');
|
|
210
|
+
this.portalEl.style.maxWidth = this.maxWidth;
|
|
211
|
+
this.contentDiv = document.createElement('div');
|
|
212
|
+
this.contentDiv.className = 'pds-tooltip__content';
|
|
213
|
+
this.contentDiv.setAttribute('aria-hidden', this.opened ? 'false' : 'true');
|
|
214
|
+
this.contentDiv.setAttribute('aria-live', this.opened ? 'polite' : 'off');
|
|
215
|
+
this.contentDiv.setAttribute('role', 'tooltip');
|
|
216
|
+
this.contentDiv.style.maxWidth = this.maxWidth;
|
|
217
|
+
const contentSlotWrapper = this.el.querySelector('.pds-tooltip__content-slot-wrapper');
|
|
218
|
+
const slottedContentContainer = contentSlotWrapper === null || contentSlotWrapper === void 0 ? void 0 : contentSlotWrapper.querySelector('[slot="content"]');
|
|
219
|
+
let hasSlottedContent = false;
|
|
220
|
+
if (slottedContentContainer !== null) {
|
|
221
|
+
const childrenToClone = Array.from(slottedContentContainer.childNodes);
|
|
222
|
+
if (childrenToClone.length > 0) {
|
|
223
|
+
const hasMeaningfulNode = childrenToClone.some(node => {
|
|
224
|
+
var _a;
|
|
225
|
+
return node.nodeType === Node.ELEMENT_NODE ||
|
|
226
|
+
(node.nodeType === Node.TEXT_NODE && ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== '');
|
|
227
|
+
});
|
|
228
|
+
if (hasMeaningfulNode) {
|
|
229
|
+
hasSlottedContent = true;
|
|
230
|
+
childrenToClone.forEach((node /*, index*/) => {
|
|
231
|
+
var _a;
|
|
232
|
+
if (node.nodeType === Node.ELEMENT_NODE || (node.nodeType === Node.TEXT_NODE && ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== '')) {
|
|
233
|
+
this.contentDiv.appendChild(node.cloneNode(true));
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (!hasSlottedContent) {
|
|
240
|
+
if (this.content !== '') {
|
|
241
|
+
this.contentDiv.textContent = this.content;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
this.portalEl.appendChild(this.contentDiv);
|
|
245
|
+
document.body.appendChild(this.portalEl);
|
|
246
|
+
this.repositionPortal();
|
|
247
|
+
if (this.contentDiv !== null) {
|
|
248
|
+
this.overlayResizeObserver = new ResizeObserver(() => {
|
|
249
|
+
this.repositionPortal();
|
|
250
|
+
});
|
|
251
|
+
this.overlayResizeObserver.observe(this.contentDiv);
|
|
252
|
+
}
|
|
253
|
+
// Add global listeners when portal is created
|
|
254
|
+
window.addEventListener('scroll', this.handleScroll, true);
|
|
255
|
+
window.addEventListener('popstate', this.handleSpaNavigation, true);
|
|
256
|
+
window.addEventListener('hashchange', this.handleSpaNavigation, true);
|
|
257
|
+
// Add ARIA attribute to trigger, now that portalEl and its ID are confirmed
|
|
258
|
+
if (this.triggerEl !== null && this.portalEl.id !== '') {
|
|
259
|
+
this.triggerEl.setAttribute('aria-describedby', this.portalEl.id);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
removePortal() {
|
|
263
|
+
if (this.overlayResizeObserver !== null && this.contentDiv !== null) {
|
|
264
|
+
this.overlayResizeObserver.unobserve(this.contentDiv);
|
|
265
|
+
this.overlayResizeObserver = null;
|
|
266
|
+
}
|
|
267
|
+
if (this.portalEl !== null) {
|
|
268
|
+
window.removeEventListener('scroll', this.handleScroll, true);
|
|
269
|
+
window.removeEventListener('popstate', this.handleSpaNavigation, true);
|
|
270
|
+
window.removeEventListener('hashchange', this.handleSpaNavigation, true);
|
|
271
|
+
document.body.removeChild(this.portalEl);
|
|
272
|
+
this.portalEl = null;
|
|
273
|
+
}
|
|
274
|
+
// Remove ARIA attribute from trigger
|
|
275
|
+
if (this.triggerEl !== null) {
|
|
276
|
+
this.triggerEl.removeAttribute('aria-describedby');
|
|
277
|
+
}
|
|
278
|
+
this.contentDiv = null;
|
|
279
|
+
}
|
|
91
280
|
render() {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
pds-tooltip--${this.placement}
|
|
95
|
-
${this.htmlContent ? 'pds-tooltip--has-html-content' : ''}
|
|
96
|
-
${this.opened ? 'pds-tooltip--is-open' : ''}
|
|
97
|
-
${this.hasArrow ? '' : 'pds-tooltip--no-arrow'}
|
|
98
|
-
` }, h("span", { key: '33e96cb4f46ebc418f79971047a37fc5c3498e0d', "aria-describedby": this.componentId, class: "pds-tooltip__trigger" }, h("slot", { key: 'cca7b5d50e2cbc0f839a46caa5a5dc8a79f1cb15' })), h("div", { key: '22c666894f7835629e00e9c2c3964bcaf63000ae', class: "pds-tooltip__content", "aria-hidden": this.opened ? 'false' : 'true', "aria-live": this.opened ? 'polite' : 'off', id: this.componentId, ref: (el) => (this.contentEl = el), role: "tooltip", style: { maxWidth: this.maxWidth } }, h("slot", { key: '83a805d9eef71ac261a03d56853ccc8ac7bfe818', name: "content" }), this.content))));
|
|
281
|
+
const hostId = this.componentId || undefined;
|
|
282
|
+
return (h(Host, { key: '0fe2bea1ea0e8eaeb5879644694a2e129f1f4898', id: hostId, class: { 'pds-tooltip--is-open': this.opened } }, h("span", { key: 'f26feb3c37957573d3b6b0a55091b2e7012ae31b', class: "pds-tooltip__trigger", onMouseEnter: this.handleShow, onMouseLeave: this.handleHide, onFocus: this.handleShow, onBlur: this.handleHide, ref: el => this.triggerEl = el }, h("slot", { key: 'c7940e3aa7f17fc5d5fcdedc0a624204ceed291c' })), h("div", { key: '0c8dc83e3b7f8c1337aae8641d80f63c0866c348', class: "pds-tooltip__content-slot-wrapper", style: { display: 'none' } }, h("slot", { key: '2f6701768c0debdd69673da3ad7dc34b8b237f6a', name: "content" }))));
|
|
99
283
|
}
|
|
100
284
|
static get is() { return "pds-tooltip"; }
|
|
101
|
-
static get encapsulation() { return "shadow"; }
|
|
102
285
|
static get originalStyleUrls() {
|
|
103
286
|
return {
|
|
104
287
|
"$": ["pds-tooltip.scss"]
|
|
@@ -268,6 +451,7 @@ export class PdsTooltip {
|
|
|
268
451
|
}
|
|
269
452
|
static get states() {
|
|
270
453
|
return {
|
|
454
|
+
"_isInteractiveOpen": {},
|
|
271
455
|
"isOpen": {}
|
|
272
456
|
};
|
|
273
457
|
}
|
|
@@ -317,4 +501,5 @@ export class PdsTooltip {
|
|
|
317
501
|
}];
|
|
318
502
|
}
|
|
319
503
|
}
|
|
504
|
+
PdsTooltip.instanceCounter = 0;
|
|
320
505
|
//# sourceMappingURL=pds-tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-tooltip.js","sourceRoot":"","sources":["../../../src/components/pds-tooltip/pds-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAE7B;;;GAGG;AAOH,MAAM,OAAO,UAAU;IALvB;QAaE;;;WAGG;QACM,WAAM,GAAG,KAAK,CAAC;QAYxB;;;WAGG;QACK,aAAQ,GAAI,IAAI,CAAC;QAEzB;;;WAGG;QACK,gBAAW,GAAG,KAAK,CAAC;QAE5B;;;WAGG;QACs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K,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE;oBAElC,6DACE,IAAI,EAAC,SAAS,GACR;oBACP,IAAI,CAAC,OAAO,CACT,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, h, Method, Watch } from '@stencil/core';\nimport {\n positionTooltip\n} from '../../utils/overlay';\n\n/**\n * @slot (default) - The tooltip's target element\n * @slot content - HTML content for the tooltip\n */\n\n@Component({\n tag: 'pds-tooltip',\n styleUrls: ['pds-tooltip.scss'],\n shadow: true,\n})\nexport class PdsTooltip {\n private contentEl: HTMLElement | null;\n\n /**\n * Reference to the Host element\n */\n @Element() el: HTMLPdsTooltipElement;\n\n /**\n * Determines when the tooltip is open\n * @defaultValue false\n */\n @State() isOpen = false;\n\n /**\n * Content for the tooltip. If HTML is required, use the content slot\n */\n @Prop() content: string;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Determines whether or not the tooltip has an arrow\n * @defaultValue true\n */\n @Prop() hasArrow? = true;\n\n /**\n * Enable this option when using the content slot\n * @defaultValue false\n */\n @Prop() htmlContent = false;\n\n /**\n * Determines the preferred position of the tooltip\n * @defaultValue \"right\"\n */\n @Prop({ reflect: true }) placement:\n 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'right';\n\n /**\n * Sets the maximum width of the tooltip content\n * @defaultValue \"352px\"\n */\n @Prop() maxWidth: string = '352px';\n\n /**\n * Determines whether or not the tooltip is visible\n * @defaultValue false\n */\n @Prop({mutable: true, reflect: true}) opened = false;\n\n @Watch('opened')\n handleOpenToggle() {\n if (this.opened) {\n this.handleShow();\n } else {\n this.handleHide();\n }\n }\n\n componentWillLoad() {\n if (this.opened) {\n this.showTooltip();\n }\n\n this.el.addEventListener('blur', this.handleHide, true);\n this.el.addEventListener('focus', this.handleShow, true);\n }\n\n componentDidLoad() {\n // fix for Safari iOS back button issue\n window.addEventListener('pageshow', this.handlePageShow);\n\n return () => {\n window.removeEventListener('pageshow', this.handlePageShow);\n };\n }\n\n componentDidUpdate() {\n if (this.opened) {\n this.showTooltip();\n }\n }\n\n componentDidRender() {\n positionTooltip({elem: this.el, elemPlacement: this.placement, overlay: this.contentEl});\n }\n\n /**\n * Shows the tooltip by enabling the opened property\n */\n @Method()\n async showTooltip() {\n this.opened = true;\n }\n\n /**\n * Hides the tooltip by disabling the opened property\n */\n @Method()\n async hideTooltip() {\n this.opened = false;\n }\n\n private handleHide = () => {\n this.hideTooltip();\n };\n\n private handleShow = () => {\n this.showTooltip();\n };\n\n private handlePageShow = () => {\n this.opened = false;\n };\n\n render() {\n return (\n <Host\n onMouseEnter={this.handleShow}\n onMouseLeave={this.handleHide}\n onFocusin={this.handleShow}\n onFocusout={this.handleHide}\n >\n <div\n class={`\n pds-tooltip\n pds-tooltip--${this.placement}\n ${this.htmlContent ? 'pds-tooltip--has-html-content' : ''}\n ${this.opened ? 'pds-tooltip--is-open' : ''}\n ${this.hasArrow ? '' : 'pds-tooltip--no-arrow'}\n `}\n >\n <span\n aria-describedby={this.componentId}\n class=\"pds-tooltip__trigger\"\n >\n <slot />\n </span>\n\n <div class=\"pds-tooltip__content\"\n aria-hidden={this.opened ? 'false' : 'true'}\n aria-live={this.opened ? 'polite' : 'off'}\n id={this.componentId}\n ref={(el) => (this.contentEl = el)}\n role=\"tooltip\"\n style={{ maxWidth: this.maxWidth }}\n >\n <slot\n name=\"content\"\n ></slot>\n {this.content}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pds-tooltip.js","sourceRoot":"","sources":["../../../src/components/pds-tooltip/pds-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;GAGG;AAQH,MAAM,OAAO,UAAU;IANvB;QASE;;;WAGG;QACc,uBAAkB,GAAG,KAAK,CAAC;QAEpC,aAAQ,GAAuB,IAAI,CAAC;QACpC,cAAS,GAAuB,IAAI,CAAC;QACrC,eAAU,GAAuB,IAAI,CAAC;QACtC,yBAAoB,GAA4B,IAAI,CAAC;QACrD,0BAAqB,GAA0B,IAAI,CAAC;QAO5D;;;WAGG;QACM,WAAM,GAAG,KAAK,CAAC;QAYxB;;;WAGG;QACK,aAAQ,GAAI,IAAI,CAAC;QAEzB;;;WAGG;QACK,gBAAW,GAAG,KAAK,CAAC;QAE5B;;;WAGG;QACsB,cAAS,GAYjB,OAAO,CAAC;QAEzB;;;WAGG;QACK,aAAQ,GAAW,OAAO,CAAC;QAEnC;;;WAGG;QACmC,WAAM,GAAG,KAAK,CAAC;QA8D7C,eAAU,GAAG,GAAG,EAAE;YACxB,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC5C,OAAO;YACT,CAAC;YAED,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAClC,CAAC,CAAC;QAEM,eAAU,GAAG,GAAG,EAAE;YACxB,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC5C,OAAO;YACT,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtXc,0BAAe,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import { Component, Element, Host, Prop, State, h, Method, Watch } from '@stencil/core';\nimport { positionTooltip } from '../../utils/overlay';\n\n/**\n * @slot (default) - The tooltip's target element\n * @slot content - HTML content for the tooltip\n */\n\n@Component({\n tag: 'pds-tooltip',\n styleUrls: ['pds-tooltip.scss'],\n shadow: false,\n})\n\nexport class PdsTooltip {\n private static instanceCounter = 0;\n\n /**\n * Internal state: true if the tooltip was opened by user interaction (hover/focus),\n * false if opened via the `opened` prop or currently closed.\n */\n @State() private _isInteractiveOpen = false;\n\n private portalEl: HTMLElement | null = null;\n private triggerEl: HTMLElement | null = null;\n private contentDiv: HTMLElement | null = null;\n private slotMutationObserver: MutationObserver | null = null;\n private overlayResizeObserver: ResizeObserver | null = null;\n\n /**\n * Reference to the Host element\n */\n @Element() el: HTMLPdsTooltipElement;\n\n /**\n * Determines when the tooltip is open\n * @defaultValue false\n */\n @State() isOpen = false;\n\n /**\n * Content for the tooltip. If HTML is required, use the content slot\n */\n @Prop() content: string;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Determines whether or not the tooltip has an arrow\n * @defaultValue true\n */\n @Prop() hasArrow? = true;\n\n /**\n * Enable this option when using the content slot\n * @defaultValue false\n */\n @Prop() htmlContent = false;\n\n /**\n * Determines the preferred position of the tooltip\n * @defaultValue \"right\"\n */\n @Prop({ reflect: true }) placement:\n 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'right';\n\n /**\n * Sets the maximum width of the tooltip content\n * @defaultValue \"352px\"\n */\n @Prop() maxWidth: string = '352px';\n\n /**\n * Determines whether or not the tooltip is visible\n * @defaultValue false\n */\n @Prop({mutable: true, reflect: true}) opened = false;\n\n @Watch('opened')\n\n handleOpenToggle(newValue: boolean, oldValue: boolean) {\n if (newValue === false && oldValue === true) {\n this._isInteractiveOpen = false;\n }\n }\n\n componentWillLoad() {\n this._isInteractiveOpen = false;\n }\n\n componentDidLoad() {\n window.addEventListener('pageshow', this.handlePageShow);\n this.triggerEl = this.el.querySelector('.pds-tooltip__trigger') as HTMLElement;\n const contentSlotWrapper = this.el.querySelector('.pds-tooltip__content-slot-wrapper');\n\n if (contentSlotWrapper !== null) {\n this.slotMutationObserver = new MutationObserver(() => {\n if (this.opened && this.portalEl !== null) {\n this.removePortal();\n this.createPortal();\n }\n });\n this.slotMutationObserver.observe(contentSlotWrapper, { childList: true, subtree: false });\n }\n\n return () => {\n window.removeEventListener('pageshow', this.handlePageShow);\n\n if (this.slotMutationObserver !== null) {\n this.slotMutationObserver.disconnect();\n }\n };\n }\n\n componentDidRender() {\n if (this.opened && this.portalEl === null) {\n this.createPortal();\n } else if (!this.opened && this.portalEl !== null) {\n this.removePortal();\n }\n }\n\n /**\n * Shows the tooltip by enabling the opened property\n */\n @Method()\n async showTooltip() {\n this.opened = true;\n }\n\n /**\n * Hides the tooltip by disabling the opened property\n */\n @Method()\n async hideTooltip() {\n this.opened = false;\n }\n\n private handleHide = () => {\n if (this.opened && !this._isInteractiveOpen) {\n return;\n }\n\n this.hideTooltip();\n this._isInteractiveOpen = false;\n };\n\n private handleShow = () => {\n if (this.opened && !this._isInteractiveOpen) {\n return;\n }\n\n this._isInteractiveOpen = true;\n this.showTooltip();\n };\n\n private handlePageShow = () => {\n if (this.opened && !this._isInteractiveOpen) {\n return;\n }\n\n this.opened = false;\n this._isInteractiveOpen = false;\n };\n\n private handleScroll = () => {\n if (this.opened) {\n if (!this._isInteractiveOpen) {\n this.repositionPortal();\n } else {\n this.hideTooltip();\n this._isInteractiveOpen = false;\n }\n }\n };\n\n private handleSpaNavigation = () => {\n if (this.opened && !this._isInteractiveOpen) {\n return;\n }\n\n this.hideTooltip();\n this._isInteractiveOpen = false;\n };\n\n /**\n * Determines the most accurate HTML element to use as the anchor for positioning the tooltip.\n * If `htmlContent` is false, it attempts to find the actual element slotted as the trigger.\n * Otherwise, or if no specific element is found, it defaults to the span wrapper around the trigger slot.\n * This helps with precise alignment.\n */\n private determinePositioningAnchor(): HTMLElement | null {\n let positioningAnchor: HTMLElement | null = this.triggerEl;\n\n if (this.triggerEl !== null) {\n const children = this.triggerEl.childNodes;\n\n for (let i = 0; i < children.length; i++) {\n const childNode = children[i];\n\n if (childNode.nodeType === Node.ELEMENT_NODE) {\n positioningAnchor = childNode as HTMLElement;\n break; // Found the first element, use it as the anchor\n }\n }\n }\n\n // If no ELEMENT_NODE is found within this.triggerEl (e.g., if trigger is just text),\n // positioningAnchor will correctly remain this.triggerEl (the span).\n return positioningAnchor;\n }\n\n /**\n * Centralized method to calculate and apply the tooltip's position.\n * Uses the determined anchor element and the current content dimensions.\n */\n private repositionPortal() {\n const anchor = this.determinePositioningAnchor();\n\n if (anchor !== null && this.contentDiv !== null) {\n positionTooltip({ elem: anchor, elemPlacement: this.placement, overlay: this.contentDiv });\n const placementParts = this.placement.split('-');\n const primaryPlacement = placementParts[0];\n const isCardinalCenterPlacement = placementParts.length === 1;\n\n if (isCardinalCenterPlacement) {\n const anchorRect = anchor.getBoundingClientRect();\n const overlayRect = this.contentDiv.getBoundingClientRect();\n\n if (primaryPlacement === 'left' || primaryPlacement === 'right') {\n const currentOverlayTop = parseFloat(this.contentDiv.style.top || '0');\n const anchorCenterY = anchorRect.top + (anchorRect.height / 2);\n const overlayCenterY = overlayRect.top + (overlayRect.height / 2);\n const adjustmentY = anchorCenterY - overlayCenterY;\n\n if (Math.abs(adjustmentY) > 0.5) {\n this.contentDiv.style.top = `${currentOverlayTop + adjustmentY}px`;\n }\n\n } else if (primaryPlacement === 'top' || primaryPlacement === 'bottom') {\n const currentOverlayLeft = parseFloat(this.contentDiv.style.left || '0');\n const anchorCenterX = anchorRect.left + (anchorRect.width / 2);\n const overlayCenterX = overlayRect.left + (overlayRect.width / 2);\n const adjustmentX = anchorCenterX - overlayCenterX;\n\n if (Math.abs(adjustmentX) > 0.5) {\n this.contentDiv.style.left = `${currentOverlayLeft + adjustmentX}px`;\n }\n }\n }\n }\n }\n\n private createPortal() {\n if (this.portalEl !== null) return;\n\n this.portalEl = document.createElement('div');\n this.portalEl.className = `pds-tooltip pds-tooltip--${this.placement} ${this.htmlContent ? 'pds-tooltip--has-html-content' : ''} ${this.opened ? 'pds-tooltip--is-open' : ''} ${this.hasArrow ? '' : 'pds-tooltip--no-arrow'}`;\n this.portalEl.style.position = 'fixed';\n this.portalEl.style.zIndex = '9999';\n\n if (this.portalEl.id === '') {\n this.portalEl.id = this.componentId || this.el.id || `pds-tooltip-portal-${PdsTooltip.instanceCounter++}`;\n }\n\n if (this.portalEl.getAttribute('id') !== this.portalEl.id) {\n this.portalEl.setAttribute('id', this.portalEl.id);\n }\n\n this.portalEl.setAttribute('role', 'tooltip');\n this.portalEl.setAttribute('aria-hidden', this.opened ? 'false' : 'true');\n this.portalEl.setAttribute('aria-live', this.opened ? 'polite' : 'off');\n this.portalEl.style.maxWidth = this.maxWidth;\n\n this.contentDiv = document.createElement('div');\n this.contentDiv.className = 'pds-tooltip__content';\n this.contentDiv.setAttribute('aria-hidden', this.opened ? 'false' : 'true');\n this.contentDiv.setAttribute('aria-live', this.opened ? 'polite' : 'off');\n this.contentDiv.setAttribute('role', 'tooltip');\n this.contentDiv.style.maxWidth = this.maxWidth;\n\n const contentSlotWrapper = this.el.querySelector('.pds-tooltip__content-slot-wrapper');\n const slottedContentContainer = contentSlotWrapper?.querySelector('[slot=\"content\"]') as HTMLElement | null;\n let hasSlottedContent = false;\n\n if (slottedContentContainer !== null) {\n const childrenToClone = Array.from(slottedContentContainer.childNodes);\n\n if (childrenToClone.length > 0) {\n const hasMeaningfulNode = childrenToClone.some(node =>\n node.nodeType === Node.ELEMENT_NODE ||\n (node.nodeType === Node.TEXT_NODE && node.textContent?.trim() !== '')\n );\n\n if (hasMeaningfulNode) {\n hasSlottedContent = true;\n childrenToClone.forEach((node /*, index*/) => {\n if (node.nodeType === Node.ELEMENT_NODE || (node.nodeType === Node.TEXT_NODE && node.textContent?.trim() !== '')) {\n this.contentDiv.appendChild(node.cloneNode(true));\n }\n });\n }\n }\n }\n\n if (!hasSlottedContent) {\n if (this.content !== '') {\n this.contentDiv.textContent = this.content;\n }\n }\n\n this.portalEl.appendChild(this.contentDiv);\n document.body.appendChild(this.portalEl);\n\n this.repositionPortal();\n\n if (this.contentDiv !== null) {\n this.overlayResizeObserver = new ResizeObserver(() => {\n this.repositionPortal();\n });\n this.overlayResizeObserver.observe(this.contentDiv);\n }\n\n // Add global listeners when portal is created\n window.addEventListener('scroll', this.handleScroll, true);\n window.addEventListener('popstate', this.handleSpaNavigation, true);\n window.addEventListener('hashchange', this.handleSpaNavigation, true);\n\n // Add ARIA attribute to trigger, now that portalEl and its ID are confirmed\n if (this.triggerEl !== null && this.portalEl.id !== '') {\n this.triggerEl.setAttribute('aria-describedby', this.portalEl.id);\n }\n }\n\n private removePortal() {\n if (this.overlayResizeObserver !== null && this.contentDiv !== null) {\n this.overlayResizeObserver.unobserve(this.contentDiv);\n this.overlayResizeObserver = null;\n }\n\n if (this.portalEl !== null) {\n window.removeEventListener('scroll', this.handleScroll, true);\n window.removeEventListener('popstate', this.handleSpaNavigation, true);\n window.removeEventListener('hashchange', this.handleSpaNavigation, true);\n document.body.removeChild(this.portalEl);\n this.portalEl = null;\n }\n\n // Remove ARIA attribute from trigger\n if (this.triggerEl !== null) {\n this.triggerEl.removeAttribute('aria-describedby');\n }\n this.contentDiv = null;\n }\n\n render() {\n const hostId = this.componentId || undefined;\n\n return (\n <Host id={hostId} class={{ 'pds-tooltip--is-open': this.opened }}>\n <span\n class=\"pds-tooltip__trigger\"\n onMouseEnter={this.handleShow}\n onMouseLeave={this.handleHide}\n onFocus={this.handleShow}\n onBlur={this.handleHide}\n ref={el => this.triggerEl = el}\n >\n <slot />\n </span>\n <div class=\"pds-tooltip__content-slot-wrapper\" style={{ display: 'none' }}>\n <slot name=\"content\"></slot>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -15,10 +15,10 @@ export default {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const BaseTemplate = (args) => html`
|
|
18
|
-
<pds-tooltip content=${args.content} max-width=${args.maxWidth} has-arrow=${args.hasArrow} placement=${args.placement}>${args.slot}</pds-tooltip>`;
|
|
18
|
+
<pds-tooltip content=${args.content} max-width=${args.maxWidth} has-arrow=${args.hasArrow} placement=${args.placement} opened=${args.opened}>${args.slot}</pds-tooltip>`;
|
|
19
19
|
|
|
20
20
|
const HTMLContentTemplate = (args) => html`
|
|
21
|
-
<pds-tooltip has-arrow=${args.hasArrow} max-width=${args.maxWidth} placement=${args.placement} html-content=${args.htmlContent}>
|
|
21
|
+
<pds-tooltip has-arrow=${args.hasArrow} max-width=${args.maxWidth} placement=${args.placement} html-content=${args.htmlContent} opened=${args.opened}>
|
|
22
22
|
<div slot="content">
|
|
23
23
|
<p><strong>This is a tooltip</strong></p>
|
|
24
24
|
<p>Tooltips are used to describe or identify an element. In most scenarios, tooltips help the user understand the meaning, function or alt-text of an element.</p>
|
|
@@ -79,25 +79,29 @@ const PositionTemplate = (args) => html`
|
|
|
79
79
|
export const Default = BaseTemplate.bind({});
|
|
80
80
|
Default.args = {
|
|
81
81
|
content: "The tooltip content",
|
|
82
|
+
opened: false,
|
|
82
83
|
placement: "right",
|
|
83
|
-
slot: "target text"
|
|
84
|
+
slot: "target text",
|
|
84
85
|
};
|
|
85
86
|
|
|
86
87
|
export const HTMLContent = HTMLContentTemplate.bind({});
|
|
87
88
|
HTMLContent.args = {
|
|
88
89
|
htmlContent: true,
|
|
90
|
+
opened: false,
|
|
89
91
|
placement: "bottom-start",
|
|
90
92
|
};
|
|
91
93
|
|
|
92
94
|
export const Positioning = PositionTemplate.bind({});
|
|
93
95
|
Positioning.args = {
|
|
94
96
|
content: "Trigger",
|
|
97
|
+
opened: false
|
|
95
98
|
};
|
|
96
99
|
|
|
97
100
|
export const NoArrow = BaseTemplate.bind({});
|
|
98
101
|
NoArrow.args = {
|
|
99
102
|
content: "The tooltip content",
|
|
100
103
|
hasArrow: false,
|
|
104
|
+
opened: false,
|
|
101
105
|
placement: "bottom-start",
|
|
102
106
|
slot: "target text"
|
|
103
107
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/utils/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["export interface BasePdsProps {\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n componentId: string;\n}\n"]}
|
|
@@ -1,68 +1,85 @@
|
|
|
1
1
|
export const positionTooltip = ({ elem, elemPlacement, overlay, offset = 8 }) => {
|
|
2
|
-
if (elem
|
|
3
|
-
return;
|
|
2
|
+
if (elem === null || overlay === null)
|
|
3
|
+
return false;
|
|
4
|
+
if (typeof elemPlacement !== 'string' || elemPlacement.trim() === '') {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
4
7
|
const rect = elem.getBoundingClientRect();
|
|
5
8
|
const contentRect = overlay.getBoundingClientRect();
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
// Reset styles
|
|
10
|
+
overlay.style.top = '';
|
|
11
|
+
overlay.style.left = '';
|
|
12
|
+
overlay.style.right = '';
|
|
13
|
+
overlay.style.bottom = '';
|
|
14
|
+
overlay.style.transform = '';
|
|
15
|
+
// Use fixed positioning for portal overlays
|
|
16
|
+
overlay.style.position = 'fixed';
|
|
17
|
+
// Detect if the trigger is a span with only text or a text node
|
|
18
|
+
let isTextTrigger = false;
|
|
19
|
+
if (elem.childNodes.length === 1 && elem.childNodes[0].nodeType === Node.TEXT_NODE) {
|
|
20
|
+
isTextTrigger = true;
|
|
21
|
+
}
|
|
22
|
+
else if (elem.childNodes.length === 1 && elem.childNodes[0].nodeType === Node.ELEMENT_NODE) {
|
|
23
|
+
const child = elem.childNodes[0];
|
|
24
|
+
if (child.tagName === 'SPAN' && child.childNodes.length === 1 && child.childNodes[0].nodeType === Node.TEXT_NODE) {
|
|
25
|
+
isTextTrigger = true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
9
28
|
switch (true) {
|
|
10
|
-
case elemPlacement.includes(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
overlay.style.
|
|
29
|
+
case elemPlacement.includes('right'):
|
|
30
|
+
if (isTextTrigger) {
|
|
31
|
+
// Align to the bottom of the trigger for text triggers
|
|
32
|
+
overlay.style.top = `${rect.bottom - contentRect.height / 2}px`;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
overlay.style.top = `${rect.top + rect.height / 2 - contentRect.height / 2}px`;
|
|
17
36
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
overlay.style.top =
|
|
21
|
-
|
|
37
|
+
overlay.style.left = `${rect.right + offset}px`;
|
|
38
|
+
if (elemPlacement.includes('start')) {
|
|
39
|
+
overlay.style.top = `${rect.top}px`;
|
|
40
|
+
}
|
|
41
|
+
if (elemPlacement.includes('end')) {
|
|
42
|
+
overlay.style.top = `${rect.bottom - contentRect.height}px`;
|
|
22
43
|
}
|
|
23
44
|
break;
|
|
24
|
-
case elemPlacement.includes(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
overlay.style.top =
|
|
30
|
-
|
|
45
|
+
case elemPlacement.includes('left'):
|
|
46
|
+
if (isTextTrigger) {
|
|
47
|
+
overlay.style.top = `${rect.bottom - contentRect.height / 2}px`;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
overlay.style.top = `${rect.top + rect.height / 2 - contentRect.height / 2}px`;
|
|
51
|
+
}
|
|
52
|
+
overlay.style.left = `${rect.left - contentRect.width - offset}px`;
|
|
53
|
+
if (elemPlacement.includes('start')) {
|
|
54
|
+
overlay.style.top = `${rect.top}px`;
|
|
31
55
|
}
|
|
32
|
-
if (elemPlacement.includes(
|
|
33
|
-
overlay.style.
|
|
34
|
-
overlay.style.top = 'initial';
|
|
35
|
-
overlay.style.transform = 'translateY(0)';
|
|
56
|
+
if (elemPlacement.includes('end')) {
|
|
57
|
+
overlay.style.top = `${rect.bottom - contentRect.height}px`;
|
|
36
58
|
}
|
|
37
59
|
break;
|
|
38
|
-
case elemPlacement.includes(
|
|
39
|
-
overlay.style.top =
|
|
40
|
-
overlay.style.left =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
overlay.style.left = '0';
|
|
44
|
-
overlay.style.transform = 'translateX(0)';
|
|
60
|
+
case elemPlacement.includes('bottom'):
|
|
61
|
+
overlay.style.top = `${rect.bottom + offset}px`;
|
|
62
|
+
overlay.style.left = `${rect.left + rect.width / 2 - contentRect.width / 2}px`;
|
|
63
|
+
if (elemPlacement.includes('start')) {
|
|
64
|
+
overlay.style.left = `${rect.left}px`;
|
|
45
65
|
}
|
|
46
|
-
if (elemPlacement.includes(
|
|
47
|
-
overlay.style.left =
|
|
48
|
-
overlay.style.right = '
|
|
49
|
-
overlay.style.transform = 'translateX(0)';
|
|
66
|
+
if (elemPlacement.includes('end')) {
|
|
67
|
+
overlay.style.left = `${rect.right - contentRect.width}px`;
|
|
68
|
+
overlay.style.right = 'initial';
|
|
50
69
|
}
|
|
51
70
|
break;
|
|
52
|
-
case elemPlacement.includes(
|
|
53
|
-
overlay.style.top =
|
|
54
|
-
overlay.style.left =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
overlay.style.left = '0';
|
|
58
|
-
overlay.style.transform = 'translateX(0)';
|
|
71
|
+
case elemPlacement.includes('top'):
|
|
72
|
+
overlay.style.top = `${rect.top - contentRect.height - offset}px`;
|
|
73
|
+
overlay.style.left = `${rect.left + rect.width / 2 - contentRect.width / 2}px`;
|
|
74
|
+
if (elemPlacement.includes('start')) {
|
|
75
|
+
overlay.style.left = `${rect.left}px`;
|
|
59
76
|
}
|
|
60
|
-
if (elemPlacement.includes(
|
|
61
|
-
overlay.style.left =
|
|
62
|
-
overlay.style.right = '
|
|
63
|
-
overlay.style.transform = 'translateX(0)';
|
|
77
|
+
if (elemPlacement.includes('end')) {
|
|
78
|
+
overlay.style.left = `${rect.right - contentRect.width}px`;
|
|
79
|
+
overlay.style.right = 'initial';
|
|
64
80
|
}
|
|
65
81
|
break;
|
|
66
82
|
}
|
|
83
|
+
return true;
|
|
67
84
|
};
|
|
68
85
|
//# sourceMappingURL=overlay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.js","sourceRoot":"","sources":["../../src/utils/overlay.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,EAAc,
|
|
1
|
+
{"version":3,"file":"overlay.js","sourceRoot":"","sources":["../../src/utils/overlay.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,EAAc,EAAW,EAAE;IAClG,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACpD,IAAI,OAAO,aAAa,KAAK,QAAQ,IAAI,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACrE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC1C,MAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAEpD,eAAe;IACf,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC;IACvB,OAAO,CAAC,KAAK,CAAC,IAAI,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;gBACpC,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC;YACxC,CAAC;YACD,IAAI,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAClC,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,IAAI,CAAC;gBAC3D,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC;YAClC,CAAC;YACD,MAAM;IACV,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAA","sourcesContent":["interface OverlayArgs {\n elem: HTMLElement | null;\n elemPlacement: string;\n overlay: HTMLElement | null;\n offset?: number;\n}\n\nexport const positionTooltip = ({elem, elemPlacement, overlay, offset = 8}: OverlayArgs): boolean => {\n if (elem === null || overlay === null) return false;\n if (typeof elemPlacement !== 'string' || elemPlacement.trim() === '') {\n return false;\n }\n\n const rect = elem.getBoundingClientRect();\n const contentRect = overlay.getBoundingClientRect();\n\n // Reset styles\n overlay.style.top = '';\n overlay.style.left = '';\n overlay.style.right = '';\n overlay.style.bottom = '';\n overlay.style.transform = '';\n\n // Use fixed positioning for portal overlays\n overlay.style.position = 'fixed';\n\n // Detect if the trigger is a span with only text or a text node\n let isTextTrigger = false;\n if (elem.childNodes.length === 1 && elem.childNodes[0].nodeType === Node.TEXT_NODE) {\n isTextTrigger = true;\n } else if (elem.childNodes.length === 1 && elem.childNodes[0].nodeType === Node.ELEMENT_NODE) {\n const child = elem.childNodes[0] as HTMLElement;\n if (child.tagName === 'SPAN' && child.childNodes.length === 1 && child.childNodes[0].nodeType === Node.TEXT_NODE) {\n isTextTrigger = true;\n }\n }\n\n switch (true) {\n case elemPlacement.includes('right'):\n if (isTextTrigger) {\n // Align to the bottom of the trigger for text triggers\n overlay.style.top = `${rect.bottom - contentRect.height / 2}px`;\n } else {\n overlay.style.top = `${rect.top + rect.height / 2 - contentRect.height / 2}px`;\n }\n overlay.style.left = `${rect.right + offset}px`;\n if (elemPlacement.includes('start')) {\n overlay.style.top = `${rect.top}px`;\n }\n if (elemPlacement.includes('end')) {\n overlay.style.top = `${rect.bottom - contentRect.height}px`;\n }\n break;\n case elemPlacement.includes('left'):\n if (isTextTrigger) {\n overlay.style.top = `${rect.bottom - contentRect.height / 2}px`;\n } else {\n overlay.style.top = `${rect.top + rect.height / 2 - contentRect.height / 2}px`;\n }\n overlay.style.left = `${rect.left - contentRect.width - offset}px`;\n if (elemPlacement.includes('start')) {\n overlay.style.top = `${rect.top}px`;\n }\n if (elemPlacement.includes('end')) {\n overlay.style.top = `${rect.bottom - contentRect.height}px`;\n }\n break;\n case elemPlacement.includes('bottom'):\n overlay.style.top = `${rect.bottom + offset}px`;\n overlay.style.left = `${rect.left + rect.width / 2 - contentRect.width / 2}px`;\n if (elemPlacement.includes('start')) {\n overlay.style.left = `${rect.left}px`;\n }\n if (elemPlacement.includes('end')) {\n overlay.style.left = `${rect.right - contentRect.width}px`;\n overlay.style.right = 'initial';\n }\n break;\n case elemPlacement.includes('top'):\n overlay.style.top = `${rect.top - contentRect.height - offset}px`;\n overlay.style.left = `${rect.left + rect.width / 2 - contentRect.width / 2}px`;\n if (elemPlacement.includes('start')) {\n overlay.style.left = `${rect.left}px`;\n }\n if (elemPlacement.includes('end')) {\n overlay.style.left = `${rect.right - contentRect.width}px`;\n overlay.style.right = 'initial';\n }\n break;\n }\n return true;\n}\n"]}
|
|
@@ -15,11 +15,11 @@ export const debounce = (func, wait = 0) => {
|
|
|
15
15
|
timer = setTimeout(func, wait, ...args);
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
export const setColor = (color) => {
|
|
18
|
+
export const setColor = (color, customColors) => {
|
|
19
19
|
var _a;
|
|
20
20
|
if (!color)
|
|
21
21
|
return;
|
|
22
|
-
const
|
|
22
|
+
const defaultColors = {
|
|
23
23
|
primary: 'var(--pine-color-text-primary)',
|
|
24
24
|
secondary: 'var(--pine-color-text-secondary)',
|
|
25
25
|
neutral: 'var(--pine-color-text-neutral)',
|
|
@@ -29,6 +29,7 @@ export const setColor = (color) => {
|
|
|
29
29
|
success: 'var(--pine-color-text-success)',
|
|
30
30
|
warning: 'var(--pine-color-text-warning)',
|
|
31
31
|
};
|
|
32
|
+
const colors = customColors || defaultColors;
|
|
32
33
|
return {
|
|
33
34
|
'--color': (_a = colors[color]) !== null && _a !== void 0 ? _a : (color.startsWith('--') ? `var(${color})` : color)
|
|
34
35
|
};
|