@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
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "radio",
|
|
4
|
+
"title": "Radio",
|
|
5
|
+
"description": "Form-associated one-of-many radio selection set with vertical or horizontal layout, three densities, per-option inactive state, and roving keyboard focus.",
|
|
6
|
+
"type": "registry:ui",
|
|
7
|
+
"meta": {
|
|
8
|
+
"library": "@ds-mo/ui",
|
|
9
|
+
"distribution": "npm",
|
|
10
|
+
"storybook": "https://zainadeel.github.io/compomo/?path=/story/radio",
|
|
11
|
+
"source": "src/wc/components/Radio/Radio.tsx",
|
|
12
|
+
"intentStatus": "complete",
|
|
13
|
+
"intent": {
|
|
14
|
+
"audience": "general",
|
|
15
|
+
"status": "stable",
|
|
16
|
+
"summary": "Form-associated one-of-many radio selection set with vertical or horizontal layout, three densities, per-option inactive state, and roving keyboard focus.",
|
|
17
|
+
"useWhen": [
|
|
18
|
+
"A user must select exactly one visible option from a small set.",
|
|
19
|
+
"All available choices should remain visible for comparison.",
|
|
20
|
+
"A form needs one selected string value with native validation, reset, or external form association."
|
|
21
|
+
],
|
|
22
|
+
"avoidWhen": [
|
|
23
|
+
"A user may select zero or multiple independent choices.",
|
|
24
|
+
"A binary setting applies immediately rather than selecting from a set.",
|
|
25
|
+
"The option list is too long or space-constrained to remain visible."
|
|
26
|
+
],
|
|
27
|
+
"alternatives": [
|
|
28
|
+
{
|
|
29
|
+
"when": "A user may select zero or multiple independent choices.",
|
|
30
|
+
"component": "component:ds-checkbox",
|
|
31
|
+
"reason": "Checkbox communicates independent selection rather than one-of-many choice."
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"when": "A binary setting applies immediately.",
|
|
35
|
+
"component": "component:ds-switch",
|
|
36
|
+
"reason": "Switch communicates an immediately applied on/off setting."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"when": "The option list is long or the available space is constrained.",
|
|
40
|
+
"component": "component:ds-select",
|
|
41
|
+
"reason": "Select keeps a larger one-of-many choice set compact."
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"commonlyComposedWith": [
|
|
45
|
+
"component:ds-field",
|
|
46
|
+
"component:ds-text"
|
|
47
|
+
],
|
|
48
|
+
"accessibility": [
|
|
49
|
+
"The host exposes radiogroup semantics and requires an accessible group name from aria-label or aria-labelledby.",
|
|
50
|
+
"Each visible option exposes radio semantics, its checked state, its label text, and any inactive state.",
|
|
51
|
+
"Arrow keys move and select through active options; Home and End select the first and last active options; Space and Enter select the focused option.",
|
|
52
|
+
"Roving tabindex keeps one active option in the tab order, preferring the selected option."
|
|
53
|
+
],
|
|
54
|
+
"states": [
|
|
55
|
+
"Unchecked circles use a tertiary-foreground inset stroke: 1.25px at md, 1px at sm, and 0.75px at xs.",
|
|
56
|
+
"Selected circles remove the border, use a brand fill, and draw a centered on-bold foreground dot sized 8px at md, 6px at sm, and 4px at xs.",
|
|
57
|
+
"Sizes are md with a 16px circle in a 20px placement, sm with a 12px circle in a 16px placement, and xs with an 8px circle in a 12px placement.",
|
|
58
|
+
"The initial value is restored by native form reset; the selected value submits under name and a required set is invalid until one active option is selected."
|
|
59
|
+
],
|
|
60
|
+
"responsiveBehavior": [
|
|
61
|
+
"Choose size from the density of the containing form or settings row.",
|
|
62
|
+
"Prefer vertical layout when labels may wrap or horizontal space is constrained; horizontal layout is appropriate for short labels in a small set."
|
|
63
|
+
],
|
|
64
|
+
"frameworkCaveats": {
|
|
65
|
+
"customElements": [
|
|
66
|
+
"Assign options as a JavaScript property, set value as a property for application state updates, and listen for dsChange.",
|
|
67
|
+
"Use the form attribute on the host when associating a radio set rendered outside its owning form."
|
|
68
|
+
],
|
|
69
|
+
"react": [
|
|
70
|
+
"Use DsRadio, pass options as an array, and handle onDsChange; value is mutable and updates after user selection."
|
|
71
|
+
],
|
|
72
|
+
"angular": [
|
|
73
|
+
"Use DsRadio with options and value bindings plus dsChange, or import the generated radio value accessor with the component adapter."
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"references": [
|
|
77
|
+
{
|
|
78
|
+
"label": "Storybook examples",
|
|
79
|
+
"path": "src/wc/components/Radio/Radio.stories.ts"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"label": "Cross-browser form and accessibility coverage",
|
|
83
|
+
"path": "tests/e2e/forms.spec.ts"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"api": {
|
|
88
|
+
"props": {
|
|
89
|
+
"ariaLabel": {
|
|
90
|
+
"type": "string | null",
|
|
91
|
+
"resolvedType": "null | string",
|
|
92
|
+
"attribute": "aria-label",
|
|
93
|
+
"default": "null",
|
|
94
|
+
"required": false,
|
|
95
|
+
"mutable": false,
|
|
96
|
+
"description": "Accessible name when visible group labeling is unavailable."
|
|
97
|
+
},
|
|
98
|
+
"ariaLabelledby": {
|
|
99
|
+
"type": "string | undefined",
|
|
100
|
+
"resolvedType": "string | undefined",
|
|
101
|
+
"attribute": "aria-labelledby",
|
|
102
|
+
"required": false,
|
|
103
|
+
"mutable": false,
|
|
104
|
+
"description": "Id reference for a visible group label."
|
|
105
|
+
},
|
|
106
|
+
"direction": {
|
|
107
|
+
"type": "'vertical' | 'horizontal'",
|
|
108
|
+
"resolvedType": "\"horizontal\" | \"vertical\"",
|
|
109
|
+
"attribute": "direction",
|
|
110
|
+
"default": "'vertical'",
|
|
111
|
+
"required": false,
|
|
112
|
+
"mutable": false,
|
|
113
|
+
"description": "Layout direction for the option set."
|
|
114
|
+
},
|
|
115
|
+
"disabled": {
|
|
116
|
+
"type": "boolean",
|
|
117
|
+
"resolvedType": "boolean",
|
|
118
|
+
"attribute": "disabled",
|
|
119
|
+
"default": "false",
|
|
120
|
+
"required": false,
|
|
121
|
+
"mutable": false,
|
|
122
|
+
"description": "Native disabled state for the complete set."
|
|
123
|
+
},
|
|
124
|
+
"form": {
|
|
125
|
+
"type": "string | undefined",
|
|
126
|
+
"resolvedType": "string | undefined",
|
|
127
|
+
"attribute": "form",
|
|
128
|
+
"required": false,
|
|
129
|
+
"mutable": false,
|
|
130
|
+
"description": "Associates the radio set with a form by id when rendered outside that form."
|
|
131
|
+
},
|
|
132
|
+
"isInactive": {
|
|
133
|
+
"type": "boolean",
|
|
134
|
+
"resolvedType": "boolean",
|
|
135
|
+
"attribute": "is-inactive",
|
|
136
|
+
"default": "false",
|
|
137
|
+
"required": false,
|
|
138
|
+
"mutable": false,
|
|
139
|
+
"description": "Design-system inactive state for the complete set."
|
|
140
|
+
},
|
|
141
|
+
"name": {
|
|
142
|
+
"type": "string | undefined",
|
|
143
|
+
"resolvedType": "string | undefined",
|
|
144
|
+
"attribute": "name",
|
|
145
|
+
"required": false,
|
|
146
|
+
"mutable": false,
|
|
147
|
+
"description": "Native form field name."
|
|
148
|
+
},
|
|
149
|
+
"options": {
|
|
150
|
+
"type": "RadioOption[]",
|
|
151
|
+
"resolvedType": "RadioOption[]",
|
|
152
|
+
"default": "[]",
|
|
153
|
+
"required": false,
|
|
154
|
+
"mutable": false,
|
|
155
|
+
"description": "Visible choices in this one-of-many set."
|
|
156
|
+
},
|
|
157
|
+
"required": {
|
|
158
|
+
"type": "boolean",
|
|
159
|
+
"resolvedType": "boolean",
|
|
160
|
+
"attribute": "required",
|
|
161
|
+
"default": "false",
|
|
162
|
+
"required": false,
|
|
163
|
+
"mutable": false,
|
|
164
|
+
"description": "Require one option to be selected for form validity."
|
|
165
|
+
},
|
|
166
|
+
"requiredMessage": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"resolvedType": "string",
|
|
169
|
+
"attribute": "required-message",
|
|
170
|
+
"default": "'This field is required.'",
|
|
171
|
+
"required": false,
|
|
172
|
+
"mutable": false,
|
|
173
|
+
"description": "Validation message used when a required set has no selection."
|
|
174
|
+
},
|
|
175
|
+
"size": {
|
|
176
|
+
"type": "RadioSize",
|
|
177
|
+
"resolvedType": "\"md\" | \"sm\" | \"xs\"",
|
|
178
|
+
"attribute": "size",
|
|
179
|
+
"default": "'md'",
|
|
180
|
+
"required": false,
|
|
181
|
+
"mutable": false,
|
|
182
|
+
"description": "Visual and placement density for every option."
|
|
183
|
+
},
|
|
184
|
+
"value": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"resolvedType": "string",
|
|
187
|
+
"attribute": "value",
|
|
188
|
+
"default": "''",
|
|
189
|
+
"required": false,
|
|
190
|
+
"mutable": true,
|
|
191
|
+
"description": "Selected option value."
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"events": [
|
|
195
|
+
{
|
|
196
|
+
"name": "dsChange",
|
|
197
|
+
"detail": "string",
|
|
198
|
+
"bubbles": true,
|
|
199
|
+
"cancelable": true,
|
|
200
|
+
"composed": true,
|
|
201
|
+
"description": "Emitted after user selection with the selected option value."
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
"methods": [],
|
|
205
|
+
"slots": []
|
|
206
|
+
},
|
|
207
|
+
"props": {
|
|
208
|
+
"ariaLabel": {
|
|
209
|
+
"type": "string | null",
|
|
210
|
+
"resolvedType": "null | string",
|
|
211
|
+
"attribute": "aria-label",
|
|
212
|
+
"default": "null",
|
|
213
|
+
"required": false,
|
|
214
|
+
"mutable": false,
|
|
215
|
+
"description": "Accessible name when visible group labeling is unavailable."
|
|
216
|
+
},
|
|
217
|
+
"ariaLabelledby": {
|
|
218
|
+
"type": "string | undefined",
|
|
219
|
+
"resolvedType": "string | undefined",
|
|
220
|
+
"attribute": "aria-labelledby",
|
|
221
|
+
"required": false,
|
|
222
|
+
"mutable": false,
|
|
223
|
+
"description": "Id reference for a visible group label."
|
|
224
|
+
},
|
|
225
|
+
"direction": {
|
|
226
|
+
"type": "'vertical' | 'horizontal'",
|
|
227
|
+
"resolvedType": "\"horizontal\" | \"vertical\"",
|
|
228
|
+
"attribute": "direction",
|
|
229
|
+
"default": "'vertical'",
|
|
230
|
+
"required": false,
|
|
231
|
+
"mutable": false,
|
|
232
|
+
"description": "Layout direction for the option set."
|
|
233
|
+
},
|
|
234
|
+
"disabled": {
|
|
235
|
+
"type": "boolean",
|
|
236
|
+
"resolvedType": "boolean",
|
|
237
|
+
"attribute": "disabled",
|
|
238
|
+
"default": "false",
|
|
239
|
+
"required": false,
|
|
240
|
+
"mutable": false,
|
|
241
|
+
"description": "Native disabled state for the complete set."
|
|
242
|
+
},
|
|
243
|
+
"form": {
|
|
244
|
+
"type": "string | undefined",
|
|
245
|
+
"resolvedType": "string | undefined",
|
|
246
|
+
"attribute": "form",
|
|
247
|
+
"required": false,
|
|
248
|
+
"mutable": false,
|
|
249
|
+
"description": "Associates the radio set with a form by id when rendered outside that form."
|
|
250
|
+
},
|
|
251
|
+
"isInactive": {
|
|
252
|
+
"type": "boolean",
|
|
253
|
+
"resolvedType": "boolean",
|
|
254
|
+
"attribute": "is-inactive",
|
|
255
|
+
"default": "false",
|
|
256
|
+
"required": false,
|
|
257
|
+
"mutable": false,
|
|
258
|
+
"description": "Design-system inactive state for the complete set."
|
|
259
|
+
},
|
|
260
|
+
"name": {
|
|
261
|
+
"type": "string | undefined",
|
|
262
|
+
"resolvedType": "string | undefined",
|
|
263
|
+
"attribute": "name",
|
|
264
|
+
"required": false,
|
|
265
|
+
"mutable": false,
|
|
266
|
+
"description": "Native form field name."
|
|
267
|
+
},
|
|
268
|
+
"options": {
|
|
269
|
+
"type": "RadioOption[]",
|
|
270
|
+
"resolvedType": "RadioOption[]",
|
|
271
|
+
"default": "[]",
|
|
272
|
+
"required": false,
|
|
273
|
+
"mutable": false,
|
|
274
|
+
"description": "Visible choices in this one-of-many set."
|
|
275
|
+
},
|
|
276
|
+
"required": {
|
|
277
|
+
"type": "boolean",
|
|
278
|
+
"resolvedType": "boolean",
|
|
279
|
+
"attribute": "required",
|
|
280
|
+
"default": "false",
|
|
281
|
+
"required": false,
|
|
282
|
+
"mutable": false,
|
|
283
|
+
"description": "Require one option to be selected for form validity."
|
|
284
|
+
},
|
|
285
|
+
"requiredMessage": {
|
|
286
|
+
"type": "string",
|
|
287
|
+
"resolvedType": "string",
|
|
288
|
+
"attribute": "required-message",
|
|
289
|
+
"default": "'This field is required.'",
|
|
290
|
+
"required": false,
|
|
291
|
+
"mutable": false,
|
|
292
|
+
"description": "Validation message used when a required set has no selection."
|
|
293
|
+
},
|
|
294
|
+
"size": {
|
|
295
|
+
"type": "RadioSize",
|
|
296
|
+
"resolvedType": "\"md\" | \"sm\" | \"xs\"",
|
|
297
|
+
"attribute": "size",
|
|
298
|
+
"default": "'md'",
|
|
299
|
+
"required": false,
|
|
300
|
+
"mutable": false,
|
|
301
|
+
"description": "Visual and placement density for every option."
|
|
302
|
+
},
|
|
303
|
+
"value": {
|
|
304
|
+
"type": "string",
|
|
305
|
+
"resolvedType": "string",
|
|
306
|
+
"attribute": "value",
|
|
307
|
+
"default": "''",
|
|
308
|
+
"required": false,
|
|
309
|
+
"mutable": true,
|
|
310
|
+
"description": "Selected option value."
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"events": [
|
|
314
|
+
{
|
|
315
|
+
"name": "dsChange",
|
|
316
|
+
"detail": "string",
|
|
317
|
+
"bubbles": true,
|
|
318
|
+
"cancelable": true,
|
|
319
|
+
"composed": true,
|
|
320
|
+
"description": "Emitted after user selection with the selected option value."
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"methods": [],
|
|
324
|
+
"slots": [],
|
|
325
|
+
"exports": {
|
|
326
|
+
"customElement": "ds-radio",
|
|
327
|
+
"react": "DsRadio",
|
|
328
|
+
"angular": "DsRadio"
|
|
329
|
+
},
|
|
330
|
+
"consumption": {
|
|
331
|
+
"install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
|
|
332
|
+
"cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
|
|
333
|
+
"customElements": {
|
|
334
|
+
"import": "import '@ds-mo/ui/dist/components/ds-radio.js';",
|
|
335
|
+
"example": "<ds-radio></ds-radio>"
|
|
336
|
+
},
|
|
337
|
+
"react": {
|
|
338
|
+
"import": "import { DsRadio } from '@ds-mo/ui/react';",
|
|
339
|
+
"example": "<DsRadio />"
|
|
340
|
+
},
|
|
341
|
+
"angular": {
|
|
342
|
+
"import": "import { DsRadio } from '@ds-mo/ui/angular/ds-radio';",
|
|
343
|
+
"example": "<ds-radio></ds-radio>"
|
|
344
|
+
},
|
|
345
|
+
"complexPropertyNote": "Assign these non-primitive values as JavaScript properties: options.",
|
|
346
|
+
"peerDependencies": {
|
|
347
|
+
"required": [
|
|
348
|
+
"@ds-mo/tokens ^3.1.1",
|
|
349
|
+
"@ds-mo/icons ^6.2.0"
|
|
350
|
+
],
|
|
351
|
+
"frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
"dependencies": [
|
|
356
|
+
"@ds-mo/ui",
|
|
357
|
+
"@ds-mo/tokens"
|
|
358
|
+
],
|
|
359
|
+
"registryDependencies": [
|
|
360
|
+
"text"
|
|
361
|
+
],
|
|
362
|
+
"files": [
|
|
363
|
+
{
|
|
364
|
+
"path": "src/wc/components/Radio/Radio.css",
|
|
365
|
+
"content": "@import '../../utils/control-inactive.css';\n@import '../../utils/control-density.css';\n@import '../../utils/focus-ring.css';\n@import '../../utils/interaction-fill.css';\n\n:host {\n display: flex;\n flex-direction: column;\n gap: var(--dimension-space-025);\n}\n\n:host(.radio--horizontal) {\n flex-direction: row;\n gap: var(--dimension-space-100);\n}\n\n:host(.radio--md) {\n --_radio-circle: var(--dimension-iconography-sm);\n --_radio-dot: var(--dimension-size-100);\n --_radio-stroke: var(--dimension-stroke-width-015);\n}\n\n:host(.radio--sm) {\n --_radio-circle: var(--dimension-iconography-xs);\n --_radio-dot: var(--dimension-size-075);\n --_radio-stroke: var(--dimension-stroke-width-012);\n}\n\n:host(.radio--xs) {\n --_radio-circle: var(--dimension-size-100);\n --_radio-dot: var(--dimension-size-050);\n --_radio-stroke: calc(var(--dimension-stroke-width-base) * 3 / 32);\n}\n\n.radio__item {\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n gap: var(--ds-control-gap);\n height: var(--ds-control-height);\n padding: 0 var(--ds-control-padding-inline);\n border-radius: var(--ds-control-radius);\n cursor: pointer;\n user-select: none;\n}\n\n.radio__placement {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--ds-control-icon);\n height: var(--ds-control-icon);\n}\n\n.radio__circle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--_radio-circle);\n height: var(--_radio-circle);\n border: 0;\n border-radius: var(--dimension-radius-half);\n box-shadow: inset 0 0 0 var(--_radio-stroke) var(--color-foreground-tertiary);\n transition:\n background-color var(--effect-motion-short-2),\n box-shadow var(--effect-motion-short-2);\n}\n\n.radio__circle--checked {\n background-color: var(--color-background-bold-brand);\n box-shadow: none;\n}\n\n.radio__dot {\n width: var(--_radio-dot);\n height: var(--_radio-dot);\n border-radius: var(--dimension-radius-half);\n background-color: var(--color-foreground-on-bold-background-primary);\n}\n\n.radio__label {\n flex: 1;\n min-width: 0;\n padding: 0 var(--ds-control-label-inset);\n}\n",
|
|
366
|
+
"type": "registry:ui"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"path": "src/wc/components/Radio/Radio.tsx",
|
|
370
|
+
"content": "import { AttachInternals, Component, Prop, State, Event, EventEmitter, Element, Listen, Watch, h, Host } from '@stencil/core';\n\nexport interface RadioOption {\n label: string;\n value: string;\n isInactive?: boolean;\n}\n\nexport type RadioSize = 'md' | 'sm' | 'xs';\n\nconst LABEL_VARIANT: Record<RadioSize, 'text-body-medium' | 'text-body-small' | 'text-caption'> = {\n md: 'text-body-medium',\n sm: 'text-body-small',\n xs: 'text-caption',\n};\n\n@Component({\n tag: 'ds-radio',\n styleUrl: 'Radio.css',\n scoped: true,\n formAssociated: true,\n})\nexport class Radio {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n /** Visible choices in this one-of-many set. */\n @Prop() options: RadioOption[] = [];\n /** Selected option value. */\n @Prop({ mutable: true }) value: string = '';\n /** Visual and placement density for every option. */\n @Prop() size: RadioSize = 'md';\n /** Native form field name. */\n @Prop({ reflect: true }) name: string | undefined;\n /** Associates the radio set with a form by id when rendered outside that form. */\n @Prop({ reflect: true }) form: string | undefined;\n /** Native disabled state for the complete set. */\n @Prop({ reflect: true }) disabled: boolean = false;\n /** Require one option to be selected for form validity. */\n @Prop({ reflect: true }) required: boolean = false;\n /** Validation message used when a required set has no selection. */\n @Prop() requiredMessage: string = 'This field is required.';\n /** Layout direction for the option set. */\n @Prop() direction: 'vertical' | 'horizontal' = 'vertical';\n /** Design-system inactive state for the complete set. */\n @Prop() isInactive: boolean = false;\n /** Accessible name when visible group labeling is unavailable. */\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n /** Id reference for a visible group label. */\n @Prop({ attribute: 'aria-labelledby' }) ariaLabelledby: string | undefined;\n\n /** Emitted after user selection with the selected option value. */\n @Event() dsChange!: EventEmitter<string>;\n\n private initialValue = '';\n @State() private formDisabled = false;\n\n componentWillLoad() {\n this.initialValue = this.value;\n this.syncFormValue();\n }\n\n @Watch('value')\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('required')\n syncFormValue() {\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n this.internals.setFormValue(inactive ? null : this.value);\n const missing = this.required && !inactive && this.value.length === 0;\n this.internals.setValidity(missing ? { valueMissing: true } : {}, missing ? this.requiredMessage : '');\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.syncFormValue();\n }\n\n formResetCallback() {\n this.value = this.initialValue;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.value = typeof state === 'string' ? state : '';\n }\n\n private get activeItems(): HTMLElement[] {\n return Array.from(this.el.querySelectorAll<HTMLElement>('[data-radio-item]:not([data-inactive])'));\n }\n\n @Listen('keydown')\n handleKeyDown(e: KeyboardEvent) {\n const items = this.activeItems;\n if (!items.length) return;\n\n const focused = items.find(item => item === document.activeElement);\n if (!focused) return;\n\n const idx = items.indexOf(focused);\n let next = -1;\n\n switch (e.key) {\n case 'ArrowDown':\n case 'ArrowRight':\n e.preventDefault();\n next = (idx + 1) % items.length;\n break;\n case 'ArrowUp':\n case 'ArrowLeft':\n e.preventDefault();\n next = (idx - 1 + items.length) % items.length;\n break;\n case 'Home':\n e.preventDefault();\n next = 0;\n break;\n case 'End':\n e.preventDefault();\n next = items.length - 1;\n break;\n }\n\n if (next >= 0) {\n items[next].focus();\n const nextValue = items[next].dataset['value'];\n if (nextValue && nextValue !== this.value) {\n this.value = nextValue;\n this.dsChange.emit(nextValue);\n }\n }\n }\n\n private selectItem(optValue: string) {\n if (this.isInactive || this.disabled || this.formDisabled) return;\n if (optValue !== this.value) {\n this.value = optValue;\n this.dsChange.emit(optValue);\n }\n }\n\n render() {\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n const invalid = this.required && !inactive && this.value.length === 0;\n const selectedIdx = this.options.findIndex(option => option.value === this.value);\n const firstActiveIdx = this.options.findIndex(option => !inactive && !option.isInactive);\n const focusableIdx = selectedIdx >= 0 && !inactive && !this.options[selectedIdx]?.isInactive\n ? selectedIdx\n : firstActiveIdx;\n\n return (\n <Host\n role=\"radiogroup\"\n aria-label={this.ariaLabel}\n aria-labelledby={this.ariaLabelledby}\n aria-required={this.required ? 'true' : undefined}\n aria-invalid={invalid ? 'true' : undefined}\n class={{\n radio: true,\n 'radio--horizontal': this.direction === 'horizontal',\n [`radio--${this.size}`]: true,\n }}\n >\n {this.options.map((option, index) => {\n const isItemInactive = inactive || !!option.isInactive;\n const isChecked = option.value === this.value;\n const tabIdx = isItemInactive ? -1 : index === focusableIdx ? 0 : -1;\n\n return (\n <div\n key={option.value}\n role=\"radio\"\n aria-checked={String(isChecked)}\n aria-disabled={isItemInactive ? 'true' : undefined}\n tabIndex={tabIdx}\n data-radio-item\n data-value={option.value}\n data-inactive={isItemInactive || undefined}\n class={{\n radio__item: true,\n [`ds-control--${this.size}`]: true,\n 'ds-control-inactive': isItemInactive,\n 'ds-focus-ring-inset': !isItemInactive,\n 'ds-interaction-fill': !isItemInactive,\n }}\n onClick={() => !isItemInactive && this.selectItem(option.value)}\n onKeyDown={(e: KeyboardEvent) => {\n if ((e.key === ' ' || e.key === 'Enter') && !isItemInactive) {\n e.preventDefault();\n this.selectItem(option.value);\n }\n }}\n >\n <span class=\"radio__placement ds-interaction-fill__content\" aria-hidden=\"true\">\n <span class={{ radio__circle: true, 'radio__circle--checked': isChecked }}>\n {isChecked && <span class=\"radio__dot\" />}\n </span>\n </span>\n <ds-text\n class=\"radio__label ds-interaction-fill__content\"\n as=\"span\"\n variant={LABEL_VARIANT[this.size]}\n >\n {option.label}\n </ds-text>\n </div>\n );\n })}\n </Host>\n );\n }\n}\n",
|
|
371
|
+
"type": "registry:ui"
|
|
372
|
+
}
|
|
373
|
+
]
|
|
374
|
+
}
|