@ds-mo/ui 9.0.0 → 9.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/README.md +28 -0
- package/dist/.build-stamp +1 -1
- package/dist/agent-patterns.json +397 -0
- package/dist/agent.json +2347 -735
- package/dist/angular/ds-agent-activity.d.ts +12 -0
- package/dist/angular/ds-agent-activity.js +38 -0
- package/dist/angular/ds-agent-response.d.ts +12 -0
- package/dist/angular/ds-agent-response.js +38 -0
- package/dist/angular/ds-agent-source-list.d.ts +12 -0
- package/dist/angular/ds-agent-source-list.js +38 -0
- package/dist/angular/ds-agent-tool-call.d.ts +12 -0
- package/dist/angular/ds-agent-tool-call.js +38 -0
- package/dist/angular/ds-attachment-list.d.ts +12 -0
- package/dist/angular/ds-attachment-list.js +38 -0
- package/dist/angular/ds-avatar.d.ts +12 -0
- package/dist/angular/ds-avatar.js +38 -0
- package/dist/angular/ds-code-block.d.ts +12 -0
- package/dist/angular/ds-code-block.js +38 -0
- package/dist/angular/ds-conversation-list-item.d.ts +19 -0
- package/dist/angular/ds-conversation-list-item.js +42 -0
- package/dist/angular/ds-conversation-list-section.d.ts +12 -0
- package/dist/angular/ds-conversation-list-section.js +38 -0
- package/dist/angular/ds-conversation-list.d.ts +12 -0
- package/dist/angular/ds-conversation-list.js +37 -0
- package/dist/angular/ds-markdown.d.ts +12 -0
- package/dist/angular/ds-markdown.js +38 -0
- package/dist/angular/ds-menu.d.ts +6 -1
- package/dist/angular/ds-menu.js +7 -4
- package/dist/angular/ds-message-bubble.d.ts +12 -0
- package/dist/angular/ds-message-bubble.js +38 -0
- package/dist/angular/ds-message-composer.d.ts +23 -0
- package/dist/angular/ds-message-composer.js +49 -0
- package/dist/angular/ds-message-scroller.d.ts +15 -0
- package/dist/angular/ds-message-scroller.js +43 -0
- package/dist/angular/ds-message.d.ts +12 -0
- package/dist/angular/ds-message.js +38 -0
- package/dist/angular/ds-panel-tool-header.d.ts +25 -0
- package/dist/angular/ds-panel-tool-header.js +49 -0
- package/dist/angular/ds-panel-tool-search.d.ts +19 -0
- package/dist/angular/ds-panel-tool-search.js +49 -0
- package/dist/angular/ds-panel-tools.d.ts +30 -1
- package/dist/angular/ds-panel-tools.js +14 -5
- package/dist/angular/ds-swatch-picker.d.ts +15 -0
- package/dist/angular/ds-swatch-picker.js +42 -0
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.js +18 -0
- package/dist/angular/proxies.d.ts +18 -0
- package/dist/angular/proxies.js +18 -0
- package/dist/components/ds-agent-activity.d.ts +11 -0
- package/dist/components/ds-agent-activity.js +2 -0
- package/dist/components/ds-agent-activity.js.map +1 -0
- package/dist/components/ds-agent-response.d.ts +11 -0
- package/dist/components/ds-agent-response.js +2 -0
- package/dist/components/ds-agent-response.js.map +1 -0
- package/dist/components/ds-agent-source-list.d.ts +11 -0
- package/dist/components/ds-agent-source-list.js +2 -0
- package/dist/components/ds-agent-source-list.js.map +1 -0
- package/dist/components/ds-agent-tool-call.d.ts +11 -0
- package/dist/components/ds-agent-tool-call.js +2 -0
- package/dist/components/ds-agent-tool-call.js.map +1 -0
- package/dist/components/ds-app-shell.js +1 -1
- package/dist/components/ds-app-shell.js.map +1 -1
- package/dist/components/ds-attachment-list.d.ts +11 -0
- package/dist/components/ds-attachment-list.js +2 -0
- package/dist/components/ds-attachment-list.js.map +1 -0
- package/dist/components/ds-avatar.d.ts +11 -0
- package/dist/components/ds-avatar.js +2 -0
- package/dist/components/ds-avatar.js.map +1 -0
- package/dist/components/ds-badge.js +1 -1
- package/dist/components/ds-banner.js +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-nav.js.map +1 -1
- package/dist/components/ds-button-filled.js +1 -1
- package/dist/components/ds-button-unfilled.js +1 -1
- package/dist/components/ds-card-data-viz-donut.js +1 -1
- package/dist/components/ds-card-setting.js +1 -1
- package/dist/components/ds-card-shell-data-viz.js +1 -1
- package/dist/components/ds-card.js +1 -1
- package/dist/components/ds-chart-bar.js +1 -1
- package/dist/components/ds-chart-bar.js.map +1 -1
- package/dist/components/ds-chart-donut.js +1 -1
- package/dist/components/ds-chart-legend.js +1 -1
- package/dist/components/ds-chart-line.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.d.ts +11 -0
- package/dist/components/ds-code-block.js +2 -0
- package/dist/components/ds-code-block.js.map +1 -0
- package/dist/components/ds-conversation-list-item.d.ts +11 -0
- package/dist/components/ds-conversation-list-item.js +2 -0
- package/dist/components/ds-conversation-list-item.js.map +1 -0
- package/dist/components/ds-conversation-list-section.d.ts +11 -0
- package/dist/components/ds-conversation-list-section.js +2 -0
- package/dist/components/ds-conversation-list-section.js.map +1 -0
- package/dist/components/ds-conversation-list.d.ts +11 -0
- package/dist/components/ds-conversation-list.js +2 -0
- package/dist/components/ds-conversation-list.js.map +1 -0
- package/dist/components/ds-divider.js +1 -1
- package/dist/components/ds-divider.js.map +1 -1
- package/dist/components/ds-empty-state.js +1 -1
- package/dist/components/ds-field.js +1 -1
- package/dist/components/ds-icon.js +1 -1
- package/dist/components/ds-input.js +1 -1
- package/dist/components/ds-markdown.d.ts +11 -0
- package/dist/components/ds-markdown.js +2 -0
- package/dist/components/ds-markdown.js.map +1 -0
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-message-bubble.d.ts +11 -0
- package/dist/components/ds-message-bubble.js +2 -0
- package/dist/components/ds-message-bubble.js.map +1 -0
- package/dist/components/ds-message-composer.d.ts +11 -0
- package/dist/components/ds-message-composer.js +2 -0
- package/dist/components/ds-message-composer.js.map +1 -0
- package/dist/components/ds-message-scroller.d.ts +11 -0
- package/dist/components/ds-message-scroller.js +2 -0
- package/dist/components/ds-message-scroller.js.map +1 -0
- package/dist/components/ds-message.d.ts +11 -0
- package/dist/components/ds-message.js +2 -0
- package/dist/components/ds-message.js.map +1 -0
- package/dist/components/ds-modal.js +1 -1
- package/dist/components/ds-panel-nav.js +1 -1
- package/dist/components/ds-panel-nav.js.map +1 -1
- package/dist/components/ds-panel-sub-nav.js +1 -1
- package/dist/components/ds-panel-tool-header.d.ts +11 -0
- package/dist/components/ds-panel-tool-header.js +2 -0
- package/dist/components/ds-panel-tool-header.js.map +1 -0
- package/dist/components/ds-panel-tool-search.d.ts +11 -0
- package/dist/components/ds-panel-tool-search.js +2 -0
- package/dist/components/ds-panel-tool-search.js.map +1 -0
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-panel-tools.js.map +1 -1
- package/dist/components/ds-radio.js +1 -1
- package/dist/components/ds-select-multi.js +1 -1
- package/dist/components/ds-select-multi.js.map +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-select.js.map +1 -1
- package/dist/components/ds-shell-gradient-picker.js +1 -1
- package/dist/components/ds-shell-gradient-picker.js.map +1 -1
- package/dist/components/ds-shell-gradient-swatch.js +1 -1
- package/dist/components/ds-shell-gradient-swatch.js.map +1 -1
- package/dist/components/ds-skeleton.js +1 -1
- package/dist/components/ds-slider.js +1 -1
- package/dist/components/ds-slider.js.map +1 -1
- package/dist/components/ds-swatch-picker.d.ts +11 -0
- package/dist/components/ds-swatch-picker.js +2 -0
- package/dist/components/ds-swatch-picker.js.map +1 -0
- package/dist/components/ds-switch.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-tab-group.js.map +1 -1
- package/dist/components/ds-tag.js +1 -1
- package/dist/components/ds-text.js +1 -1
- package/dist/components/ds-tooltip-data-viz.js +1 -1
- package/dist/components/ds-tooltip.js +1 -1
- package/dist/components/index.d.ts +14 -0
- package/dist/components/p--KbMQblZ.js +2 -0
- package/dist/components/p--KbMQblZ.js.map +1 -0
- package/dist/components/p-2br9YDbG.js +2 -0
- package/dist/components/p-2br9YDbG.js.map +1 -0
- package/dist/components/p-41UAx2eq.js +2 -0
- package/dist/components/p-41UAx2eq.js.map +1 -0
- package/dist/components/p-B1pWGQn1.js +2 -0
- package/dist/components/p-B1pWGQn1.js.map +1 -0
- package/dist/components/p-B7NbIYjS.js +2 -0
- package/dist/components/p-B7NbIYjS.js.map +1 -0
- package/dist/components/p-BBu_Svz7.js +2 -0
- package/dist/components/p-BBu_Svz7.js.map +1 -0
- package/dist/components/p-BEQB8EnB.js +2 -0
- package/dist/components/p-BEQB8EnB.js.map +1 -0
- package/dist/components/{p-CZ9wemOA.js → p-BFWC17em.js} +2 -2
- package/dist/components/{p-KRGBGTu5.js → p-BO6C8abO.js} +2 -2
- package/dist/components/{p-CbS_WWs2.js → p-BSOZXagj.js} +2 -2
- package/dist/components/p-BSOZXagj.js.map +1 -0
- package/dist/components/{p-DT2MK8Kt.js → p-BZAEZENv.js} +2 -2
- package/dist/components/p-BhC1YyId.js +2 -0
- package/dist/components/p-BhC1YyId.js.map +1 -0
- package/dist/components/p-BjtXYFhw.js +2 -0
- package/dist/components/p-BjtXYFhw.js.map +1 -0
- package/dist/components/{p-B-zhgAvL.js → p-Bo5wikia.js} +2 -2
- package/dist/components/p-Bx1G7P6W.js +2 -0
- package/dist/components/p-Bx1G7P6W.js.map +1 -0
- package/dist/components/p-C0sq948W.js +2 -0
- package/dist/components/p-C0sq948W.js.map +1 -0
- package/dist/components/p-CC1C8s6m.js +2 -0
- package/dist/components/p-CC1C8s6m.js.map +1 -0
- package/dist/components/p-CKaJx0IX.js +2 -0
- package/dist/components/p-CKaJx0IX.js.map +1 -0
- package/dist/components/{p-DyZj3k9S.js → p-CZMEhdlA.js} +2 -2
- package/dist/components/{p-BbV68F23.js → p-CiwdnKKp.js} +2 -2
- package/dist/components/{p-BLzivrE3.js → p-CnM9SW_8.js} +2 -2
- package/dist/components/{p-C7UFYvsO.js → p-CuKn9I5f.js} +2 -2
- package/dist/components/p-D1HFMTdC.js +2 -0
- package/dist/components/p-D1HFMTdC.js.map +1 -0
- package/dist/components/p-DFMM60My.js +2 -0
- package/dist/components/p-DFMM60My.js.map +1 -0
- package/dist/components/p-DIsDiGcp.js +2 -0
- package/dist/components/p-DIsDiGcp.js.map +1 -0
- package/dist/components/p-DVsje4AY.js +2 -0
- package/dist/components/p-DVsje4AY.js.map +1 -0
- package/dist/components/p-Di-ThR90.js +2 -0
- package/dist/components/p-Di-ThR90.js.map +1 -0
- package/dist/components/{p-C7RObioO.js → p-Di4HBckb.js} +2 -2
- package/dist/components/p-a9nGf1s6.js +2 -0
- package/dist/components/p-a9nGf1s6.js.map +1 -0
- package/dist/components/p-gidVv1FX.js +2 -0
- package/dist/components/p-gidVv1FX.js.map +1 -0
- package/dist/components/p-l6PmnW_P.js +2 -0
- package/dist/components/p-l6PmnW_P.js.map +1 -0
- package/dist/components/p-rEe-3KR_.js +2 -0
- package/dist/components/p-rEe-3KR_.js.map +1 -0
- package/dist/components/p-t9Ei1kHP.js +2 -0
- package/dist/components/p-t9Ei1kHP.js.map +1 -0
- package/dist/docs/components.json +8097 -3924
- package/dist/lib/components/Menu/menu-placement.d.ts +19 -3
- package/dist/lib/shell/index.d.ts +3 -3
- package/dist/lib/shell/index.js +48 -39
- package/dist/lib/shell/index.js.map +3 -3
- package/dist/lib/shell/shell-gradient-presets.d.ts +15 -0
- package/dist/lib/utils/choice-popup-alignment.d.ts +20 -0
- package/dist/lib/utils/index.d.ts +2 -0
- package/dist/lib/utils/index.js +16 -0
- package/dist/lib/utils/index.js.map +3 -3
- package/dist/mcp/cli.js +31409 -0
- package/dist/mcp-data/registry/agent-activity.json +158 -0
- package/dist/mcp-data/registry/agent-response.json +211 -0
- package/dist/mcp-data/registry/agent-source-list.json +153 -0
- package/dist/mcp-data/registry/agent-tool-call.json +213 -0
- package/dist/mcp-data/registry/app-shell.json +210 -0
- package/dist/mcp-data/registry/attachment-list.json +137 -0
- package/dist/mcp-data/registry/avatar.json +136 -0
- package/dist/mcp-data/registry/badge.json +289 -0
- package/dist/mcp-data/registry/banner.json +206 -0
- package/dist/mcp-data/registry/bar-nav.json +341 -0
- package/dist/mcp-data/registry/button-filled.json +386 -0
- package/dist/mcp-data/registry/button-unfilled.json +537 -0
- package/dist/mcp-data/registry/card-data-viz-donut.json +143 -0
- package/dist/mcp-data/registry/card-setting.json +194 -0
- package/dist/mcp-data/registry/card-shell-data-viz.json +173 -0
- package/dist/mcp-data/registry/card.json +126 -0
- package/dist/mcp-data/registry/chart-bar.json +121 -0
- package/dist/mcp-data/registry/chart-donut.json +257 -0
- package/dist/mcp-data/registry/chart-legend.json +209 -0
- package/dist/mcp-data/registry/chart-line.json +153 -0
- package/dist/mcp-data/registry/checkbox.json +361 -0
- package/dist/mcp-data/registry/chip.json +276 -0
- package/dist/mcp-data/registry/code-block.json +150 -0
- package/dist/mcp-data/registry/conversation-list-item.json +265 -0
- package/dist/mcp-data/registry/conversation-list-section.json +139 -0
- package/dist/mcp-data/registry/conversation-list.json +101 -0
- package/dist/mcp-data/registry/divider.json +225 -0
- package/dist/mcp-data/registry/empty-state.json +197 -0
- package/dist/mcp-data/registry/field.json +222 -0
- package/dist/mcp-data/registry/icon.json +242 -0
- package/dist/mcp-data/registry/input.json +597 -0
- package/dist/mcp-data/registry/loader.json +192 -0
- package/dist/mcp-data/registry/markdown.json +141 -0
- package/dist/mcp-data/registry/menu.json +479 -0
- package/dist/mcp-data/registry/message-bubble.json +119 -0
- package/dist/mcp-data/registry/message-composer.json +265 -0
- package/dist/mcp-data/registry/message-scroller.json +217 -0
- package/dist/mcp-data/registry/message.json +255 -0
- package/dist/mcp-data/registry/modal.json +150 -0
- package/dist/mcp-data/registry/panel-nav.json +622 -0
- package/dist/mcp-data/registry/panel-sub-nav.json +249 -0
- package/dist/mcp-data/registry/panel-tool-header.json +342 -0
- package/dist/mcp-data/registry/panel-tool-search.json +387 -0
- package/dist/mcp-data/registry/panel-tools.json +514 -0
- package/dist/mcp-data/registry/radio.json +374 -0
- package/dist/mcp-data/registry/registry.json +6916 -0
- package/dist/mcp-data/registry/select-multi.json +755 -0
- package/dist/mcp-data/registry/select.json +740 -0
- package/dist/mcp-data/registry/shell-gradient-picker.json +195 -0
- package/dist/mcp-data/registry/shell-gradient-swatch.json +215 -0
- package/dist/mcp-data/registry/skeleton.json +282 -0
- package/dist/mcp-data/registry/slider.json +657 -0
- package/dist/mcp-data/registry/swatch-picker.json +231 -0
- package/dist/mcp-data/registry/switch.json +361 -0
- package/dist/mcp-data/registry/tab-group.json +255 -0
- package/dist/mcp-data/registry/tag.json +352 -0
- package/dist/mcp-data/registry/text.json +371 -0
- package/dist/mcp-data/registry/tooltip-data-viz.json +158 -0
- package/dist/mcp-data/registry/tooltip.json +311 -0
- package/dist/react/components.d.ts +18 -0
- package/dist/react/components.js +18 -0
- package/dist/react/ds-agent-activity.d.ts +9 -0
- package/dist/react/ds-agent-activity.js +12 -0
- package/dist/react/ds-agent-response.d.ts +9 -0
- package/dist/react/ds-agent-response.js +12 -0
- package/dist/react/ds-agent-source-list.d.ts +9 -0
- package/dist/react/ds-agent-source-list.js +12 -0
- package/dist/react/ds-agent-tool-call.d.ts +9 -0
- package/dist/react/ds-agent-tool-call.js +12 -0
- package/dist/react/ds-attachment-list.d.ts +9 -0
- package/dist/react/ds-attachment-list.js +12 -0
- package/dist/react/ds-avatar.d.ts +9 -0
- package/dist/react/ds-avatar.js +12 -0
- package/dist/react/ds-code-block.d.ts +9 -0
- package/dist/react/ds-code-block.js +12 -0
- package/dist/react/ds-conversation-list-item.d.ts +14 -0
- package/dist/react/ds-conversation-list-item.js +12 -0
- package/dist/react/ds-conversation-list-section.d.ts +9 -0
- package/dist/react/ds-conversation-list-section.js +12 -0
- package/dist/react/ds-conversation-list.d.ts +9 -0
- package/dist/react/ds-conversation-list.js +12 -0
- package/dist/react/ds-markdown.d.ts +9 -0
- package/dist/react/ds-markdown.js +12 -0
- package/dist/react/ds-menu.d.ts +1 -0
- package/dist/react/ds-menu.js +2 -1
- package/dist/react/ds-message-bubble.d.ts +9 -0
- package/dist/react/ds-message-bubble.js +12 -0
- package/dist/react/ds-message-composer.d.ts +16 -0
- package/dist/react/ds-message-composer.js +16 -0
- package/dist/react/ds-message-scroller.d.ts +12 -0
- package/dist/react/ds-message-scroller.js +12 -0
- package/dist/react/ds-message.d.ts +9 -0
- package/dist/react/ds-message.js +12 -0
- package/dist/react/ds-panel-tool-header.d.ts +17 -0
- package/dist/react/ds-panel-tool-header.js +16 -0
- package/dist/react/ds-panel-tool-search.d.ts +14 -0
- package/dist/react/ds-panel-tool-search.js +16 -0
- package/dist/react/ds-panel-tools.d.ts +10 -0
- package/dist/react/ds-panel-tools.js +3 -0
- package/dist/react/ds-swatch-picker.d.ts +12 -0
- package/dist/react/ds-swatch-picker.js +12 -0
- package/dist/types/components/AgentActivity/AgentActivity.d.ts +14 -0
- package/dist/types/components/AgentResponse/AgentResponse.d.ts +12 -0
- package/dist/types/components/AgentSourceList/AgentSourceList.d.ts +9 -0
- package/dist/types/components/AgentToolCall/AgentToolCall.d.ts +13 -0
- package/dist/types/components/AppShell/AppShell.d.ts +4 -0
- package/dist/types/components/AttachmentList/AttachmentList.d.ts +8 -0
- package/dist/types/components/Avatar/Avatar.d.ts +8 -0
- package/dist/types/components/CodeBlock/CodeBlock.d.ts +11 -0
- package/dist/types/components/ConversationList/ConversationList.d.ts +4 -0
- package/dist/types/components/ConversationListItem/ConversationListItem.d.ts +22 -0
- package/dist/types/components/ConversationListSection/ConversationListSection.d.ts +9 -0
- package/dist/types/components/Markdown/Markdown.d.ts +15 -0
- package/dist/types/components/Menu/Menu.d.ts +10 -1
- package/dist/types/components/Menu/menu-placement.d.ts +19 -3
- package/dist/types/components/Menu/menu-types.d.ts +15 -2
- package/dist/types/components/Message/Message.d.ts +17 -0
- package/dist/types/components/MessageBubble/MessageBubble.d.ts +6 -0
- package/dist/types/components/MessageComposer/MessageComposer.d.ts +29 -0
- package/dist/types/components/MessageScroller/MessageScroller.d.ts +37 -0
- package/dist/types/components/PanelNav/PanelNav.d.ts +3 -0
- package/dist/types/components/PanelToolHeader/PanelToolHeader.d.ts +34 -0
- package/dist/types/components/PanelToolSearch/PanelToolSearch.d.ts +35 -0
- package/dist/types/components/PanelTools/PanelTools.d.ts +40 -1
- package/dist/types/components/PanelTools/panel-tools-types.d.ts +20 -0
- package/dist/types/components/PanelTools/panel-tools-utils.d.ts +2 -0
- package/dist/types/components/ShellGradientPicker/ShellGradientPicker.d.ts +2 -5
- package/dist/types/components/ShellGradientSwatch/ShellGradientSwatch.d.ts +1 -0
- package/dist/types/components/Slider/Slider.d.ts +1 -1
- package/dist/types/components/SwatchPicker/SwatchPicker.d.ts +21 -0
- package/dist/types/components/SwatchPicker/swatch-picker-types.d.ts +26 -0
- package/dist/types/components/conversation-types.d.ts +55 -0
- package/dist/types/components.d.ts +1298 -4
- package/dist/types/shell/index.d.ts +3 -3
- package/dist/types/shell/shell-gradient-presets.d.ts +15 -0
- package/dist/types/utils/choice-list-parts.d.ts +4 -1
- package/dist/types/utils/choice-popup-alignment.d.ts +21 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/package.json +9 -2
- package/dist/components/p-Bafp65bw.js +0 -2
- package/dist/components/p-Bafp65bw.js.map +0 -1
- package/dist/components/p-BdnR3jxi.js +0 -2
- package/dist/components/p-BdnR3jxi.js.map +0 -1
- package/dist/components/p-CXF8yd-g.js +0 -2
- package/dist/components/p-CXF8yd-g.js.map +0 -1
- package/dist/components/p-C_cu-HIT.js +0 -2
- package/dist/components/p-C_cu-HIT.js.map +0 -1
- package/dist/components/p-CbS_WWs2.js.map +0 -1
- package/dist/components/p-D0B9uDTP.js +0 -2
- package/dist/components/p-D0B9uDTP.js.map +0 -1
- package/dist/components/p-DF0yLZG_.js +0 -2
- package/dist/components/p-DF0yLZG_.js.map +0 -1
- package/dist/components/p-VKIsOVza.js +0 -2
- package/dist/components/p-VKIsOVza.js.map +0 -1
- /package/dist/components/{p-CZ9wemOA.js.map → p-BFWC17em.js.map} +0 -0
- /package/dist/components/{p-KRGBGTu5.js.map → p-BO6C8abO.js.map} +0 -0
- /package/dist/components/{p-DT2MK8Kt.js.map → p-BZAEZENv.js.map} +0 -0
- /package/dist/components/{p-B-zhgAvL.js.map → p-Bo5wikia.js.map} +0 -0
- /package/dist/components/{p-DyZj3k9S.js.map → p-CZMEhdlA.js.map} +0 -0
- /package/dist/components/{p-BbV68F23.js.map → p-CiwdnKKp.js.map} +0 -0
- /package/dist/components/{p-BLzivrE3.js.map → p-CnM9SW_8.js.map} +0 -0
- /package/dist/components/{p-C7UFYvsO.js.map → p-CuKn9I5f.js.map} +0 -0
- /package/dist/components/{p-C7RObioO.js.map → p-Di4HBckb.js.map} +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { ChoicePopupAnchorAlignment } from '../../utils/choice-popup-alignment';
|
|
1
2
|
import type { MenuAlign, MenuSide } from './menu-position';
|
|
2
3
|
/** Placement props bindable on `ds-menu` (side, align, offsets). */
|
|
3
4
|
export interface MenuPlacement {
|
|
4
5
|
side: MenuSide;
|
|
5
6
|
align: MenuAlign;
|
|
7
|
+
anchorAlignment: ChoicePopupAnchorAlignment;
|
|
6
8
|
sideOffset: number | string;
|
|
7
9
|
alignOffset: number | string;
|
|
8
10
|
}
|
|
@@ -11,13 +13,27 @@ export interface MenuPlacement {
|
|
|
11
13
|
* Anchor from `dsNavUserAction` detail `{ anchor }` (id `ds-panel-nav-user-menu-anchor`).
|
|
12
14
|
*
|
|
13
15
|
* Not for BarNav overflow menus — those use `side="bottom"` / `align="end"` internally.
|
|
14
|
-
* `align: 'end'` bottom-aligns on the anchor;
|
|
16
|
+
* `align: 'end'` bottom-aligns the last choice cell on the anchor; the side offset nudges into the content area:
|
|
15
17
|
* - `sideOffset` space-100 + space-050 (12px): 4px past the panel-nav outer edge (anchor is ~8px inset).
|
|
16
|
-
* - `
|
|
18
|
+
* - `anchorAlignment: 'choice-cell'`: the shared section inset puts the last row edge on the footer user row.
|
|
17
19
|
*/
|
|
18
20
|
export declare const PANEL_NAV_USER_MENU_PLACEMENT: {
|
|
19
21
|
readonly side: "right";
|
|
20
22
|
readonly align: "end";
|
|
23
|
+
readonly anchorAlignment: "choice-cell";
|
|
21
24
|
readonly sideOffset: "calc(var(--dimension-space-100) + var(--dimension-space-050))";
|
|
22
|
-
readonly alignOffset:
|
|
25
|
+
readonly alignOffset: 0;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Canonical placement for a menu opened by a PanelTools header action.
|
|
29
|
+
* Matches BarNav overflow: the 32px trigger is 8px inside the 48px header, so
|
|
30
|
+
* a 12px side offset places the popup 4px below the header edge. Choice-cell
|
|
31
|
+
* alignment keeps the final menu item edge aligned with the trigger.
|
|
32
|
+
*/
|
|
33
|
+
export declare const PANEL_TOOLS_HEADER_MENU_PLACEMENT: {
|
|
34
|
+
readonly side: "bottom";
|
|
35
|
+
readonly align: "end";
|
|
36
|
+
readonly anchorAlignment: "choice-cell";
|
|
37
|
+
readonly sideOffset: "calc(var(--dimension-space-100) + var(--dimension-space-050))";
|
|
38
|
+
readonly alignOffset: 0;
|
|
23
39
|
};
|
|
@@ -5,9 +5,9 @@ export type { ShellNavRevealOrigin } from './shell-view-transition';
|
|
|
5
5
|
export { SHELL_GRADIENT_IMAGE_VAR, SHELL_GRADIENT_SIZE_VAR, SHELL_GRADIENT_POSITION_PANEL_VAR, SHELL_GRADIENT_POSITION_BAR_VAR, SHELL_GRADIENT_OPACITY_VAR, SHELL_CHROME_SURFACE_POSITION_VAR, buildShellRadialGradient, shellGradientImage, shellGradientSize, shellGradientPositionPanel, shellGradientPositionBar, shellChromeSurfacePosition, shellChromeLayerActive, readShellViewportDimensions, } from './shell-gradient';
|
|
6
6
|
export type { ShellGradientLayout, ShellViewportDimensions } from './shell-gradient';
|
|
7
7
|
export type { MenuPlacement } from '../components/Menu/menu-placement';
|
|
8
|
-
export { PANEL_NAV_USER_MENU_PLACEMENT, } from '../components/Menu/menu-placement';
|
|
9
|
-
export type { ShellGradientPreset } from './shell-gradient-presets';
|
|
10
|
-
export { DEFAULT_SHELL_GRADIENT_PRESET, SHELL_GRADIENT_PRESETS, SHELL_GRADIENT_PRESET_LABELS, buildShellRadialGradientForPreset, isShellGradientPreset, normalizeShellGradientPreset, shellGradientPresetStopToken, } from './shell-gradient-presets';
|
|
8
|
+
export { PANEL_NAV_USER_MENU_PLACEMENT, PANEL_TOOLS_HEADER_MENU_PLACEMENT, } from '../components/Menu/menu-placement';
|
|
9
|
+
export type { ShellGradientPickerOption, ShellGradientPickerPreview, ShellGradientPickerSection, ShellGradientPreset, } from './shell-gradient-presets';
|
|
10
|
+
export { DEFAULT_SHELL_GRADIENT_PRESET, SHELL_GRADIENT_PRESETS, SHELL_GRADIENT_PRESET_LABELS, buildShellRadialGradientForPreset, isShellGradientPreset, normalizeShellGradientPreset, shellGradientPickerSections, shellGradientPresetStopToken, } from './shell-gradient-presets';
|
|
11
11
|
export type { ChromeTransitionDetail, ChromeTransitionSource } from './chrome-transition';
|
|
12
12
|
export { CHROME_TRANSITION_END, CHROME_TRANSITION_START, ChromeTransitionDepth, createRafCoalescer, readChromeTransitionSource, readChromeTransitionPhase, } from './chrome-transition';
|
|
13
13
|
export { barGradientPositionFromPanelWidth, isPanelNavCollapsed, panelWidthPxFromTokens, readCssVarWidthPx, readPanelNavWidthTokens, } from './shell-chrome-metrics';
|
package/dist/lib/shell/index.js
CHANGED
|
@@ -137,6 +137,12 @@ var SHELL_GRADIENT_PRESETS = [
|
|
|
137
137
|
"warm",
|
|
138
138
|
"fresh"
|
|
139
139
|
];
|
|
140
|
+
var SHELL_GRADIENT_WASH_PRESETS = [
|
|
141
|
+
"cool",
|
|
142
|
+
"neutral",
|
|
143
|
+
"warm",
|
|
144
|
+
"fresh"
|
|
145
|
+
];
|
|
140
146
|
var DEFAULT_SHELL_GRADIENT_PRESET = "neutral";
|
|
141
147
|
var SHELL_GRADIENT_PRESET_LABELS = {
|
|
142
148
|
none: "None",
|
|
@@ -184,6 +190,13 @@ function shellGradientPresetStopToken(preset) {
|
|
|
184
190
|
const stops = SHELL_GRADIENT_RECIPES[preset].stops;
|
|
185
191
|
return stops[stops.length - 1]?.color ?? null;
|
|
186
192
|
}
|
|
193
|
+
function shellGradientPresetRecipe(preset) {
|
|
194
|
+
const normalized = normalizeShellGradientPreset(preset);
|
|
195
|
+
return normalized === "none" ? null : SHELL_GRADIENT_RECIPES[normalized];
|
|
196
|
+
}
|
|
197
|
+
function shellGradientPresetOpacity(preset) {
|
|
198
|
+
return String(shellGradientPresetRecipe(preset)?.opacity ?? 0);
|
|
199
|
+
}
|
|
187
200
|
function isShellGradientPreset(value) {
|
|
188
201
|
return SHELL_GRADIENT_PRESETS.includes(value);
|
|
189
202
|
}
|
|
@@ -199,6 +212,30 @@ function buildShellRadialGradientFromStops(stops) {
|
|
|
199
212
|
const serialized = stops.map((stop) => `${stop.color} ${stop.position}%`).join(", ");
|
|
200
213
|
return `radial-gradient(${GRADIENT_GEOMETRY}, ${serialized})`;
|
|
201
214
|
}
|
|
215
|
+
function shellGradientPickerSections() {
|
|
216
|
+
return [
|
|
217
|
+
{
|
|
218
|
+
options: [{
|
|
219
|
+
value: "none",
|
|
220
|
+
label: SHELL_GRADIENT_PRESET_LABELS.none,
|
|
221
|
+
preview: {
|
|
222
|
+
backgroundColor: "var(--color-background-secondary)"
|
|
223
|
+
}
|
|
224
|
+
}]
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
options: SHELL_GRADIENT_WASH_PRESETS.map((preset) => ({
|
|
228
|
+
value: preset,
|
|
229
|
+
label: SHELL_GRADIENT_PRESET_LABELS[preset],
|
|
230
|
+
preview: {
|
|
231
|
+
backgroundColor: "var(--color-background-secondary)",
|
|
232
|
+
backgroundImage: buildShellRadialGradientForPreset(preset),
|
|
233
|
+
opacity: Number(shellGradientPresetOpacity(preset))
|
|
234
|
+
}
|
|
235
|
+
}))
|
|
236
|
+
}
|
|
237
|
+
];
|
|
238
|
+
}
|
|
202
239
|
|
|
203
240
|
// src/wc/shell/shell-gradient.ts
|
|
204
241
|
var SHELL_GRADIENT_IMAGE_VAR = "--ds-shell-gradient-image";
|
|
@@ -238,50 +275,20 @@ function shellChromeSurfacePosition(leftPx, topPx) {
|
|
|
238
275
|
return `${-Math.round(leftPx)}px ${-Math.round(topPx)}px`;
|
|
239
276
|
}
|
|
240
277
|
|
|
241
|
-
// src/wc/utils/token-defaults.ts
|
|
242
|
-
import {
|
|
243
|
-
dimensionIconographyMd,
|
|
244
|
-
dimensionIconographySm,
|
|
245
|
-
dimensionIconographyXs,
|
|
246
|
-
dimensionMenuWidthXs,
|
|
247
|
-
dimensionPanelWidth2xs,
|
|
248
|
-
dimensionPanelWidthLg,
|
|
249
|
-
dimensionPanelWidthMd,
|
|
250
|
-
dimensionRadius025,
|
|
251
|
-
dimensionSize200,
|
|
252
|
-
dimensionSize300,
|
|
253
|
-
dimensionSize400,
|
|
254
|
-
dimensionSize600,
|
|
255
|
-
dimensionSize800,
|
|
256
|
-
dimensionSpace050,
|
|
257
|
-
dimensionSpace200,
|
|
258
|
-
typographyLineheightLg,
|
|
259
|
-
typographyLineheightMd,
|
|
260
|
-
typographyLineheightSm,
|
|
261
|
-
typographyLineheightXl,
|
|
262
|
-
typographyLineheightXs,
|
|
263
|
-
effectAnimationDelayLong2,
|
|
264
|
-
effectAnimationDelayMedium1,
|
|
265
|
-
effectAnimationDelayMedium3,
|
|
266
|
-
effectAnimationDelayInstant,
|
|
267
|
-
effectAnimationDelayShort2,
|
|
268
|
-
effectAnimationDurationMedium1,
|
|
269
|
-
effectAnimationDurationShort3,
|
|
270
|
-
effectMotionShort2,
|
|
271
|
-
effectMotionShort3
|
|
272
|
-
} from "@ds-mo/tokens/ts";
|
|
273
|
-
var TOKEN_CSS_LENGTHS = {
|
|
274
|
-
space050: `var(${dimensionSpace050})`,
|
|
275
|
-
space200: `var(${dimensionSpace200})`,
|
|
276
|
-
menuWidthXs: `var(${dimensionMenuWidthXs})`
|
|
277
|
-
};
|
|
278
|
-
|
|
279
278
|
// src/wc/components/Menu/menu-placement.ts
|
|
280
279
|
var PANEL_NAV_USER_MENU_PLACEMENT = {
|
|
281
280
|
side: "right",
|
|
282
281
|
align: "end",
|
|
282
|
+
anchorAlignment: "choice-cell",
|
|
283
|
+
sideOffset: "calc(var(--dimension-space-100) + var(--dimension-space-050))",
|
|
284
|
+
alignOffset: 0
|
|
285
|
+
};
|
|
286
|
+
var PANEL_TOOLS_HEADER_MENU_PLACEMENT = {
|
|
287
|
+
side: "bottom",
|
|
288
|
+
align: "end",
|
|
289
|
+
anchorAlignment: "choice-cell",
|
|
283
290
|
sideOffset: "calc(var(--dimension-space-100) + var(--dimension-space-050))",
|
|
284
|
-
alignOffset:
|
|
291
|
+
alignOffset: 0
|
|
285
292
|
};
|
|
286
293
|
|
|
287
294
|
// src/wc/shell/chrome-transition.ts
|
|
@@ -427,6 +434,7 @@ export {
|
|
|
427
434
|
DEFAULT_SHELL_GRADIENT_PRESET,
|
|
428
435
|
NAV_STYLE_HINT_ATTR,
|
|
429
436
|
PANEL_NAV_USER_MENU_PLACEMENT,
|
|
437
|
+
PANEL_TOOLS_HEADER_MENU_PLACEMENT,
|
|
430
438
|
SHELL_BAR_NAV_VT_NAME,
|
|
431
439
|
SHELL_CHROME_SURFACE_POSITION_VAR,
|
|
432
440
|
SHELL_GRADIENT_IMAGE_VAR,
|
|
@@ -469,6 +477,7 @@ export {
|
|
|
469
477
|
shellChromeLayerActive,
|
|
470
478
|
shellChromeSurfacePosition,
|
|
471
479
|
shellGradientImage,
|
|
480
|
+
shellGradientPickerSections,
|
|
472
481
|
shellGradientPositionBar,
|
|
473
482
|
shellGradientPositionPanel,
|
|
474
483
|
shellGradientPresetStopToken,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/wc/shell/nav-chrome.ts", "../../../src/wc/utils/resolve-css-time-ms.ts", "../../../src/wc/shell/shell-view-transition.ts", "../../../src/wc/shell/shell-gradient-presets.ts", "../../../src/wc/shell/shell-gradient.ts", "../../../src/wc/
|
|
4
|
-
"sourcesContent": ["/** Nav chrome style slot \u2014 dashboard vs settings. Colors unified for now; texture hooks use the class. */\nexport type NavChromeStyle = 'dashboard' | 'settings';\n\n/** Document hint for first paint before framework props land. */\nexport const NAV_STYLE_HINT_ATTR = 'data-nav-style';\n\nexport function readNavStyleAttr(attr: string | null): NavChromeStyle | undefined {\n if (attr === 'dashboard' || attr === 'settings') return attr;\n return undefined;\n}\n\nexport function setNavStyleHint(style: NavChromeStyle): void {\n if (typeof document === 'undefined') return;\n document.documentElement.setAttribute(NAV_STYLE_HINT_ATTR, style);\n}\n\nexport function clearNavStyleHint(): void {\n if (typeof document === 'undefined') return;\n document.documentElement.removeAttribute(NAV_STYLE_HINT_ATTR);\n}\n\nexport function resolveNavChromeStyle(\n styleProp: NavChromeStyle,\n hostAttr: string | null,\n docHint?: string | null,\n): NavChromeStyle {\n const fromHost = readNavStyleAttr(hostAttr);\n if (fromHost) return fromHost;\n\n const hint =\n docHint !== undefined\n ? docHint\n : typeof document !== 'undefined'\n ? document.documentElement.getAttribute(NAV_STYLE_HINT_ATTR)\n : null;\n const fromHint = readNavStyleAttr(hint);\n if (fromHint) return fromHint;\n\n return styleProp;\n}\n\nexport function shouldResyncNavChromeStyle(\n renderedStyle: NavChromeStyle,\n style: NavChromeStyle,\n): boolean {\n return renderedStyle !== style;\n}\n", "/** Parse a CSS <time> value (or motion shorthand's first token) to milliseconds. */\nexport function parseCssTimeMs(value: string, fallback: number): number {\n const firstToken = value.trim().split(/\\s+/)[0] ?? '';\n const num = parseFloat(firstToken);\n if (Number.isNaN(num)) return fallback;\n if (/ms\\s*$/.test(firstToken)) return num;\n if (/s\\s*$/.test(firstToken)) return num * 1000;\n return num;\n}\n\nfunction extractCssCustomProp(ref: string): string | null {\n const varMatch = ref.match(/^var\\(\\s*(--[^),]+)/);\n if (varMatch) return varMatch[1].trim();\n if (ref.startsWith('--')) return ref.trim();\n return null;\n}\n\nfunction readTokenTimeMs(token: string, fallback: number): number {\n if (typeof document === 'undefined') return fallback;\n\n const prop = extractCssCustomProp(token);\n if (!prop) return parseCssTimeMs(token, fallback);\n\n const raw = getComputedStyle(document.documentElement).getPropertyValue(prop).trim();\n return parseCssTimeMs(raw, fallback);\n}\n\n/**\n * Resolve a duration to milliseconds for JS timers aligned with CSS motion tokens.\n * Accepts numbers (ms), raw times (`200ms`, `0.75s`), or `var(--effect-*)` references.\n */\nexport function resolveCssTimeMs(\n value: number | string | undefined,\n fallbackToken: string,\n): number {\n if (typeof value === 'number') return value;\n\n const token = typeof value === 'string' && value.trim() ? value.trim() : fallbackToken;\n const prop = extractCssCustomProp(token);\n\n if (prop) {\n return readTokenTimeMs(token, readTokenTimeMs(fallbackToken, 200));\n }\n\n return parseCssTimeMs(token, readTokenTimeMs(fallbackToken, 200));\n}\n\n/** Whether the user has requested reduced non-essential motion. */\nexport function prefersReducedMotion(): boolean {\n return typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Resolve an animation-coupled duration. Returns zero under reduced motion so\n * JS cleanup stays synchronized with CSS that removes the corresponding motion.\n */\nexport function resolveMotionTimeMs(\n value: number | string | undefined,\n fallbackToken: string,\n): number {\n return prefersReducedMotion() ? 0 : resolveCssTimeMs(value, fallbackToken);\n}\n", "import { parseCssTimeMs, prefersReducedMotion } from '../utils/resolve-css-time-ms';\n\n/** `view-transition-name` on `ds-bar-nav` \u2014 pairs with root reveal in shell apps. */\nexport const SHELL_BAR_NAV_VT_NAME = 'ds-shell-bar-nav';\n\nexport { parseCssTimeMs };\n\nconst VT_STYLE_ID = 'ds-shell-nav-vt-style';\n\n/** TokoMo tokens for the dashboard \u2194 settings radial reveal (WAAPI). */\nexport const SHELL_NAV_REVEAL_DURATION_VAR = '--effect-animation-duration-medium-3';\nexport const SHELL_NAV_REVEAL_EASING_VAR = '--effect-animation-easing-ease-in-out';\nconst SHELL_NAV_REVEAL_DURATION_FALLBACK_MS = 500;\nconst SHELL_NAV_REVEAL_EASING_FALLBACK = 'ease-in-out';\n\nfunction readCssCustomProperty(name: string, fallback: string): string {\n if (typeof document === 'undefined') return fallback;\n const value = getComputedStyle(document.documentElement).getPropertyValue(name).trim();\n return value || fallback;\n}\n\n/** Suppress default cross-fade and pin new snapshots to a 0px circle for WAAPI reveal. */\nexport function ensureShellNavVtStyle(): void {\n if (typeof document === 'undefined') return;\n\n const reduceMotion = prefersReducedMotion();\n const content = [\n '::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}',\n `::view-transition-old(${SHELL_BAR_NAV_VT_NAME}),::view-transition-new(${SHELL_BAR_NAV_VT_NAME}){animation:none;mix-blend-mode:normal}`,\n `::view-transition-old(${SHELL_BAR_NAV_VT_NAME}){z-index:1}`,\n `::view-transition-new(${SHELL_BAR_NAV_VT_NAME}){z-index:2${reduceMotion ? '' : ';clip-path:circle(0px at var(--vt-x,50%) var(--vt-y,50%))'}}`,\n reduceMotion ? '' : '::view-transition-new(root){clip-path:circle(0px at var(--vt-x,50%) var(--vt-y,50%))}',\n ].join('\\n');\n\n const existing = document.getElementById(VT_STYLE_ID) as HTMLStyleElement | null;\n if (existing) {\n if (existing.textContent !== content) existing.textContent = content;\n return;\n }\n\n const style = document.createElement('style');\n style.id = VT_STYLE_ID;\n style.textContent = content;\n document.head.appendChild(style);\n}\n\nexport interface ShellNavRevealOrigin {\n x: number;\n y: number;\n maxRadius: number;\n}\n\n/** Origin for the radial reveal \u2014 defaults to panel-nav footer gear, then viewport center. */\nexport function resolveShellNavRevealOrigin(originEl?: HTMLElement | null): ShellNavRevealOrigin {\n const btn =\n originEl ??\n document.querySelector<HTMLElement>('.panel-nav__footer-btn');\n const rect = btn?.getBoundingClientRect();\n const x = rect ? Math.round(rect.left + rect.width / 2) : Math.round(window.innerWidth / 2);\n const y = rect ? Math.round(rect.top + rect.height / 2) : Math.round(window.innerHeight / 2);\n const maxRadius = Math.ceil(\n Math.hypot(Math.max(x, window.innerWidth - x), Math.max(y, window.innerHeight - y)),\n );\n return { x, y, maxRadius };\n}\n\nexport function setShellNavRevealOriginVars(origin: ShellNavRevealOrigin): void {\n document.documentElement.style.setProperty('--vt-x', `${origin.x}px`);\n document.documentElement.style.setProperty('--vt-y', `${origin.y}px`);\n}\n\n/** Animate root + bar-nav snapshots with the same radial clip-path reveal. */\nexport function animateShellNavRadialReveal(\n origin: ShellNavRevealOrigin,\n durationMs?: number,\n): void {\n if (prefersReducedMotion()) {\n ensureShellNavVtStyle();\n return;\n }\n\n const duration =\n durationMs ??\n parseCssTimeMs(\n readCssCustomProperty(SHELL_NAV_REVEAL_DURATION_VAR, '400ms'),\n SHELL_NAV_REVEAL_DURATION_FALLBACK_MS,\n );\n const easing = readCssCustomProperty(\n SHELL_NAV_REVEAL_EASING_VAR,\n SHELL_NAV_REVEAL_EASING_FALLBACK,\n );\n const keyframes = {\n clipPath: [\n `circle(0px at ${origin.x}px ${origin.y}px)`,\n `circle(${origin.maxRadius}px at ${origin.x}px ${origin.y}px)`,\n ],\n };\n const options = {\n duration,\n easing,\n fill: 'forwards' as const,\n };\n\n document.documentElement.animate(keyframes, {\n ...options,\n pseudoElement: '::view-transition-new(root)',\n });\n document.documentElement.animate(keyframes, {\n ...options,\n pseudoElement: `::view-transition-new(${SHELL_BAR_NAV_VT_NAME})`,\n });\n}\n\n/** Run radial reveal when a view transition's `ready` promise settles (app/router driver). */\nexport function runShellNavStyleRevealOnReady(\n transition: { ready: Promise<void> },\n originEl?: HTMLElement | null,\n): void {\n ensureShellNavVtStyle();\n if (prefersReducedMotion()) {\n transition.ready.catch(() => {\n /* transition skipped or superseded */\n });\n return;\n }\n const origin = resolveShellNavRevealOrigin(originEl);\n setShellNavRevealOriginVars(origin);\n\n transition.ready\n .then(() => animateShellNavRadialReveal(origin))\n .catch(() => {\n /* transition skipped or superseded */\n });\n}\n", "/** Built-in shell chrome wash presets. */\nexport type ShellGradientPreset = 'none' | 'cool' | 'neutral' | 'warm' | 'fresh';\n\nexport const SHELL_GRADIENT_PRESETS: ShellGradientPreset[] = [\n 'none',\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Wash presets shown after the `none` option in pickers. */\nexport const SHELL_GRADIENT_WASH_PRESETS: Exclude<ShellGradientPreset, 'none'>[] = [\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Default wash when `gradient-preset` is omitted. */\nexport const DEFAULT_SHELL_GRADIENT_PRESET: ShellGradientPreset = 'neutral';\n\nexport const SHELL_GRADIENT_PRESET_LABELS: Record<ShellGradientPreset, string> = {\n none: 'None',\n cool: 'Cool',\n neutral: 'Neutral',\n warm: 'Warm',\n fresh: 'Fresh',\n};\n\nexport interface ShellGradientStop {\n color: string;\n position: number;\n}\n\nexport interface ShellGradientRecipe {\n opacity: number;\n stops: readonly ShellGradientStop[];\n}\n\nconst SHELL_GRADIENT_RECIPES: Record<Exclude<ShellGradientPreset, 'none'>, ShellGradientRecipe> = {\n cool: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-blue-strong-background)', position: 100 },\n ],\n },\n neutral: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-grey-strong-background)', position: 100 },\n ],\n },\n warm: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-yellow-strong-background)', position: 100 },\n ],\n },\n fresh: {\n opacity: 0.4,\n stops: [\n { color: 'var(--color-color-intent-cyan-faint-background)', position: 0 },\n { color: 'var(--color-background-transparent)', position: 47 },\n { color: 'var(--color-background-transparent)', position: 58 },\n { color: 'var(--color-color-intent-red-faint-background)', position: 83 },\n { color: 'var(--color-color-intent-pink-faint-background)', position: 100 },\n ],\n },\n};\n\nconst GRADIENT_GEOMETRY = '100% 100% at 0% 0%';\n\nexport function shellGradientPresetStopToken(preset: ShellGradientPreset): string | null {\n if (preset === 'none') return null;\n const stops = SHELL_GRADIENT_RECIPES[preset].stops;\n return stops[stops.length - 1]?.color ?? null;\n}\n\nexport function shellGradientPresetRecipe(preset: ShellGradientPreset): ShellGradientRecipe | null {\n const normalized = normalizeShellGradientPreset(preset);\n return normalized === 'none' ? null : SHELL_GRADIENT_RECIPES[normalized];\n}\n\nexport function shellGradientPresetOpacity(preset: ShellGradientPreset): string {\n return String(shellGradientPresetRecipe(preset)?.opacity ?? 0);\n}\n\nexport function isShellGradientPreset(value: string): value is ShellGradientPreset {\n return (SHELL_GRADIENT_PRESETS as string[]).includes(value);\n}\n\n/**\n * Coerce unknown/absent presets to the default. Runtime values escape the\n * type: removing the reflected `gradient-preset` attribute (e.g. an Angular\n * `[attr.gradient-preset]=\"null\"` binding) drives the prop to null past its\n * field default \u2014 without normalization the stop lookup interpolates the\n * literal string \"undefined\" into CSS and the wash silently disappears.\n */\nexport function normalizeShellGradientPreset(\n value: string | null | undefined,\n): ShellGradientPreset {\n return value != null && isShellGradientPreset(value) ? value : DEFAULT_SHELL_GRADIENT_PRESET;\n}\n\n/** Radial wash for a preset \u2014 transparent at top-left into the intent stop. `none` returns no image. */\nexport function buildShellRadialGradientForPreset(preset: ShellGradientPreset): string {\n const normalized = normalizeShellGradientPreset(preset);\n if (normalized === 'none') return 'none';\n\n return buildShellRadialGradientFromStops(SHELL_GRADIENT_RECIPES[normalized].stops);\n}\n\n/** Build the production shell geometry from an ordered set of design-time stops. */\nexport function buildShellRadialGradientFromStops(stops: readonly ShellGradientStop[]): string {\n const serialized = stops.map(stop => `${stop.color} ${stop.position}%`).join(', ');\n return `radial-gradient(${GRADIENT_GEOMETRY}, ${serialized})`;\n}\n", "/** CSS var names consumed by `ds-panel-nav` / `ds-bar-nav` inside `ds-app-shell`. */\nimport type { ShellGradientPreset } from './shell-gradient-presets';\nimport {\n DEFAULT_SHELL_GRADIENT_PRESET,\n buildShellRadialGradientForPreset,\n normalizeShellGradientPreset,\n} from './shell-gradient-presets';\n\nexport type { ShellGradientPreset } from './shell-gradient-presets';\nexport {\n DEFAULT_SHELL_GRADIENT_PRESET,\n SHELL_GRADIENT_PRESETS,\n SHELL_GRADIENT_PRESET_LABELS,\n buildShellRadialGradientForPreset,\n buildShellRadialGradientFromStops,\n isShellGradientPreset,\n shellGradientPresetOpacity,\n shellGradientPresetRecipe,\n shellGradientPresetStopToken,\n} from './shell-gradient-presets';\n\nexport const SHELL_GRADIENT_IMAGE_VAR = '--ds-shell-gradient-image';\nexport const SHELL_GRADIENT_SIZE_VAR = '--ds-shell-gradient-size';\nexport const SHELL_GRADIENT_POSITION_PANEL_VAR = '--ds-shell-gradient-position-panel';\nexport const SHELL_GRADIENT_POSITION_BAR_VAR = '--ds-shell-gradient-position-bar';\nexport const SHELL_GRADIENT_OPACITY_VAR = '--ds-shell-gradient-opacity';\n/** Per chrome-surface background-position \u2014 offsets wash + grid to shell row origin. */\nexport const SHELL_CHROME_SURFACE_POSITION_VAR = '--ds-shell-chrome-surface-position';\n\n/** Whether the shared chrome layer (secondary bg + optional wash) should mount. */\nexport function shellChromeLayerActive(preset: ShellGradientPreset): boolean {\n return normalizeShellGradientPreset(preset) !== 'none';\n}\n\n/**\n * Shell radial wash \u2014 same for panel and bar nav.\n * Tokens follow `data-theme` (light/dark intent stops).\n */\nexport function buildShellRadialGradient(\n preset: ShellGradientPreset = DEFAULT_SHELL_GRADIENT_PRESET,\n): string {\n return buildShellRadialGradientForPreset(preset);\n}\n\n/** Built-in radial image for the selected shell preset. */\nexport function shellGradientImage(\n preset: ShellGradientPreset = DEFAULT_SHELL_GRADIENT_PRESET,\n): string {\n return buildShellRadialGradient(preset);\n}\n\nexport interface ShellViewportDimensions {\n width: number;\n height: number;\n}\n\n/**\n * Viewport size for shell chrome with `background-attachment: fixed`.\n * Must not use the `ds-app-shell` element box \u2014 the shell can be shorter or\n * taller than the viewport when host height chains break or content overflows.\n */\nexport function readShellViewportDimensions(win?: Window): ShellViewportDimensions {\n const w = win ?? (typeof globalThis.window !== 'undefined' ? globalThis.window : undefined);\n if (!w) return { width: 0, height: 0 };\n\n const visual = w.visualViewport;\n return {\n width: Math.round(visual?.width ?? w.innerWidth),\n height: Math.round(visual?.height ?? w.innerHeight),\n };\n}\n\nexport interface ShellGradientLayout {\n width: number;\n height: number;\n panelWidth: number;\n}\n\n/** Pixel `background-size` for the fixed-attachment radial wash. */\nexport function shellGradientSize(layout: Pick<ShellGradientLayout, 'width' | 'height'>): string {\n return `${Math.round(layout.width)}px ${Math.round(layout.height)}px`;\n}\n\nexport function shellGradientPositionPanel(): string {\n return '0 0';\n}\n\nexport function shellGradientPositionBar(panelWidth: number): string {\n return `${-Math.round(panelWidth)}px 0`;\n}\n\n/** Phase-lock a chrome rect to the shell row coordinate system (wash + grid). */\nexport function shellChromeSurfacePosition(leftPx: number, topPx: number): string {\n return `${-Math.round(leftPx)}px ${-Math.round(topPx)}px`;\n}\n", "import {\n dimensionIconographyMd,\n dimensionIconographySm,\n dimensionIconographyXs,\n dimensionMenuWidthXs,\n dimensionPanelWidth2xs,\n dimensionPanelWidthLg,\n dimensionPanelWidthMd,\n dimensionRadius025,\n dimensionSize200,\n dimensionSize300,\n dimensionSize400,\n dimensionSize600,\n dimensionSize800,\n dimensionSpace050,\n dimensionSpace200,\n typographyLineheightLg,\n typographyLineheightMd,\n typographyLineheightSm,\n typographyLineheightXl,\n typographyLineheightXs,\n effectAnimationDelayLong2,\n effectAnimationDelayMedium1,\n effectAnimationDelayMedium3,\n effectAnimationDelayInstant,\n effectAnimationDelayShort2,\n effectAnimationDurationMedium1,\n effectAnimationDurationShort3,\n effectMotionShort2,\n effectMotionShort3,\n} from '@ds-mo/tokens/ts';\n\n/** TokoMo CSS custom-property names for shared component defaults (runtime resolution). */\nexport const TOKEN_DEFAULTS = {\n space050: dimensionSpace050,\n space200: dimensionSpace200,\n radius025: dimensionRadius025,\n size200: dimensionSize200,\n size300: dimensionSize300,\n size400: dimensionSize400,\n size600: dimensionSize600,\n size800: dimensionSize800,\n iconographyMd: dimensionIconographyMd,\n iconographySm: dimensionIconographySm,\n iconographyXs: dimensionIconographyXs,\n panelWidth2xs: dimensionPanelWidth2xs,\n panelWidthMd: dimensionPanelWidthMd,\n panelWidthLg: dimensionPanelWidthLg,\n menuWidthXs: dimensionMenuWidthXs,\n lineheightLg: typographyLineheightLg,\n lineheightMd: typographyLineheightMd,\n lineheightSm: typographyLineheightSm,\n lineheightXl: typographyLineheightXl,\n lineheightXs: typographyLineheightXs,\n motionShort2: effectMotionShort2,\n motionShort3: effectMotionShort3,\n animationDurationShort3: effectAnimationDurationShort3,\n animationDurationMedium1: effectAnimationDurationMedium1,\n animationDelayInstant: effectAnimationDelayInstant,\n animationDelayMedium1: effectAnimationDelayMedium1,\n animationDelayMedium3: effectAnimationDelayMedium3,\n animationDelayShort2: effectAnimationDelayShort2,\n animationDelayLong2: effectAnimationDelayLong2,\n /** Unmeasured menu height fallback: 20\u00D7 base (160px at default scale). */\n menuFallbackHeight: 'calc(var(--dimension-size-base) * 20)',\n /** Unmeasured tooltip width fallback: size-800 + size-200 (80px). */\n tooltipFallbackWidth: 'calc(var(--dimension-size-800) + var(--dimension-size-200))',\n /** Fill-mode donut diameter floor: 16\u00D7 size-base (128px). */\n donutFillMin: 'calc(var(--dimension-size-base) * 16)',\n /** Fill-mode donut diameter ceiling: 24\u00D7 size-base (192px). */\n donutFillMax: 'calc(var(--dimension-size-base) * 24)',\n} as const;\n\nexport type TokenDefaultKey = keyof typeof TOKEN_DEFAULTS;\n\n/** Valid CSS length strings for overlay offset props \u2014 bind on `sideOffset` / `alignOffset` in hosts. */\nexport const TOKEN_CSS_LENGTHS = {\n space050: `var(${dimensionSpace050})`,\n space200: `var(${dimensionSpace200})`,\n menuWidthXs: `var(${dimensionMenuWidthXs})`,\n} as const;\n", "import { TOKEN_CSS_LENGTHS } from '../../utils/token-defaults';\nimport type { MenuAlign, MenuSide } from './menu-position';\n\n/** Placement props bindable on `ds-menu` (side, align, offsets). */\nexport interface MenuPlacement {\n side: MenuSide;\n align: MenuAlign;\n sideOffset: number | string;\n alignOffset: number | string;\n}\n\n/**\n * Canonical `ds-menu` placement for the **panel-nav footer user menu**.\n * Anchor from `dsNavUserAction` detail `{ anchor }` (id `ds-panel-nav-user-menu-anchor`).\n *\n * Not for BarNav overflow menus \u2014 those use `side=\"bottom\"` / `align=\"end\"` internally.\n * `align: 'end'` bottom-aligns on the anchor; offsets nudge into the content area:\n * - `sideOffset` space-100 + space-050 (12px): 4px past the panel-nav outer edge (anchor is ~8px inset).\n * - `alignOffset` space-050 (4px): 4px below the footer user row.\n */\nexport const PANEL_NAV_USER_MENU_PLACEMENT = {\n side: 'right',\n align: 'end',\n sideOffset: 'calc(var(--dimension-space-100) + var(--dimension-space-050))',\n alignOffset: TOKEN_CSS_LENGTHS.space050,\n} as const satisfies MenuPlacement;\n", "/** Bubbling/composed events \u2014 `ds-app-shell` and `ds-bar-nav` coordinate during width motion. */\n\nexport const CHROME_TRANSITION_START = 'dsChromeTransitionStart';\nexport const CHROME_TRANSITION_END = 'dsChromeTransitionEnd';\n\nexport type ChromeTransitionSource = 'panel-nav' | 'panel-tools';\n\nexport interface ChromeTransitionDetail {\n source: ChromeTransitionSource;\n /** Panel-tools drawer motion direction; omitted for panel-nav. */\n phase?: 'opening' | 'closing';\n}\n\n/** Reference-counted gate \u2014 used while panel-nav width is transitioning. */\nexport class ChromeTransitionDepth {\n private depth = 0;\n\n enter(): void {\n this.depth += 1;\n }\n\n exit(): void {\n this.depth = Math.max(0, this.depth - 1);\n }\n\n get isActive(): boolean {\n return this.depth > 0;\n }\n}\n\n/** Idempotent gate for one physical chrome surface.\n * Duplicate start notifications still require only one matching end. */\nexport class ChromeTransitionGate {\n private active = false;\n\n enter(): void {\n this.active = true;\n }\n\n exit(): void {\n this.active = false;\n }\n\n get isActive(): boolean {\n return this.active;\n }\n}\n\nexport interface RafCoalescer {\n schedule(): void;\n cancel(): void;\n}\n\n/** Coalesce bursty layout work (ResizeObserver, prop churn) to one callback per frame. */\nexport function createRafCoalescer(onFrame: () => void): RafCoalescer {\n let rafId = 0;\n return {\n schedule() {\n if (rafId !== 0) return;\n rafId = requestAnimationFrame(() => {\n rafId = 0;\n onFrame();\n });\n },\n cancel() {\n if (rafId !== 0) {\n cancelAnimationFrame(rafId);\n rafId = 0;\n }\n },\n };\n}\n\nexport function readChromeTransitionSource(event: Event): ChromeTransitionSource | undefined {\n return (event as CustomEvent<ChromeTransitionDetail>).detail?.source;\n}\n\nexport function readChromeTransitionPhase(event: Event): ChromeTransitionDetail['phase'] {\n return (event as CustomEvent<ChromeTransitionDetail>).detail?.phase;\n}\n", "import { shellGradientPositionBar } from './shell-gradient';\n\n/** Read a `var(--token)` width in px using a hidden probe (works with calc() tokens). */\nexport function readCssVarWidthPx(context: HTMLElement, cssVarName: string): number {\n if (typeof document === 'undefined') return 0;\n\n const probe = document.createElement('div');\n probe.style.cssText =\n 'position:absolute;visibility:hidden;pointer-events:none;height:0;width:var(' +\n cssVarName +\n ');';\n context.appendChild(probe);\n const width = probe.getBoundingClientRect().width;\n context.removeChild(probe);\n return width;\n}\n\nexport interface PanelNavWidthTokens {\n expandedPx: number;\n collapsedPx: number;\n}\n\n/** Resolve panel-nav expanded/collapsed widths from scoped CSS vars on `.panel-nav`. */\nexport function readPanelNavWidthTokens(navRoot: HTMLElement): PanelNavWidthTokens {\n return {\n expandedPx: readCssVarWidthPx(navRoot, '--_nav-width'),\n collapsedPx: readCssVarWidthPx(navRoot, '--_nav-width-collapsed'),\n };\n}\n\nexport function isPanelNavCollapsed(\n panelNavHost: HTMLElement | null,\n navRoot: HTMLElement | null,\n): boolean {\n if (navRoot?.classList.contains('panel-nav--collapsed')) return true;\n const collapsedProp = (panelNavHost as (HTMLElement & { collapsed?: boolean }) | null)?.collapsed;\n return collapsedProp === true;\n}\n\nexport function panelWidthPxFromTokens(\n tokens: PanelNavWidthTokens,\n collapsed: boolean,\n): number {\n return collapsed ? tokens.collapsedPx : tokens.expandedPx;\n}\n\nexport function barGradientPositionFromPanelWidth(panelWidthPx: number): string {\n return shellGradientPositionBar(panelWidthPx);\n}\n", "import {\n SHELL_GRADIENT_POSITION_BAR_VAR,\n SHELL_GRADIENT_POSITION_PANEL_VAR,\n} from './shell-gradient';\n\n/** Per-badge background-position for shell gradient ring sampling. */\nexport const BADGE_GRADIENT_POSITION_VAR = '--_badge-gradient-position';\n\nexport interface GradientSurface {\n element: HTMLElement;\n chromeHost: HTMLElement;\n positionVar: string;\n}\n\n/** Whether the badge sits under a shell with an active wash preset. */\nexport function isShellGradientActive(from: HTMLElement): boolean {\n // Explicit <HTMLElement>: the inferred HTMLDsAppShellElement type only\n // resolves where @stencil/core types are installed \u2014 consumers importing\n // `@ds-mo/ui/shell` (raw TS) compile this without them.\n const shell = from.closest<HTMLElement>('ds-app-shell');\n return shell !== null && shell.getAttribute('gradient-preset') !== 'none';\n}\n\n/** Bar or panel chrome surface that owns the shell gradient stack. */\nexport function findGradientSurface(from: HTMLElement): GradientSurface | null {\n const barHost = from.closest('ds-bar-nav') as HTMLElement | null;\n if (barHost) {\n const root = barHost.shadowRoot ?? barHost;\n const element = root.querySelector('.bar-nav');\n if (element) {\n return {\n element: element as HTMLElement,\n chromeHost: barHost,\n positionVar: SHELL_GRADIENT_POSITION_BAR_VAR,\n };\n }\n }\n\n const panelHost = from.closest('ds-panel-nav') as HTMLElement | null;\n if (panelHost) {\n const root = panelHost.shadowRoot ?? panelHost;\n const element = root.querySelector('.panel-nav');\n if (element) {\n return {\n element: element as HTMLElement,\n chromeHost: panelHost,\n positionVar: SHELL_GRADIENT_POSITION_PANEL_VAR,\n };\n }\n }\n\n return null;\n}\n\ninterface ParsedPosition {\n x: number;\n y: number;\n}\n\n/** Parse a two-value CSS background-position (e.g. `-200px 0`). */\nexport function parseCssBackgroundPosition(value: string): ParsedPosition {\n const trimmed = value.trim();\n if (!trimmed) return { x: 0, y: 0 };\n\n const parts = trimmed.split(/\\s+/);\n const x = parseLength(parts[0] ?? '0');\n const y = parseLength(parts[1] ?? '0');\n return { x, y };\n}\n\nfunction parseLength(token: string): number {\n const px = token.match(/^(-?[\\d.]+)px$/);\n if (px) return Number(px[1]);\n return 0;\n}\n\n/**\n * Background position for a badge ring so the shell gradient aligns with nav chrome.\n * Uses badge center relative to the painted chrome surface.\n */\nexport function badgeGradientPosition(\n badgeHost: HTMLElement,\n surface: GradientSurface,\n shellPosition: string,\n): string {\n const badgeRect = badgeHost.getBoundingClientRect();\n const surfaceRect = surface.element.getBoundingClientRect();\n const anchorX = badgeRect.left + badgeRect.width / 2 - surfaceRect.left;\n const anchorY = badgeRect.top + badgeRect.height / 2 - surfaceRect.top;\n const { x, y } = parseCssBackgroundPosition(shellPosition);\n\n return `${Math.round(x - anchorX)}px ${Math.round(y - anchorY)}px`;\n}\n\n/** Resolve shell gradient position from chrome host custom properties. */\nexport function readShellGradientPosition(surface: GradientSurface): string {\n const styles = getComputedStyle(surface.chromeHost);\n return styles.getPropertyValue(surface.positionVar).trim() || '0 0';\n}\n\n/** Stamp `--_badge-gradient-position` on the badge host (fixed viewport chrome). */\nexport function syncBadgeGradientPosition(badgeHost: HTMLElement): void {\n if (!isShellGradientActive(badgeHost)) {\n badgeHost.style.removeProperty(BADGE_GRADIENT_POSITION_VAR);\n return;\n }\n\n badgeHost.style.setProperty(BADGE_GRADIENT_POSITION_VAR, '0 0');\n}\n"],
|
|
5
|
-
"mappings": ";AAIO,IAAM,sBAAsB;AAE5B,SAAS,iBAAiB,MAAiD;AAChF,MAAI,SAAS,eAAe,SAAS,WAAY,QAAO;AACxD,SAAO;AACT;AAEO,SAAS,gBAAgB,OAA6B;AAC3D,MAAI,OAAO,aAAa,YAAa;AACrC,WAAS,gBAAgB,aAAa,qBAAqB,KAAK;AAClE;AAEO,SAAS,oBAA0B;AACxC,MAAI,OAAO,aAAa,YAAa;AACrC,WAAS,gBAAgB,gBAAgB,mBAAmB;AAC9D;AAEO,SAAS,sBACd,WACA,UACA,SACgB;AAChB,QAAM,WAAW,iBAAiB,QAAQ;AAC1C,MAAI,SAAU,QAAO;AAErB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A,EACF;AACA,QAAM,UAAU;AAAA,IACd;AAAA,IACA;AAAA,IACA,MAAM;AAAA,EACR;AAEA,WAAS,gBAAgB,QAAQ,WAAW;AAAA,IAC1C,GAAG;AAAA,IACH,eAAe;AAAA,EACjB,CAAC;AACD,WAAS,gBAAgB,QAAQ,WAAW;AAAA,IAC1C,GAAG;AAAA,IACH,eAAe,yBAAyB,qBAAqB;AAAA,EAC/D,CAAC;AACH;AAGO,SAAS,8BACd,YACA,UACM;AACN,wBAAsB;AACtB,MAAI,qBAAqB,GAAG;AAC1B,eAAW,MAAM,MAAM,MAAM;AAAA,IAE7B,CAAC;AACD;AAAA,EACF;AACA,QAAM,SAAS,4BAA4B,QAAQ;AACnD,8BAA4B,MAAM;AAElC,aAAW,MACR,KAAK,MAAM,4BAA4B,MAAM,CAAC,EAC9C,MAAM,MAAM;AAAA,EAEb,CAAC;AACL;;;AClIO,IAAM,yBAAgD;AAAA,EAC3D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;
|
|
3
|
+
"sources": ["../../../src/wc/shell/nav-chrome.ts", "../../../src/wc/utils/resolve-css-time-ms.ts", "../../../src/wc/shell/shell-view-transition.ts", "../../../src/wc/shell/shell-gradient-presets.ts", "../../../src/wc/shell/shell-gradient.ts", "../../../src/wc/components/Menu/menu-placement.ts", "../../../src/wc/shell/chrome-transition.ts", "../../../src/wc/shell/shell-chrome-metrics.ts", "../../../src/wc/shell/badge-gradient-ring.ts"],
|
|
4
|
+
"sourcesContent": ["/** Nav chrome style slot \u2014 dashboard vs settings. Colors unified for now; texture hooks use the class. */\nexport type NavChromeStyle = 'dashboard' | 'settings';\n\n/** Document hint for first paint before framework props land. */\nexport const NAV_STYLE_HINT_ATTR = 'data-nav-style';\n\nexport function readNavStyleAttr(attr: string | null): NavChromeStyle | undefined {\n if (attr === 'dashboard' || attr === 'settings') return attr;\n return undefined;\n}\n\nexport function setNavStyleHint(style: NavChromeStyle): void {\n if (typeof document === 'undefined') return;\n document.documentElement.setAttribute(NAV_STYLE_HINT_ATTR, style);\n}\n\nexport function clearNavStyleHint(): void {\n if (typeof document === 'undefined') return;\n document.documentElement.removeAttribute(NAV_STYLE_HINT_ATTR);\n}\n\nexport function resolveNavChromeStyle(\n styleProp: NavChromeStyle,\n hostAttr: string | null,\n docHint?: string | null,\n): NavChromeStyle {\n const fromHost = readNavStyleAttr(hostAttr);\n if (fromHost) return fromHost;\n\n const hint =\n docHint !== undefined\n ? docHint\n : typeof document !== 'undefined'\n ? document.documentElement.getAttribute(NAV_STYLE_HINT_ATTR)\n : null;\n const fromHint = readNavStyleAttr(hint);\n if (fromHint) return fromHint;\n\n return styleProp;\n}\n\nexport function shouldResyncNavChromeStyle(\n renderedStyle: NavChromeStyle,\n style: NavChromeStyle,\n): boolean {\n return renderedStyle !== style;\n}\n", "/** Parse a CSS <time> value (or motion shorthand's first token) to milliseconds. */\nexport function parseCssTimeMs(value: string, fallback: number): number {\n const firstToken = value.trim().split(/\\s+/)[0] ?? '';\n const num = parseFloat(firstToken);\n if (Number.isNaN(num)) return fallback;\n if (/ms\\s*$/.test(firstToken)) return num;\n if (/s\\s*$/.test(firstToken)) return num * 1000;\n return num;\n}\n\nfunction extractCssCustomProp(ref: string): string | null {\n const varMatch = ref.match(/^var\\(\\s*(--[^),]+)/);\n if (varMatch) return varMatch[1].trim();\n if (ref.startsWith('--')) return ref.trim();\n return null;\n}\n\nfunction readTokenTimeMs(token: string, fallback: number): number {\n if (typeof document === 'undefined') return fallback;\n\n const prop = extractCssCustomProp(token);\n if (!prop) return parseCssTimeMs(token, fallback);\n\n const raw = getComputedStyle(document.documentElement).getPropertyValue(prop).trim();\n return parseCssTimeMs(raw, fallback);\n}\n\n/**\n * Resolve a duration to milliseconds for JS timers aligned with CSS motion tokens.\n * Accepts numbers (ms), raw times (`200ms`, `0.75s`), or `var(--effect-*)` references.\n */\nexport function resolveCssTimeMs(\n value: number | string | undefined,\n fallbackToken: string,\n): number {\n if (typeof value === 'number') return value;\n\n const token = typeof value === 'string' && value.trim() ? value.trim() : fallbackToken;\n const prop = extractCssCustomProp(token);\n\n if (prop) {\n return readTokenTimeMs(token, readTokenTimeMs(fallbackToken, 200));\n }\n\n return parseCssTimeMs(token, readTokenTimeMs(fallbackToken, 200));\n}\n\n/** Whether the user has requested reduced non-essential motion. */\nexport function prefersReducedMotion(): boolean {\n return typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Resolve an animation-coupled duration. Returns zero under reduced motion so\n * JS cleanup stays synchronized with CSS that removes the corresponding motion.\n */\nexport function resolveMotionTimeMs(\n value: number | string | undefined,\n fallbackToken: string,\n): number {\n return prefersReducedMotion() ? 0 : resolveCssTimeMs(value, fallbackToken);\n}\n", "import { parseCssTimeMs, prefersReducedMotion } from '../utils/resolve-css-time-ms';\n\n/** `view-transition-name` on `ds-bar-nav` \u2014 pairs with root reveal in shell apps. */\nexport const SHELL_BAR_NAV_VT_NAME = 'ds-shell-bar-nav';\n\nexport { parseCssTimeMs };\n\nconst VT_STYLE_ID = 'ds-shell-nav-vt-style';\n\n/** TokoMo tokens for the dashboard \u2194 settings radial reveal (WAAPI). */\nexport const SHELL_NAV_REVEAL_DURATION_VAR = '--effect-animation-duration-medium-3';\nexport const SHELL_NAV_REVEAL_EASING_VAR = '--effect-animation-easing-ease-in-out';\nconst SHELL_NAV_REVEAL_DURATION_FALLBACK_MS = 500;\nconst SHELL_NAV_REVEAL_EASING_FALLBACK = 'ease-in-out';\n\nfunction readCssCustomProperty(name: string, fallback: string): string {\n if (typeof document === 'undefined') return fallback;\n const value = getComputedStyle(document.documentElement).getPropertyValue(name).trim();\n return value || fallback;\n}\n\n/** Suppress default cross-fade and pin new snapshots to a 0px circle for WAAPI reveal. */\nexport function ensureShellNavVtStyle(): void {\n if (typeof document === 'undefined') return;\n\n const reduceMotion = prefersReducedMotion();\n const content = [\n '::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}',\n `::view-transition-old(${SHELL_BAR_NAV_VT_NAME}),::view-transition-new(${SHELL_BAR_NAV_VT_NAME}){animation:none;mix-blend-mode:normal}`,\n `::view-transition-old(${SHELL_BAR_NAV_VT_NAME}){z-index:1}`,\n `::view-transition-new(${SHELL_BAR_NAV_VT_NAME}){z-index:2${reduceMotion ? '' : ';clip-path:circle(0px at var(--vt-x,50%) var(--vt-y,50%))'}}`,\n reduceMotion ? '' : '::view-transition-new(root){clip-path:circle(0px at var(--vt-x,50%) var(--vt-y,50%))}',\n ].join('\\n');\n\n const existing = document.getElementById(VT_STYLE_ID) as HTMLStyleElement | null;\n if (existing) {\n if (existing.textContent !== content) existing.textContent = content;\n return;\n }\n\n const style = document.createElement('style');\n style.id = VT_STYLE_ID;\n style.textContent = content;\n document.head.appendChild(style);\n}\n\nexport interface ShellNavRevealOrigin {\n x: number;\n y: number;\n maxRadius: number;\n}\n\n/** Origin for the radial reveal \u2014 defaults to panel-nav footer gear, then viewport center. */\nexport function resolveShellNavRevealOrigin(originEl?: HTMLElement | null): ShellNavRevealOrigin {\n const btn =\n originEl ??\n document.querySelector<HTMLElement>('.panel-nav__footer-btn');\n const rect = btn?.getBoundingClientRect();\n const x = rect ? Math.round(rect.left + rect.width / 2) : Math.round(window.innerWidth / 2);\n const y = rect ? Math.round(rect.top + rect.height / 2) : Math.round(window.innerHeight / 2);\n const maxRadius = Math.ceil(\n Math.hypot(Math.max(x, window.innerWidth - x), Math.max(y, window.innerHeight - y)),\n );\n return { x, y, maxRadius };\n}\n\nexport function setShellNavRevealOriginVars(origin: ShellNavRevealOrigin): void {\n document.documentElement.style.setProperty('--vt-x', `${origin.x}px`);\n document.documentElement.style.setProperty('--vt-y', `${origin.y}px`);\n}\n\n/** Animate root + bar-nav snapshots with the same radial clip-path reveal. */\nexport function animateShellNavRadialReveal(\n origin: ShellNavRevealOrigin,\n durationMs?: number,\n): void {\n if (prefersReducedMotion()) {\n ensureShellNavVtStyle();\n return;\n }\n\n const duration =\n durationMs ??\n parseCssTimeMs(\n readCssCustomProperty(SHELL_NAV_REVEAL_DURATION_VAR, '400ms'),\n SHELL_NAV_REVEAL_DURATION_FALLBACK_MS,\n );\n const easing = readCssCustomProperty(\n SHELL_NAV_REVEAL_EASING_VAR,\n SHELL_NAV_REVEAL_EASING_FALLBACK,\n );\n const keyframes = {\n clipPath: [\n `circle(0px at ${origin.x}px ${origin.y}px)`,\n `circle(${origin.maxRadius}px at ${origin.x}px ${origin.y}px)`,\n ],\n };\n const options = {\n duration,\n easing,\n fill: 'forwards' as const,\n };\n\n document.documentElement.animate(keyframes, {\n ...options,\n pseudoElement: '::view-transition-new(root)',\n });\n document.documentElement.animate(keyframes, {\n ...options,\n pseudoElement: `::view-transition-new(${SHELL_BAR_NAV_VT_NAME})`,\n });\n}\n\n/** Run radial reveal when a view transition's `ready` promise settles (app/router driver). */\nexport function runShellNavStyleRevealOnReady(\n transition: { ready: Promise<void> },\n originEl?: HTMLElement | null,\n): void {\n ensureShellNavVtStyle();\n if (prefersReducedMotion()) {\n transition.ready.catch(() => {\n /* transition skipped or superseded */\n });\n return;\n }\n const origin = resolveShellNavRevealOrigin(originEl);\n setShellNavRevealOriginVars(origin);\n\n transition.ready\n .then(() => animateShellNavRadialReveal(origin))\n .catch(() => {\n /* transition skipped or superseded */\n });\n}\n", "/** Built-in shell chrome wash presets. */\nexport type ShellGradientPreset = 'none' | 'cool' | 'neutral' | 'warm' | 'fresh';\n\nexport const SHELL_GRADIENT_PRESETS: ShellGradientPreset[] = [\n 'none',\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Wash presets shown after the `none` option in pickers. */\nexport const SHELL_GRADIENT_WASH_PRESETS: Exclude<ShellGradientPreset, 'none'>[] = [\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Default wash when `gradient-preset` is omitted. */\nexport const DEFAULT_SHELL_GRADIENT_PRESET: ShellGradientPreset = 'neutral';\n\nexport const SHELL_GRADIENT_PRESET_LABELS: Record<ShellGradientPreset, string> = {\n none: 'None',\n cool: 'Cool',\n neutral: 'Neutral',\n warm: 'Warm',\n fresh: 'Fresh',\n};\n\nexport interface ShellGradientStop {\n color: string;\n position: number;\n}\n\nexport interface ShellGradientRecipe {\n opacity: number;\n stops: readonly ShellGradientStop[];\n}\n\nexport interface ShellGradientPickerPreview {\n backgroundColor: string;\n backgroundImage?: string;\n opacity?: number;\n}\n\nexport interface ShellGradientPickerOption {\n value: ShellGradientPreset;\n label: string;\n preview: ShellGradientPickerPreview;\n}\n\nexport interface ShellGradientPickerSection {\n options: ShellGradientPickerOption[];\n}\n\nconst SHELL_GRADIENT_RECIPES: Record<Exclude<ShellGradientPreset, 'none'>, ShellGradientRecipe> = {\n cool: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-blue-strong-background)', position: 100 },\n ],\n },\n neutral: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-grey-strong-background)', position: 100 },\n ],\n },\n warm: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-yellow-strong-background)', position: 100 },\n ],\n },\n fresh: {\n opacity: 0.4,\n stops: [\n { color: 'var(--color-color-intent-cyan-faint-background)', position: 0 },\n { color: 'var(--color-background-transparent)', position: 47 },\n { color: 'var(--color-background-transparent)', position: 58 },\n { color: 'var(--color-color-intent-red-faint-background)', position: 83 },\n { color: 'var(--color-color-intent-pink-faint-background)', position: 100 },\n ],\n },\n};\n\nconst GRADIENT_GEOMETRY = '100% 100% at 0% 0%';\n\nexport function shellGradientPresetStopToken(preset: ShellGradientPreset): string | null {\n if (preset === 'none') return null;\n const stops = SHELL_GRADIENT_RECIPES[preset].stops;\n return stops[stops.length - 1]?.color ?? null;\n}\n\nexport function shellGradientPresetRecipe(preset: ShellGradientPreset): ShellGradientRecipe | null {\n const normalized = normalizeShellGradientPreset(preset);\n return normalized === 'none' ? null : SHELL_GRADIENT_RECIPES[normalized];\n}\n\nexport function shellGradientPresetOpacity(preset: ShellGradientPreset): string {\n return String(shellGradientPresetRecipe(preset)?.opacity ?? 0);\n}\n\nexport function isShellGradientPreset(value: string): value is ShellGradientPreset {\n return (SHELL_GRADIENT_PRESETS as string[]).includes(value);\n}\n\n/**\n * Coerce unknown/absent presets to the default. Runtime values escape the\n * type: removing the reflected `gradient-preset` attribute (e.g. an Angular\n * `[attr.gradient-preset]=\"null\"` binding) drives the prop to null past its\n * field default \u2014 without normalization the stop lookup interpolates the\n * literal string \"undefined\" into CSS and the wash silently disappears.\n */\nexport function normalizeShellGradientPreset(\n value: string | null | undefined,\n): ShellGradientPreset {\n return value != null && isShellGradientPreset(value) ? value : DEFAULT_SHELL_GRADIENT_PRESET;\n}\n\n/** Radial wash for a preset \u2014 transparent at top-left into the intent stop. `none` returns no image. */\nexport function buildShellRadialGradientForPreset(preset: ShellGradientPreset): string {\n const normalized = normalizeShellGradientPreset(preset);\n if (normalized === 'none') return 'none';\n\n return buildShellRadialGradientFromStops(SHELL_GRADIENT_RECIPES[normalized].stops);\n}\n\n/** Build the production shell geometry from an ordered set of design-time stops. */\nexport function buildShellRadialGradientFromStops(stops: readonly ShellGradientStop[]): string {\n const serialized = stops.map(stop => `${stop.color} ${stop.position}%`).join(', ');\n return `radial-gradient(${GRADIENT_GEOMETRY}, ${serialized})`;\n}\n\n/** Generic SwatchPicker sections for the fixed shell appearance presets. */\nexport function shellGradientPickerSections(): ShellGradientPickerSection[] {\n return [\n {\n options: [{\n value: 'none',\n label: SHELL_GRADIENT_PRESET_LABELS.none,\n preview: {\n backgroundColor: 'var(--color-background-secondary)',\n },\n }],\n },\n {\n options: SHELL_GRADIENT_WASH_PRESETS.map(preset => ({\n value: preset,\n label: SHELL_GRADIENT_PRESET_LABELS[preset],\n preview: {\n backgroundColor: 'var(--color-background-secondary)',\n backgroundImage: buildShellRadialGradientForPreset(preset),\n opacity: Number(shellGradientPresetOpacity(preset)),\n },\n })),\n },\n ];\n}\n", "/** CSS var names consumed by `ds-panel-nav` / `ds-bar-nav` inside `ds-app-shell`. */\nimport type { ShellGradientPreset } from './shell-gradient-presets';\nimport {\n DEFAULT_SHELL_GRADIENT_PRESET,\n buildShellRadialGradientForPreset,\n normalizeShellGradientPreset,\n} from './shell-gradient-presets';\n\nexport type { ShellGradientPreset } from './shell-gradient-presets';\nexport {\n DEFAULT_SHELL_GRADIENT_PRESET,\n SHELL_GRADIENT_PRESETS,\n SHELL_GRADIENT_PRESET_LABELS,\n buildShellRadialGradientForPreset,\n buildShellRadialGradientFromStops,\n isShellGradientPreset,\n shellGradientPresetOpacity,\n shellGradientPresetRecipe,\n shellGradientPresetStopToken,\n} from './shell-gradient-presets';\n\nexport const SHELL_GRADIENT_IMAGE_VAR = '--ds-shell-gradient-image';\nexport const SHELL_GRADIENT_SIZE_VAR = '--ds-shell-gradient-size';\nexport const SHELL_GRADIENT_POSITION_PANEL_VAR = '--ds-shell-gradient-position-panel';\nexport const SHELL_GRADIENT_POSITION_BAR_VAR = '--ds-shell-gradient-position-bar';\nexport const SHELL_GRADIENT_OPACITY_VAR = '--ds-shell-gradient-opacity';\n/** Per chrome-surface background-position \u2014 offsets wash + grid to shell row origin. */\nexport const SHELL_CHROME_SURFACE_POSITION_VAR = '--ds-shell-chrome-surface-position';\n\n/** Whether the shared chrome layer (secondary bg + optional wash) should mount. */\nexport function shellChromeLayerActive(preset: ShellGradientPreset): boolean {\n return normalizeShellGradientPreset(preset) !== 'none';\n}\n\n/**\n * Shell radial wash \u2014 same for panel and bar nav.\n * Tokens follow `data-theme` (light/dark intent stops).\n */\nexport function buildShellRadialGradient(\n preset: ShellGradientPreset = DEFAULT_SHELL_GRADIENT_PRESET,\n): string {\n return buildShellRadialGradientForPreset(preset);\n}\n\n/** Built-in radial image for the selected shell preset. */\nexport function shellGradientImage(\n preset: ShellGradientPreset = DEFAULT_SHELL_GRADIENT_PRESET,\n): string {\n return buildShellRadialGradient(preset);\n}\n\nexport interface ShellViewportDimensions {\n width: number;\n height: number;\n}\n\n/**\n * Viewport size for shell chrome with `background-attachment: fixed`.\n * Must not use the `ds-app-shell` element box \u2014 the shell can be shorter or\n * taller than the viewport when host height chains break or content overflows.\n */\nexport function readShellViewportDimensions(win?: Window): ShellViewportDimensions {\n const w = win ?? (typeof globalThis.window !== 'undefined' ? globalThis.window : undefined);\n if (!w) return { width: 0, height: 0 };\n\n const visual = w.visualViewport;\n return {\n width: Math.round(visual?.width ?? w.innerWidth),\n height: Math.round(visual?.height ?? w.innerHeight),\n };\n}\n\nexport interface ShellGradientLayout {\n width: number;\n height: number;\n panelWidth: number;\n}\n\n/** Pixel `background-size` for the fixed-attachment radial wash. */\nexport function shellGradientSize(layout: Pick<ShellGradientLayout, 'width' | 'height'>): string {\n return `${Math.round(layout.width)}px ${Math.round(layout.height)}px`;\n}\n\nexport function shellGradientPositionPanel(): string {\n return '0 0';\n}\n\nexport function shellGradientPositionBar(panelWidth: number): string {\n return `${-Math.round(panelWidth)}px 0`;\n}\n\n/** Phase-lock a chrome rect to the shell row coordinate system (wash + grid). */\nexport function shellChromeSurfacePosition(leftPx: number, topPx: number): string {\n return `${-Math.round(leftPx)}px ${-Math.round(topPx)}px`;\n}\n", "import type { ChoicePopupAnchorAlignment } from '../../utils/choice-popup-alignment';\nimport type { MenuAlign, MenuSide } from './menu-position';\n\n/** Placement props bindable on `ds-menu` (side, align, offsets). */\nexport interface MenuPlacement {\n side: MenuSide;\n align: MenuAlign;\n anchorAlignment: ChoicePopupAnchorAlignment;\n sideOffset: number | string;\n alignOffset: number | string;\n}\n\n/**\n * Canonical `ds-menu` placement for the **panel-nav footer user menu**.\n * Anchor from `dsNavUserAction` detail `{ anchor }` (id `ds-panel-nav-user-menu-anchor`).\n *\n * Not for BarNav overflow menus \u2014 those use `side=\"bottom\"` / `align=\"end\"` internally.\n * `align: 'end'` bottom-aligns the last choice cell on the anchor; the side offset nudges into the content area:\n * - `sideOffset` space-100 + space-050 (12px): 4px past the panel-nav outer edge (anchor is ~8px inset).\n * - `anchorAlignment: 'choice-cell'`: the shared section inset puts the last row edge on the footer user row.\n */\nexport const PANEL_NAV_USER_MENU_PLACEMENT = {\n side: 'right',\n align: 'end',\n anchorAlignment: 'choice-cell',\n sideOffset: 'calc(var(--dimension-space-100) + var(--dimension-space-050))',\n alignOffset: 0,\n} as const satisfies MenuPlacement;\n\n/**\n * Canonical placement for a menu opened by a PanelTools header action.\n * Matches BarNav overflow: the 32px trigger is 8px inside the 48px header, so\n * a 12px side offset places the popup 4px below the header edge. Choice-cell\n * alignment keeps the final menu item edge aligned with the trigger.\n */\nexport const PANEL_TOOLS_HEADER_MENU_PLACEMENT = {\n side: 'bottom',\n align: 'end',\n anchorAlignment: 'choice-cell',\n sideOffset: 'calc(var(--dimension-space-100) + var(--dimension-space-050))',\n alignOffset: 0,\n} as const satisfies MenuPlacement;\n", "/** Bubbling/composed events \u2014 `ds-app-shell` and `ds-bar-nav` coordinate during width motion. */\n\nexport const CHROME_TRANSITION_START = 'dsChromeTransitionStart';\nexport const CHROME_TRANSITION_END = 'dsChromeTransitionEnd';\n\nexport type ChromeTransitionSource = 'panel-nav' | 'panel-tools';\n\nexport interface ChromeTransitionDetail {\n source: ChromeTransitionSource;\n /** Panel-tools drawer motion direction; omitted for panel-nav. */\n phase?: 'opening' | 'closing';\n}\n\n/** Reference-counted gate \u2014 used while panel-nav width is transitioning. */\nexport class ChromeTransitionDepth {\n private depth = 0;\n\n enter(): void {\n this.depth += 1;\n }\n\n exit(): void {\n this.depth = Math.max(0, this.depth - 1);\n }\n\n get isActive(): boolean {\n return this.depth > 0;\n }\n}\n\n/** Idempotent gate for one physical chrome surface.\n * Duplicate start notifications still require only one matching end. */\nexport class ChromeTransitionGate {\n private active = false;\n\n enter(): void {\n this.active = true;\n }\n\n exit(): void {\n this.active = false;\n }\n\n get isActive(): boolean {\n return this.active;\n }\n}\n\nexport interface RafCoalescer {\n schedule(): void;\n cancel(): void;\n}\n\n/** Coalesce bursty layout work (ResizeObserver, prop churn) to one callback per frame. */\nexport function createRafCoalescer(onFrame: () => void): RafCoalescer {\n let rafId = 0;\n return {\n schedule() {\n if (rafId !== 0) return;\n rafId = requestAnimationFrame(() => {\n rafId = 0;\n onFrame();\n });\n },\n cancel() {\n if (rafId !== 0) {\n cancelAnimationFrame(rafId);\n rafId = 0;\n }\n },\n };\n}\n\nexport function readChromeTransitionSource(event: Event): ChromeTransitionSource | undefined {\n return (event as CustomEvent<ChromeTransitionDetail>).detail?.source;\n}\n\nexport function readChromeTransitionPhase(event: Event): ChromeTransitionDetail['phase'] {\n return (event as CustomEvent<ChromeTransitionDetail>).detail?.phase;\n}\n", "import { shellGradientPositionBar } from './shell-gradient';\n\n/** Read a `var(--token)` width in px using a hidden probe (works with calc() tokens). */\nexport function readCssVarWidthPx(context: HTMLElement, cssVarName: string): number {\n if (typeof document === 'undefined') return 0;\n\n const probe = document.createElement('div');\n probe.style.cssText =\n 'position:absolute;visibility:hidden;pointer-events:none;height:0;width:var(' +\n cssVarName +\n ');';\n context.appendChild(probe);\n const width = probe.getBoundingClientRect().width;\n context.removeChild(probe);\n return width;\n}\n\nexport interface PanelNavWidthTokens {\n expandedPx: number;\n collapsedPx: number;\n}\n\n/** Resolve panel-nav expanded/collapsed widths from scoped CSS vars on `.panel-nav`. */\nexport function readPanelNavWidthTokens(navRoot: HTMLElement): PanelNavWidthTokens {\n return {\n expandedPx: readCssVarWidthPx(navRoot, '--_nav-width'),\n collapsedPx: readCssVarWidthPx(navRoot, '--_nav-width-collapsed'),\n };\n}\n\nexport function isPanelNavCollapsed(\n panelNavHost: HTMLElement | null,\n navRoot: HTMLElement | null,\n): boolean {\n if (navRoot?.classList.contains('panel-nav--collapsed')) return true;\n const collapsedProp = (panelNavHost as (HTMLElement & { collapsed?: boolean }) | null)?.collapsed;\n return collapsedProp === true;\n}\n\nexport function panelWidthPxFromTokens(\n tokens: PanelNavWidthTokens,\n collapsed: boolean,\n): number {\n return collapsed ? tokens.collapsedPx : tokens.expandedPx;\n}\n\nexport function barGradientPositionFromPanelWidth(panelWidthPx: number): string {\n return shellGradientPositionBar(panelWidthPx);\n}\n", "import {\n SHELL_GRADIENT_POSITION_BAR_VAR,\n SHELL_GRADIENT_POSITION_PANEL_VAR,\n} from './shell-gradient';\n\n/** Per-badge background-position for shell gradient ring sampling. */\nexport const BADGE_GRADIENT_POSITION_VAR = '--_badge-gradient-position';\n\nexport interface GradientSurface {\n element: HTMLElement;\n chromeHost: HTMLElement;\n positionVar: string;\n}\n\n/** Whether the badge sits under a shell with an active wash preset. */\nexport function isShellGradientActive(from: HTMLElement): boolean {\n // Explicit <HTMLElement>: the inferred HTMLDsAppShellElement type only\n // resolves where @stencil/core types are installed \u2014 consumers importing\n // `@ds-mo/ui/shell` (raw TS) compile this without them.\n const shell = from.closest<HTMLElement>('ds-app-shell');\n return shell !== null && shell.getAttribute('gradient-preset') !== 'none';\n}\n\n/** Bar or panel chrome surface that owns the shell gradient stack. */\nexport function findGradientSurface(from: HTMLElement): GradientSurface | null {\n const barHost = from.closest('ds-bar-nav') as HTMLElement | null;\n if (barHost) {\n const root = barHost.shadowRoot ?? barHost;\n const element = root.querySelector('.bar-nav');\n if (element) {\n return {\n element: element as HTMLElement,\n chromeHost: barHost,\n positionVar: SHELL_GRADIENT_POSITION_BAR_VAR,\n };\n }\n }\n\n const panelHost = from.closest('ds-panel-nav') as HTMLElement | null;\n if (panelHost) {\n const root = panelHost.shadowRoot ?? panelHost;\n const element = root.querySelector('.panel-nav');\n if (element) {\n return {\n element: element as HTMLElement,\n chromeHost: panelHost,\n positionVar: SHELL_GRADIENT_POSITION_PANEL_VAR,\n };\n }\n }\n\n return null;\n}\n\ninterface ParsedPosition {\n x: number;\n y: number;\n}\n\n/** Parse a two-value CSS background-position (e.g. `-200px 0`). */\nexport function parseCssBackgroundPosition(value: string): ParsedPosition {\n const trimmed = value.trim();\n if (!trimmed) return { x: 0, y: 0 };\n\n const parts = trimmed.split(/\\s+/);\n const x = parseLength(parts[0] ?? '0');\n const y = parseLength(parts[1] ?? '0');\n return { x, y };\n}\n\nfunction parseLength(token: string): number {\n const px = token.match(/^(-?[\\d.]+)px$/);\n if (px) return Number(px[1]);\n return 0;\n}\n\n/**\n * Background position for a badge ring so the shell gradient aligns with nav chrome.\n * Uses badge center relative to the painted chrome surface.\n */\nexport function badgeGradientPosition(\n badgeHost: HTMLElement,\n surface: GradientSurface,\n shellPosition: string,\n): string {\n const badgeRect = badgeHost.getBoundingClientRect();\n const surfaceRect = surface.element.getBoundingClientRect();\n const anchorX = badgeRect.left + badgeRect.width / 2 - surfaceRect.left;\n const anchorY = badgeRect.top + badgeRect.height / 2 - surfaceRect.top;\n const { x, y } = parseCssBackgroundPosition(shellPosition);\n\n return `${Math.round(x - anchorX)}px ${Math.round(y - anchorY)}px`;\n}\n\n/** Resolve shell gradient position from chrome host custom properties. */\nexport function readShellGradientPosition(surface: GradientSurface): string {\n const styles = getComputedStyle(surface.chromeHost);\n return styles.getPropertyValue(surface.positionVar).trim() || '0 0';\n}\n\n/** Stamp `--_badge-gradient-position` on the badge host (fixed viewport chrome). */\nexport function syncBadgeGradientPosition(badgeHost: HTMLElement): void {\n if (!isShellGradientActive(badgeHost)) {\n badgeHost.style.removeProperty(BADGE_GRADIENT_POSITION_VAR);\n return;\n }\n\n badgeHost.style.setProperty(BADGE_GRADIENT_POSITION_VAR, '0 0');\n}\n"],
|
|
5
|
+
"mappings": ";AAIO,IAAM,sBAAsB;AAE5B,SAAS,iBAAiB,MAAiD;AAChF,MAAI,SAAS,eAAe,SAAS,WAAY,QAAO;AACxD,SAAO;AACT;AAEO,SAAS,gBAAgB,OAA6B;AAC3D,MAAI,OAAO,aAAa,YAAa;AACrC,WAAS,gBAAgB,aAAa,qBAAqB,KAAK;AAClE;AAEO,SAAS,oBAA0B;AACxC,MAAI,OAAO,aAAa,YAAa;AACrC,WAAS,gBAAgB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AEA,YAAU,MAAM,YAAY,6BAA6B,KAAK;AAChE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,6 +14,19 @@ export interface ShellGradientRecipe {
|
|
|
14
14
|
opacity: number;
|
|
15
15
|
stops: readonly ShellGradientStop[];
|
|
16
16
|
}
|
|
17
|
+
export interface ShellGradientPickerPreview {
|
|
18
|
+
backgroundColor: string;
|
|
19
|
+
backgroundImage?: string;
|
|
20
|
+
opacity?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ShellGradientPickerOption {
|
|
23
|
+
value: ShellGradientPreset;
|
|
24
|
+
label: string;
|
|
25
|
+
preview: ShellGradientPickerPreview;
|
|
26
|
+
}
|
|
27
|
+
export interface ShellGradientPickerSection {
|
|
28
|
+
options: ShellGradientPickerOption[];
|
|
29
|
+
}
|
|
17
30
|
export declare function shellGradientPresetStopToken(preset: ShellGradientPreset): string | null;
|
|
18
31
|
export declare function shellGradientPresetRecipe(preset: ShellGradientPreset): ShellGradientRecipe | null;
|
|
19
32
|
export declare function shellGradientPresetOpacity(preset: ShellGradientPreset): string;
|
|
@@ -30,3 +43,5 @@ export declare function normalizeShellGradientPreset(value: string | null | unde
|
|
|
30
43
|
export declare function buildShellRadialGradientForPreset(preset: ShellGradientPreset): string;
|
|
31
44
|
/** Build the production shell geometry from an ordered set of design-time stops. */
|
|
32
45
|
export declare function buildShellRadialGradientFromStops(stops: readonly ShellGradientStop[]): string;
|
|
46
|
+
/** Generic SwatchPicker sections for the fixed shell appearance presets. */
|
|
47
|
+
export declare function shellGradientPickerSections(): ShellGradientPickerSection[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AnchoredPopupAlign } from './anchored-popup';
|
|
2
|
+
/**
|
|
3
|
+
* `choice-cell` aligns the first/last interactive row edge with the anchor,
|
|
4
|
+
* allowing the popup frame to extend by the section inset. `popup-frame`
|
|
5
|
+
* aligns the popup frame itself and is reserved for deliberate custom geometry.
|
|
6
|
+
*/
|
|
7
|
+
export type ChoicePopupAnchorAlignment = 'choice-cell' | 'popup-frame';
|
|
8
|
+
export interface ChoicePopupAlignOffsetInput {
|
|
9
|
+
align: AnchoredPopupAlign;
|
|
10
|
+
alignOffsetPx: number;
|
|
11
|
+
sectionInsetPx: number;
|
|
12
|
+
anchorAlignment?: ChoicePopupAnchorAlignment;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolve the cross-axis offset for a choice popup. Authored `alignOffsetPx`
|
|
16
|
+
* remains an additive nudge after the shared inner-cell alignment is applied.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveChoicePopupAlignOffset({ align, alignOffsetPx, sectionInsetPx, anchorAlignment, }: ChoicePopupAlignOffsetInput): number;
|
|
19
|
+
/** Minimum popup width that keeps both choice-cell edges aligned to a trigger. */
|
|
20
|
+
export declare function choicePopupMinWidth(anchorWidth: number, sectionInsetPx: number): number;
|
|
@@ -13,3 +13,5 @@ export { controlWidthClass } from './control-width';
|
|
|
13
13
|
export type { ControlWidth } from './control-width';
|
|
14
14
|
export { CONTROL_TEXT_VARIANT } from './control-text';
|
|
15
15
|
export type { ControlSize } from './control-text';
|
|
16
|
+
export { choicePopupMinWidth, resolveChoicePopupAlignOffset, } from './choice-popup-alignment';
|
|
17
|
+
export type { ChoicePopupAnchorAlignment } from './choice-popup-alignment';
|
package/dist/lib/utils/index.js
CHANGED
|
@@ -334,12 +334,27 @@ var CONTROL_TEXT_VARIANT = {
|
|
|
334
334
|
sm: "text-body-small",
|
|
335
335
|
xs: "text-caption"
|
|
336
336
|
};
|
|
337
|
+
|
|
338
|
+
// src/wc/utils/choice-popup-alignment.ts
|
|
339
|
+
function resolveChoicePopupAlignOffset({
|
|
340
|
+
align,
|
|
341
|
+
alignOffsetPx,
|
|
342
|
+
sectionInsetPx,
|
|
343
|
+
anchorAlignment = "choice-cell"
|
|
344
|
+
}) {
|
|
345
|
+
if (anchorAlignment === "popup-frame" || align === "center") return alignOffsetPx;
|
|
346
|
+
return alignOffsetPx + (align === "start" ? -sectionInsetPx : sectionInsetPx);
|
|
347
|
+
}
|
|
348
|
+
function choicePopupMinWidth(anchorWidth, sectionInsetPx) {
|
|
349
|
+
return anchorWidth + sectionInsetPx * 2;
|
|
350
|
+
}
|
|
337
351
|
export {
|
|
338
352
|
CONTROL_TEXT_VARIANT,
|
|
339
353
|
SCROLL_EDGE_FADE_DEFAULT_SIZE,
|
|
340
354
|
SCROLL_EDGE_FADE_SIZE_VAR,
|
|
341
355
|
TOKEN_CSS_LENGTHS,
|
|
342
356
|
TOKEN_DEFAULTS,
|
|
357
|
+
choicePopupMinWidth,
|
|
343
358
|
clearCssLengthPxCache,
|
|
344
359
|
controlWidthClass,
|
|
345
360
|
formatCompactNumber,
|
|
@@ -348,6 +363,7 @@ export {
|
|
|
348
363
|
parseCssTimeMs,
|
|
349
364
|
prefersReducedMotion,
|
|
350
365
|
registerIcons,
|
|
366
|
+
resolveChoicePopupAlignOffset,
|
|
351
367
|
resolveCssLengthPx,
|
|
352
368
|
resolveCssTimeMs,
|
|
353
369
|
resolveMotionTimeMs,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/wc/components/Icon/icon-cache.ts", "../../../src/wc/utils/resolve-css-length-px.ts", "../../../src/wc/utils/format-compact-number.ts", "../../../src/wc/utils/format-percentage.ts", "../../../src/wc/utils/truncate-svg-text.ts", "../../../src/wc/utils/resolve-css-time-ms.ts", "../../../src/wc/utils/scroll-edge-fade.ts", "../../../src/wc/utils/token-defaults.ts", "../../../src/wc/utils/control-width.ts", "../../../src/wc/utils/control-text.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Shared SVG glyph cache for ds-icon.\n *\n * Keyed on a global symbol so every module instance (the compiled Stencil chunk\n * inside dist/components and any direct source import, e.g. via `@ds-mo/ui/utils`)\n * reads and writes the same cache. Without this, `registerIcons` called from an\n * app would fill a different Map than the one ds-icon resolves from.\n */\nconst CACHE_KEY = Symbol.for('ds-mo.icon-svg-cache');\n\ntype IconCacheMap = Map<string, string>;\n\ntype GlobalWithIconCache = { [CACHE_KEY]?: IconCacheMap };\n\nexport function iconCacheKey(name: string, flag: boolean): string {\n return flag ? `flag:${name}` : `system:${name}`;\n}\n\nexport function iconCache(): IconCacheMap {\n const g = globalThis as GlobalWithIconCache;\n return (g[CACHE_KEY] ??= new Map());\n}\n\n/**\n * Pre-register glyphs so ds-icon renders them synchronously \u2014 no lazy-chunk\n * fetch, no first-paint pop-in. Import the SVG strings from `@ds-mo/icons`\n * in the app (statically, so they ship in the app's own bundle):\n *\n * ```ts\n * import { Bell } from '@ds-mo/icons/svg/Bell';\n * import { FlagUnitedStates } from '@ds-mo/icons/svg/flags/FlagUnitedStates';\n * import { registerIcons } from '@ds-mo/ui/utils';\n *\n * registerIcons({ Bell });\n * registerIcons({ FlagUnitedStates });\n * ```\n *\n * Icons that are not registered still work \u2014 they lazy-load on first render\n * and stay cached afterwards.\n */\nexport function registerIcons(icons: Record<string, string>, options?: { flag?: boolean }): void {\n const cache = iconCache();\n for (const [name, svg] of Object.entries(icons)) {\n const flag = options?.flag ?? name.startsWith('Flag');\n cache.set(iconCacheKey(name, flag), svg);\n }\n}\n", "const lengthPxCache = new Map<string, number>();\n\nlet probeEl: HTMLElement | null = null;\n\nfunction getProbeElement(): HTMLElement | null {\n if (typeof document === 'undefined') return null;\n\n if (!probeEl) {\n probeEl = document.createElement('div');\n probeEl.setAttribute('aria-hidden', 'true');\n probeEl.style.cssText =\n 'position:absolute;visibility:hidden;pointer-events:none;top:0;left:0;width:0;height:0;overflow:hidden;';\n document.documentElement.appendChild(probeEl);\n }\n\n return probeEl;\n}\n\n/** Clear session cache (tests only). */\nexport function clearCssLengthPxCache(): void {\n lengthPxCache.clear();\n}\n\n/**\n * Resolve a CSS length to pixels for layout math.\n * Numbers pass through; `var(--dimension-*)`, `calc(...)`, and `16px` resolve via a hidden probe.\n */\nexport function resolveCssLengthPx(\n value: number | string | undefined,\n fallback: number | string,\n): number {\n const resolved = value === undefined || value === null || value === '' ? fallback : value;\n if (typeof resolved === 'number') return resolved;\n\n const trimmed = resolved.trim();\n if (!trimmed) return resolveCssLengthPx(fallback, 0);\n\n const cached = lengthPxCache.get(trimmed);\n if (cached !== undefined) return cached;\n\n if (/^-?\\d+(\\.\\d+)?$/.test(trimmed)) {\n const n = Number(trimmed);\n lengthPxCache.set(trimmed, n);\n return n;\n }\n\n const pxMatch = trimmed.match(/^(-?\\d+(\\.\\d+)?)px$/);\n if (pxMatch) {\n const px = parseFloat(pxMatch[1]);\n lengthPxCache.set(trimmed, px);\n return px;\n }\n\n const cssLength = /^--[\\w-]+$/.test(trimmed) ? `var(${trimmed})` : trimmed;\n\n const probe = getProbeElement();\n if (!probe) {\n return typeof fallback === 'number' ? fallback : 0;\n }\n\n probe.style.width = cssLength;\n const px = probe.getBoundingClientRect().width;\n probe.style.width = '';\n lengthPxCache.set(trimmed, px);\n return px;\n}\n", "const COMPACT_UNITS: { threshold: number; suffix: string }[] = [\n { threshold: 1_000_000_000, suffix: 'b' },\n { threshold: 1_000_000, suffix: 'm' },\n { threshold: 1_000, suffix: 'k' },\n];\n\n/** Compact large numbers for display: 1000 -> \"1k\", 1500 -> \"1.5k\", 110100 -> \"110.1k\", 1000000 -> \"1m\". */\nexport function formatCompactNumber(value: number, locale?: string): string {\n if (locale) {\n return new Intl.NumberFormat(locale, {\n notation: 'compact',\n compactDisplay: 'short',\n maximumFractionDigits: 1,\n }).format(value);\n }\n const sign = value < 0 ? '-' : '';\n const abs = Math.abs(value);\n if (abs < 1000) return String(value);\n\n for (let i = 0; i < COMPACT_UNITS.length; i++) {\n const unit = COMPACT_UNITS[i];\n if (abs < unit.threshold) continue;\n\n let scaled = Math.round((abs / unit.threshold) * 10) / 10;\n // Carry over, e.g. 999.96k rounds to \"1000k\" \u2014 bump to the next unit instead.\n if (scaled >= 1000 && i > 0) {\n const next = COMPACT_UNITS[i - 1];\n scaled = Math.round((abs / next.threshold) * 10) / 10;\n return `${sign}${scaled}${next.suffix}`;\n }\n return `${sign}${scaled}${unit.suffix}`;\n }\n return String(value);\n}\n", "export type PercentageDecimals = 1 | 2;\n\n/** Format a ratio as a locale-aware percentage with an exact, supported precision. */\nexport function formatPercentage(\n ratio: number,\n decimals: PercentageDecimals = 1,\n locale?: string,\n): string {\n const precision = decimals === 2 ? 2 : 1;\n const value = Number.isFinite(ratio) ? ratio : 0;\n\n return new Intl.NumberFormat(locale, {\n style: 'percent',\n minimumFractionDigits: precision,\n maximumFractionDigits: precision,\n }).format(value);\n}\n", "/**\n * Binary-searches the longest prefix of `text` (plus an ellipsis) that fits within `maxWidth`\n * px when rendered by `el`, using the SVG `getComputedTextLength()` API for exact measurement \u2014\n * `text-overflow: ellipsis` doesn't apply to raw SVG `<text>` nodes.\n *\n * Mutates `el.textContent` during measurement; the caller's next render (driven by the\n * returned string going into state) overwrites it with the final value.\n */\nexport function truncateSvgTextToWidth(el: SVGTextElement, text: string, maxWidth: number): string {\n el.textContent = text;\n if (maxWidth <= 0 || el.getComputedTextLength() <= maxWidth) return text;\n\n let lo = 0;\n let hi = text.length;\n while (lo < hi) {\n const mid = Math.ceil((lo + hi) / 2);\n el.textContent = `${text.slice(0, mid)}\u2026`;\n if (el.getComputedTextLength() <= maxWidth) {\n lo = mid;\n } else {\n hi = mid - 1;\n }\n }\n return lo > 0 ? `${text.slice(0, lo)}\u2026` : '\u2026';\n}\n", "/** Parse a CSS <time> value (or motion shorthand's first token) to milliseconds. */\nexport function parseCssTimeMs(value: string, fallback: number): number {\n const firstToken = value.trim().split(/\\s+/)[0] ?? '';\n const num = parseFloat(firstToken);\n if (Number.isNaN(num)) return fallback;\n if (/ms\\s*$/.test(firstToken)) return num;\n if (/s\\s*$/.test(firstToken)) return num * 1000;\n return num;\n}\n\nfunction extractCssCustomProp(ref: string): string | null {\n const varMatch = ref.match(/^var\\(\\s*(--[^),]+)/);\n if (varMatch) return varMatch[1].trim();\n if (ref.startsWith('--')) return ref.trim();\n return null;\n}\n\nfunction readTokenTimeMs(token: string, fallback: number): number {\n if (typeof document === 'undefined') return fallback;\n\n const prop = extractCssCustomProp(token);\n if (!prop) return parseCssTimeMs(token, fallback);\n\n const raw = getComputedStyle(document.documentElement).getPropertyValue(prop).trim();\n return parseCssTimeMs(raw, fallback);\n}\n\n/**\n * Resolve a duration to milliseconds for JS timers aligned with CSS motion tokens.\n * Accepts numbers (ms), raw times (`200ms`, `0.75s`), or `var(--effect-*)` references.\n */\nexport function resolveCssTimeMs(\n value: number | string | undefined,\n fallbackToken: string,\n): number {\n if (typeof value === 'number') return value;\n\n const token = typeof value === 'string' && value.trim() ? value.trim() : fallbackToken;\n const prop = extractCssCustomProp(token);\n\n if (prop) {\n return readTokenTimeMs(token, readTokenTimeMs(fallbackToken, 200));\n }\n\n return parseCssTimeMs(token, readTokenTimeMs(fallbackToken, 200));\n}\n\n/** Whether the user has requested reduced non-essential motion. */\nexport function prefersReducedMotion(): boolean {\n return typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Resolve an animation-coupled duration. Returns zero under reduced motion so\n * JS cleanup stays synchronized with CSS that removes the corresponding motion.\n */\nexport function resolveMotionTimeMs(\n value: number | string | undefined,\n fallbackToken: string,\n): number {\n return prefersReducedMotion() ? 0 : resolveCssTimeMs(value, fallbackToken);\n}\n", "/** CSS custom property for scroll-edge fade depth (dimension token or length). */\nexport const SCROLL_EDGE_FADE_SIZE_VAR = '--ds-scroll-edge-fade-size';\n\nexport const SCROLL_EDGE_FADE_DEFAULT_SIZE = 'var(--dimension-size-600)';\n\nexport type ScrollEdgeFadeEdge = 'top' | 'bottom' | 'left' | 'right';\n\nexport type ScrollEdgeFadeSizeToken =\n | 'size-000'\n | 'size-050'\n | 'size-075'\n | 'size-100'\n | 'size-150'\n | 'size-200'\n | 'size-250'\n | 'size-300'\n | 'size-400'\n | 'size-500'\n | 'size-600'\n | 'size-800';\n\nexport type ScrollEdgeFadeSize = ScrollEdgeFadeSizeToken | (string & {});\n\nconst SIZE_VALUE: Record<ScrollEdgeFadeSizeToken, string> = {\n 'size-000': 'var(--dimension-size-000)',\n 'size-050': 'var(--dimension-size-050)',\n 'size-075': 'var(--dimension-size-075)',\n 'size-100': 'var(--dimension-size-100)',\n 'size-150': 'var(--dimension-size-150)',\n 'size-200': 'var(--dimension-size-200)',\n 'size-250': 'var(--dimension-size-250)',\n 'size-300': 'var(--dimension-size-300)',\n 'size-400': 'var(--dimension-size-400)',\n 'size-500': 'var(--dimension-size-500)',\n 'size-600': 'var(--dimension-size-600)',\n 'size-800': 'var(--dimension-size-800)',\n};\n\nconst SIZE_REF = `var(${SCROLL_EDGE_FADE_SIZE_VAR}, ${SCROLL_EDGE_FADE_DEFAULT_SIZE})`;\n\nexport interface ScrollEdgeFadeOptions {\n /** One or more edges to fade. */\n edges: ScrollEdgeFadeEdge | ScrollEdgeFadeEdge[];\n /**\n * Reveal and hide configured fades from the container's own scroll position.\n * Uses CSS scroll-driven animations with a static-fade fallback; no listener required.\n */\n scrollAware?: boolean;\n /**\n * When true, removes the complete mask. Pass a map to remove only configured\n * edges that are flush when scroll state already lives in JavaScript.\n */\n atEnd?: boolean | Partial<Record<ScrollEdgeFadeEdge, boolean>>;\n /** Force the mask off regardless of scroll position (`ds-fade` `visible={false}`). */\n hidden?: boolean;\n}\n\n/** Resolve a dimension size token name or raw CSS length for `--ds-scroll-edge-fade-size`. */\nexport function resolveScrollEdgeFadeSize(\n size: ScrollEdgeFadeSize = 'size-600',\n height?: string,\n): string {\n if (height) return height;\n return Object.prototype.hasOwnProperty.call(SIZE_VALUE, size)\n ? SIZE_VALUE[size as ScrollEdgeFadeSizeToken]\n : size;\n}\n\n/** Inline style map setting fade depth on a scroll container. */\nexport function scrollEdgeFadeSizeStyle(\n size: ScrollEdgeFadeSize = 'size-600',\n height?: string,\n): Record<string, string> {\n return {\n [SCROLL_EDGE_FADE_SIZE_VAR]: resolveScrollEdgeFadeSize(size, height),\n };\n}\n\n/**\n * Alpha mask for a scroll container edge \u2014 content fades to transparent so\n * textured backgrounds (shell gradients, images) show through.\n */\nexport function scrollEdgeFadeMaskImage(edge: ScrollEdgeFadeEdge): string {\n switch (edge) {\n case 'top':\n return `linear-gradient(to bottom, transparent 0, #000 ${SIZE_REF}, #000 100%)`;\n case 'bottom':\n return `linear-gradient(to bottom, #000 0, #000 calc(100% - ${SIZE_REF}), transparent 100%)`;\n case 'left':\n return `linear-gradient(to right, transparent 0, #000 ${SIZE_REF}, #000 100%)`;\n case 'right':\n return `linear-gradient(to right, #000 0, #000 calc(100% - ${SIZE_REF}), transparent 100%)`;\n }\n}\n\n/** Inline style map for a masked scroll region (single edge). */\nexport function scrollEdgeFadeMaskStyle(\n edge: ScrollEdgeFadeEdge,\n size: ScrollEdgeFadeSize = 'size-600',\n height?: string,\n): Record<string, string> {\n const mask = scrollEdgeFadeMaskImage(edge);\n return {\n ...scrollEdgeFadeSizeStyle(size, height),\n WebkitMaskImage: mask,\n maskImage: mask,\n WebkitMaskSize: '100% 100%',\n maskSize: '100% 100%',\n };\n}\n\n/** Class map for `scroll-edge-fade` modifiers \u2014 pair with `scroll-edge-fade.css`. */\nexport function scrollEdgeFadeClassMap(opts: ScrollEdgeFadeOptions): Record<string, boolean> {\n const edges = Array.isArray(opts.edges) ? opts.edges : [opts.edges];\n const classes: Record<string, boolean> = {\n 'scroll-edge-fade': true,\n 'scroll-edge-fade--scroll-aware': opts.scrollAware === true,\n 'scroll-edge-fade--hidden': opts.hidden === true,\n };\n\n for (const edge of edges) {\n classes[`scroll-edge-fade--${edge}`] = true;\n }\n\n const { atEnd } = opts;\n if (atEnd === true) {\n classes['scroll-edge-fade--at-end'] = true;\n } else if (atEnd && typeof atEnd === 'object') {\n for (const edge of edges) {\n if (atEnd[edge]) {\n classes[`scroll-edge-fade--${edge}-at-edge`] = true;\n }\n }\n }\n\n return classes;\n}\n\n/** Whether a scroll container is flush with the given edge (within `threshold` px). */\nexport function isScrollAtEdge(\n el: HTMLElement,\n edge: ScrollEdgeFadeEdge,\n threshold = 2,\n): boolean {\n switch (edge) {\n case 'top':\n return el.scrollTop <= threshold;\n case 'bottom':\n return el.scrollHeight - el.scrollTop - el.clientHeight <= threshold;\n case 'left':\n return el.scrollLeft <= threshold;\n case 'right':\n return el.scrollWidth - el.scrollLeft - el.clientWidth <= threshold;\n }\n}\n", "import {\n dimensionIconographyMd,\n dimensionIconographySm,\n dimensionIconographyXs,\n dimensionMenuWidthXs,\n dimensionPanelWidth2xs,\n dimensionPanelWidthLg,\n dimensionPanelWidthMd,\n dimensionRadius025,\n dimensionSize200,\n dimensionSize300,\n dimensionSize400,\n dimensionSize600,\n dimensionSize800,\n dimensionSpace050,\n dimensionSpace200,\n typographyLineheightLg,\n typographyLineheightMd,\n typographyLineheightSm,\n typographyLineheightXl,\n typographyLineheightXs,\n effectAnimationDelayLong2,\n effectAnimationDelayMedium1,\n effectAnimationDelayMedium3,\n effectAnimationDelayInstant,\n effectAnimationDelayShort2,\n effectAnimationDurationMedium1,\n effectAnimationDurationShort3,\n effectMotionShort2,\n effectMotionShort3,\n} from '@ds-mo/tokens/ts';\n\n/** TokoMo CSS custom-property names for shared component defaults (runtime resolution). */\nexport const TOKEN_DEFAULTS = {\n space050: dimensionSpace050,\n space200: dimensionSpace200,\n radius025: dimensionRadius025,\n size200: dimensionSize200,\n size300: dimensionSize300,\n size400: dimensionSize400,\n size600: dimensionSize600,\n size800: dimensionSize800,\n iconographyMd: dimensionIconographyMd,\n iconographySm: dimensionIconographySm,\n iconographyXs: dimensionIconographyXs,\n panelWidth2xs: dimensionPanelWidth2xs,\n panelWidthMd: dimensionPanelWidthMd,\n panelWidthLg: dimensionPanelWidthLg,\n menuWidthXs: dimensionMenuWidthXs,\n lineheightLg: typographyLineheightLg,\n lineheightMd: typographyLineheightMd,\n lineheightSm: typographyLineheightSm,\n lineheightXl: typographyLineheightXl,\n lineheightXs: typographyLineheightXs,\n motionShort2: effectMotionShort2,\n motionShort3: effectMotionShort3,\n animationDurationShort3: effectAnimationDurationShort3,\n animationDurationMedium1: effectAnimationDurationMedium1,\n animationDelayInstant: effectAnimationDelayInstant,\n animationDelayMedium1: effectAnimationDelayMedium1,\n animationDelayMedium3: effectAnimationDelayMedium3,\n animationDelayShort2: effectAnimationDelayShort2,\n animationDelayLong2: effectAnimationDelayLong2,\n /** Unmeasured menu height fallback: 20\u00D7 base (160px at default scale). */\n menuFallbackHeight: 'calc(var(--dimension-size-base) * 20)',\n /** Unmeasured tooltip width fallback: size-800 + size-200 (80px). */\n tooltipFallbackWidth: 'calc(var(--dimension-size-800) + var(--dimension-size-200))',\n /** Fill-mode donut diameter floor: 16\u00D7 size-base (128px). */\n donutFillMin: 'calc(var(--dimension-size-base) * 16)',\n /** Fill-mode donut diameter ceiling: 24\u00D7 size-base (192px). */\n donutFillMax: 'calc(var(--dimension-size-base) * 24)',\n} as const;\n\nexport type TokenDefaultKey = keyof typeof TOKEN_DEFAULTS;\n\n/** Valid CSS length strings for overlay offset props \u2014 bind on `sideOffset` / `alignOffset` in hosts. */\nexport const TOKEN_CSS_LENGTHS = {\n space050: `var(${dimensionSpace050})`,\n space200: `var(${dimensionSpace200})`,\n menuWidthXs: `var(${dimensionMenuWidthXs})`,\n} as const;\n", "/** Shared width fit for interactive controls (buttons, select, \u2026). */\nexport type ControlWidth = 'hug' | 'fill';\n\n/** Host / control class map for `width=\"hug\" | \"fill\"`. */\nexport function controlWidthClass(width: ControlWidth): Record<string, boolean> {\n return {\n 'ds-control-width--hug': width === 'hug',\n 'ds-control-width--fill': width === 'fill',\n };\n}\n", "import type { TextVariant } from '../components/Text/text-types';\n\n/** Shared public control sizes. Typography is derived; it is not a separate density API. */\nexport type ControlSize = 'md' | 'sm' | 'xs';\n\n/** Complete text variant selected internally by each control size. */\nexport const CONTROL_TEXT_VARIANT: Record<ControlSize, TextVariant> = {\n md: 'text-body-medium',\n sm: 'text-body-small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AqB;AAAA;AAAA,EAErB,oBAAoB;AAAA;AAAA,EAEpB,sBAAsB;AAAA;AAAA,EAEtB,cAAc;AAAA;AAAA,EAEd,cAAc;AAChB;AAKO,IAAM,oBAAoB;AAAA,EAC/B,UAAU,OAAO,iBAAiB;AAAA,EAClC,UAAU,OAAO,iBAAiB;AAAA,EAClC,aAAa,OAAO,oBAAoB;AAC1C;;;AC5EO,SAAS,kBAAkB,OAA8C;AAC9E,SAAO;AAAA,IACL,yBAAyB,UAAU;AAAA,IACnC,0BAA0B,UAAU;AAAA,EACtC;AACF;;;ACHO,IAAM,uBAAyD;AAAA,EACpE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;",
|
|
3
|
+
"sources": ["../../../src/wc/components/Icon/icon-cache.ts", "../../../src/wc/utils/resolve-css-length-px.ts", "../../../src/wc/utils/format-compact-number.ts", "../../../src/wc/utils/format-percentage.ts", "../../../src/wc/utils/truncate-svg-text.ts", "../../../src/wc/utils/resolve-css-time-ms.ts", "../../../src/wc/utils/scroll-edge-fade.ts", "../../../src/wc/utils/token-defaults.ts", "../../../src/wc/utils/control-width.ts", "../../../src/wc/utils/control-text.ts", "../../../src/wc/utils/choice-popup-alignment.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Shared SVG glyph cache for ds-icon.\n *\n * Keyed on a global symbol so every module instance (the compiled Stencil chunk\n * inside dist/components and any direct source import, e.g. via `@ds-mo/ui/utils`)\n * reads and writes the same cache. Without this, `registerIcons` called from an\n * app would fill a different Map than the one ds-icon resolves from.\n */\nconst CACHE_KEY = Symbol.for('ds-mo.icon-svg-cache');\n\ntype IconCacheMap = Map<string, string>;\n\ntype GlobalWithIconCache = { [CACHE_KEY]?: IconCacheMap };\n\nexport function iconCacheKey(name: string, flag: boolean): string {\n return flag ? `flag:${name}` : `system:${name}`;\n}\n\nexport function iconCache(): IconCacheMap {\n const g = globalThis as GlobalWithIconCache;\n return (g[CACHE_KEY] ??= new Map());\n}\n\n/**\n * Pre-register glyphs so ds-icon renders them synchronously \u2014 no lazy-chunk\n * fetch, no first-paint pop-in. Import the SVG strings from `@ds-mo/icons`\n * in the app (statically, so they ship in the app's own bundle):\n *\n * ```ts\n * import { Bell } from '@ds-mo/icons/svg/Bell';\n * import { FlagUnitedStates } from '@ds-mo/icons/svg/flags/FlagUnitedStates';\n * import { registerIcons } from '@ds-mo/ui/utils';\n *\n * registerIcons({ Bell });\n * registerIcons({ FlagUnitedStates });\n * ```\n *\n * Icons that are not registered still work \u2014 they lazy-load on first render\n * and stay cached afterwards.\n */\nexport function registerIcons(icons: Record<string, string>, options?: { flag?: boolean }): void {\n const cache = iconCache();\n for (const [name, svg] of Object.entries(icons)) {\n const flag = options?.flag ?? name.startsWith('Flag');\n cache.set(iconCacheKey(name, flag), svg);\n }\n}\n", "const lengthPxCache = new Map<string, number>();\n\nlet probeEl: HTMLElement | null = null;\n\nfunction getProbeElement(): HTMLElement | null {\n if (typeof document === 'undefined') return null;\n\n if (!probeEl) {\n probeEl = document.createElement('div');\n probeEl.setAttribute('aria-hidden', 'true');\n probeEl.style.cssText =\n 'position:absolute;visibility:hidden;pointer-events:none;top:0;left:0;width:0;height:0;overflow:hidden;';\n document.documentElement.appendChild(probeEl);\n }\n\n return probeEl;\n}\n\n/** Clear session cache (tests only). */\nexport function clearCssLengthPxCache(): void {\n lengthPxCache.clear();\n}\n\n/**\n * Resolve a CSS length to pixels for layout math.\n * Numbers pass through; `var(--dimension-*)`, `calc(...)`, and `16px` resolve via a hidden probe.\n */\nexport function resolveCssLengthPx(\n value: number | string | undefined,\n fallback: number | string,\n): number {\n const resolved = value === undefined || value === null || value === '' ? fallback : value;\n if (typeof resolved === 'number') return resolved;\n\n const trimmed = resolved.trim();\n if (!trimmed) return resolveCssLengthPx(fallback, 0);\n\n const cached = lengthPxCache.get(trimmed);\n if (cached !== undefined) return cached;\n\n if (/^-?\\d+(\\.\\d+)?$/.test(trimmed)) {\n const n = Number(trimmed);\n lengthPxCache.set(trimmed, n);\n return n;\n }\n\n const pxMatch = trimmed.match(/^(-?\\d+(\\.\\d+)?)px$/);\n if (pxMatch) {\n const px = parseFloat(pxMatch[1]);\n lengthPxCache.set(trimmed, px);\n return px;\n }\n\n const cssLength = /^--[\\w-]+$/.test(trimmed) ? `var(${trimmed})` : trimmed;\n\n const probe = getProbeElement();\n if (!probe) {\n return typeof fallback === 'number' ? fallback : 0;\n }\n\n probe.style.width = cssLength;\n const px = probe.getBoundingClientRect().width;\n probe.style.width = '';\n lengthPxCache.set(trimmed, px);\n return px;\n}\n", "const COMPACT_UNITS: { threshold: number; suffix: string }[] = [\n { threshold: 1_000_000_000, suffix: 'b' },\n { threshold: 1_000_000, suffix: 'm' },\n { threshold: 1_000, suffix: 'k' },\n];\n\n/** Compact large numbers for display: 1000 -> \"1k\", 1500 -> \"1.5k\", 110100 -> \"110.1k\", 1000000 -> \"1m\". */\nexport function formatCompactNumber(value: number, locale?: string): string {\n if (locale) {\n return new Intl.NumberFormat(locale, {\n notation: 'compact',\n compactDisplay: 'short',\n maximumFractionDigits: 1,\n }).format(value);\n }\n const sign = value < 0 ? '-' : '';\n const abs = Math.abs(value);\n if (abs < 1000) return String(value);\n\n for (let i = 0; i < COMPACT_UNITS.length; i++) {\n const unit = COMPACT_UNITS[i];\n if (abs < unit.threshold) continue;\n\n let scaled = Math.round((abs / unit.threshold) * 10) / 10;\n // Carry over, e.g. 999.96k rounds to \"1000k\" \u2014 bump to the next unit instead.\n if (scaled >= 1000 && i > 0) {\n const next = COMPACT_UNITS[i - 1];\n scaled = Math.round((abs / next.threshold) * 10) / 10;\n return `${sign}${scaled}${next.suffix}`;\n }\n return `${sign}${scaled}${unit.suffix}`;\n }\n return String(value);\n}\n", "export type PercentageDecimals = 1 | 2;\n\n/** Format a ratio as a locale-aware percentage with an exact, supported precision. */\nexport function formatPercentage(\n ratio: number,\n decimals: PercentageDecimals = 1,\n locale?: string,\n): string {\n const precision = decimals === 2 ? 2 : 1;\n const value = Number.isFinite(ratio) ? ratio : 0;\n\n return new Intl.NumberFormat(locale, {\n style: 'percent',\n minimumFractionDigits: precision,\n maximumFractionDigits: precision,\n }).format(value);\n}\n", "/**\n * Binary-searches the longest prefix of `text` (plus an ellipsis) that fits within `maxWidth`\n * px when rendered by `el`, using the SVG `getComputedTextLength()` API for exact measurement \u2014\n * `text-overflow: ellipsis` doesn't apply to raw SVG `<text>` nodes.\n *\n * Mutates `el.textContent` during measurement; the caller's next render (driven by the\n * returned string going into state) overwrites it with the final value.\n */\nexport function truncateSvgTextToWidth(el: SVGTextElement, text: string, maxWidth: number): string {\n el.textContent = text;\n if (maxWidth <= 0 || el.getComputedTextLength() <= maxWidth) return text;\n\n let lo = 0;\n let hi = text.length;\n while (lo < hi) {\n const mid = Math.ceil((lo + hi) / 2);\n el.textContent = `${text.slice(0, mid)}\u2026`;\n if (el.getComputedTextLength() <= maxWidth) {\n lo = mid;\n } else {\n hi = mid - 1;\n }\n }\n return lo > 0 ? `${text.slice(0, lo)}\u2026` : '\u2026';\n}\n", "/** Parse a CSS <time> value (or motion shorthand's first token) to milliseconds. */\nexport function parseCssTimeMs(value: string, fallback: number): number {\n const firstToken = value.trim().split(/\\s+/)[0] ?? '';\n const num = parseFloat(firstToken);\n if (Number.isNaN(num)) return fallback;\n if (/ms\\s*$/.test(firstToken)) return num;\n if (/s\\s*$/.test(firstToken)) return num * 1000;\n return num;\n}\n\nfunction extractCssCustomProp(ref: string): string | null {\n const varMatch = ref.match(/^var\\(\\s*(--[^),]+)/);\n if (varMatch) return varMatch[1].trim();\n if (ref.startsWith('--')) return ref.trim();\n return null;\n}\n\nfunction readTokenTimeMs(token: string, fallback: number): number {\n if (typeof document === 'undefined') return fallback;\n\n const prop = extractCssCustomProp(token);\n if (!prop) return parseCssTimeMs(token, fallback);\n\n const raw = getComputedStyle(document.documentElement).getPropertyValue(prop).trim();\n return parseCssTimeMs(raw, fallback);\n}\n\n/**\n * Resolve a duration to milliseconds for JS timers aligned with CSS motion tokens.\n * Accepts numbers (ms), raw times (`200ms`, `0.75s`), or `var(--effect-*)` references.\n */\nexport function resolveCssTimeMs(\n value: number | string | undefined,\n fallbackToken: string,\n): number {\n if (typeof value === 'number') return value;\n\n const token = typeof value === 'string' && value.trim() ? value.trim() : fallbackToken;\n const prop = extractCssCustomProp(token);\n\n if (prop) {\n return readTokenTimeMs(token, readTokenTimeMs(fallbackToken, 200));\n }\n\n return parseCssTimeMs(token, readTokenTimeMs(fallbackToken, 200));\n}\n\n/** Whether the user has requested reduced non-essential motion. */\nexport function prefersReducedMotion(): boolean {\n return typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Resolve an animation-coupled duration. Returns zero under reduced motion so\n * JS cleanup stays synchronized with CSS that removes the corresponding motion.\n */\nexport function resolveMotionTimeMs(\n value: number | string | undefined,\n fallbackToken: string,\n): number {\n return prefersReducedMotion() ? 0 : resolveCssTimeMs(value, fallbackToken);\n}\n", "/** CSS custom property for scroll-edge fade depth (dimension token or length). */\nexport const SCROLL_EDGE_FADE_SIZE_VAR = '--ds-scroll-edge-fade-size';\n\nexport const SCROLL_EDGE_FADE_DEFAULT_SIZE = 'var(--dimension-size-600)';\n\nexport type ScrollEdgeFadeEdge = 'top' | 'bottom' | 'left' | 'right';\n\nexport type ScrollEdgeFadeSizeToken =\n | 'size-000'\n | 'size-050'\n | 'size-075'\n | 'size-100'\n | 'size-150'\n | 'size-200'\n | 'size-250'\n | 'size-300'\n | 'size-400'\n | 'size-500'\n | 'size-600'\n | 'size-800';\n\nexport type ScrollEdgeFadeSize = ScrollEdgeFadeSizeToken | (string & {});\n\nconst SIZE_VALUE: Record<ScrollEdgeFadeSizeToken, string> = {\n 'size-000': 'var(--dimension-size-000)',\n 'size-050': 'var(--dimension-size-050)',\n 'size-075': 'var(--dimension-size-075)',\n 'size-100': 'var(--dimension-size-100)',\n 'size-150': 'var(--dimension-size-150)',\n 'size-200': 'var(--dimension-size-200)',\n 'size-250': 'var(--dimension-size-250)',\n 'size-300': 'var(--dimension-size-300)',\n 'size-400': 'var(--dimension-size-400)',\n 'size-500': 'var(--dimension-size-500)',\n 'size-600': 'var(--dimension-size-600)',\n 'size-800': 'var(--dimension-size-800)',\n};\n\nconst SIZE_REF = `var(${SCROLL_EDGE_FADE_SIZE_VAR}, ${SCROLL_EDGE_FADE_DEFAULT_SIZE})`;\n\nexport interface ScrollEdgeFadeOptions {\n /** One or more edges to fade. */\n edges: ScrollEdgeFadeEdge | ScrollEdgeFadeEdge[];\n /**\n * Reveal and hide configured fades from the container's own scroll position.\n * Uses CSS scroll-driven animations with a static-fade fallback; no listener required.\n */\n scrollAware?: boolean;\n /**\n * When true, removes the complete mask. Pass a map to remove only configured\n * edges that are flush when scroll state already lives in JavaScript.\n */\n atEnd?: boolean | Partial<Record<ScrollEdgeFadeEdge, boolean>>;\n /** Force the mask off regardless of scroll position (`ds-fade` `visible={false}`). */\n hidden?: boolean;\n}\n\n/** Resolve a dimension size token name or raw CSS length for `--ds-scroll-edge-fade-size`. */\nexport function resolveScrollEdgeFadeSize(\n size: ScrollEdgeFadeSize = 'size-600',\n height?: string,\n): string {\n if (height) return height;\n return Object.prototype.hasOwnProperty.call(SIZE_VALUE, size)\n ? SIZE_VALUE[size as ScrollEdgeFadeSizeToken]\n : size;\n}\n\n/** Inline style map setting fade depth on a scroll container. */\nexport function scrollEdgeFadeSizeStyle(\n size: ScrollEdgeFadeSize = 'size-600',\n height?: string,\n): Record<string, string> {\n return {\n [SCROLL_EDGE_FADE_SIZE_VAR]: resolveScrollEdgeFadeSize(size, height),\n };\n}\n\n/**\n * Alpha mask for a scroll container edge \u2014 content fades to transparent so\n * textured backgrounds (shell gradients, images) show through.\n */\nexport function scrollEdgeFadeMaskImage(edge: ScrollEdgeFadeEdge): string {\n switch (edge) {\n case 'top':\n return `linear-gradient(to bottom, transparent 0, #000 ${SIZE_REF}, #000 100%)`;\n case 'bottom':\n return `linear-gradient(to bottom, #000 0, #000 calc(100% - ${SIZE_REF}), transparent 100%)`;\n case 'left':\n return `linear-gradient(to right, transparent 0, #000 ${SIZE_REF}, #000 100%)`;\n case 'right':\n return `linear-gradient(to right, #000 0, #000 calc(100% - ${SIZE_REF}), transparent 100%)`;\n }\n}\n\n/** Inline style map for a masked scroll region (single edge). */\nexport function scrollEdgeFadeMaskStyle(\n edge: ScrollEdgeFadeEdge,\n size: ScrollEdgeFadeSize = 'size-600',\n height?: string,\n): Record<string, string> {\n const mask = scrollEdgeFadeMaskImage(edge);\n return {\n ...scrollEdgeFadeSizeStyle(size, height),\n WebkitMaskImage: mask,\n maskImage: mask,\n WebkitMaskSize: '100% 100%',\n maskSize: '100% 100%',\n };\n}\n\n/** Class map for `scroll-edge-fade` modifiers \u2014 pair with `scroll-edge-fade.css`. */\nexport function scrollEdgeFadeClassMap(opts: ScrollEdgeFadeOptions): Record<string, boolean> {\n const edges = Array.isArray(opts.edges) ? opts.edges : [opts.edges];\n const classes: Record<string, boolean> = {\n 'scroll-edge-fade': true,\n 'scroll-edge-fade--scroll-aware': opts.scrollAware === true,\n 'scroll-edge-fade--hidden': opts.hidden === true,\n };\n\n for (const edge of edges) {\n classes[`scroll-edge-fade--${edge}`] = true;\n }\n\n const { atEnd } = opts;\n if (atEnd === true) {\n classes['scroll-edge-fade--at-end'] = true;\n } else if (atEnd && typeof atEnd === 'object') {\n for (const edge of edges) {\n if (atEnd[edge]) {\n classes[`scroll-edge-fade--${edge}-at-edge`] = true;\n }\n }\n }\n\n return classes;\n}\n\n/** Whether a scroll container is flush with the given edge (within `threshold` px). */\nexport function isScrollAtEdge(\n el: HTMLElement,\n edge: ScrollEdgeFadeEdge,\n threshold = 2,\n): boolean {\n switch (edge) {\n case 'top':\n return el.scrollTop <= threshold;\n case 'bottom':\n return el.scrollHeight - el.scrollTop - el.clientHeight <= threshold;\n case 'left':\n return el.scrollLeft <= threshold;\n case 'right':\n return el.scrollWidth - el.scrollLeft - el.clientWidth <= threshold;\n }\n}\n", "import {\n dimensionIconographyMd,\n dimensionIconographySm,\n dimensionIconographyXs,\n dimensionMenuWidthXs,\n dimensionPanelWidth2xs,\n dimensionPanelWidthLg,\n dimensionPanelWidthMd,\n dimensionRadius025,\n dimensionSize200,\n dimensionSize300,\n dimensionSize400,\n dimensionSize600,\n dimensionSize800,\n dimensionSpace050,\n dimensionSpace200,\n typographyLineheightLg,\n typographyLineheightMd,\n typographyLineheightSm,\n typographyLineheightXl,\n typographyLineheightXs,\n effectAnimationDelayLong2,\n effectAnimationDelayMedium1,\n effectAnimationDelayMedium3,\n effectAnimationDelayInstant,\n effectAnimationDelayShort2,\n effectAnimationDurationMedium1,\n effectAnimationDurationShort3,\n effectMotionShort2,\n effectMotionShort3,\n} from '@ds-mo/tokens/ts';\n\n/** TokoMo CSS custom-property names for shared component defaults (runtime resolution). */\nexport const TOKEN_DEFAULTS = {\n space050: dimensionSpace050,\n space200: dimensionSpace200,\n radius025: dimensionRadius025,\n size200: dimensionSize200,\n size300: dimensionSize300,\n size400: dimensionSize400,\n size600: dimensionSize600,\n size800: dimensionSize800,\n iconographyMd: dimensionIconographyMd,\n iconographySm: dimensionIconographySm,\n iconographyXs: dimensionIconographyXs,\n panelWidth2xs: dimensionPanelWidth2xs,\n panelWidthMd: dimensionPanelWidthMd,\n panelWidthLg: dimensionPanelWidthLg,\n menuWidthXs: dimensionMenuWidthXs,\n lineheightLg: typographyLineheightLg,\n lineheightMd: typographyLineheightMd,\n lineheightSm: typographyLineheightSm,\n lineheightXl: typographyLineheightXl,\n lineheightXs: typographyLineheightXs,\n motionShort2: effectMotionShort2,\n motionShort3: effectMotionShort3,\n animationDurationShort3: effectAnimationDurationShort3,\n animationDurationMedium1: effectAnimationDurationMedium1,\n animationDelayInstant: effectAnimationDelayInstant,\n animationDelayMedium1: effectAnimationDelayMedium1,\n animationDelayMedium3: effectAnimationDelayMedium3,\n animationDelayShort2: effectAnimationDelayShort2,\n animationDelayLong2: effectAnimationDelayLong2,\n /** Unmeasured menu height fallback: 20\u00D7 base (160px at default scale). */\n menuFallbackHeight: 'calc(var(--dimension-size-base) * 20)',\n /** Unmeasured tooltip width fallback: size-800 + size-200 (80px). */\n tooltipFallbackWidth: 'calc(var(--dimension-size-800) + var(--dimension-size-200))',\n /** Fill-mode donut diameter floor: 16\u00D7 size-base (128px). */\n donutFillMin: 'calc(var(--dimension-size-base) * 16)',\n /** Fill-mode donut diameter ceiling: 24\u00D7 size-base (192px). */\n donutFillMax: 'calc(var(--dimension-size-base) * 24)',\n} as const;\n\nexport type TokenDefaultKey = keyof typeof TOKEN_DEFAULTS;\n\n/** Valid CSS length strings for overlay offset props \u2014 bind on `sideOffset` / `alignOffset` in hosts. */\nexport const TOKEN_CSS_LENGTHS = {\n space050: `var(${dimensionSpace050})`,\n space200: `var(${dimensionSpace200})`,\n menuWidthXs: `var(${dimensionMenuWidthXs})`,\n} as const;\n", "/** Shared width fit for interactive controls (buttons, select, \u2026). */\nexport type ControlWidth = 'hug' | 'fill';\n\n/** Host / control class map for `width=\"hug\" | \"fill\"`. */\nexport function controlWidthClass(width: ControlWidth): Record<string, boolean> {\n return {\n 'ds-control-width--hug': width === 'hug',\n 'ds-control-width--fill': width === 'fill',\n };\n}\n", "import type { TextVariant } from '../components/Text/text-types';\n\n/** Shared public control sizes. Typography is derived; it is not a separate density API. */\nexport type ControlSize = 'md' | 'sm' | 'xs';\n\n/** Complete text variant selected internally by each control size. */\nexport const CONTROL_TEXT_VARIANT: Record<ControlSize, TextVariant> = {\n md: 'text-body-medium',\n sm: 'text-body-small',\n xs: 'text-caption',\n};\n", "import type { AnchoredPopupAlign } from './anchored-popup';\n\n/**\n * `choice-cell` aligns the first/last interactive row edge with the anchor,\n * allowing the popup frame to extend by the section inset. `popup-frame`\n * aligns the popup frame itself and is reserved for deliberate custom geometry.\n */\nexport type ChoicePopupAnchorAlignment = 'choice-cell' | 'popup-frame';\n\nexport interface ChoicePopupAlignOffsetInput {\n align: AnchoredPopupAlign;\n alignOffsetPx: number;\n sectionInsetPx: number;\n anchorAlignment?: ChoicePopupAnchorAlignment;\n}\n\n/**\n * Resolve the cross-axis offset for a choice popup. Authored `alignOffsetPx`\n * remains an additive nudge after the shared inner-cell alignment is applied.\n */\nexport function resolveChoicePopupAlignOffset({\n align,\n alignOffsetPx,\n sectionInsetPx,\n anchorAlignment = 'choice-cell',\n}: ChoicePopupAlignOffsetInput): number {\n if (anchorAlignment === 'popup-frame' || align === 'center') return alignOffsetPx;\n return alignOffsetPx + (align === 'start' ? -sectionInsetPx : sectionInsetPx);\n}\n\n/** Minimum popup width that keeps both choice-cell edges aligned to a trigger. */\nexport function choicePopupMinWidth(anchorWidth: number, sectionInsetPx: number): number {\n return anchorWidth + sectionInsetPx * 2;\n}\n"],
|
|
5
|
+
"mappings": ";AAQA,IAAM,YAAY,uBAAO,IAAI,sBAAsB;AAM5C,SAAS,aAAa,MAAc,MAAuB;AAChE,SAAO,OAAO,QAAQ,IAAI,KAAK,UAAU,IAAI;AAC/C;AAEO,SAAS,YAA0B;AACxC,QAAM,IAAI;AACV,SAAQ,gCAAiB,oBAAI,IAAI;AACnC;AAmBO,SAAS,cAAc,OAA+B,SAAoC;AAC/F,QAAM,QAAQ,UAAU;AACxB,aAAW,CAAC,MAAM,GAAG,KAAK,OAAO,QAAQ,KAAK,GAAG;AAC/C,UAAM,OAAO,SAAS,QAAQ,KAAK,WAAW,MAAM;AACpD,UAAM,IAAI,aAAa,MAAM,IAAI,GAAG,GAAG;AAAA,EACzC;AACF;;;AC9CA,IAAM,gBAAgB,oBAAI,IAAoB;AAE9C,IAAI,UAA8B;AAElC,SAAS,kBAAsC;AAC7C,MAAI,OAAO,aAAa,YAAa,QAAO;AAE5C,MAAI,CAAC,SAAS;AACZ,cAAU,SAAS,cAAc,KAAK;AACtC,YAAQ,aAAa,eAAe,MAAM;AAC1C,YAAQ,MAAM,UACZ;AACF,aAAS,gBAAgB,YAAY,OAAO;AAAA,EAC9C;AAEA,SAAO;AACT;AA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