@ds-mo/ui 16.1.2 → 16.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/dist/.package-ready.json +1 -1
- package/dist/agent-patterns.json +1 -1
- package/dist/agent.json +574 -3
- package/dist/angular/ds-disclosure.d.ts +18 -0
- package/dist/angular/ds-disclosure.js +42 -0
- package/dist/angular/ds-drawer.d.ts +40 -0
- package/dist/angular/ds-drawer.js +54 -0
- package/dist/angular/ds-popover.d.ts +24 -0
- package/dist/angular/ds-popover.js +45 -0
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.js +3 -0
- package/dist/angular/proxies.d.ts +3 -0
- package/dist/angular/proxies.js +3 -0
- package/dist/components/ds-agent-activity.js +1 -1
- package/dist/components/ds-agent-questionnaire.js +1 -1
- package/dist/components/ds-agent-response.js +1 -1
- package/dist/components/ds-agent-source-list.js +1 -1
- package/dist/components/ds-agent-tool-call.js +1 -1
- package/dist/components/ds-attachment-list.js +1 -1
- package/dist/components/ds-avatar.js +1 -1
- package/dist/components/ds-badge.js +1 -1
- package/dist/components/ds-banner.js +1 -1
- package/dist/components/ds-bar-action.js +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-page-title.js +1 -1
- package/dist/components/ds-bar-title.js +1 -1
- package/dist/components/ds-bar-workflow.js +1 -1
- package/dist/components/ds-breadcrumb.js +1 -1
- package/dist/components/ds-button-filled.js +1 -1
- package/dist/components/ds-button-inverted.js +1 -1
- package/dist/components/ds-button-unfilled.js +1 -1
- package/dist/components/ds-calendar.js +1 -1
- package/dist/components/ds-card-action-center.js +1 -1
- package/dist/components/ds-card-chart.js +1 -1
- package/dist/components/ds-card-navigation.js +1 -1
- package/dist/components/ds-card-overview.js +1 -1
- package/dist/components/ds-card-setting.js +1 -1
- package/dist/components/ds-card-settings-scope.js +1 -1
- package/dist/components/ds-chart-legend.js +1 -1
- package/dist/components/ds-chart.js +1 -1
- package/dist/components/ds-checkbox-group.js +1 -1
- package/dist/components/ds-checkbox.js +1 -1
- package/dist/components/ds-chip.js +1 -1
- package/dist/components/ds-code-block.js +1 -1
- package/dist/components/ds-conversation-list-item.js +1 -1
- package/dist/components/ds-conversation-list-section.js +1 -1
- package/dist/components/ds-conversation-list.js +1 -1
- package/dist/components/ds-data-customize.js +1 -1
- package/dist/components/ds-data-customize.js.map +1 -1
- package/dist/components/ds-data-filter.js +1 -1
- package/dist/components/ds-data-group.js +1 -1
- package/dist/components/ds-data-preferences.js +1 -1
- package/dist/components/ds-data-preferences.js.map +1 -1
- package/dist/components/ds-data-saved-views.js +1 -1
- package/dist/components/ds-data-search.js +1 -1
- package/dist/components/ds-data-search.js.map +1 -1
- package/dist/components/ds-data-sort.js +1 -1
- package/dist/components/ds-data-toolbar.js +1 -1
- package/dist/components/ds-disclosure.d.ts +11 -0
- package/dist/components/ds-disclosure.js +2 -0
- package/dist/components/ds-disclosure.js.map +1 -0
- package/dist/components/ds-divider.js +1 -1
- package/dist/components/ds-drawer.d.ts +11 -0
- package/dist/components/ds-drawer.js +2 -0
- package/dist/components/ds-drawer.js.map +1 -0
- package/dist/components/ds-empty-state.js +1 -1
- package/dist/components/ds-field.js +1 -1
- package/dist/components/ds-filter-menu.js +1 -1
- package/dist/components/ds-icon.js +1 -1
- package/dist/components/ds-inline-banner-settings.js +1 -1
- package/dist/components/ds-input-date.js +1 -1
- package/dist/components/ds-input-time.js +1 -1
- package/dist/components/ds-input.js +1 -1
- package/dist/components/ds-map-cluster-marker.js +1 -1
- package/dist/components/ds-map-entity-marker.js +1 -1
- package/dist/components/ds-map-marker.js +1 -1
- package/dist/components/ds-markdown.js +1 -1
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-message-actions.js +1 -1
- package/dist/components/ds-message-bubble.js +1 -1
- package/dist/components/ds-message-composer.js +1 -1
- package/dist/components/ds-message-scroller.js +1 -1
- package/dist/components/ds-message.js +1 -1
- package/dist/components/ds-mobile-bar-nav.js +1 -1
- package/dist/components/ds-mobile-header.js +1 -1
- package/dist/components/ds-mobile-section-switcher.js +1 -1
- package/dist/components/ds-mobile-sheet-nav.js +1 -1
- package/dist/components/ds-modal.js +1 -1
- package/dist/components/ds-navigation-tab-group.js +1 -1
- package/dist/components/ds-pagination.js +1 -1
- package/dist/components/ds-panel-nav.js +1 -1
- package/dist/components/ds-panel-sub-nav.js +1 -1
- package/dist/components/ds-panel-tool-header.js +1 -1
- package/dist/components/ds-panel-tool-search.js +1 -1
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-paper-texture.js +1 -1
- package/dist/components/ds-popover.d.ts +11 -0
- package/dist/components/ds-popover.js +2 -0
- package/dist/components/ds-popover.js.map +1 -0
- package/dist/components/ds-radio-tile.js +1 -1
- package/dist/components/ds-radio.js +1 -1
- package/dist/components/ds-score.js +1 -1
- package/dist/components/ds-scroll-overlay.js +1 -1
- package/dist/components/ds-select-toggle.js +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-setting-row-checkbox.js +1 -1
- package/dist/components/ds-setting-row-radio.js +1 -1
- package/dist/components/ds-setting-row-radio.js.map +1 -1
- package/dist/components/ds-setting-row-toggle.js +1 -1
- package/dist/components/ds-shell-app.js +1 -1
- package/dist/components/ds-shell-app.js.map +1 -1
- package/dist/components/ds-shell-page.js +1 -1
- package/dist/components/ds-shell-tools.js +1 -1
- package/dist/components/ds-skeleton.js +1 -1
- package/dist/components/ds-slider.js +1 -1
- package/dist/components/ds-swatch-picker.js +1 -1
- package/dist/components/ds-switch.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/ds-tag.js +1 -1
- package/dist/components/ds-text.js +1 -1
- package/dist/components/ds-textarea.js +1 -1
- package/dist/components/ds-time-picker.js +1 -1
- package/dist/components/ds-toast.js +1 -1
- package/dist/components/ds-toast.js.map +1 -1
- package/dist/components/ds-tooltip-chart.js +1 -1
- package/dist/components/ds-tooltip.js +1 -1
- package/dist/components/ds-typing-indicator.js +1 -1
- package/dist/components/{p-BxkhBlKJ.js → p-3_LHRdqq.js} +2 -2
- package/dist/components/{p-ZumxIz-2.js → p-9EjkmESv.js} +2 -2
- package/dist/components/{p-CQnjpuMX.js → p-9PpepIfc.js} +2 -2
- package/dist/components/{p-C860ilDn.js → p-A47UHyiC.js} +2 -2
- package/dist/components/p-BCzvtlR2.js +2 -0
- package/dist/components/{p-9zDZcSc0.js.map → p-BCzvtlR2.js.map} +1 -1
- package/dist/components/{p-ClOvX8cD.js → p-BEj9uENH.js} +2 -2
- package/dist/components/{p-CymFzY_N.js → p-BJmAAyRk.js} +2 -2
- package/dist/components/{p-CwL5zodA.js → p-BQ6p3LFP.js} +2 -2
- package/dist/components/{p-DI5GEmid.js → p-BbndBzzZ.js} +2 -2
- package/dist/components/{p-BgMeLCj3.js → p-Bg1UmSZn.js} +2 -2
- package/dist/components/{p-Cm1FS7D-.js → p-Bn-cskPo.js} +2 -2
- package/dist/components/p-Bz9dI7nI.js +2 -0
- package/dist/components/{p-B3-zImxn.js.map → p-Bz9dI7nI.js.map} +1 -1
- package/dist/components/{p-D538svhW.js → p-C0-sabnr.js} +2 -2
- package/dist/components/{p-qnp-yeXl.js → p-C11CnHDl.js} +2 -2
- package/dist/components/{p-xszHlNkG.js → p-C68nt4dl.js} +2 -2
- package/dist/components/p-C8UThLHd.js +2 -0
- package/dist/components/{p-txmcXZdy.js.map → p-C8UThLHd.js.map} +1 -1
- package/dist/components/p-C8WKo0sf.js +2 -0
- package/dist/components/{p-D_kOVT6i.js.map → p-C8WKo0sf.js.map} +1 -1
- package/dist/components/p-C942uiH1.js +3 -0
- package/dist/components/p-C942uiH1.js.map +1 -0
- package/dist/components/p-CAYqnjyC.js +2 -0
- package/dist/components/{p-Ddkyu_wE.js.map → p-CAYqnjyC.js.map} +1 -1
- package/dist/components/{p-G6r6yYg8.js → p-CBezgJ3r.js} +2 -2
- package/dist/components/p-CF6Px2b2.js +2 -0
- package/dist/components/p-CF6Px2b2.js.map +1 -0
- package/dist/components/{p-BLQgaSh-.js → p-CVSE2Ool.js} +2 -2
- package/dist/components/{p-KTaiJztz.js → p-CVuSm1Sh.js} +2 -2
- package/dist/components/{p-DOazC0iw.js → p-CZVoCdYE.js} +2 -2
- package/dist/components/{p-BYo1-6b5.js → p-CeACJYcU.js} +2 -2
- package/dist/components/{p-D9MqUHig.js → p-Cjw63BmX.js} +2 -2
- package/dist/components/{p-N-2CZze7.js → p-CkUF45d_.js} +2 -2
- package/dist/components/{p-B8jrUwL-.js → p-ClRd39mR.js} +2 -2
- package/dist/components/{p-Nx52go85.js → p-Cn6Ud58k.js} +2 -2
- package/dist/components/{p-BKd0e8k8.js → p-D3r_5Fw-.js} +2 -2
- package/dist/components/p-DCqDQWVK.js +2 -0
- package/dist/components/{p-CcWT4SzP.js.map → p-DCqDQWVK.js.map} +1 -1
- package/dist/components/{p-DMjOjrHi.js → p-DIXpyBWB.js} +2 -2
- package/dist/components/{p-C3nUi5Lo.js → p-DJtohrKV.js} +2 -2
- package/dist/components/{p-Bn-tsogb.js → p-DKL7n7NM.js} +2 -2
- package/dist/components/{p-BknNUjWh.js → p-D_CfgH1L.js} +2 -2
- package/dist/components/{p-P2-eHQJU.js → p-D_N38YjY.js} +2 -2
- package/dist/components/p-Dalq5voO.js +2 -0
- package/dist/components/{p-xouEdChm.js.map → p-Dalq5voO.js.map} +1 -1
- package/dist/components/{p-DMPn_dt7.js → p-DcwgXLe-.js} +2 -2
- package/dist/components/{p-BNySDuzx.js → p-DpA8UeSy.js} +2 -2
- package/dist/components/{p-DfGJX_Eo.js → p-DtNCj4p0.js} +2 -2
- package/dist/components/{p-pkJ3X3s7.js → p-Dwga8azB.js} +2 -2
- package/dist/components/{p-CGtq7TnC.js → p-LFHrICnV.js} +2 -2
- package/dist/components/p-LQGcTdiv.js +2 -0
- package/dist/components/{p-BK_SriZN.js.map → p-LQGcTdiv.js.map} +1 -1
- package/dist/components/{p-BoWpIl_m.js → p-N8tEOYt8.js} +2 -2
- package/dist/components/{p-CbJx9swS.js → p-QU-CyuBt.js} +2 -2
- package/dist/components/p-QYI9nW7a.js +2 -0
- package/dist/components/p-QYI9nW7a.js.map +1 -0
- package/dist/components/{p-DcvPY30Q.js → p-X-GPE9bP.js} +2 -2
- package/dist/components/{p-zdiRX3Sf.js → p-cOkFnnZV.js} +2 -2
- package/dist/components/{p-ZcZ0N7Ok.js → p-c_qWiZ6V.js} +2 -2
- package/dist/components/{p-BJB6kfA2.js → p-dVdTdZdu.js} +2 -2
- package/dist/components/{p-DXAY6GB5.js → p-hHtKJMVu.js} +2 -2
- package/dist/components/{p-BdJqRDKY.js → p-snYhfM1q.js} +2 -2
- package/dist/components/p-xHv_RGJh.js +2 -0
- package/dist/components/p-xHv_RGJh.js.map +1 -0
- package/dist/components/{p-CvK-Gy-b.js → p-zGd26CTX.js} +2 -2
- package/dist/docs/components.json +1291 -1
- package/dist/lint/index.js +1 -1
- package/dist/mcp-data/registry/agent-activity.json +1 -1
- package/dist/mcp-data/registry/agent-questionnaire.json +1 -1
- package/dist/mcp-data/registry/agent-response.json +1 -1
- package/dist/mcp-data/registry/agent-source-list.json +1 -1
- package/dist/mcp-data/registry/agent-tool-call.json +1 -1
- package/dist/mcp-data/registry/attachment-list.json +1 -1
- package/dist/mcp-data/registry/avatar.json +1 -1
- package/dist/mcp-data/registry/badge.json +1 -1
- package/dist/mcp-data/registry/banner.json +1 -1
- package/dist/mcp-data/registry/bar-action.json +1 -1
- package/dist/mcp-data/registry/bar-nav.json +1 -1
- package/dist/mcp-data/registry/bar-page-title.json +1 -1
- package/dist/mcp-data/registry/bar-title.json +1 -1
- package/dist/mcp-data/registry/bar-workflow.json +1 -1
- package/dist/mcp-data/registry/breadcrumb.json +1 -1
- package/dist/mcp-data/registry/button-filled.json +1 -1
- package/dist/mcp-data/registry/button-inverted.json +1 -1
- package/dist/mcp-data/registry/button-unfilled.json +1 -1
- package/dist/mcp-data/registry/calendar.json +1 -1
- package/dist/mcp-data/registry/card-action-center.json +1 -1
- package/dist/mcp-data/registry/card-chart.json +1 -1
- package/dist/mcp-data/registry/card-navigation.json +1 -1
- package/dist/mcp-data/registry/card-overview.json +1 -1
- package/dist/mcp-data/registry/card-setting.json +1 -1
- package/dist/mcp-data/registry/card-settings-scope.json +1 -1
- package/dist/mcp-data/registry/chart-legend.json +1 -1
- package/dist/mcp-data/registry/chart.json +1 -1
- package/dist/mcp-data/registry/checkbox-group.json +1 -1
- package/dist/mcp-data/registry/checkbox.json +1 -1
- package/dist/mcp-data/registry/chip.json +1 -1
- package/dist/mcp-data/registry/code-block.json +1 -1
- package/dist/mcp-data/registry/conversation-list-item.json +1 -1
- package/dist/mcp-data/registry/conversation-list-section.json +1 -1
- package/dist/mcp-data/registry/conversation-list.json +1 -1
- package/dist/mcp-data/registry/data-customize.json +1 -1
- package/dist/mcp-data/registry/data-filter.json +1 -1
- package/dist/mcp-data/registry/data-group.json +1 -1
- package/dist/mcp-data/registry/data-preferences.json +1 -1
- package/dist/mcp-data/registry/data-saved-views.json +1 -1
- package/dist/mcp-data/registry/data-search.json +1 -1
- package/dist/mcp-data/registry/data-sort.json +1 -1
- package/dist/mcp-data/registry/data-toolbar.json +1 -1
- package/dist/mcp-data/registry/disclosure.json +282 -0
- package/dist/mcp-data/registry/divider.json +1 -1
- package/dist/mcp-data/registry/drawer.json +567 -0
- package/dist/mcp-data/registry/empty-state.json +1 -1
- package/dist/mcp-data/registry/field.json +1 -1
- package/dist/mcp-data/registry/filter-menu.json +1 -1
- package/dist/mcp-data/registry/icon.json +2 -2
- package/dist/mcp-data/registry/inline-banner-settings.json +1 -1
- package/dist/mcp-data/registry/input-date.json +1 -1
- package/dist/mcp-data/registry/input-time.json +1 -1
- package/dist/mcp-data/registry/input.json +1 -1
- package/dist/mcp-data/registry/loader.json +1 -1
- package/dist/mcp-data/registry/map-cluster-marker.json +1 -1
- package/dist/mcp-data/registry/map-entity-marker.json +1 -1
- package/dist/mcp-data/registry/map-marker.json +1 -1
- package/dist/mcp-data/registry/markdown.json +1 -1
- package/dist/mcp-data/registry/menu.json +1 -1
- package/dist/mcp-data/registry/message-actions.json +1 -1
- package/dist/mcp-data/registry/message-bubble.json +1 -1
- package/dist/mcp-data/registry/message-composer.json +1 -1
- package/dist/mcp-data/registry/message-scroller.json +1 -1
- package/dist/mcp-data/registry/message.json +1 -1
- package/dist/mcp-data/registry/mobile-bar-nav.json +1 -1
- package/dist/mcp-data/registry/mobile-header.json +1 -1
- package/dist/mcp-data/registry/mobile-section-switcher.json +1 -1
- package/dist/mcp-data/registry/mobile-sheet-nav.json +1 -1
- package/dist/mcp-data/registry/modal.json +1 -1
- package/dist/mcp-data/registry/navigation-tab-group.json +1 -1
- package/dist/mcp-data/registry/pagination.json +1 -1
- package/dist/mcp-data/registry/panel-nav.json +1 -1
- package/dist/mcp-data/registry/panel-sub-nav.json +1 -1
- package/dist/mcp-data/registry/panel-tool-header.json +1 -1
- package/dist/mcp-data/registry/panel-tool-search.json +1 -1
- package/dist/mcp-data/registry/panel-tools.json +1 -1
- package/dist/mcp-data/registry/paper-texture.json +1 -1
- package/dist/mcp-data/registry/popover.json +385 -0
- package/dist/mcp-data/registry/radio-tile.json +1 -1
- package/dist/mcp-data/registry/radio.json +1 -1
- package/dist/mcp-data/registry/registry.json +583 -3
- package/dist/mcp-data/registry/score.json +1 -1
- package/dist/mcp-data/registry/scroll-overlay.json +1 -1
- package/dist/mcp-data/registry/select-toggle.json +1 -1
- package/dist/mcp-data/registry/select.json +1 -1
- package/dist/mcp-data/registry/setting-row-checkbox.json +1 -1
- package/dist/mcp-data/registry/setting-row-radio.json +1 -1
- package/dist/mcp-data/registry/setting-row-toggle.json +1 -1
- package/dist/mcp-data/registry/shell-app.json +7 -5
- package/dist/mcp-data/registry/shell-page.json +1 -1
- package/dist/mcp-data/registry/shell-tools.json +1 -1
- package/dist/mcp-data/registry/skeleton.json +1 -1
- package/dist/mcp-data/registry/slider.json +1 -1
- package/dist/mcp-data/registry/swatch-picker.json +1 -1
- package/dist/mcp-data/registry/switch.json +1 -1
- package/dist/mcp-data/registry/tab-group.json +1 -1
- package/dist/mcp-data/registry/table.json +1 -1
- package/dist/mcp-data/registry/tag.json +1 -1
- package/dist/mcp-data/registry/text.json +1 -1
- package/dist/mcp-data/registry/textarea.json +1 -1
- package/dist/mcp-data/registry/time-picker.json +1 -1
- package/dist/mcp-data/registry/toast.json +1 -1
- package/dist/mcp-data/registry/tooltip-chart.json +1 -1
- package/dist/mcp-data/registry/tooltip.json +1 -1
- package/dist/mcp-data/registry/typing-indicator.json +1 -1
- package/dist/react/components.d.ts +3 -0
- package/dist/react/components.js +3 -0
- package/dist/react/ds-disclosure.d.ts +12 -0
- package/dist/react/ds-disclosure.js +12 -0
- package/dist/react/ds-drawer.d.ts +16 -0
- package/dist/react/ds-drawer.js +18 -0
- package/dist/react/ds-popover.d.ts +13 -0
- package/dist/react/ds-popover.js +15 -0
- package/dist/types/components/Disclosure/Disclosure.d.ts +22 -0
- package/dist/types/components/Drawer/Drawer.d.ts +123 -0
- package/dist/types/components/Popover/Popover.d.ts +64 -0
- package/dist/types/components.d.ts +423 -0
- package/dist/vue/components.d.ts +3 -0
- package/dist/vue/components.js +3 -0
- package/dist/vue/ds-disclosure.d.ts +3 -0
- package/dist/vue/ds-disclosure.js +15 -0
- package/dist/vue/ds-drawer.d.ts +3 -0
- package/dist/vue/ds-drawer.js +34 -0
- package/dist/vue/ds-popover.d.ts +3 -0
- package/dist/vue/ds-popover.js +21 -0
- package/package.json +3 -3
- package/dist/components/p-9zDZcSc0.js +0 -2
- package/dist/components/p-B3-zImxn.js +0 -2
- package/dist/components/p-BK_SriZN.js +0 -2
- package/dist/components/p-CcWT4SzP.js +0 -2
- package/dist/components/p-Ckar-ZZa.js +0 -2
- package/dist/components/p-Ckar-ZZa.js.map +0 -1
- package/dist/components/p-DTlNtCX1.js +0 -2
- package/dist/components/p-DTlNtCX1.js.map +0 -1
- package/dist/components/p-D_kOVT6i.js +0 -2
- package/dist/components/p-Ddkyu_wE.js +0 -2
- package/dist/components/p-GP7Dz3qO.js +0 -3
- package/dist/components/p-GP7Dz3qO.js.map +0 -1
- package/dist/components/p-txmcXZdy.js +0 -2
- package/dist/components/p-xouEdChm.js +0 -2
- /package/dist/components/{p-BxkhBlKJ.js.map → p-3_LHRdqq.js.map} +0 -0
- /package/dist/components/{p-ZumxIz-2.js.map → p-9EjkmESv.js.map} +0 -0
- /package/dist/components/{p-CQnjpuMX.js.map → p-9PpepIfc.js.map} +0 -0
- /package/dist/components/{p-C860ilDn.js.map → p-A47UHyiC.js.map} +0 -0
- /package/dist/components/{p-ClOvX8cD.js.map → p-BEj9uENH.js.map} +0 -0
- /package/dist/components/{p-CymFzY_N.js.map → p-BJmAAyRk.js.map} +0 -0
- /package/dist/components/{p-CwL5zodA.js.map → p-BQ6p3LFP.js.map} +0 -0
- /package/dist/components/{p-DI5GEmid.js.map → p-BbndBzzZ.js.map} +0 -0
- /package/dist/components/{p-BgMeLCj3.js.map → p-Bg1UmSZn.js.map} +0 -0
- /package/dist/components/{p-Cm1FS7D-.js.map → p-Bn-cskPo.js.map} +0 -0
- /package/dist/components/{p-D538svhW.js.map → p-C0-sabnr.js.map} +0 -0
- /package/dist/components/{p-qnp-yeXl.js.map → p-C11CnHDl.js.map} +0 -0
- /package/dist/components/{p-xszHlNkG.js.map → p-C68nt4dl.js.map} +0 -0
- /package/dist/components/{p-G6r6yYg8.js.map → p-CBezgJ3r.js.map} +0 -0
- /package/dist/components/{p-BLQgaSh-.js.map → p-CVSE2Ool.js.map} +0 -0
- /package/dist/components/{p-KTaiJztz.js.map → p-CVuSm1Sh.js.map} +0 -0
- /package/dist/components/{p-DOazC0iw.js.map → p-CZVoCdYE.js.map} +0 -0
- /package/dist/components/{p-BYo1-6b5.js.map → p-CeACJYcU.js.map} +0 -0
- /package/dist/components/{p-D9MqUHig.js.map → p-Cjw63BmX.js.map} +0 -0
- /package/dist/components/{p-N-2CZze7.js.map → p-CkUF45d_.js.map} +0 -0
- /package/dist/components/{p-B8jrUwL-.js.map → p-ClRd39mR.js.map} +0 -0
- /package/dist/components/{p-Nx52go85.js.map → p-Cn6Ud58k.js.map} +0 -0
- /package/dist/components/{p-BKd0e8k8.js.map → p-D3r_5Fw-.js.map} +0 -0
- /package/dist/components/{p-DMjOjrHi.js.map → p-DIXpyBWB.js.map} +0 -0
- /package/dist/components/{p-C3nUi5Lo.js.map → p-DJtohrKV.js.map} +0 -0
- /package/dist/components/{p-Bn-tsogb.js.map → p-DKL7n7NM.js.map} +0 -0
- /package/dist/components/{p-BknNUjWh.js.map → p-D_CfgH1L.js.map} +0 -0
- /package/dist/components/{p-P2-eHQJU.js.map → p-D_N38YjY.js.map} +0 -0
- /package/dist/components/{p-DMPn_dt7.js.map → p-DcwgXLe-.js.map} +0 -0
- /package/dist/components/{p-BNySDuzx.js.map → p-DpA8UeSy.js.map} +0 -0
- /package/dist/components/{p-DfGJX_Eo.js.map → p-DtNCj4p0.js.map} +0 -0
- /package/dist/components/{p-pkJ3X3s7.js.map → p-Dwga8azB.js.map} +0 -0
- /package/dist/components/{p-CGtq7TnC.js.map → p-LFHrICnV.js.map} +0 -0
- /package/dist/components/{p-BoWpIl_m.js.map → p-N8tEOYt8.js.map} +0 -0
- /package/dist/components/{p-CbJx9swS.js.map → p-QU-CyuBt.js.map} +0 -0
- /package/dist/components/{p-DcvPY30Q.js.map → p-X-GPE9bP.js.map} +0 -0
- /package/dist/components/{p-zdiRX3Sf.js.map → p-cOkFnnZV.js.map} +0 -0
- /package/dist/components/{p-ZcZ0N7Ok.js.map → p-c_qWiZ6V.js.map} +0 -0
- /package/dist/components/{p-BJB6kfA2.js.map → p-dVdTdZdu.js.map} +0 -0
- /package/dist/components/{p-DXAY6GB5.js.map → p-hHtKJMVu.js.map} +0 -0
- /package/dist/components/{p-BdJqRDKY.js.map → p-snYhfM1q.js.map} +0 -0
- /package/dist/components/{p-CvK-Gy-b.js.map → p-zGd26CTX.js.map} +0 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "popover",
|
|
4
|
+
"title": "Popover",
|
|
5
|
+
"description": "Anchored non-modal dialog for short interactive content tied to a trigger. It uses the same choice-popup surface and placement as Menu, Select, and the date picker, with fully composable content and no built-in header or footer.",
|
|
6
|
+
"type": "registry:ui",
|
|
7
|
+
"meta": {
|
|
8
|
+
"library": "@ds-mo/ui",
|
|
9
|
+
"distribution": "npm",
|
|
10
|
+
"storybook": "https://zainadeel.github.io/compomo/?path=/story/popover",
|
|
11
|
+
"source": "src/wc/components/Popover/Popover.tsx",
|
|
12
|
+
"intentStatus": "complete",
|
|
13
|
+
"intent": {
|
|
14
|
+
"audience": "general",
|
|
15
|
+
"status": "experimental",
|
|
16
|
+
"summary": "Anchored non-modal dialog for short interactive content tied to a trigger. It uses the same choice-popup surface and placement as Menu, Select, and the date picker, with fully composable content and no built-in header or footer.",
|
|
17
|
+
"useWhen": [
|
|
18
|
+
"A trigger reveals a few related controls, such as share options or display settings, that apply without leaving the page.",
|
|
19
|
+
"Supplementary explanation is too long or needs a link, so a Tooltip is not enough.",
|
|
20
|
+
"The content should dismiss on outside activation or Escape and return focus to its trigger."
|
|
21
|
+
],
|
|
22
|
+
"avoidWhen": [
|
|
23
|
+
"The content is a list of commands or one-of-many choices.",
|
|
24
|
+
"The content picks a date.",
|
|
25
|
+
"The content is a short non-interactive label for an icon control.",
|
|
26
|
+
"The user must complete or confirm a blocking task.",
|
|
27
|
+
"The content needs more than a few controls or scrolling sections."
|
|
28
|
+
],
|
|
29
|
+
"alternatives": [
|
|
30
|
+
{
|
|
31
|
+
"when": "A trigger reveals commands or a choice list.",
|
|
32
|
+
"component": "component:ds-menu",
|
|
33
|
+
"reason": "Menu provides menu semantics, roving focus, and selection."
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"when": "The user picks a calendar date.",
|
|
37
|
+
"component": "component:ds-input-date",
|
|
38
|
+
"reason": "InputDate owns its calendar popup, anchored to the whole field and aligned to its end edge, with calendar keyboard behavior."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"when": "An icon control needs a short non-interactive name.",
|
|
42
|
+
"component": "component:ds-tooltip",
|
|
43
|
+
"reason": "Tooltip shows supplementary labels on hover and keyboard focus without taking focus."
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"when": "The task is blocking or needs explicit completion.",
|
|
47
|
+
"component": "component:ds-modal",
|
|
48
|
+
"reason": "Modal contains focus and makes the page inert until the user decides."
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"when": "The content is a larger panel of detail or a multi-field task.",
|
|
52
|
+
"component": "component:ds-drawer",
|
|
53
|
+
"reason": "Drawer provides room for longer content beside the page."
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"commonlyComposedWith": [
|
|
57
|
+
"component:ds-button-unfilled",
|
|
58
|
+
"component:ds-button-filled",
|
|
59
|
+
"component:ds-field",
|
|
60
|
+
"component:ds-switch",
|
|
61
|
+
"component:ds-text"
|
|
62
|
+
],
|
|
63
|
+
"accessibility": [
|
|
64
|
+
"The surface is a non-modal dialog named by popoverLabel. Always set it.",
|
|
65
|
+
"The owner marks the trigger with haspopup=\"dialog\" and mirrors open into expanded and surfaceOpen on ButtonUnfilled.",
|
|
66
|
+
"Opening moves focus to an element marked autofocus in the content, otherwise to the surface itself.",
|
|
67
|
+
"Escape returns focus to the anchor. Outside activation closes without moving focus. Tab past the last control closes the popover and continues to the control after the trigger.",
|
|
68
|
+
"dsClose reports escape, outside, or tab so the owner can sync trigger state. Actions inside the content close the popover by setting open to false."
|
|
69
|
+
],
|
|
70
|
+
"states": [
|
|
71
|
+
"The owner sets open and an anchor or anchorId; the component mutates open to false for user dismissal and emits dsAfterClose after exit motion.",
|
|
72
|
+
"Slotted content stays in the host while closed so authored nodes and their state persist between openings.",
|
|
73
|
+
"Placement flips to the opposite side when the preferred side does not fit, and clamps within the viewport or the nearest overlay boundary."
|
|
74
|
+
],
|
|
75
|
+
"responsiveBehavior": [
|
|
76
|
+
"Unset, width follows content between menu-width-xs and panel-width-lg, clamped to the viewport. popoverWidth fixes it to a menu-width token or a CSS length.",
|
|
77
|
+
"Height is limited to the space available on the resolved side; content scrolls when it exceeds it.",
|
|
78
|
+
"The surface lives in the native top layer, escaping clipping containers and transformed ancestors."
|
|
79
|
+
],
|
|
80
|
+
"frameworkCaveats": {
|
|
81
|
+
"customElements": [
|
|
82
|
+
"Set anchor as a JavaScript property or anchorId as an attribute, then set open.",
|
|
83
|
+
"Listen for dsClose to update the trigger's expanded and surfaceOpen state."
|
|
84
|
+
],
|
|
85
|
+
"react": [
|
|
86
|
+
"Pass a trigger ref's element as anchor, or anchorId, and control open; update trigger state in onDsClose."
|
|
87
|
+
],
|
|
88
|
+
"angular": [
|
|
89
|
+
"Bind [anchor] to the trigger element or set anchorId, bind [open], and update trigger state in (dsClose)."
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
"references": [
|
|
93
|
+
{
|
|
94
|
+
"label": "Storybook share, help, trigger, and placement examples",
|
|
95
|
+
"path": "src/wc/components/Popover/Popover.stories.ts"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"styling": {
|
|
99
|
+
"rationale": "The component owns the anchored choice-popup surface shared with Menu, Select, and the date and time pickers so every anchored overlay reads as the same material. Content insets to the Menu label edge by default.",
|
|
100
|
+
"protected": [
|
|
101
|
+
{
|
|
102
|
+
"properties": [
|
|
103
|
+
"background",
|
|
104
|
+
"border",
|
|
105
|
+
"border-radius",
|
|
106
|
+
"box-shadow"
|
|
107
|
+
],
|
|
108
|
+
"reason": "The anchored surface recipe is shared across overlay families; compose application surfaces inside the content slot.",
|
|
109
|
+
"props": []
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"properties": [
|
|
113
|
+
"width"
|
|
114
|
+
],
|
|
115
|
+
"reason": "Width follows content within the choice-popup bounds, or a menu-width token or length through popoverWidth.",
|
|
116
|
+
"props": [
|
|
117
|
+
"popoverWidth"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"properties": [
|
|
122
|
+
"padding"
|
|
123
|
+
],
|
|
124
|
+
"reason": "The 4px frame and the content inset align content with Menu labels; compose lists and pickers with Menu, Select, or InputDate instead.",
|
|
125
|
+
"props": []
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"customProperties": []
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"api": {
|
|
132
|
+
"props": {
|
|
133
|
+
"align": {
|
|
134
|
+
"type": "PopoverAlign",
|
|
135
|
+
"resolvedType": "\"center\" | \"end\" | \"start\"",
|
|
136
|
+
"attribute": "align",
|
|
137
|
+
"default": "'start'",
|
|
138
|
+
"required": false,
|
|
139
|
+
"mutable": false
|
|
140
|
+
},
|
|
141
|
+
"anchor": {
|
|
142
|
+
"type": "HTMLElement | undefined",
|
|
143
|
+
"resolvedType": "HTMLElement | undefined",
|
|
144
|
+
"required": false,
|
|
145
|
+
"mutable": false,
|
|
146
|
+
"description": "External trigger element to position against. Set via JS: popoverEl.anchor = buttonEl"
|
|
147
|
+
},
|
|
148
|
+
"anchorId": {
|
|
149
|
+
"type": "string | undefined",
|
|
150
|
+
"resolvedType": "string | undefined",
|
|
151
|
+
"attribute": "anchor-id",
|
|
152
|
+
"required": false,
|
|
153
|
+
"mutable": false,
|
|
154
|
+
"description": "ID of the external trigger element for positioning."
|
|
155
|
+
},
|
|
156
|
+
"boundary": {
|
|
157
|
+
"type": "HTMLElement | undefined",
|
|
158
|
+
"resolvedType": "HTMLElement | undefined",
|
|
159
|
+
"required": false,
|
|
160
|
+
"mutable": false,
|
|
161
|
+
"description": "Explicit collision owner; otherwise the nearest data-ds-overlay-boundary ancestor is used."
|
|
162
|
+
},
|
|
163
|
+
"open": {
|
|
164
|
+
"type": "boolean",
|
|
165
|
+
"resolvedType": "boolean",
|
|
166
|
+
"attribute": "open",
|
|
167
|
+
"default": "false",
|
|
168
|
+
"required": false,
|
|
169
|
+
"mutable": true
|
|
170
|
+
},
|
|
171
|
+
"popoverLabel": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"resolvedType": "string",
|
|
174
|
+
"attribute": "popover-label",
|
|
175
|
+
"default": "''",
|
|
176
|
+
"required": false,
|
|
177
|
+
"mutable": false,
|
|
178
|
+
"description": "Accessible name for the dialog surface."
|
|
179
|
+
},
|
|
180
|
+
"popoverWidth": {
|
|
181
|
+
"type": "PopoverWidth | string | undefined",
|
|
182
|
+
"resolvedType": "string | undefined",
|
|
183
|
+
"attribute": "popover-width",
|
|
184
|
+
"required": false,
|
|
185
|
+
"mutable": false,
|
|
186
|
+
"description": "Menu width token (`xs`, `sm`, `md`, `lg`) or a CSS length. Unset, the surface\nfollows its content between the menu-width-xs and panel-width-lg bounds."
|
|
187
|
+
},
|
|
188
|
+
"side": {
|
|
189
|
+
"type": "PopoverSide",
|
|
190
|
+
"resolvedType": "\"bottom\" | \"left\" | \"right\" | \"top\"",
|
|
191
|
+
"attribute": "side",
|
|
192
|
+
"default": "'bottom'",
|
|
193
|
+
"required": false,
|
|
194
|
+
"mutable": false,
|
|
195
|
+
"description": "Preferred side; placement flips to the opposite side when that offers a better fit."
|
|
196
|
+
},
|
|
197
|
+
"sideOffset": {
|
|
198
|
+
"type": "number | string",
|
|
199
|
+
"resolvedType": "number | string",
|
|
200
|
+
"attribute": "side-offset",
|
|
201
|
+
"default": "TOKEN_CSS_LENGTHS.space050",
|
|
202
|
+
"required": false,
|
|
203
|
+
"mutable": false,
|
|
204
|
+
"description": "Gap between anchor and popover — number (px) or TokoMo length."
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"events": [
|
|
208
|
+
{
|
|
209
|
+
"name": "dsAfterClose",
|
|
210
|
+
"detail": "void",
|
|
211
|
+
"bubbles": true,
|
|
212
|
+
"cancelable": true,
|
|
213
|
+
"composed": true,
|
|
214
|
+
"description": "Emitted after exit motion completes."
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"name": "dsClose",
|
|
218
|
+
"detail": "PopoverCloseDetail",
|
|
219
|
+
"bubbles": true,
|
|
220
|
+
"cancelable": true,
|
|
221
|
+
"composed": true,
|
|
222
|
+
"description": "Emitted when the user dismisses the popover. The component sets open to false."
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"methods": [],
|
|
226
|
+
"slots": [
|
|
227
|
+
{
|
|
228
|
+
"name": "",
|
|
229
|
+
"description": "The default slot"
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
"props": {
|
|
234
|
+
"align": {
|
|
235
|
+
"type": "PopoverAlign",
|
|
236
|
+
"resolvedType": "\"center\" | \"end\" | \"start\"",
|
|
237
|
+
"attribute": "align",
|
|
238
|
+
"default": "'start'",
|
|
239
|
+
"required": false,
|
|
240
|
+
"mutable": false
|
|
241
|
+
},
|
|
242
|
+
"anchor": {
|
|
243
|
+
"type": "HTMLElement | undefined",
|
|
244
|
+
"resolvedType": "HTMLElement | undefined",
|
|
245
|
+
"required": false,
|
|
246
|
+
"mutable": false,
|
|
247
|
+
"description": "External trigger element to position against. Set via JS: popoverEl.anchor = buttonEl"
|
|
248
|
+
},
|
|
249
|
+
"anchorId": {
|
|
250
|
+
"type": "string | undefined",
|
|
251
|
+
"resolvedType": "string | undefined",
|
|
252
|
+
"attribute": "anchor-id",
|
|
253
|
+
"required": false,
|
|
254
|
+
"mutable": false,
|
|
255
|
+
"description": "ID of the external trigger element for positioning."
|
|
256
|
+
},
|
|
257
|
+
"boundary": {
|
|
258
|
+
"type": "HTMLElement | undefined",
|
|
259
|
+
"resolvedType": "HTMLElement | undefined",
|
|
260
|
+
"required": false,
|
|
261
|
+
"mutable": false,
|
|
262
|
+
"description": "Explicit collision owner; otherwise the nearest data-ds-overlay-boundary ancestor is used."
|
|
263
|
+
},
|
|
264
|
+
"open": {
|
|
265
|
+
"type": "boolean",
|
|
266
|
+
"resolvedType": "boolean",
|
|
267
|
+
"attribute": "open",
|
|
268
|
+
"default": "false",
|
|
269
|
+
"required": false,
|
|
270
|
+
"mutable": true
|
|
271
|
+
},
|
|
272
|
+
"popoverLabel": {
|
|
273
|
+
"type": "string",
|
|
274
|
+
"resolvedType": "string",
|
|
275
|
+
"attribute": "popover-label",
|
|
276
|
+
"default": "''",
|
|
277
|
+
"required": false,
|
|
278
|
+
"mutable": false,
|
|
279
|
+
"description": "Accessible name for the dialog surface."
|
|
280
|
+
},
|
|
281
|
+
"popoverWidth": {
|
|
282
|
+
"type": "PopoverWidth | string | undefined",
|
|
283
|
+
"resolvedType": "string | undefined",
|
|
284
|
+
"attribute": "popover-width",
|
|
285
|
+
"required": false,
|
|
286
|
+
"mutable": false,
|
|
287
|
+
"description": "Menu width token (`xs`, `sm`, `md`, `lg`) or a CSS length. Unset, the surface\nfollows its content between the menu-width-xs and panel-width-lg bounds."
|
|
288
|
+
},
|
|
289
|
+
"side": {
|
|
290
|
+
"type": "PopoverSide",
|
|
291
|
+
"resolvedType": "\"bottom\" | \"left\" | \"right\" | \"top\"",
|
|
292
|
+
"attribute": "side",
|
|
293
|
+
"default": "'bottom'",
|
|
294
|
+
"required": false,
|
|
295
|
+
"mutable": false,
|
|
296
|
+
"description": "Preferred side; placement flips to the opposite side when that offers a better fit."
|
|
297
|
+
},
|
|
298
|
+
"sideOffset": {
|
|
299
|
+
"type": "number | string",
|
|
300
|
+
"resolvedType": "number | string",
|
|
301
|
+
"attribute": "side-offset",
|
|
302
|
+
"default": "TOKEN_CSS_LENGTHS.space050",
|
|
303
|
+
"required": false,
|
|
304
|
+
"mutable": false,
|
|
305
|
+
"description": "Gap between anchor and popover — number (px) or TokoMo length."
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"events": [
|
|
309
|
+
{
|
|
310
|
+
"name": "dsAfterClose",
|
|
311
|
+
"detail": "void",
|
|
312
|
+
"bubbles": true,
|
|
313
|
+
"cancelable": true,
|
|
314
|
+
"composed": true,
|
|
315
|
+
"description": "Emitted after exit motion completes."
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"name": "dsClose",
|
|
319
|
+
"detail": "PopoverCloseDetail",
|
|
320
|
+
"bubbles": true,
|
|
321
|
+
"cancelable": true,
|
|
322
|
+
"composed": true,
|
|
323
|
+
"description": "Emitted when the user dismisses the popover. The component sets open to false."
|
|
324
|
+
}
|
|
325
|
+
],
|
|
326
|
+
"methods": [],
|
|
327
|
+
"slots": [
|
|
328
|
+
{
|
|
329
|
+
"name": "",
|
|
330
|
+
"description": "The default slot"
|
|
331
|
+
}
|
|
332
|
+
],
|
|
333
|
+
"exports": {
|
|
334
|
+
"customElement": "ds-popover",
|
|
335
|
+
"react": "DsPopover",
|
|
336
|
+
"vue": "DsPopover",
|
|
337
|
+
"angular": "DsPopover"
|
|
338
|
+
},
|
|
339
|
+
"consumption": {
|
|
340
|
+
"install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
|
|
341
|
+
"cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
|
|
342
|
+
"customElements": {
|
|
343
|
+
"import": "import '@ds-mo/ui/dist/components/ds-popover.js';",
|
|
344
|
+
"example": "<ds-popover></ds-popover>"
|
|
345
|
+
},
|
|
346
|
+
"react": {
|
|
347
|
+
"import": "import { DsPopover } from '@ds-mo/ui/react';",
|
|
348
|
+
"example": "<DsPopover />"
|
|
349
|
+
},
|
|
350
|
+
"vue": {
|
|
351
|
+
"import": "import { DsPopover } from '@ds-mo/ui/vue';",
|
|
352
|
+
"example": "<DsPopover />"
|
|
353
|
+
},
|
|
354
|
+
"angular": {
|
|
355
|
+
"import": "import { DsPopover } from '@ds-mo/ui/angular/ds-popover';",
|
|
356
|
+
"example": "<ds-popover></ds-popover>"
|
|
357
|
+
},
|
|
358
|
+
"complexPropertyNote": "Assign these non-primitive values as JavaScript properties: anchor, boundary.",
|
|
359
|
+
"peerDependencies": {
|
|
360
|
+
"required": [
|
|
361
|
+
"@ds-mo/tokens ^9.0.0",
|
|
362
|
+
"@ds-mo/icons ^8.2.2"
|
|
363
|
+
],
|
|
364
|
+
"frameworks": "Custom Elements; React 18/19 wrappers; Vue 3 wrappers; Angular 19-22 standalone adapters."
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
"dependencies": [
|
|
369
|
+
"@ds-mo/ui",
|
|
370
|
+
"@ds-mo/tokens"
|
|
371
|
+
],
|
|
372
|
+
"registryDependencies": [],
|
|
373
|
+
"files": [
|
|
374
|
+
{
|
|
375
|
+
"path": "src/wc/components/Popover/Popover.css",
|
|
376
|
+
"content": "@import '../../utils/radius.css';\n@import '../../utils/choice-popup.css';\n@import '../../utils/forced-colors.css';\n\n:host {\n display: contents;\n}\n\n/*\n * The anchored choice-popup surface shared with Menu, Select, and InputDate:\n * menu radius, floating shadow and highlight, and the same 4px frame. Width\n * follows content between the choice-popup bounds unless popoverWidth fixes it.\n */\n.popover-surface.ds-choice-popup {\n width: var(--_popover-width, max-content);\n padding: var(--dimension-space-050);\n color: var(--color-foreground-primary);\n outline: none;\n}\n\n.popover-surface--hidden {\n display: none;\n}\n\n/* Default inset puts content on the same 12px edge as Menu item labels. */\n.popover-content {\n box-sizing: border-box;\n flex: 1 1 auto;\n min-height: 0;\n padding: var(--dimension-space-100);\n overflow-y: auto;\n}\n",
|
|
377
|
+
"type": "registry:ui"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"path": "src/wc/components/Popover/Popover.tsx",
|
|
381
|
+
"content": "import {\n Component,\n Prop,\n State,\n Event,\n EventEmitter,\n Element,\n Watch,\n h,\n Host,\n} from '@stencil/core';\nimport {\n resolveCssLengthPx,\n resolveMotionTimeMs,\n TOKEN_CSS_LENGTHS,\n TOKEN_DEFAULTS,\n} from '../../utils';\nimport { resolveAnchoredOverlayBoundaryRect } from '../../utils/anchored-overlay-boundary';\nimport { AnchoredOverlayInteractionController } from '../../utils/anchored-overlay-interaction-controller';\nimport type { AnchoredAlign, AnchoredSide } from '../../utils/anchored-position';\nimport { AnchoredPositionController } from '../../utils/anchored-position-controller';\nimport { ConnectionTasks } from '../../utils/connection-tasks';\n\nexport type PopoverSide = AnchoredSide;\nexport type PopoverAlign = AnchoredAlign;\nexport type PopoverWidth = 'xs' | 'sm' | 'md' | 'lg';\nexport type PopoverCloseReason = 'escape' | 'outside' | 'tab';\n\nexport interface PopoverCloseDetail {\n reason: PopoverCloseReason;\n /** The triggering event; absent for outside activation, which the shared controller observes. */\n originalEvent?: Event;\n}\n\nconst TABBABLE_SELECTOR =\n 'a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\nconst WIDTH_MAP: Record<PopoverWidth, string> = {\n xs: 'var(--dimension-menu-width-xs)',\n sm: 'var(--dimension-menu-width-sm)',\n md: 'var(--dimension-menu-width-md)',\n lg: 'var(--dimension-menu-width-lg)',\n};\n\nlet popoverIdCounter = 0;\n\n@Component({\n tag: 'ds-popover',\n styleUrl: 'Popover.css',\n scoped: true,\n})\nexport class Popover {\n @Element() el!: HTMLElement;\n\n @Prop({ mutable: true }) open: boolean = false;\n /** External trigger element to position against. Set via JS: popoverEl.anchor = buttonEl */\n @Prop() anchor: HTMLElement | undefined;\n /** ID of the external trigger element for positioning. */\n @Prop() anchorId: string | undefined;\n /** Preferred side; placement flips to the opposite side when that offers a better fit. */\n @Prop() side: PopoverSide = 'bottom';\n @Prop() align: PopoverAlign = 'start';\n /** Gap between anchor and popover — number (px) or TokoMo length. */\n @Prop() sideOffset: number | string = TOKEN_CSS_LENGTHS.space050;\n /** Explicit collision owner; otherwise the nearest data-ds-overlay-boundary ancestor is used. */\n @Prop() boundary: HTMLElement | undefined;\n /**\n * Menu width token (`xs`, `sm`, `md`, `lg`) or a CSS length. Unset, the surface\n * follows its content between the menu-width-xs and panel-width-lg bounds.\n */\n @Prop() popoverWidth: PopoverWidth | string | undefined;\n /** Accessible name for the dialog surface. */\n @Prop() popoverLabel: string = '';\n\n @State() private shouldRender: boolean = false;\n @State() private closing: boolean = false;\n @State() private positionReady: boolean = false;\n @State() private pos: { x: number; y: number } = { x: 0, y: 0 };\n @State() private availableHeight: number | null = null;\n\n /** Emitted when the user dismisses the popover. The component sets open to false. */\n @Event() dsClose!: EventEmitter<PopoverCloseDetail>;\n /** Emitted after exit motion completes. */\n @Event() dsAfterClose!: EventEmitter<void>;\n\n private readonly popupId = `ds-popover-${++popoverIdCounter}`;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n private loaded = false;\n private readonly tasks = new ConnectionTasks(() => this.el.isConnected);\n\n private readonly position = new AnchoredPositionController({\n getAnchor: () => this.resolvedAnchor,\n getPopup: () => this.popupEl,\n getOwnerDocument: () => this.el.ownerDocument,\n measure: (anchor, popup) => {\n if (!this.open) return null;\n const viewportPadPx = this.viewportPadPx;\n return {\n anchorRect: anchor.getBoundingClientRect(),\n popupWidth: popup.offsetWidth,\n popupHeight: Math.min(popup.scrollHeight, window.innerHeight - viewportPadPx * 2),\n side: this.side,\n align: this.align,\n sideOffsetPx: resolveCssLengthPx(this.sideOffset, TOKEN_DEFAULTS.space050),\n alignOffsetPx: 0,\n viewportPadPx,\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n collisionRect: resolveAnchoredOverlayBoundaryRect(anchor, this.boundary),\n };\n },\n apply: ({ x, y, availableHeight }) => {\n this.pos = { x, y };\n this.availableHeight = availableHeight;\n },\n onReady: () => {\n this.positionReady = true;\n },\n liveUpdate: 'double-frame',\n topLayer: true,\n observeResize: true,\n observeAnchorMotion: true,\n });\n\n private readonly interaction = new AnchoredOverlayInteractionController({\n getAnchor: () => this.resolvedAnchor,\n getPopup: () => this.popupEl,\n getOwnerDocument: () => this.el.ownerDocument,\n onOutsideActivation: () => this.close('outside', undefined, false),\n });\n\n componentDidLoad() {\n this.loaded = true;\n if (this.open) this.onOpenChange(true);\n }\n\n connectedCallback() {\n if (this.loaded && this.open) this.onOpenChange(true);\n }\n\n disconnectedCallback() {\n this.tasks.cancel();\n this.teardown();\n this.shouldRender = false;\n this.closing = false;\n this.positionReady = false;\n }\n\n @Watch('open')\n onOpenChange(isOpen: boolean) {\n if (!this.loaded || !this.el.isConnected) return;\n if (isOpen) {\n this.teardown();\n this.shouldRender = true;\n this.closing = false;\n this.positionReady = false;\n this.availableHeight = null;\n this.interaction.connect();\n this.position.observe();\n this.position.schedule(() => this.focusInitial());\n } else if (this.shouldRender && !this.closing) {\n this.closing = true;\n this.teardown();\n const closeAnimationMs = resolveMotionTimeMs(\n TOKEN_DEFAULTS.motionShort2,\n TOKEN_DEFAULTS.animationDurationShort3\n );\n if (closeAnimationMs <= 0) {\n this.finishClose();\n return;\n }\n this.closeTimer = setTimeout(() => {\n this.closeTimer = null;\n this.finishClose();\n }, closeAnimationMs);\n }\n }\n\n @Watch('anchor')\n @Watch('anchorId')\n @Watch('boundary')\n @Watch('side')\n @Watch('align')\n @Watch('sideOffset')\n onPlacementChange() {\n if (this.open && this.shouldRender) this.position.schedule();\n }\n\n private get resolvedAnchor(): HTMLElement | null {\n if (this.anchor) return this.anchor;\n if (this.anchorId) return this.el.ownerDocument.getElementById(this.anchorId);\n return null;\n }\n\n private get popupEl(): HTMLElement | null {\n return this.el.querySelector<HTMLElement>('.popover-surface');\n }\n\n private get viewportPadPx(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n }\n\n private get resolvedWidth(): string | undefined {\n const width = this.popoverWidth?.trim();\n if (!width) return undefined;\n return WIDTH_MAP[width as PopoverWidth] ?? width;\n }\n\n private teardown() {\n this.position.unobserve();\n this.interaction.disconnect();\n if (this.closeTimer) clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n\n private focusInitial() {\n this.tasks.frame(() => {\n if (!this.open) return;\n const popup = this.popupEl;\n if (!popup) return;\n const content = popup.querySelector<HTMLElement>('.popover-content');\n const autofocus = content?.querySelector<HTMLElement>('[autofocus]');\n if (autofocus) {\n autofocus.focus();\n return;\n }\n popup.focus();\n });\n }\n\n private close(\n reason: PopoverCloseReason,\n originalEvent: Event | undefined,\n restoreFocus: boolean\n ) {\n if (!this.open || this.closing) return;\n if (restoreFocus) this.interaction.focusAnchor();\n this.dsClose.emit({ reason, originalEvent });\n this.open = false;\n }\n\n private finishClose() {\n if (this.open || !this.closing || !this.el.isConnected) return;\n const popup = this.popupEl;\n if (popup?.matches(':popover-open')) popup.hidePopover();\n this.shouldRender = false;\n this.closing = false;\n this.positionReady = false;\n this.dsAfterClose.emit();\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (this.closing) return;\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n this.close('escape', event, true);\n return;\n }\n // From the focused surface itself, a forward Tab enters the first control. WebKit\n // sends native Tab from a top-layer surface to the document body, so move it here.\n if (event.key === 'Tab' && !event.shiftKey && event.target === this.popupEl) {\n const first = this.popupEl?.querySelector<HTMLElement>(TABBABLE_SELECTOR);\n if (first) {\n event.preventDefault();\n first.focus();\n return;\n }\n }\n if (event.key === 'Tab' && this.interaction.tabLeavesPopup(event)) {\n event.preventDefault();\n this.close('tab', event, false);\n this.interaction.moveFocusAfterTab(event.shiftKey);\n }\n };\n\n render() {\n // Slotted content stays in the host while closed so authored nodes are never discarded.\n const visible = this.shouldRender;\n const popupStyle: Record<string, string> = {\n position: 'fixed',\n left: '0',\n top: '0',\n transform: `translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,\n visibility: this.positionReady ? 'visible' : 'hidden',\n };\n const width = this.resolvedWidth;\n if (width) popupStyle['--_popover-width'] = width;\n if (this.availableHeight !== null) {\n popupStyle['max-height'] = `${Math.floor(this.availableHeight)}px`;\n }\n\n return (\n <Host>\n <div\n id={this.popupId}\n popover=\"manual\"\n tabindex={-1}\n class={{\n 'popover-surface': true,\n 'ds-choice-popup': true,\n 'ds-choice-popup--closing': this.closing,\n 'popover-surface--hidden': !visible,\n }}\n style={visible ? popupStyle : undefined}\n role=\"dialog\"\n aria-label={this.popoverLabel || undefined}\n inert={this.closing}\n onKeyDown={this.handleKeyDown}\n >\n <div class=\"popover-content\">\n <slot />\n </div>\n </div>\n </Host>\n );\n }\n}\n",
|
|
382
|
+
"type": "registry:ui"
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
}
|