@adea-ai/ui 0.162.6 → 0.162.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/composites/about-dialog/about-dialog.js +5 -5
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js +3 -3
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/accent-picker/custom-color-popover.js +2 -2
- package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +22 -22
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.js +2 -2
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js +3 -3
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +10 -10
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +13 -13
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +12 -12
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js +13 -13
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.js +9 -9
- package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +10 -10
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js +5 -5
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.js +7 -7
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.js +5 -5
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +13 -13
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.js +7 -7
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js +9 -9
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/help-center/help-center.js +5 -5
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +10 -10
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/icon-picker/image-data-url.js.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.js +117 -117
- package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js +7 -7
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +1 -1
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/list-row/list-row.js +2 -2
- package/dist/components/composites/list-row/list-row.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js +7 -7
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/message-scroller/scroll-anchor.js +1 -1
- package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +12 -12
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/plan/plan.js +5 -5
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/prompt-input/prompt-input.js +3 -3
- package/dist/components/composites/prompt-input/prompt-input.js.map +1 -1
- package/dist/components/composites/queue/queue.js +13 -13
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.js +5 -5
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.js +16 -16
- package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
- package/dist/components/composites/settings/settings-layout.js +2 -2
- package/dist/components/composites/settings/settings-layout.js.map +1 -1
- package/dist/components/composites/settings/settings-navigation.js +2 -2
- package/dist/components/composites/settings/settings-navigation.js.map +1 -1
- package/dist/components/composites/settings/settings.js +5 -5
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/sources.js +5 -5
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/parse-stack-trace.js +2 -2
- package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js +10 -10
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.js +6 -6
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.js +5 -5
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/suggestion/suggestion.js +2 -2
- package/dist/components/composites/suggestion/suggestion.js.map +1 -1
- package/dist/components/composites/task/task.js +5 -5
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/ansi.js +1 -1
- package/dist/components/composites/terminal/ansi.js.map +1 -1
- package/dist/components/composites/terminal/terminal.js +18 -18
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results.js +17 -17
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.js +5 -5
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.js +6 -6
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.js +1 -1
- package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +23 -23
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +2 -2
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +6 -6
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.js +11 -11
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/components/conversation/atomic/chat-composer.js +1 -1
- package/dist/components/conversation/busy-send-button.js +10 -10
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/chat-composer.js +1 -1
- package/dist/components/conversation/composer-core.js +1 -1
- package/dist/components/conversation/composer-menu.js +2 -2
- package/dist/components/conversation/composer-menu.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.js +7 -7
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-pane.js +1 -1
- package/dist/components/conversation/conversation-pane.js.map +1 -1
- package/dist/components/conversation/conversation-surface.js +5 -5
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +9 -9
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.js +9 -9
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.js +13 -13
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/paste-token-editor.js +1 -1
- package/dist/components/conversation/paste-token-editor.js.map +1 -1
- package/dist/components/conversation/scroll-follow.js +1 -1
- package/dist/components/conversation/thread-panel.js +5 -5
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.js +5 -5
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/app-shell/app-shell.js +1 -1
- package/dist/components/layout/app-shell/app-shell.js.map +1 -1
- package/dist/components/layout/app-shell/skip-link.js +1 -1
- package/dist/components/layout/app-shell/skip-link.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +2 -2
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
- package/dist/components/layout/floating-preview/floating-preview.js +7 -7
- package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
- package/dist/components/layout/orbit-layout/orbit-layout.js +1 -1
- package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
- package/dist/components/layout/page/page.js +2 -2
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/panel/panel.js +1 -1
- package/dist/components/layout/panel/panel.js.map +1 -1
- package/dist/components/layout/pixel-pane/pixel-pane.js +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +5 -5
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.js +5 -5
- package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
- package/dist/components/layout/shell-top-bar/shell-top-bar.js +2 -2
- package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +2 -2
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +5 -5
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/pane-focus.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +7 -7
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/status-bar/status-bar.js +1 -1
- package/dist/components/layout/status-bar/status-bar.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +5 -5
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/layout/virtual-window/virtual-window.js +1 -1
- package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
- package/dist/components/motion/presence.js +1 -1
- package/dist/components/theme/appearance-panel.js +3 -3
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/lazy.js +3 -3
- package/dist/components/theme/lazy.js.map +1 -1
- package/dist/components/theme/script-projection.js +1 -1
- package/dist/components/theme/theme-catalogue-source.js +1 -1
- package/dist/components/theme/theme-document.js.map +1 -1
- package/dist/components/theme/theme-mode-toggle.js +7 -7
- package/dist/components/theme/theme-mode-toggle.js.map +1 -1
- package/dist/components/theme/theme-picker.js +2 -2
- package/dist/components/theme/theme-picker.js.map +1 -1
- package/dist/components/theme/theme-provider-value.js +1 -1
- package/dist/components/theme/theme-provider-value.js.map +1 -1
- package/dist/components/theme/theme-provider.js +1 -1
- package/dist/components/theme/theme-toggle.js +7 -7
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/accordion/accordion.js +13 -13
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/alert/alert.js +12 -12
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js +14 -14
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js +2 -2
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/aspect-ratio/aspect-ratio.js +1 -1
- package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/ui/attachment/attachment.js +16 -16
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js +1 -1
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/badge/badge.js +2 -2
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/board/board.js +2 -2
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js +7 -7
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/bubble/bubble.js +2 -2
- package/dist/components/ui/bubble/bubble.js.map +1 -1
- package/dist/components/ui/button/button.js +2 -2
- package/dist/components/ui/button-group/button-group.js +2 -2
- package/dist/components/ui/button-group/button-group.js.map +1 -1
- package/dist/components/ui/calendar/calendar.js +8 -8
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/callout/callout.js +2 -2
- package/dist/components/ui/callout/callout.js.map +1 -1
- package/dist/components/ui/card/card.js +2 -2
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/carousel/carousel.js +8 -8
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/chart/chart.js +2 -2
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +6 -6
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.js +6 -6
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/collapsible/collapsible.js +7 -7
- package/dist/components/ui/collapsible/collapsible.js.map +1 -1
- package/dist/components/ui/combobox/combobox.js +21 -21
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/combobox/value-combobox.js +1 -1
- package/dist/components/ui/command/command.js +23 -23
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.js +2 -2
- package/dist/components/ui/detail-panel/detail-panel.js +5 -5
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.js +2 -2
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js +21 -21
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/diff-block/diff-block.js +2 -2
- package/dist/components/ui/diff-block/diff-block.js.map +1 -1
- package/dist/components/ui/drawer/drawer.js +14 -14
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
- package/dist/components/ui/dropdown-menu/menu-parts.js +10 -10
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.js +5 -5
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/empty/empty.js +1 -1
- package/dist/components/ui/empty/empty.js.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.js +2 -2
- package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
- package/dist/components/ui/field/field.js +14 -14
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/field/number-field.js +2 -2
- package/dist/components/ui/field/number-field.js.map +1 -1
- package/dist/components/ui/hover-card/hover-card.js +10 -10
- package/dist/components/ui/hover-card/hover-card.js.map +1 -1
- package/dist/components/ui/input/input-control.js +1 -1
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input/input.js +2 -2
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/input-group/input-group.js +2 -2
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/input-group/secret-input-group.js +2 -2
- package/dist/components/ui/input-otp/input-otp.js +2 -2
- package/dist/components/ui/input-otp/input-otp.js.map +1 -1
- package/dist/components/ui/item/item.js +2 -2
- package/dist/components/ui/item/item.js.map +1 -1
- package/dist/components/ui/kbd/kbd.js +2 -2
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/label/label.js +1 -1
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/marker/marker.js +2 -2
- package/dist/components/ui/marker/marker.js.map +1 -1
- package/dist/components/ui/menubar/menubar.js +7 -7
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/message/message.js +3 -3
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.js +2 -2
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/ui/native-select/native-select.js +5 -5
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js +18 -18
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.js +28 -28
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/popover/popover.js +15 -15
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/progress/progress.js +5 -5
- package/dist/components/ui/progress/progress.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +10 -10
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +9 -9
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.js +11 -11
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/ui/select/select.js +21 -21
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/separator/separator.js +5 -5
- package/dist/components/ui/separator/separator.js.map +1 -1
- package/dist/components/ui/sheet/sheet.js +6 -6
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/skeleton/skeleton.js +1 -1
- package/dist/components/ui/skeleton/skeleton.js.map +1 -1
- package/dist/components/ui/slider/slider.js +5 -5
- package/dist/components/ui/slider/slider.js.map +1 -1
- package/dist/components/ui/spinner/spinner.js +5 -5
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +2 -2
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.js +4 -4
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/table/table.js +1 -1
- package/dist/components/ui/table/table.js.map +1 -1
- package/dist/components/ui/tabs/tabs.js +7 -7
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/text-link/text-link.js +1 -1
- package/dist/components/ui/text-link/text-link.js.map +1 -1
- package/dist/components/ui/textarea/textarea.js +2 -2
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.js +7 -7
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/toggle/toggle.js +6 -6
- package/dist/components/ui/toggle/toggle.js.map +1 -1
- package/dist/components/ui/toggle-group/toggle-group.js +7 -8
- package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.js +6 -6
- package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
- package/dist/components/ui/tooltip/lazy-tooltip.js +2 -2
- package/dist/components/ui/tooltip/tooltip.js +10 -10
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/components/ui/trace/trace.js +19 -19
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.js +2 -2
- package/dist/lib/accent-presets.js +1 -1
- package/dist/lib/accent-roles.js +2 -2
- package/dist/lib/async-action.js +1 -1
- package/dist/lib/create-poll.js +1 -1
- package/dist/lib/create-poll.js.map +1 -1
- package/dist/lib/external-link.js +1 -1
- package/dist/lib/external-link.js.map +1 -1
- package/dist/lib/fast-icon.js +1 -1
- package/dist/lib/theme-css.js +1 -1
- package/dist/lib/theme-engine-light.js +1 -1
- package/dist/lib/theme-projection.js +2 -2
- package/dist/lib/theme-records.js +1 -1
- package/dist/lib/themes.js +1 -1
- package/dist/lib/themes.js.map +1 -1
- package/dist/lib/tooltip-focus-gate.js.map +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/vite/source-parser.js +1 -1
- package/dist/vite/tailwind-sources.js +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","names":["<SdkProgress\n data-slot=\"progress\"\n class={cn('flex w-full flex-col gap-1.5', props.class as string)}\n value={props.indeterminate ? null : (props.value ?? min())}\n min={min()}\n max={max()}\n getValueLabel={props.getValueLabel ? (value) => words(value) ?? '' : undefined}\n {...rest}\n >\n <Show when={props.label || !props.hideValue}>\n <div class=\"flex items-center justify-between gap-3\">\n <Show when={props.label}>\n {(labelSlot) => (\n <SdkProgressLabel class=\"text-muted-foreground text-sm\">\n {labelSlot()}\n </SdkProgressLabel>\n )}\n </Show>\n <Show when={!props.hideValue}>\n <SdkProgressValue class=\"text-muted-foreground text-sm tabular-nums\">\n {(state) =>\n props.getValueLabel && state.value !== null ? words(state.value) : state.text\n }\n </SdkProgressValue>\n </Show>\n </div>\n </Show>\n <SdkProgressTrack\n class={cn('bg-input relative h-1.5 w-full overflow-hidden rounded-full', props.trackClass)}\n >\n {/* ui-sdk sizes the indicator inline and sets `--progress-value` on the root. */}\n <SdkProgressIndicator\n class={cn(\n 'bg-primary h-full rounded-full',\n {\n 'animate-indeterminate w-1/4': props.indeterminate,\n 'w-(--progress-value)': !props.indeterminate,\n },\n props.indicatorClass\n )}\n />\n </SdkProgressTrack>\n </SdkProgress>","props.indeterminate ? null : (props.value ?? min())","<Show when={props.label || !props.hideValue}>\n <div class=\"flex items-center justify-between gap-3\">\n <Show when={props.label}>\n {(labelSlot) => (\n <SdkProgressLabel class=\"text-muted-foreground text-sm\">\n {labelSlot()}\n </SdkProgressLabel>\n )}\n </Show>\n <Show when={!props.hideValue}>\n <SdkProgressValue class=\"text-muted-foreground text-sm tabular-nums\">\n {(state) =>\n props.getValueLabel && state.value !== null ? words(state.value) : state.text\n }\n </SdkProgressValue>\n </Show>\n </div>\n </Show>","<Show when={props.label}>\n {(labelSlot) => (\n <SdkProgressLabel class=\"text-muted-foreground text-sm\">\n {labelSlot()}\n </SdkProgressLabel>\n )}\n </Show>","<SdkProgressLabel class=\"text-muted-foreground text-sm\">\n {labelSlot()}\n </SdkProgressLabel>","class=\"text-muted-foreground text-sm\"","<div class=\"flex items-center justify-between gap-3\">\n <Show when={props.label}>\n {(labelSlot) => (\n <SdkProgressLabel class=\"text-muted-foreground text-sm\">\n {labelSlot()}\n </SdkProgressLabel>\n )}\n </Show>\n <Show when={!props.hideValue}>\n <SdkProgressValue class=\"text-muted-foreground text-sm tabular-nums\">\n {(state) =>\n props.getValueLabel && state.value !== null ? words(state.value) : state.text\n }\n </SdkProgressValue>\n </Show>\n </div>","<SdkProgressValue class=\"text-muted-foreground text-sm tabular-nums\">\n {(state) =>\n props.getValueLabel && state.value !== null ? words(state.value) : state.text\n }\n </SdkProgressValue>","class=\"text-muted-foreground text-sm tabular-nums\"","<SdkProgressTrack\n class={cn('bg-input relative h-1.5 w-full overflow-hidden rounded-full', props.trackClass)}\n >\n {/* ui-sdk sizes the indicator inline and sets `--progress-value` on the root. */}\n <SdkProgressIndicator\n class={cn(\n 'bg-primary h-full rounded-full',\n {\n 'animate-indeterminate w-1/4': props.indeterminate,\n 'w-(--progress-value)': !props.indeterminate,\n },\n props.indicatorClass\n )}\n />\n </SdkProgressTrack>","<SdkProgressIndicator\n class={cn(\n 'bg-primary h-full rounded-full',\n {\n 'animate-indeterminate w-1/4': props.indeterminate,\n 'w-(--progress-value)': !props.indeterminate,\n },\n props.indicatorClass\n )}\n />","Progress"],"sources":["../../../../src/components/ui/progress/progress.tsx"],"sourcesContent":["import {\n Progress as SdkProgress,\n ProgressIndicator as SdkProgressIndicator,\n ProgressLabel as SdkProgressLabel,\n ProgressTrack as SdkProgressTrack,\n ProgressValue as SdkProgressValue,\n} from '@ui-sdk/solid/progress'\nimport type { ComponentProps } from '@solidjs/web'\nimport { Show, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Progress.\n *\n * A determinate bar. ui-sdk's Progress publishes the value as `aria-valuenow`, so a\n * screen reader reports the percentage instead of just \"progress bar\" — which\n * is why a caller must pass a real `value`, or use Spinner when there is none.\n *\n * `indeterminate` renders the sweeping bar for an operation that reports no\n * progress at all. It is a visibly different treatment so the two states are\n * never confused by someone glancing at the screen.\n */\nexport type ProgressProps = Omit<\n ComponentProps<typeof SdkProgress>,\n 'value' | 'min' | 'max' | 'getValueLabel' | 'children'\n> & {\n /** How far the task has come, between `minValue` and `maxValue`. */\n value?: number\n /** The lowest value; 0 by default. */\n minValue?: number\n /** The highest value; 100 by default. */\n maxValue?: number\n /** The task is under way but reports no progress: the sweeping bar, and no value. */\n indeterminate?: boolean\n /**\n * The value as words, like \"3 of 12 files\". It is both the readout beside\n * the track and what a screen reader announces; without it both read the\n * percentage.\n */\n getValueLabel?: (params: { value: number; min: number; max: number }) => string\n /**\n * The visible label, which is also the bar's accessible name.\n *\n * Pass this, or `aria-label` when the label is drawn elsewhere. A progressbar\n * with neither announces \"progress bar, 64%\" and no subject — the reader\n * cannot tell whether it is a build, an upload or a download.\n */\n label?: string\n trackClass?: string\n indicatorClass?: string\n /** Hide the numeric readout that otherwise sits beside the track. */\n hideValue?: boolean\n}\n\nexport function Progress(props: ProgressProps) {\n const rest = omit(\n props,\n 'class',\n 'trackClass',\n 'indicatorClass',\n 'hideValue',\n 'label',\n 'value',\n 'minValue',\n 'maxValue',\n 'indeterminate',\n 'getValueLabel'\n )\n const min = () => props.minValue ?? 0\n const max = () => props.maxValue ?? 100\n const words = (value: number | null) =>\n props.getValueLabel?.({ value: value ?? min(), min: min(), max: max() })\n\n return (\n <SdkProgress\n data-slot=\"progress\"\n class={cn('flex w-full flex-col gap-1.5', props.class as string)}\n value={props.indeterminate ? null : (props.value ?? min())}\n min={min()}\n max={max()}\n getValueLabel={props.getValueLabel ? (value) => words(value) ?? '' : undefined}\n {...rest}\n >\n <Show when={props.label || !props.hideValue}>\n <div class=\"flex items-center justify-between gap-3\">\n <Show when={props.label}>\n {(labelSlot) => (\n <SdkProgressLabel class=\"text-muted-foreground text-sm\">\n {labelSlot()}\n </SdkProgressLabel>\n )}\n </Show>\n <Show when={!props.hideValue}>\n <SdkProgressValue class=\"text-muted-foreground text-sm tabular-nums\">\n {(state) =>\n props.getValueLabel && state.value !== null ? words(state.value) : state.text\n }\n </SdkProgressValue>\n </Show>\n </div>\n </Show>\n <SdkProgressTrack\n class={cn('bg-input relative h-1.5 w-full overflow-hidden rounded-full', props.trackClass)}\n >\n {/* ui-sdk sizes the indicator inline and sets `--progress-value` on the root. */}\n <SdkProgressIndicator\n class={cn(\n 'bg-primary h-full rounded-full',\n {\n 'animate-indeterminate w-1/4': props.indeterminate,\n 'w-(--progress-value)': !props.indeterminate,\n },\n props.indicatorClass\n )}\n />\n </SdkProgressTrack>\n </SdkProgress>\n )\n}\n"],"mappings":";;;;;;AAsDA,SAAgBW,WAAS,OAAsB;CAC7C,MAAM,OAAO,KACX,OACA,SACA,cACA,kBACA,aACA,SACA,SACA,YACA,YACA,iBACA,eACF;CACA,MAAM,YAAY,MAAM,YAAY;CACpC,MAAM,YAAY,MAAM,YAAY;CACpC,MAAM,SAAS,UACb,MAAM,gBAAgB;EAAE,OAAO,SAAS,IAAI;EAAG,KAAK,IAAI;EAAG,KAAK,IAAI;CAAE,CAAC;CAEzE,OACEX,gBAAAA,UAAAA,WAAAA;EACE,aAAU;EACV,IAAA,UAAA;GAAO,OAAA,GAAG,gCAAgC,MAAM,KAAe;EAAC;EAChE,IAAA,QAAA;GAAOC,OAAAA,WAAAA;IAAM,OAAA,CAAA,CAAA,MAAA;GAA4C,CAAA,CAAC,CAAD,IAA5B,OAAQ,MAAM,SAAS,IAAI;EAAE;EAC1D,IAAA,MAAA;GAAK,OAAA,IAAI;EAAC;EACV,IAAA,MAAA;GAAK,OAAA,IAAI;EAAC;EACV,IAAA,gBAAA;GAAe,OAAA,MAAM,iBAAiB,UAAU,MAAM,KAAK,KAAK,KAAK,KAAA;EAAS;CAoCnE,GAnCP,MAPN,EAAA,IAAA,WAAA;EAQC,OAAA,CACCC,gBAAAA,MAAAA;GAAM,IAAA,OAAA;IAAM,OAAA,MAAM,SAAS,CAAC,MAAM;GAAS;GAA3C,IAAA,WAAA;IACE,IAAA,OAAA,OAeK;IAfL,IAAA,QAAA,KAAA;;IACEC,OAAAA,MAAAA,gBAAAA,MAAAA;KAAM,IAAA,OAAA;MAAM,OAAA,MAAM;KAAK;KAAvBA,WACI,cACAC,gBAAAA,eAAAA;MAAkBC,OAAM;MAAxB,IAAA,WAAA;OACG,OAAA,UAAU;MACK;;IAEhB,CAAA,GAPRC,KAeK;IAfL,OAAA,aAQE;;MAAY,OAAA,CAAC,MAAM;KAMb,CAAA;KANN,aAAA;MAMM,OAAA,IAAA,IALJC,gBAAAA,eAAAA;OAAkBC,OAAM;OAAxBD,WACI,UACA,MAAM,iBAAiB,MAAM,UAAU,OAAO,MAAM,MAAM,KAAK,IAAI,MAAM;MAE3D,CAAA,IALpB,KAAA;KAMM;IAAC,EAAA,CAAD,GAdRD,KAeK;IAhBP,OACEA;GAgBI;EACNG,CAAAA,GAAAA,gBAAAA,eAAAA;GACE,IAAA,UAAA;IAAO,OAAA,GAAG,+DAA+D,MAAM,UAAU;GAAC;GAD5F,IAAA,WAAA;IAIEC,OAAAA,gBAAAA,mBAAAA,EACE,IAAA,UAAA;KAAO,OAAA,GACL,kCACA;MACE,+BAA+B,MAAM;MACrC,wBAAwB,CAAC,MAAM;KACjC,GACA,MAAM,cACR;IAAC,EACF,CAAA;GACe;EAhCnB,CAAA,CAAA;CAiCY,EAAA,CAAA,CAAA;AAEjB"}
|
|
1
|
+
{"version":3,"file":"progress.js","names":["<SdkProgress\n data-slot=\"progress\"\n class={cn('flex w-full flex-col gap-1.5', props.class as string)}\n value={props.indeterminate ? null : (props.value ?? min())}\n min={min()}\n max={max()}\n getValueLabel={props.getValueLabel ? (value) => words(value) ?? '' : undefined}\n {...rest}\n >\n <Show when={props.label || !props.hideValue}>\n <div class=\"flex items-center justify-between gap-3\">\n <Show when={props.label}>\n {(labelSlot) => (\n <SdkProgressLabel class=\"text-muted-foreground text-sm\">\n {labelSlot()}\n </SdkProgressLabel>\n )}\n </Show>\n <Show when={!props.hideValue}>\n <SdkProgressValue class=\"text-muted-foreground text-sm tabular-nums\">\n {(state) =>\n props.getValueLabel && state.value !== null ? words(state.value) : state.text\n }\n </SdkProgressValue>\n </Show>\n </div>\n </Show>\n <SdkProgressTrack\n class={cn('bg-input relative h-1.5 w-full overflow-hidden rounded-full', props.trackClass)}\n >\n {/* ui-sdk sizes the indicator inline and sets `--progress-value` on the root. */}\n <SdkProgressIndicator\n class={cn(\n 'bg-primary h-full rounded-full',\n {\n 'animate-indeterminate w-1/4': props.indeterminate,\n 'w-(--progress-value)': !props.indeterminate,\n },\n props.indicatorClass\n )}\n />\n </SdkProgressTrack>\n </SdkProgress>","props.indeterminate ? null : (props.value ?? min())","<Show when={props.label || !props.hideValue}>\n <div class=\"flex items-center justify-between gap-3\">\n <Show when={props.label}>\n {(labelSlot) => (\n <SdkProgressLabel class=\"text-muted-foreground text-sm\">\n {labelSlot()}\n </SdkProgressLabel>\n )}\n </Show>\n <Show when={!props.hideValue}>\n <SdkProgressValue class=\"text-muted-foreground text-sm tabular-nums\">\n {(state) =>\n props.getValueLabel && state.value !== null ? words(state.value) : state.text\n }\n </SdkProgressValue>\n </Show>\n </div>\n </Show>","<Show when={props.label}>\n {(labelSlot) => (\n <SdkProgressLabel class=\"text-muted-foreground text-sm\">\n {labelSlot()}\n </SdkProgressLabel>\n )}\n </Show>","<SdkProgressLabel class=\"text-muted-foreground text-sm\">\n {labelSlot()}\n </SdkProgressLabel>","class=\"text-muted-foreground text-sm\"","<div class=\"flex items-center justify-between gap-3\">\n <Show when={props.label}>\n {(labelSlot) => (\n <SdkProgressLabel class=\"text-muted-foreground text-sm\">\n {labelSlot()}\n </SdkProgressLabel>\n )}\n </Show>\n <Show when={!props.hideValue}>\n <SdkProgressValue class=\"text-muted-foreground text-sm tabular-nums\">\n {(state) =>\n props.getValueLabel && state.value !== null ? words(state.value) : state.text\n }\n </SdkProgressValue>\n </Show>\n </div>","<SdkProgressValue class=\"text-muted-foreground text-sm tabular-nums\">\n {(state) =>\n props.getValueLabel && state.value !== null ? words(state.value) : state.text\n }\n </SdkProgressValue>","class=\"text-muted-foreground text-sm tabular-nums\"","<SdkProgressTrack\n class={cn('bg-input relative h-1.5 w-full overflow-hidden rounded-full', props.trackClass)}\n >\n {/* ui-sdk sizes the indicator inline and sets `--progress-value` on the root. */}\n <SdkProgressIndicator\n class={cn(\n 'bg-primary h-full rounded-full',\n {\n 'animate-indeterminate w-1/4': props.indeterminate,\n 'w-(--progress-value)': !props.indeterminate,\n },\n props.indicatorClass\n )}\n />\n </SdkProgressTrack>","<SdkProgressIndicator\n class={cn(\n 'bg-primary h-full rounded-full',\n {\n 'animate-indeterminate w-1/4': props.indeterminate,\n 'w-(--progress-value)': !props.indeterminate,\n },\n props.indicatorClass\n )}\n />","_$insert"],"sources":["../../../../src/components/ui/progress/progress.tsx"],"sourcesContent":["import {\n Progress as SdkProgress,\n ProgressIndicator as SdkProgressIndicator,\n ProgressLabel as SdkProgressLabel,\n ProgressTrack as SdkProgressTrack,\n ProgressValue as SdkProgressValue,\n} from '@ui-sdk/solid/progress'\nimport type { ComponentProps } from '@solidjs/web'\nimport { Show, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Progress.\n *\n * A determinate bar. ui-sdk's Progress publishes the value as `aria-valuenow`, so a\n * screen reader reports the percentage instead of just \"progress bar\" — which\n * is why a caller must pass a real `value`, or use Spinner when there is none.\n *\n * `indeterminate` renders the sweeping bar for an operation that reports no\n * progress at all. It is a visibly different treatment so the two states are\n * never confused by someone glancing at the screen.\n */\nexport type ProgressProps = Omit<\n ComponentProps<typeof SdkProgress>,\n 'value' | 'min' | 'max' | 'getValueLabel' | 'children'\n> & {\n /** How far the task has come, between `minValue` and `maxValue`. */\n value?: number\n /** The lowest value; 0 by default. */\n minValue?: number\n /** The highest value; 100 by default. */\n maxValue?: number\n /** The task is under way but reports no progress: the sweeping bar, and no value. */\n indeterminate?: boolean\n /**\n * The value as words, like \"3 of 12 files\". It is both the readout beside\n * the track and what a screen reader announces; without it both read the\n * percentage.\n */\n getValueLabel?: (params: { value: number; min: number; max: number }) => string\n /**\n * The visible label, which is also the bar's accessible name.\n *\n * Pass this, or `aria-label` when the label is drawn elsewhere. A progressbar\n * with neither announces \"progress bar, 64%\" and no subject — the reader\n * cannot tell whether it is a build, an upload or a download.\n */\n label?: string\n trackClass?: string\n indicatorClass?: string\n /** Hide the numeric readout that otherwise sits beside the track. */\n hideValue?: boolean\n}\n\nexport function Progress(props: ProgressProps) {\n const rest = omit(\n props,\n 'class',\n 'trackClass',\n 'indicatorClass',\n 'hideValue',\n 'label',\n 'value',\n 'minValue',\n 'maxValue',\n 'indeterminate',\n 'getValueLabel'\n )\n const min = () => props.minValue ?? 0\n const max = () => props.maxValue ?? 100\n const words = (value: number | null) =>\n props.getValueLabel?.({ value: value ?? min(), min: min(), max: max() })\n\n return (\n <SdkProgress\n data-slot=\"progress\"\n class={cn('flex w-full flex-col gap-1.5', props.class as string)}\n value={props.indeterminate ? null : (props.value ?? min())}\n min={min()}\n max={max()}\n getValueLabel={props.getValueLabel ? (value) => words(value) ?? '' : undefined}\n {...rest}\n >\n <Show when={props.label || !props.hideValue}>\n <div class=\"flex items-center justify-between gap-3\">\n <Show when={props.label}>\n {(labelSlot) => (\n <SdkProgressLabel class=\"text-muted-foreground text-sm\">\n {labelSlot()}\n </SdkProgressLabel>\n )}\n </Show>\n <Show when={!props.hideValue}>\n <SdkProgressValue class=\"text-muted-foreground text-sm tabular-nums\">\n {(state) =>\n props.getValueLabel && state.value !== null ? words(state.value) : state.text\n }\n </SdkProgressValue>\n </Show>\n </div>\n </Show>\n <SdkProgressTrack\n class={cn('bg-input relative h-1.5 w-full overflow-hidden rounded-full', props.trackClass)}\n >\n {/* ui-sdk sizes the indicator inline and sets `--progress-value` on the root. */}\n <SdkProgressIndicator\n class={cn(\n 'bg-primary h-full rounded-full',\n {\n 'animate-indeterminate w-1/4': props.indeterminate,\n 'w-(--progress-value)': !props.indeterminate,\n },\n props.indicatorClass\n )}\n />\n </SdkProgressTrack>\n </SdkProgress>\n )\n}\n"],"mappings":";;;;;;AAsDA,SAAgB,SAAS,OAAsB;CAC7C,MAAM,OAAO,KACX,OACA,SACA,cACA,kBACA,aACA,SACA,SACA,YACA,YACA,iBACA,eACF;CACA,MAAM,YAAY,MAAM,YAAY;CACpC,MAAM,YAAY,MAAM,YAAY;CACpC,MAAM,SAAS,UACb,MAAM,gBAAgB;EAAE,OAAO,SAAS,IAAI;EAAG,KAAK,IAAI;EAAG,KAAK,IAAI;CAAE,CAAC;CAEzE,OACEA,gBAAAA,YAAAA,WAAAA;EACE,aAAU;EACV,IAAA,UAAA;GAAO,OAAA,GAAG,gCAAgC,MAAM,KAAe;EAAC;EAChE,IAAA,QAAA;GAAOC,OAAAA,WAAAA;IAAM,OAAA,CAAA,CAAA,MAAA;GAA4C,CAAA,CAAC,CAAD,IAA5B,OAAQ,MAAM,SAAS,IAAI;EAAE;EAC1D,IAAA,MAAA;GAAK,OAAA,IAAI;EAAC;EACV,IAAA,MAAA;GAAK,OAAA,IAAI;EAAC;EACV,IAAA,gBAAA;GAAe,OAAA,MAAM,iBAAiB,UAAU,MAAM,KAAK,KAAK,KAAK,KAAA;EAAS;CAoCnE,GAnCP,MAPN,EAAA,IAAA,WAAA;EAQC,OAAA,CACCC,gBAAAA,MAAAA;GAAM,IAAA,OAAA;IAAM,OAAA,MAAM,SAAS,CAAC,MAAM;GAAS;GAA3C,IAAA,WAAA;IACE,IAAA,OAAA,OAeK;IAfL,IAAA,QAAA,KAAA;;IACEC,OAAAA,MAAAA,gBAAAA,MAAAA;KAAM,IAAA,OAAA;MAAM,OAAA,MAAM;KAAK;KAAvBA,WACI,cACAC,gBAAAA,eAAAA;MAAkBC,OAAM;MAAxB,IAAA,WAAA;OACG,OAAA,UAAU;MACK;;IAEhB,CAAA,GAPRC,KAeK;IAfLK,OAAA,aAQE;;MAAY,OAAA,CAAC,MAAM;KAMb,CAAA;KANN,aAAA;MAMM,OAAA,IAAA,IALJJ,gBAAAA,eAAAA;OAAkBC,OAAM;OAAxBD,WACI,UACA,MAAM,iBAAiB,MAAM,UAAU,OAAO,MAAM,MAAM,KAAK,IAAI,MAAM;MAE3D,CAAA,IALpB,KAAA;KAMM;IAAC,EAAA,CAAD,GAdRD,KAeK;IAhBP,OACEA;GAgBI;EACNG,CAAAA,GAAAA,gBAAAA,eAAAA;GACE,IAAA,UAAA;IAAO,OAAA,GAAG,+DAA+D,MAAM,UAAU;GAAC;GAD5F,IAAA,WAAA;IAIEC,OAAAA,gBAAAA,mBAAAA,EACE,IAAA,UAAA;KAAO,OAAA,GACL,kCACA;MACE,+BAA+B,MAAM;MACrC,wBAAwB,CAAC,MAAM;KACjC,GACA,MAAM,cACR;IAAC,EACF,CAAA;GACe;EAhCnB,CAAA,CAAA;CAiCY,EAAA,CAAA,CAAA;AAEjB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { createComponent, effect, insert, memo, ref, setAttribute, spread, template } from "@solidjs/web";
|
|
2
|
+
import { Check as Check$1, CircleHelp as CircleHelp$1, Clock as Clock$1, LoaderCircle as LoaderCircle$1 } from "@lucide/solid";
|
|
3
|
+
import { For, Show, createEffect, createMemo, createSignal, createUniqueId, omit } from "solid-js";
|
|
1
4
|
import { cn } from "../../../lib/utils.js";
|
|
2
5
|
import { Button } from "../button/button.js";
|
|
3
6
|
import { Checkbox } from "../checkbox/checkbox.js";
|
|
4
7
|
import { RadioGroup, RadioGroupItem } from "../radio-group/radio-group.js";
|
|
5
8
|
import { Textarea } from "../textarea/textarea.js";
|
|
6
9
|
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
7
|
-
import { createComponent, effect, insert, memo, ref, setAttribute, spread, template } from "@solidjs/web";
|
|
8
|
-
import { Check, CircleHelp, Clock, LoaderCircle } from "@lucide/solid";
|
|
9
|
-
import { For, Show, createEffect, createMemo, createSignal, createUniqueId, omit } from "solid-js";
|
|
10
10
|
// src/components/ui/questionnaire/questionnaire.tsx
|
|
11
11
|
var _tmpl$ = /* @__PURE__ */ template(`<section><header class="flex items-start gap-2.5"><span aria-hidden=true class="mt-0.5 text-muted-foreground [&_svg]:size-4"></span><div class="min-w-0 flex-1"><h3 class="m-0 text-sm font-semibold"></h3></div><!><!>`);
|
|
12
12
|
var _tmpl$2 = /* @__PURE__ */ template(`<p class="m-0 mt-0.5 text-xs text-muted-foreground">`);
|
|
@@ -23,10 +23,10 @@ var _tmpl$12 = /* @__PURE__ */ template(`<div class="flex flex-col gap-1"><label
|
|
|
23
23
|
var _tmpl$13 = /* @__PURE__ */ template(`<p role=alert class="m-0 text-xs text-destructive">`);
|
|
24
24
|
var _tmpl$14 = /* @__PURE__ */ template(`<span>`);
|
|
25
25
|
var _tmpl$15 = /* @__PURE__ */ template(`<div class="flex flex-col gap-0.5"><dt class="text-xs text-muted-foreground"></dt><dd class="m-0 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap">`);
|
|
26
|
-
var Check
|
|
27
|
-
var CircleHelp
|
|
28
|
-
var Clock
|
|
29
|
-
var LoaderCircle
|
|
26
|
+
var Check = fastIcon(Check$1);
|
|
27
|
+
var CircleHelp = fastIcon(CircleHelp$1);
|
|
28
|
+
var Clock = fastIcon(Clock$1);
|
|
29
|
+
var LoaderCircle = fastIcon(LoaderCircle$1);
|
|
30
30
|
var EMPTY = {
|
|
31
31
|
optionIds: [],
|
|
32
32
|
text: ""
|
|
@@ -146,7 +146,7 @@ function Questionnaire(props) {
|
|
|
146
146
|
return status() === "expired";
|
|
147
147
|
});
|
|
148
148
|
return () => {
|
|
149
|
-
return _c$() ? createComponent(Clock
|
|
149
|
+
return _c$() ? createComponent(Clock, {}) : createComponent(CircleHelp, {});
|
|
150
150
|
};
|
|
151
151
|
})());
|
|
152
152
|
insert(_el$5, () => {
|
|
@@ -170,7 +170,7 @@ function Questionnaire(props) {
|
|
|
170
170
|
return _c$2() ? (() => {
|
|
171
171
|
var _el$9 = _tmpl$3();
|
|
172
172
|
var _el$10 = _el$9.firstChild;
|
|
173
|
-
insert(_el$9, createComponent(Check
|
|
173
|
+
insert(_el$9, createComponent(Check, {
|
|
174
174
|
"aria-hidden": "true",
|
|
175
175
|
class: "size-3.5"
|
|
176
176
|
}), _el$10);
|
|
@@ -427,7 +427,7 @@ function Questionnaire(props) {
|
|
|
427
427
|
return status() === "submitting";
|
|
428
428
|
},
|
|
429
429
|
get children() {
|
|
430
|
-
return createComponent(LoaderCircle
|
|
430
|
+
return createComponent(LoaderCircle, {
|
|
431
431
|
"aria-hidden": "true",
|
|
432
432
|
class: "motion-safe:animate-spin"
|
|
433
433
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"questionnaire.js","names":["tabindex=\"-1\"","onFocusIn={() => (focusWithin = true)}","onFocusOut={(event) => {\n // Moving to another element ends it; a control disappearing does not.\n const next = event.relatedTarget\n if (next instanceof Node && !event.currentTarget.contains(next)) focusWithin = false\n }}","ref={(element) => (root = element)}","<Clock />","<CircleHelp />","<Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>","<Check aria-hidden=\"true\" class=\"size-3.5\" />","class=\"size-3.5\"","<span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>","<header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={status() === 'expired'} fallback={<CircleHelp />}>\n <Clock />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"m-0 text-sm font-semibold\">{local.title ?? 'The agent has a question'}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={status() === 'answered'}>\n <span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>\n </Show>\n <Show when={status() === 'expired'}>\n <span class=\"text-xs text-muted-foreground\">No longer waiting</span>\n </Show>\n </header>","<span class=\"text-xs text-muted-foreground\">No longer waiting</span>","<Show when={current()} keyed>\n {(question) => (\n <fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>\n )}\n </Show>","<span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>","<legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>","ref={(element) => (questionHeading = element)}","<Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>","<For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>","<Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />","onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}","<RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>","onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }","<For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>","<RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />","variant=\"card\"","<fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>","<Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />","rows={2}","onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }","<Show when={submitReason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>\n </Show>","<p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>","<Show when={local.error}>\n {(errorSlot) => (\n <p role=\"alert\" class=\"m-0 text-xs text-destructive\">\n {errorSlot()}\n </p>\n )}\n </Show>","<Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>","type=\"button\"","variant=\"ghost\"","size=\"sm\"","onClick={() => setStep((value) => Math.max(0, value - 1))}","<span />","<footer class=\"flex items-center justify-between gap-2\">\n <Show when={count() > 1} fallback={<span />}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>\n </Show>\n <Show\n when={last()}\n fallback={\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>\n </Show>\n </footer>","<Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>","onClick={() => void submit()}","<Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>","<LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />","class=\"motion-safe:animate-spin\"","local.submitLabel ?? 'Send answer'","<Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>","onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}","<For each={summary()}>\n {(entry) => (\n <div class=\"flex flex-col gap-0.5\">\n <dt class=\"text-xs text-muted-foreground\">{entry.question.prompt}</dt>\n <dd class=\"m-0 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap\">\n {entry.parts.length > 0 ? entry.parts.join(', ') : 'Skipped'}\n </dd>\n </div>\n )}\n </For>","<section\n ref={(element) => (root = element)}\n data-slot=\"questionnaire\"\n data-status={status()}\n aria-label={local.title ?? 'Question from the agent'}\n // Not a tab stop: only the landing place for focus when a control goes away.\n tabindex=\"-1\"\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n 'border-border': settled(),\n 'border-ring': !settled(),\n },\n local.class\n )}\n onKeyDown={onKeyDown}\n onFocusIn={() => (focusWithin = true)}\n onFocusOut={(event) => {\n // Moving to another element ends it; a control disappearing does not.\n const next = event.relatedTarget\n if (next instanceof Node && !event.currentTarget.contains(next)) focusWithin = false\n }}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={status() === 'expired'} fallback={<CircleHelp />}>\n <Clock />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"m-0 text-sm font-semibold\">{local.title ?? 'The agent has a question'}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={status() === 'answered'}>\n <span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>\n </Show>\n <Show when={status() === 'expired'}>\n <span class=\"text-xs text-muted-foreground\">No longer waiting</span>\n </Show>\n </header>\n\n <Show\n when={!settled()}\n fallback={\n <dl class=\"m-0 flex flex-col gap-2\">\n <For each={summary()}>\n {(entry) => (\n <div class=\"flex flex-col gap-0.5\">\n <dt class=\"text-xs text-muted-foreground\">{entry.question.prompt}</dt>\n <dd class=\"m-0 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap\">\n {entry.parts.length > 0 ? entry.parts.join(', ') : 'Skipped'}\n </dd>\n </div>\n )}\n </For>\n </dl>\n }\n >\n <Show when={current()} keyed>\n {(question) => (\n <fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>\n )}\n </Show>\n\n <Show when={submitReason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>\n </Show>\n <Show when={local.error}>\n {(errorSlot) => (\n <p role=\"alert\" class=\"m-0 text-xs text-destructive\">\n {errorSlot()}\n </p>\n )}\n </Show>\n\n <footer class=\"flex items-center justify-between gap-2\">\n <Show when={count() > 1} fallback={<span />}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>\n </Show>\n <Show\n when={last()}\n fallback={\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>\n </Show>\n </footer>\n </Show>\n </section>","Check","LucideCheck","CircleHelp","LucideCircleHelp","Clock","LucideClock","LoaderCircle","LucideLoaderCircle"],"sources":["../../../../src/components/ui/questionnaire/questionnaire.tsx"],"sourcesContent":["import {\n Check as LucideCheck,\n CircleHelp as LucideCircleHelp,\n Clock as LucideClock,\n LoaderCircle as LucideLoaderCircle,\n} from '@lucide/solid'\nimport { createEffect, createMemo, createSignal, createUniqueId, For, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\nimport { Checkbox } from '../checkbox'\nimport { RadioGroup, RadioGroupItem } from '../radio-group'\nimport { Textarea } from '../textarea'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst CircleHelp = fastIcon(LucideCircleHelp)\nconst Clock = fastIcon(LucideClock)\nconst LoaderCircle = fastIcon(LucideLoaderCircle)\n\n/**\n * Questionnaire.\n *\n * The agent has stopped and is asking the person something before it continues.\n * This is the one place in a transcript where the reader *must* act, so it is\n * the one element allowed to look like a card — and it only ever asks what the\n * runtime actually asked.\n *\n * ## What it models\n *\n * One question or several. Each has a prompt and, optionally, a closed set of\n * options (single choice, or `multiple`) and/or a free-text answer. A question\n * with only a prompt is a text box; the runtime contract that exists today is\n * exactly that. Options are shown only when the producer supplied them, which is\n * why they are data here and not something this component can invent.\n *\n * Several questions are asked one at a time, with \"Question 2 of 3\" and Back /\n * Next, because a wall of unrelated fields is how a person answers none of them\n * well. Moving between them returns focus to the question, so a screen-reader\n * user hears what they are now answering.\n *\n * ## It does not decide whether you may answer\n *\n * `status` and `disabledReason` come from the host, which owns authority (is\n * this session connected, is the generation current, does this client have the\n * input). A disabled questionnaire says *why* in words next to the button.\n * `answered` and `expired` render the exchange read-only, so a settled question\n * stays in the record as what was asked and what was answered.\n *\n * Submit is `Cmd/Ctrl+Enter` from any text field; plain Enter stays a newline.\n */\nexport type QuestionnaireOption = Readonly<{\n id: string\n label: string\n description?: string\n}>\n\nexport type QuestionnaireQuestion = Readonly<{\n id: string\n prompt: string\n description?: string\n options?: readonly QuestionnaireOption[]\n /** Allow more than one option. */\n multiple?: boolean\n /** Offer a free-text answer (always present when there are no options). */\n allowText?: boolean\n textLabel?: string\n textPlaceholder?: string\n /** The question may be skipped. */\n optional?: boolean\n}>\n\nexport type QuestionnaireAnswer = Readonly<{ optionIds: readonly string[]; text: string }>\nexport type QuestionnaireAnswers = Readonly<Record<string, QuestionnaireAnswer>>\nexport type QuestionnaireStatus = 'open' | 'submitting' | 'answered' | 'expired'\n\nconst EMPTY: QuestionnaireAnswer = { optionIds: [], text: '' }\n\n/**\n * The answer a record holds for a question. Question ids are host strings, and\n * the record is an ordinary object, so `constructor`, `toString` and `__proto__`\n * are valid ids that a plain index would resolve to inherited values and a\n * summary or a validity check would then read `optionIds` from.\n */\nexport function answerFor(\n record: QuestionnaireAnswers,\n question: Pick<QuestionnaireQuestion, 'id'>\n): QuestionnaireAnswer | undefined {\n return Object.hasOwn(record, question.id) ? record[question.id] : undefined\n}\n\n/** Whether a question has what it needs. */\nexport function isQuestionAnswered(\n question: QuestionnaireQuestion,\n answer: QuestionnaireAnswer | undefined\n): boolean {\n if (question.optional) return true\n return (answer?.optionIds.length ?? 0) > 0 || (answer?.text.trim().length ?? 0) > 0\n}\n\nexport type QuestionnaireProps = Omit<ComponentProps<'section'>, 'onSubmit' | 'title'> & {\n questions: readonly QuestionnaireQuestion[]\n title?: string\n description?: string\n status?: QuestionnaireStatus\n answers?: QuestionnaireAnswers\n defaultAnswers?: QuestionnaireAnswers\n onAnswersChange?: (answers: QuestionnaireAnswers) => void\n onSubmit?: (answers: QuestionnaireAnswers) => void | Promise<void>\n /** Why answering is not possible right now; shown beside the button. */\n disabledReason?: string\n /** A failed submit, in words. */\n error?: string\n submitLabel?: string\n}\n\nexport function Questionnaire(props: QuestionnaireProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'questions',\n 'title',\n 'description',\n 'status',\n 'answers',\n 'defaultAnswers',\n 'onAnswersChange',\n 'onSubmit',\n 'disabledReason',\n 'error',\n 'submitLabel'\n )\n const uid = createUniqueId()\n const [internal, setInternal] = createSignal<QuestionnaireAnswers>(\n () => local.defaultAnswers ?? {}\n )\n const [step, setStep] = createSignal(0)\n const answers = () => local.answers ?? internal()\n const status = () => local.status ?? 'open'\n const settled = () => status() === 'answered' || status() === 'expired'\n const hostDisabledReason = () => (local.disabledReason?.trim() ? local.disabledReason : undefined)\n const locked = () => status() !== 'open' || hostDisabledReason() !== undefined\n const count = () => local.questions.length\n const current = () => local.questions[Math.min(step(), count() - 1)]\n const last = () => step() >= count() - 1\n const reasonId = `${uid}-reason`\n const submitReason = () =>\n hostDisabledReason() ??\n (status() === 'open' && last() && local.onSubmit === undefined\n ? 'Sending answers is not available here.'\n : undefined)\n let questionHeading: HTMLHeadingElement | undefined\n\n const answerOf = (question: QuestionnaireQuestion) => answerFor(answers(), question) ?? EMPTY\n const change = (question: QuestionnaireQuestion, next: QuestionnaireAnswer) => {\n const value = { ...answers(), [question.id]: next }\n if (local.answers === undefined) setInternal(value)\n local.onAnswersChange?.(value)\n }\n\n const canAdvance = () => {\n const question = current()\n return question !== undefined && isQuestionAnswered(question, answerFor(answers(), question))\n }\n const canSubmit = () =>\n local.questions.every((question) =>\n isQuestionAnswered(question, answerFor(answers(), question))\n )\n\n // A host that is slow to report `submitting` must not be handed the same answer\n // twice by a second Ctrl+Enter or a double click.\n let sending = false\n const submit = async () => {\n if (sending || locked() || !canSubmit() || local.onSubmit === undefined) return\n sending = true\n try {\n await local.onSubmit?.(answers())\n } finally {\n sending = false\n }\n }\n\n // The control that had focus is removed when the exchange settles into its\n // read-only record. Give focus to the record instead of dropping it on <body>,\n // but only if it was inside this questionnaire to begin with.\n let root: HTMLElement | undefined\n let focusWithin = false\n // Memoised, so open -> submitting (both unsettled) does not re-run the effect.\n const isSettled = createMemo(settled)\n createEffect(\n isSettled,\n (done) => {\n if (done && focusWithin && document.activeElement === document.body) {\n root?.focus({ preventScroll: true })\n }\n focusWithin = false\n },\n { defer: true }\n )\n\n // Land on the new question when the step changes, not on the Next button that\n // has just been replaced by one for a different question.\n createEffect(\n step,\n () => {\n questionHeading?.focus()\n },\n { defer: true }\n )\n\n const onKeyDown: JSX.EventHandler<HTMLElement, KeyboardEvent> = (event) => {\n if (event.key === 'Enter' && (event.metaKey || event.ctrlKey) && last()) {\n event.preventDefault()\n void submit()\n }\n }\n\n const summary = createMemo(() =>\n local.questions.map((question) => {\n const answer = answerFor(answers(), question) ?? EMPTY\n const chosen = (question.options ?? [])\n .filter((option) => answer.optionIds.includes(option.id))\n .map((option) => option.label)\n return {\n question,\n parts: [...chosen, ...(answer.text.trim() ? [answer.text.trim()] : [])],\n }\n })\n )\n\n return (\n <section\n ref={(element) => (root = element)}\n data-slot=\"questionnaire\"\n data-status={status()}\n aria-label={local.title ?? 'Question from the agent'}\n // Not a tab stop: only the landing place for focus when a control goes away.\n tabindex=\"-1\"\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n 'border-border': settled(),\n 'border-ring': !settled(),\n },\n local.class\n )}\n onKeyDown={onKeyDown}\n onFocusIn={() => (focusWithin = true)}\n onFocusOut={(event) => {\n // Moving to another element ends it; a control disappearing does not.\n const next = event.relatedTarget\n if (next instanceof Node && !event.currentTarget.contains(next)) focusWithin = false\n }}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={status() === 'expired'} fallback={<CircleHelp />}>\n <Clock />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"m-0 text-sm font-semibold\">{local.title ?? 'The agent has a question'}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={status() === 'answered'}>\n <span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>\n </Show>\n <Show when={status() === 'expired'}>\n <span class=\"text-xs text-muted-foreground\">No longer waiting</span>\n </Show>\n </header>\n\n <Show\n when={!settled()}\n fallback={\n <dl class=\"m-0 flex flex-col gap-2\">\n <For each={summary()}>\n {(entry) => (\n <div class=\"flex flex-col gap-0.5\">\n <dt class=\"text-xs text-muted-foreground\">{entry.question.prompt}</dt>\n <dd class=\"m-0 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap\">\n {entry.parts.length > 0 ? entry.parts.join(', ') : 'Skipped'}\n </dd>\n </div>\n )}\n </For>\n </dl>\n }\n >\n <Show when={current()} keyed>\n {(question) => (\n <fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>\n )}\n </Show>\n\n <Show when={submitReason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>\n </Show>\n <Show when={local.error}>\n {(errorSlot) => (\n <p role=\"alert\" class=\"m-0 text-xs text-destructive\">\n {errorSlot()}\n </p>\n )}\n </Show>\n\n <footer class=\"flex items-center justify-between gap-2\">\n <Show when={count() > 1} fallback={<span />}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>\n </Show>\n <Show\n when={last()}\n fallback={\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>\n </Show>\n </footer>\n </Show>\n </section>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAMiD,UAAQ,SAASC,KAAW;AAClC,IAAMC,eAAa,SAASC,UAAgB;AAC5C,IAAMC,UAAQ,SAASC,KAAW;AAClC,IAAMC,iBAAe,SAASC,YAAkB;AA0DhD,IAAM,QAA6B;CAAE,WAAW,CAAC;CAAG,MAAM;AAAG;;;;;;;AAQ7D,SAAgB,UACd,QACA,UACiC;CACjC,OAAO,OAAO,OAAO,QAAQ,SAAS,EAAE,IAAI,OAAO,SAAS,MAAM,KAAA;AACpE;;AAGA,SAAgB,mBACd,UACA,QACS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ends it; a control disappearing does not.\n const next = event.relatedTarget\n if (next instanceof Node && !event.currentTarget.contains(next)) focusWithin = false\n }}","ref={(element) => (root = element)}","<Clock />","<CircleHelp />","<Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>","<Check aria-hidden=\"true\" class=\"size-3.5\" />","class=\"size-3.5\"","<span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>","<header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={status() === 'expired'} fallback={<CircleHelp />}>\n <Clock />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"m-0 text-sm font-semibold\">{local.title ?? 'The agent has a question'}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={status() === 'answered'}>\n <span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>\n </Show>\n <Show when={status() === 'expired'}>\n <span class=\"text-xs text-muted-foreground\">No longer waiting</span>\n </Show>\n </header>","<span class=\"text-xs text-muted-foreground\">No longer waiting</span>","<Show when={current()} keyed>\n {(question) => (\n <fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>\n )}\n </Show>","<span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>","<legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>","ref={(element) => (questionHeading = element)}","<Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>","<For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>","<Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />","onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}","<RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>","onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }","<For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>","<RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />","variant=\"card\"","<fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>","<Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />","rows={2}","onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }","<Show when={submitReason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>\n </Show>","<p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>","<Show when={local.error}>\n {(errorSlot) => (\n <p role=\"alert\" class=\"m-0 text-xs text-destructive\">\n {errorSlot()}\n </p>\n )}\n </Show>","<Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>","type=\"button\"","variant=\"ghost\"","size=\"sm\"","onClick={() => setStep((value) => Math.max(0, value - 1))}","<span />","<footer class=\"flex items-center justify-between gap-2\">\n <Show when={count() > 1} fallback={<span />}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>\n </Show>\n <Show\n when={last()}\n fallback={\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>\n </Show>\n </footer>","<Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>","onClick={() => void submit()}","<Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>","<LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />","class=\"motion-safe:animate-spin\"","local.submitLabel ?? 'Send answer'","<Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>","onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}","<For each={summary()}>\n {(entry) => (\n <div class=\"flex flex-col gap-0.5\">\n <dt class=\"text-xs text-muted-foreground\">{entry.question.prompt}</dt>\n <dd class=\"m-0 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap\">\n {entry.parts.length > 0 ? entry.parts.join(', ') : 'Skipped'}\n </dd>\n </div>\n )}\n </For>","<section\n ref={(element) => (root = element)}\n data-slot=\"questionnaire\"\n data-status={status()}\n aria-label={local.title ?? 'Question from the agent'}\n // Not a tab stop: only the landing place for focus when a control goes away.\n tabindex=\"-1\"\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n 'border-border': settled(),\n 'border-ring': !settled(),\n },\n local.class\n )}\n onKeyDown={onKeyDown}\n onFocusIn={() => (focusWithin = true)}\n onFocusOut={(event) => {\n // Moving to another element ends it; a control disappearing does not.\n const next = event.relatedTarget\n if (next instanceof Node && !event.currentTarget.contains(next)) focusWithin = false\n }}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={status() === 'expired'} fallback={<CircleHelp />}>\n <Clock />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"m-0 text-sm font-semibold\">{local.title ?? 'The agent has a question'}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={status() === 'answered'}>\n <span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>\n </Show>\n <Show when={status() === 'expired'}>\n <span class=\"text-xs text-muted-foreground\">No longer waiting</span>\n </Show>\n </header>\n\n <Show\n when={!settled()}\n fallback={\n <dl class=\"m-0 flex flex-col gap-2\">\n <For each={summary()}>\n {(entry) => (\n <div class=\"flex flex-col gap-0.5\">\n <dt class=\"text-xs text-muted-foreground\">{entry.question.prompt}</dt>\n <dd class=\"m-0 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap\">\n {entry.parts.length > 0 ? entry.parts.join(', ') : 'Skipped'}\n </dd>\n </div>\n )}\n </For>\n </dl>\n }\n >\n <Show when={current()} keyed>\n {(question) => (\n <fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>\n )}\n </Show>\n\n <Show when={submitReason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>\n </Show>\n <Show when={local.error}>\n {(errorSlot) => (\n <p role=\"alert\" class=\"m-0 text-xs text-destructive\">\n {errorSlot()}\n </p>\n )}\n </Show>\n\n <footer class=\"flex items-center justify-between gap-2\">\n <Show when={count() > 1} fallback={<span />}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>\n </Show>\n <Show\n when={last()}\n fallback={\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>\n </Show>\n </footer>\n </Show>\n </section>","LucideCheck","LucideCircleHelp","LucideClock","LucideLoaderCircle","_$spread","_$ref","_$insert","_$effect","_$setAttribute"],"sources":["../../../../src/components/ui/questionnaire/questionnaire.tsx"],"sourcesContent":["import {\n Check as LucideCheck,\n CircleHelp as LucideCircleHelp,\n Clock as LucideClock,\n LoaderCircle as LucideLoaderCircle,\n} from '@lucide/solid'\nimport { createEffect, createMemo, createSignal, createUniqueId, For, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\nimport { Checkbox } from '../checkbox'\nimport { RadioGroup, RadioGroupItem } from '../radio-group'\nimport { Textarea } from '../textarea'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst CircleHelp = fastIcon(LucideCircleHelp)\nconst Clock = fastIcon(LucideClock)\nconst LoaderCircle = fastIcon(LucideLoaderCircle)\n\n/**\n * Questionnaire.\n *\n * The agent has stopped and is asking the person something before it continues.\n * This is the one place in a transcript where the reader *must* act, so it is\n * the one element allowed to look like a card — and it only ever asks what the\n * runtime actually asked.\n *\n * ## What it models\n *\n * One question or several. Each has a prompt and, optionally, a closed set of\n * options (single choice, or `multiple`) and/or a free-text answer. A question\n * with only a prompt is a text box; the runtime contract that exists today is\n * exactly that. Options are shown only when the producer supplied them, which is\n * why they are data here and not something this component can invent.\n *\n * Several questions are asked one at a time, with \"Question 2 of 3\" and Back /\n * Next, because a wall of unrelated fields is how a person answers none of them\n * well. Moving between them returns focus to the question, so a screen-reader\n * user hears what they are now answering.\n *\n * ## It does not decide whether you may answer\n *\n * `status` and `disabledReason` come from the host, which owns authority (is\n * this session connected, is the generation current, does this client have the\n * input). A disabled questionnaire says *why* in words next to the button.\n * `answered` and `expired` render the exchange read-only, so a settled question\n * stays in the record as what was asked and what was answered.\n *\n * Submit is `Cmd/Ctrl+Enter` from any text field; plain Enter stays a newline.\n */\nexport type QuestionnaireOption = Readonly<{\n id: string\n label: string\n description?: string\n}>\n\nexport type QuestionnaireQuestion = Readonly<{\n id: string\n prompt: string\n description?: string\n options?: readonly QuestionnaireOption[]\n /** Allow more than one option. */\n multiple?: boolean\n /** Offer a free-text answer (always present when there are no options). */\n allowText?: boolean\n textLabel?: string\n textPlaceholder?: string\n /** The question may be skipped. */\n optional?: boolean\n}>\n\nexport type QuestionnaireAnswer = Readonly<{ optionIds: readonly string[]; text: string }>\nexport type QuestionnaireAnswers = Readonly<Record<string, QuestionnaireAnswer>>\nexport type QuestionnaireStatus = 'open' | 'submitting' | 'answered' | 'expired'\n\nconst EMPTY: QuestionnaireAnswer = { optionIds: [], text: '' }\n\n/**\n * The answer a record holds for a question. Question ids are host strings, and\n * the record is an ordinary object, so `constructor`, `toString` and `__proto__`\n * are valid ids that a plain index would resolve to inherited values and a\n * summary or a validity check would then read `optionIds` from.\n */\nexport function answerFor(\n record: QuestionnaireAnswers,\n question: Pick<QuestionnaireQuestion, 'id'>\n): QuestionnaireAnswer | undefined {\n return Object.hasOwn(record, question.id) ? record[question.id] : undefined\n}\n\n/** Whether a question has what it needs. */\nexport function isQuestionAnswered(\n question: QuestionnaireQuestion,\n answer: QuestionnaireAnswer | undefined\n): boolean {\n if (question.optional) return true\n return (answer?.optionIds.length ?? 0) > 0 || (answer?.text.trim().length ?? 0) > 0\n}\n\nexport type QuestionnaireProps = Omit<ComponentProps<'section'>, 'onSubmit' | 'title'> & {\n questions: readonly QuestionnaireQuestion[]\n title?: string\n description?: string\n status?: QuestionnaireStatus\n answers?: QuestionnaireAnswers\n defaultAnswers?: QuestionnaireAnswers\n onAnswersChange?: (answers: QuestionnaireAnswers) => void\n onSubmit?: (answers: QuestionnaireAnswers) => void | Promise<void>\n /** Why answering is not possible right now; shown beside the button. */\n disabledReason?: string\n /** A failed submit, in words. */\n error?: string\n submitLabel?: string\n}\n\nexport function Questionnaire(props: QuestionnaireProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'questions',\n 'title',\n 'description',\n 'status',\n 'answers',\n 'defaultAnswers',\n 'onAnswersChange',\n 'onSubmit',\n 'disabledReason',\n 'error',\n 'submitLabel'\n )\n const uid = createUniqueId()\n const [internal, setInternal] = createSignal<QuestionnaireAnswers>(\n () => local.defaultAnswers ?? {}\n )\n const [step, setStep] = createSignal(0)\n const answers = () => local.answers ?? internal()\n const status = () => local.status ?? 'open'\n const settled = () => status() === 'answered' || status() === 'expired'\n const hostDisabledReason = () => (local.disabledReason?.trim() ? local.disabledReason : undefined)\n const locked = () => status() !== 'open' || hostDisabledReason() !== undefined\n const count = () => local.questions.length\n const current = () => local.questions[Math.min(step(), count() - 1)]\n const last = () => step() >= count() - 1\n const reasonId = `${uid}-reason`\n const submitReason = () =>\n hostDisabledReason() ??\n (status() === 'open' && last() && local.onSubmit === undefined\n ? 'Sending answers is not available here.'\n : undefined)\n let questionHeading: HTMLHeadingElement | undefined\n\n const answerOf = (question: QuestionnaireQuestion) => answerFor(answers(), question) ?? EMPTY\n const change = (question: QuestionnaireQuestion, next: QuestionnaireAnswer) => {\n const value = { ...answers(), [question.id]: next }\n if (local.answers === undefined) setInternal(value)\n local.onAnswersChange?.(value)\n }\n\n const canAdvance = () => {\n const question = current()\n return question !== undefined && isQuestionAnswered(question, answerFor(answers(), question))\n }\n const canSubmit = () =>\n local.questions.every((question) =>\n isQuestionAnswered(question, answerFor(answers(), question))\n )\n\n // A host that is slow to report `submitting` must not be handed the same answer\n // twice by a second Ctrl+Enter or a double click.\n let sending = false\n const submit = async () => {\n if (sending || locked() || !canSubmit() || local.onSubmit === undefined) return\n sending = true\n try {\n await local.onSubmit?.(answers())\n } finally {\n sending = false\n }\n }\n\n // The control that had focus is removed when the exchange settles into its\n // read-only record. Give focus to the record instead of dropping it on <body>,\n // but only if it was inside this questionnaire to begin with.\n let root: HTMLElement | undefined\n let focusWithin = false\n // Memoised, so open -> submitting (both unsettled) does not re-run the effect.\n const isSettled = createMemo(settled)\n createEffect(\n isSettled,\n (done) => {\n if (done && focusWithin && document.activeElement === document.body) {\n root?.focus({ preventScroll: true })\n }\n focusWithin = false\n },\n { defer: true }\n )\n\n // Land on the new question when the step changes, not on the Next button that\n // has just been replaced by one for a different question.\n createEffect(\n step,\n () => {\n questionHeading?.focus()\n },\n { defer: true }\n )\n\n const onKeyDown: JSX.EventHandler<HTMLElement, KeyboardEvent> = (event) => {\n if (event.key === 'Enter' && (event.metaKey || event.ctrlKey) && last()) {\n event.preventDefault()\n void submit()\n }\n }\n\n const summary = createMemo(() =>\n local.questions.map((question) => {\n const answer = answerFor(answers(), question) ?? EMPTY\n const chosen = (question.options ?? [])\n .filter((option) => answer.optionIds.includes(option.id))\n .map((option) => option.label)\n return {\n question,\n parts: [...chosen, ...(answer.text.trim() ? [answer.text.trim()] : [])],\n }\n })\n )\n\n return (\n <section\n ref={(element) => (root = element)}\n data-slot=\"questionnaire\"\n data-status={status()}\n aria-label={local.title ?? 'Question from the agent'}\n // Not a tab stop: only the landing place for focus when a control goes away.\n tabindex=\"-1\"\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n 'border-border': settled(),\n 'border-ring': !settled(),\n },\n local.class\n )}\n onKeyDown={onKeyDown}\n onFocusIn={() => (focusWithin = true)}\n onFocusOut={(event) => {\n // Moving to another element ends it; a control disappearing does not.\n const next = event.relatedTarget\n if (next instanceof Node && !event.currentTarget.contains(next)) focusWithin = false\n }}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={status() === 'expired'} fallback={<CircleHelp />}>\n <Clock />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"m-0 text-sm font-semibold\">{local.title ?? 'The agent has a question'}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={status() === 'answered'}>\n <span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>\n </Show>\n <Show when={status() === 'expired'}>\n <span class=\"text-xs text-muted-foreground\">No longer waiting</span>\n </Show>\n </header>\n\n <Show\n when={!settled()}\n fallback={\n <dl class=\"m-0 flex flex-col gap-2\">\n <For each={summary()}>\n {(entry) => (\n <div class=\"flex flex-col gap-0.5\">\n <dt class=\"text-xs text-muted-foreground\">{entry.question.prompt}</dt>\n <dd class=\"m-0 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap\">\n {entry.parts.length > 0 ? entry.parts.join(', ') : 'Skipped'}\n </dd>\n </div>\n )}\n </For>\n </dl>\n }\n >\n <Show when={current()} keyed>\n {(question) => (\n <fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>\n )}\n </Show>\n\n <Show when={submitReason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>\n </Show>\n <Show when={local.error}>\n {(errorSlot) => (\n <p role=\"alert\" class=\"m-0 text-xs text-destructive\">\n {errorSlot()}\n </p>\n )}\n </Show>\n\n <footer class=\"flex items-center justify-between gap-2\">\n <Show when={count() > 1} fallback={<span />}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>\n </Show>\n <Show\n when={last()}\n fallback={\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>\n </Show>\n </footer>\n </Show>\n </section>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAM,QAAQ,SAASiD,OAAW;AAClC,IAAM,aAAa,SAASC,YAAgB;AAC5C,IAAM,QAAQ,SAASC,OAAW;AAClC,IAAM,eAAe,SAASC,cAAkB;AA0DhD,IAAM,QAA6B;CAAE,WAAW,CAAC;CAAG,MAAM;AAAG;;;;;;;AAQ7D,SAAgB,UACd,QACA,UACiC;CACjC,OAAO,OAAO,OAAO,QAAQ,SAAS,EAAE,IAAI,OAAO,SAAS,MAAM,KAAA;AACpE;;AAGA,SAAgB,mBACd,UACA,QACS;CACT,IAAI,SAAS,UAAU,OAAO;CAC9B,QAAQ,QAAQ,UAAU,UAAU,KAAK,MAAM,QAAQ,KAAK,KAAK,CAAC,CAAC,UAAU,KAAK;AACpF;AAkBA,SAAgB,cAAc,OAA2B;CACvD,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,SACA,aACA,SACA,eACA,UACA,WACA,kBACA,mBACA,YACA,kBACA,SACA,aACF;CACA,MAAM,MAAM,eAAe;CAC3B,MAAM,CAAC,UAAU,eAAe,mBACxB,MAAM,kBAAkB,CAAC,CACjC;CACA,MAAM,CAAC,MAAM,WAAW,aAAa,CAAC;CACtC,MAAM,gBAAgB,MAAM,WAAW,SAAS;CAChD,MAAM,eAAe,MAAM,UAAU;CACrC,MAAM,gBAAgB,OAAO,MAAM,cAAc,OAAO,MAAM;CAC9D,MAAM,2BAA4B,MAAM,gBAAgB,KAAK,IAAI,MAAM,iBAAiB,KAAA;CACxF,MAAM,eAAe,OAAO,MAAM,UAAU,mBAAmB,MAAM,KAAA;CACrE,MAAM,cAAc,MAAM,UAAU;CACpC,MAAM,g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AAA,QAAA;IAXJiB,OAAA,QACER,gBAAAA,KAAAA;KAAK,IAAA,OAAA;MAAM,OAAA,QAAQ;KAAC;KAApBA,WACI,iBACA;MAKK,IAAA,SAAA,SAAA;MAJH,IAAA,SAAA,OAAA;MACA,IAAA,SAAA,OAAA;MADAQ,OAAA,cAA0C;OAAC,OAAA,MAAM,SAAS;MAAM,CAAK;MACrEA,OAAA,eACE;;QAAC,OAAA,MAAM,MAAM,SAAS;OAAsC,CAAA;OAA5D,aAAA;QAA4D,OAAA,MAAA,IAAlC,MAAM,MAAM,KAAK,IAAI,IAAI;OAAS;MAAC,EAAA,CAAD,CAC1D;MAJN,OAAA;KAKK,EAAA,CAAA;IAEJ,CAAA,CACH;IAXJ,OAAA;GAWI,EAAA,CAAA;EAuJF;CAAC,EAAA,CAAD,GAtNR,IAuNS;CAxNX,OACEP;AAyNJ"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import { className, createComponent, effect, insert, memo, mergeProps, readShallow, setAttribute, spread, template } from "@solidjs/web";
|
|
2
|
+
import { Radio, RadioGroup as RadioGroup$1, RadioIndicator } from "@ui-sdk/solid/radio";
|
|
3
|
+
import { Circle as Circle$1 } from "@lucide/solid";
|
|
4
|
+
import { Show, children, createContext, createSignal, createUniqueId, omit, useContext } from "solid-js";
|
|
1
5
|
import { useFormFieldControl } from "../../../lib/form-field.js";
|
|
2
6
|
import { cn } from "../../../lib/utils.js";
|
|
3
7
|
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
4
|
-
import { className, createComponent, effect, insert, memo, mergeProps, readShallow, setAttribute, spread, template } from "@solidjs/web";
|
|
5
|
-
import { Circle } from "@lucide/solid";
|
|
6
|
-
import { Show, children, createContext, createSignal, createUniqueId, omit, useContext } from "solid-js";
|
|
7
|
-
import { Radio, RadioGroup, RadioIndicator } from "@ui-sdk/solid/radio";
|
|
8
8
|
// src/components/ui/radio-group/radio-group.tsx
|
|
9
9
|
var _tmpl$ = /* @__PURE__ */ template(`<div><!><!><!>`);
|
|
10
10
|
var _tmpl$2 = /* @__PURE__ */ template(`<span data-slot=radio-group-item-media class="flex shrink-0 items-center">`);
|
|
11
11
|
var _tmpl$3 = /* @__PURE__ */ template(`<div class="grid gap-0.5 leading-none"><!><!>`);
|
|
12
12
|
var _tmpl$4 = /* @__PURE__ */ template(`<label>`);
|
|
13
13
|
var _tmpl$5 = /* @__PURE__ */ template(`<div class="text-muted-foreground text-sm">`);
|
|
14
|
-
var Circle
|
|
14
|
+
var Circle = fastIcon(Circle$1);
|
|
15
15
|
var RadioGroupContext = createContext(null);
|
|
16
|
-
function RadioGroup
|
|
16
|
+
function RadioGroup(props) {
|
|
17
17
|
const rest = omit(props, "class", "id", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid", "aria-errormessage", "value", "defaultValue", "onChange", "orientation", "validationState");
|
|
18
18
|
const field = useFormFieldControl("group", props);
|
|
19
19
|
const [own, setOwn] = createSignal(() => props.defaultValue);
|
|
@@ -24,7 +24,7 @@ function RadioGroup$1(props) {
|
|
|
24
24
|
invalid: () => props.validationState === "invalid"
|
|
25
25
|
},
|
|
26
26
|
get children() {
|
|
27
|
-
return createComponent(RadioGroup, mergeProps({
|
|
27
|
+
return createComponent(RadioGroup$1, mergeProps({
|
|
28
28
|
"data-slot": "radio-group",
|
|
29
29
|
get id() {
|
|
30
30
|
return field?.id ?? props.id;
|
|
@@ -151,7 +151,7 @@ function RadioGroupItem(props) {
|
|
|
151
151
|
return createComponent(RadioIndicator, {
|
|
152
152
|
class: "flex items-center justify-center",
|
|
153
153
|
get children() {
|
|
154
|
-
return createComponent(Circle
|
|
154
|
+
return createComponent(Circle, { class: "size-2 fill-current" });
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
}
|
|
@@ -226,6 +226,6 @@ function RadioGroupItem(props) {
|
|
|
226
226
|
}, _el$4);
|
|
227
227
|
return _el$;
|
|
228
228
|
}
|
|
229
|
-
export { RadioGroup
|
|
229
|
+
export { RadioGroup, RadioGroupItem };
|
|
230
230
|
|
|
231
231
|
//# sourceMappingURL=radio-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.js","names":["<RadioGroupContext value={state}>\n <SdkRadioGroup\n data-slot=\"radio-group\"\n id={field?.id ?? props.id}\n aria-label={props['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? props['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? props['aria-describedby']}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-orientation={props.orientation}\n data-orientation={props.orientation}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}\n class={cn('grid gap-2', props.class as string)}\n {...rest}\n />\n </RadioGroupContext>","value={state}","<SdkRadioGroup\n data-slot=\"radio-group\"\n id={field?.id ?? props.id}\n aria-label={props['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? props['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? props['aria-describedby']}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-orientation={props.orientation}\n data-orientation={props.orientation}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}\n class={cn('grid gap-2', props.class as string)}\n {...rest}\n />","onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}","<SdkRadio\n id={radioId}\n value={props.value}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={\n [props.description ? descriptionId : '', props['aria-describedby'] ?? '']\n .filter(Boolean)\n .join(' ') || undefined\n }\n aria-invalid={props['aria-invalid']}\n aria-busy={props['aria-busy']}\n title={props.title}\n data-invalid={flag(invalid())}\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:border-primary data-[checked]:text-primary',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n props.controlClass\n )}\n >\n <SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>\n </SdkRadio>","id={radioId}","<SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>","class=\"flex items-center justify-center\"","<Circle class=\"size-2 fill-current\" />","class=\"size-2 fill-current\"","<div\n data-slot=\"radio-group-item\"\n data-variant={card() ? 'card' : undefined}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n data-invalid={flag(invalid())}\n title={props.title}\n class={cn(\n 'group/radio flex gap-2.5',\n {\n 'items-start': !card(),\n // A card centres its radio, media and text on one axis. Top alignment\n // is right for a bare row, where the radio sits on the label's first\n // line, but in a card the media is taller than that line, so a\n // top-aligned radio floats above the icon and the label beside it.\n 'items-center': card(),\n 'relative rounded-lg border border-border bg-card px-3 py-2.5 transition-[color,box-shadow,border-color,background-color] ease-out hover:bg-surface-hover data-[checked]:border-primary data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-card':\n card(),\n // The radio button is what takes focus; the card rings while it has it.\n 'has-[[data-slot=radio]:focus-visible]:border-ring has-[[data-slot=radio]:focus-visible]:ring-3 has-[[data-slot=radio]:focus-visible]:ring-primary-subtle':\n card(),\n },\n props.class\n )}\n {...rest}\n >\n <SdkRadio\n id={radioId}\n value={props.value}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={\n [props.description ? descriptionId : '', props['aria-describedby'] ?? '']\n .filter(Boolean)\n .join(' ') || undefined\n }\n aria-invalid={props['aria-invalid']}\n aria-busy={props['aria-busy']}\n title={props.title}\n data-invalid={flag(invalid())}\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:border-primary data-[checked]:text-primary',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n props.controlClass\n )}\n >\n <SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>\n </SdkRadio>\n <Show when={media()}>\n {(slot) => (\n <span data-slot=\"radio-group-item-media\" class=\"flex shrink-0 items-center\">\n {slot()}\n </span>\n )}\n </Show>\n {props.children ?? (\n <div class=\"grid gap-0.5 leading-none\">\n {props.label ? (\n <label\n for={radioId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}\n >\n {props.label}\n </label>\n ) : null}\n {props.description ? (\n <div\n id={descriptionId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class=\"text-muted-foreground text-sm\"\n >\n {props.description}\n </div>\n ) : null}\n </div>\n )}\n </div>","<Show when={media()}>\n {(slot) => (\n <span data-slot=\"radio-group-item-media\" class=\"flex shrink-0 items-center\">\n {slot()}\n </span>\n )}\n </Show>","data-disabled={flag(disabled())}","class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}","<div class=\"grid gap-0.5 leading-none\">\n {props.label ? (\n <label\n for={radioId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}\n >\n {props.label}\n </label>\n ) : null}\n {props.description ? (\n <div\n id={descriptionId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class=\"text-muted-foreground text-sm\"\n >\n {props.description}\n </div>\n ) : null}\n </div>","Circle","LucideCircle","RadioGroup","resolveChildren","_$setAttribute"],"sources":["../../../../src/components/ui/radio-group/radio-group.tsx"],"sourcesContent":["import {\n Radio as SdkRadio,\n RadioGroup as SdkRadioGroup,\n RadioIndicator as SdkRadioIndicator,\n} from '@ui-sdk/solid/radio'\nimport { Circle as LucideCircle } from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport {\n Show,\n children as resolveChildren,\n createContext,\n createSignal,\n createUniqueId,\n omit,\n useContext,\n} from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Circle = fastIcon(LucideCircle)\n\n/**\n * RadioGroup.\n *\n * A single choice from a small, visible set. The group owns the value and the\n * arrow-key navigation, so a caller sets `value` once instead of wiring a\n * `name` and a handler onto every item.\n *\n * Below about five options a Select hides the choices behind a click, which is\n * the wrong trade; above about seven, radios become a wall and the Select wins.\n * That call belongs to the caller, and both controls are drawn from the same\n * tokens so either choice sits correctly next to the other.\n *\n * Built on ui-sdk's RadioGroup: each radio is a `role=\"radio\"` button with one\n * tab stop for the group, arrow keys between items, and a hidden native radio\n * beside it that takes part in the form (required, reset, submission).\n */\nexport type RadioGroupProps = Omit<\n ComponentProps<typeof SdkRadioGroup>,\n 'value' | 'defaultValue' | 'onValueChange' | 'onChange'\n> & {\n /** The checked item's value. Pass it to control the group. */\n value?: string\n defaultValue?: string\n /** Called with the newly checked item's value. */\n onChange?: (value: string) => void\n /** Which arrow keys move between items; both pairs work either way. */\n orientation?: 'horizontal' | 'vertical'\n /** `'invalid'` marks the group `aria-invalid` and its items invalid. */\n validationState?: 'valid' | 'invalid'\n}\n\n/** What an item needs from its group to mark its own row. */\ntype RadioGroupState = {\n value: () => string | null | undefined\n disabled: () => boolean\n invalid: () => boolean\n}\n\nconst RadioGroupContext = createContext<RadioGroupState | null>(null)\n\nexport function RadioGroup(props: RadioGroupProps) {\n const rest = omit(\n props,\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n 'value',\n 'defaultValue',\n 'onChange',\n 'orientation',\n 'validationState'\n )\n const field = useFormFieldControl('group', props)\n // The item rows carry `data-checked` and `data-disabled` themselves (the\n // card variant draws its edge from them), so the group's value is kept here\n // as well as in the primitive: the controlled prop, else the last change.\n const [own, setOwn] = createSignal<string | null | undefined>(() => props.defaultValue)\n const state: RadioGroupState = {\n value: () => (props.value !== undefined ? props.value : own()),\n disabled: () => props.disabled ?? false,\n invalid: () => props.validationState === 'invalid',\n }\n return (\n <RadioGroupContext value={state}>\n <SdkRadioGroup\n data-slot=\"radio-group\"\n id={field?.id ?? props.id}\n aria-label={props['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? props['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? props['aria-describedby']}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-orientation={props.orientation}\n data-orientation={props.orientation}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}\n class={cn('grid gap-2', props.class as string)}\n {...rest}\n />\n </RadioGroupContext>\n )\n}\n\nexport type RadioGroupItemProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** What the group's value becomes when this item is checked. */\n value: string\n /** Skips the item: arrow keys pass it and it can't be checked. */\n disabled?: boolean\n /** Replaces the label block, beside the radio. */\n children?: JSX.Element\n controlClass?: string\n /**\n * The option's visible label. A radio with no accessible name is unreachable\n * by a screen reader and by voice control, so supply this, a labelled child,\n * `aria-label`, or `aria-labelledby`.\n */\n label?: string\n description?: string\n /**\n * `card` draws the option as a bordered, selectable card — for a choice\n * whose options need a sentence each (a source type, a sync budget), where a\n * bare radio row reads as a form field rather than a decision. The whole card\n * is the hit target, and the selected card takes the primary edge. The radio,\n * `media` and text centre on one axis; the default variant keeps the radio on\n * the first line of its label.\n */\n variant?: 'default' | 'card'\n /** A leading icon or `EntityIcon` between the radio and the text, for `card`. */\n media?: JSX.Element\n}\n\nconst flag = (on: boolean) => (on ? '' : undefined)\n\n/**\n * A card option's label stretches an invisible layer over the whole card, so a\n * click anywhere on it — padding, media, description — selects the option\n * through the label's native association with the radio. Wrapping the card in\n * a `<label>` would nest the item's own label inside another.\n */\nexport function RadioGroupItem(props: RadioGroupItemProps) {\n const rest = omit(\n props,\n 'class',\n 'controlClass',\n 'label',\n 'description',\n 'variant',\n 'media',\n 'children',\n 'value',\n 'disabled',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-busy',\n 'title'\n )\n const group = useContext(RadioGroupContext)\n const card = () => props.variant === 'card'\n const uid = createUniqueId()\n const radioId = `radio-${uid}`\n const descriptionId = `radio-${uid}-description`\n const checked = () => group?.value() === props.value\n const disabled = () => Boolean(props.disabled || group?.disabled())\n const invalid = () => group?.invalid() ?? false\n\n const media = resolveChildren(() => props.media)\n return (\n <div\n data-slot=\"radio-group-item\"\n data-variant={card() ? 'card' : undefined}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n data-invalid={flag(invalid())}\n title={props.title}\n class={cn(\n 'group/radio flex gap-2.5',\n {\n 'items-start': !card(),\n // A card centres its radio, media and text on one axis. Top alignment\n // is right for a bare row, where the radio sits on the label's first\n // line, but in a card the media is taller than that line, so a\n // top-aligned radio floats above the icon and the label beside it.\n 'items-center': card(),\n 'relative rounded-lg border border-border bg-card px-3 py-2.5 transition-[color,box-shadow,border-color,background-color] ease-out hover:bg-surface-hover data-[checked]:border-primary data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-card':\n card(),\n // The radio button is what takes focus; the card rings while it has it.\n 'has-[[data-slot=radio]:focus-visible]:border-ring has-[[data-slot=radio]:focus-visible]:ring-3 has-[[data-slot=radio]:focus-visible]:ring-primary-subtle':\n card(),\n },\n props.class\n )}\n {...rest}\n >\n <SdkRadio\n id={radioId}\n value={props.value}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={\n [props.description ? descriptionId : '', props['aria-describedby'] ?? '']\n .filter(Boolean)\n .join(' ') || undefined\n }\n aria-invalid={props['aria-invalid']}\n aria-busy={props['aria-busy']}\n title={props.title}\n data-invalid={flag(invalid())}\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:border-primary data-[checked]:text-primary',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n props.controlClass\n )}\n >\n <SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>\n </SdkRadio>\n <Show when={media()}>\n {(slot) => (\n <span data-slot=\"radio-group-item-media\" class=\"flex shrink-0 items-center\">\n {slot()}\n </span>\n )}\n </Show>\n {props.children ?? (\n <div class=\"grid gap-0.5 leading-none\">\n {props.label ? (\n <label\n for={radioId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}\n >\n {props.label}\n </label>\n ) : null}\n {props.description ? (\n <div\n id={descriptionId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class=\"text-muted-foreground text-sm\"\n >\n {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AA;;QAAc,GAAA,KAAK,QAAQ,CAAC;QAC5BE,GAAe,KAAK,SAAS,CAAC;QAC9BC,GAAAA,YAAO,GAAG,uBAAuB,KAAK,KAAK,8BAA8B,CAAC;OAF7C;MAA7B,IAAA,EAAA,GAAA,GAAA,KAAA,QAAA;OAA6B,MAAA,KAAA,KAAAM,aAAA,OAAA,gBAAA,CAAA;OAC7B,MAAA,KAAA,KAAAA,aAAA,OAAA,iBAAA,CAA+B;OAC/B,UAAA,OAAA,GAAA,KAAA,CAA0E;MAF7C,CAAA;MAF/B,OAAA;KAOO,EAAA,CAAA,IACL;IAAI;GAAC,EAAA,CAAD,GAVVL,KAqBK;GArBL,OAAA,cAWE;;KAAC,OAAA,CAAA,CAAA,MAAM;IASC,CAAA;IATR,aAAA;KASQ,OAAA,KAAA,WARN;MAOK,IAAA,SAAA,QAAA;MANH,aAAA,QAAA,MAAI,aAAa;MADnB,OAAA,cAME;OAAC,OAAA,MAAM;MAAW,CACf;MALH,aAAA;;QAAc,GAAA,KAAK,QAAQ,CAAC;QAC5BF,GAAe,KAAK,SAAS,CAAC;OADD;MAA7B,IAAA,EAAA,GAAA,KAAA,QAAA;OAA6B,MAAA,KAAA,KAAAO,aAAA,QAAA,gBAAA,CAAA;OAC7B,MAAA,KAAA,KAAAA,aAAA,QAAA,iBAAA,CAA+B;MADF,CAAA;MAF/B,OAAA;KAOK,EAAA,CAAA,IACH;IAAI;GAAC,EAAA,CAAD,GApBVL,KAqBK;GArBL,OAAA;EAqBK,EAAA,CAAA;CACN,GArFHJ,KAsFK;CAvFP,OACEA;AAwFJ"}
|
|
1
|
+
{"version":3,"file":"radio-group.js","names":["<RadioGroupContext value={state}>\n <SdkRadioGroup\n data-slot=\"radio-group\"\n id={field?.id ?? props.id}\n aria-label={props['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? props['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? props['aria-describedby']}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-orientation={props.orientation}\n data-orientation={props.orientation}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}\n class={cn('grid gap-2', props.class as string)}\n {...rest}\n />\n </RadioGroupContext>","value={state}","<SdkRadioGroup\n data-slot=\"radio-group\"\n id={field?.id ?? props.id}\n aria-label={props['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? props['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? props['aria-describedby']}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-orientation={props.orientation}\n data-orientation={props.orientation}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}\n class={cn('grid gap-2', props.class as string)}\n {...rest}\n />","onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}","<SdkRadio\n id={radioId}\n value={props.value}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={\n [props.description ? descriptionId : '', props['aria-describedby'] ?? '']\n .filter(Boolean)\n .join(' ') || undefined\n }\n aria-invalid={props['aria-invalid']}\n aria-busy={props['aria-busy']}\n title={props.title}\n data-invalid={flag(invalid())}\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:border-primary data-[checked]:text-primary',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n props.controlClass\n )}\n >\n <SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>\n </SdkRadio>","id={radioId}","<SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>","class=\"flex items-center justify-center\"","<Circle class=\"size-2 fill-current\" />","class=\"size-2 fill-current\"","<div\n data-slot=\"radio-group-item\"\n data-variant={card() ? 'card' : undefined}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n data-invalid={flag(invalid())}\n title={props.title}\n class={cn(\n 'group/radio flex gap-2.5',\n {\n 'items-start': !card(),\n // A card centres its radio, media and text on one axis. Top alignment\n // is right for a bare row, where the radio sits on the label's first\n // line, but in a card the media is taller than that line, so a\n // top-aligned radio floats above the icon and the label beside it.\n 'items-center': card(),\n 'relative rounded-lg border border-border bg-card px-3 py-2.5 transition-[color,box-shadow,border-color,background-color] ease-out hover:bg-surface-hover data-[checked]:border-primary data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-card':\n card(),\n // The radio button is what takes focus; the card rings while it has it.\n 'has-[[data-slot=radio]:focus-visible]:border-ring has-[[data-slot=radio]:focus-visible]:ring-3 has-[[data-slot=radio]:focus-visible]:ring-primary-subtle':\n card(),\n },\n props.class\n )}\n {...rest}\n >\n <SdkRadio\n id={radioId}\n value={props.value}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={\n [props.description ? descriptionId : '', props['aria-describedby'] ?? '']\n .filter(Boolean)\n .join(' ') || undefined\n }\n aria-invalid={props['aria-invalid']}\n aria-busy={props['aria-busy']}\n title={props.title}\n data-invalid={flag(invalid())}\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:border-primary data-[checked]:text-primary',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n props.controlClass\n )}\n >\n <SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>\n </SdkRadio>\n <Show when={media()}>\n {(slot) => (\n <span data-slot=\"radio-group-item-media\" class=\"flex shrink-0 items-center\">\n {slot()}\n </span>\n )}\n </Show>\n {props.children ?? (\n <div class=\"grid gap-0.5 leading-none\">\n {props.label ? (\n <label\n for={radioId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}\n >\n {props.label}\n </label>\n ) : null}\n {props.description ? (\n <div\n id={descriptionId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class=\"text-muted-foreground text-sm\"\n >\n {props.description}\n </div>\n ) : null}\n </div>\n )}\n </div>","<Show when={media()}>\n {(slot) => (\n <span data-slot=\"radio-group-item-media\" class=\"flex shrink-0 items-center\">\n {slot()}\n </span>\n )}\n </Show>","data-disabled={flag(disabled())}","class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}","<div class=\"grid gap-0.5 leading-none\">\n {props.label ? (\n <label\n for={radioId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}\n >\n {props.label}\n </label>\n ) : null}\n {props.description ? (\n <div\n id={descriptionId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class=\"text-muted-foreground text-sm\"\n >\n {props.description}\n </div>\n ) : null}\n </div>","LucideCircle","resolveChildren","_$spread","_$insert","_$setAttribute","_$effect","_$className"],"sources":["../../../../src/components/ui/radio-group/radio-group.tsx"],"sourcesContent":["import {\n Radio as SdkRadio,\n RadioGroup as SdkRadioGroup,\n RadioIndicator as SdkRadioIndicator,\n} from '@ui-sdk/solid/radio'\nimport { Circle as LucideCircle } from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport {\n Show,\n children as resolveChildren,\n createContext,\n createSignal,\n createUniqueId,\n omit,\n useContext,\n} from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Circle = fastIcon(LucideCircle)\n\n/**\n * RadioGroup.\n *\n * A single choice from a small, visible set. The group owns the value and the\n * arrow-key navigation, so a caller sets `value` once instead of wiring a\n * `name` and a handler onto every item.\n *\n * Below about five options a Select hides the choices behind a click, which is\n * the wrong trade; above about seven, radios become a wall and the Select wins.\n * That call belongs to the caller, and both controls are drawn from the same\n * tokens so either choice sits correctly next to the other.\n *\n * Built on ui-sdk's RadioGroup: each radio is a `role=\"radio\"` button with one\n * tab stop for the group, arrow keys between items, and a hidden native radio\n * beside it that takes part in the form (required, reset, submission).\n */\nexport type RadioGroupProps = Omit<\n ComponentProps<typeof SdkRadioGroup>,\n 'value' | 'defaultValue' | 'onValueChange' | 'onChange'\n> & {\n /** The checked item's value. Pass it to control the group. */\n value?: string\n defaultValue?: string\n /** Called with the newly checked item's value. */\n onChange?: (value: string) => void\n /** Which arrow keys move between items; both pairs work either way. */\n orientation?: 'horizontal' | 'vertical'\n /** `'invalid'` marks the group `aria-invalid` and its items invalid. */\n validationState?: 'valid' | 'invalid'\n}\n\n/** What an item needs from its group to mark its own row. */\ntype RadioGroupState = {\n value: () => string | null | undefined\n disabled: () => boolean\n invalid: () => boolean\n}\n\nconst RadioGroupContext = createContext<RadioGroupState | null>(null)\n\nexport function RadioGroup(props: RadioGroupProps) {\n const rest = omit(\n props,\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n 'value',\n 'defaultValue',\n 'onChange',\n 'orientation',\n 'validationState'\n )\n const field = useFormFieldControl('group', props)\n // The item rows carry `data-checked` and `data-disabled` themselves (the\n // card variant draws its edge from them), so the group's value is kept here\n // as well as in the primitive: the controlled prop, else the last change.\n const [own, setOwn] = createSignal<string | null | undefined>(() => props.defaultValue)\n const state: RadioGroupState = {\n value: () => (props.value !== undefined ? props.value : own()),\n disabled: () => props.disabled ?? false,\n invalid: () => props.validationState === 'invalid',\n }\n return (\n <RadioGroupContext value={state}>\n <SdkRadioGroup\n data-slot=\"radio-group\"\n id={field?.id ?? props.id}\n aria-label={props['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? props['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? props['aria-describedby']}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-orientation={props.orientation}\n data-orientation={props.orientation}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}\n class={cn('grid gap-2', props.class as string)}\n {...rest}\n />\n </RadioGroupContext>\n )\n}\n\nexport type RadioGroupItemProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** What the group's value becomes when this item is checked. */\n value: string\n /** Skips the item: arrow keys pass it and it can't be checked. */\n disabled?: boolean\n /** Replaces the label block, beside the radio. */\n children?: JSX.Element\n controlClass?: string\n /**\n * The option's visible label. A radio with no accessible name is unreachable\n * by a screen reader and by voice control, so supply this, a labelled child,\n * `aria-label`, or `aria-labelledby`.\n */\n label?: string\n description?: string\n /**\n * `card` draws the option as a bordered, selectable card — for a choice\n * whose options need a sentence each (a source type, a sync budget), where a\n * bare radio row reads as a form field rather than a decision. The whole card\n * is the hit target, and the selected card takes the primary edge. The radio,\n * `media` and text centre on one axis; the default variant keeps the radio on\n * the first line of its label.\n */\n variant?: 'default' | 'card'\n /** A leading icon or `EntityIcon` between the radio and the text, for `card`. */\n media?: JSX.Element\n}\n\nconst flag = (on: boolean) => (on ? '' : undefined)\n\n/**\n * A card option's label stretches an invisible layer over the whole card, so a\n * click anywhere on it — padding, media, description — selects the option\n * through the label's native association with the radio. Wrapping the card in\n * a `<label>` would nest the item's own label inside another.\n */\nexport function RadioGroupItem(props: RadioGroupItemProps) {\n const rest = omit(\n props,\n 'class',\n 'controlClass',\n 'label',\n 'description',\n 'variant',\n 'media',\n 'children',\n 'value',\n 'disabled',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-busy',\n 'title'\n )\n const group = useContext(RadioGroupContext)\n const card = () => props.variant === 'card'\n const uid = createUniqueId()\n const radioId = `radio-${uid}`\n const descriptionId = `radio-${uid}-description`\n const checked = () => group?.value() === props.value\n const disabled = () => Boolean(props.disabled || group?.disabled())\n const invalid = () => group?.invalid() ?? false\n\n const media = resolveChildren(() => props.media)\n return (\n <div\n data-slot=\"radio-group-item\"\n data-variant={card() ? 'card' : undefined}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n data-invalid={flag(invalid())}\n title={props.title}\n class={cn(\n 'group/radio flex gap-2.5',\n {\n 'items-start': !card(),\n // A card centres its radio, media and text on one axis. Top alignment\n // is right for a bare row, where the radio sits on the label's first\n // line, but in a card the media is taller than that line, so a\n // top-aligned radio floats above the icon and the label beside it.\n 'items-center': card(),\n 'relative rounded-lg border border-border bg-card px-3 py-2.5 transition-[color,box-shadow,border-color,background-color] ease-out hover:bg-surface-hover data-[checked]:border-primary data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-card':\n card(),\n // The radio button is what takes focus; the card rings while it has it.\n 'has-[[data-slot=radio]:focus-visible]:border-ring has-[[data-slot=radio]:focus-visible]:ring-3 has-[[data-slot=radio]:focus-visible]:ring-primary-subtle':\n card(),\n },\n props.class\n )}\n {...rest}\n >\n <SdkRadio\n id={radioId}\n value={props.value}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={\n [props.description ? descriptionId : '', props['aria-describedby'] ?? '']\n .filter(Boolean)\n .join(' ') || undefined\n }\n aria-invalid={props['aria-invalid']}\n aria-busy={props['aria-busy']}\n title={props.title}\n data-invalid={flag(invalid())}\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:border-primary data-[checked]:text-primary',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n props.controlClass\n )}\n >\n <SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>\n </SdkRadio>\n <Show when={media()}>\n {(slot) => (\n <span data-slot=\"radio-group-item-media\" class=\"flex shrink-0 items-center\">\n {slot()}\n </span>\n )}\n </Show>\n {props.children ?? (\n <div class=\"grid gap-0.5 leading-none\">\n {props.label ? (\n <label\n for={radioId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}\n >\n {props.label}\n </label>\n ) : null}\n {props.description ? (\n <div\n id={descriptionId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class=\"text-muted-foreground text-sm\"\n >\n {props.description}\n </div>\n ) : null}\n </div>\n )}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAqBA,IAAM,SAAS,SAASe,QAAY;AAwCpC,IAAM,oBAAoB,cAAsC,IAAI;AAEpE,SAAgB,WAAW,OAAwB;CACjD,MAAM,OAAO,KACX,OACA,SACA,MACA,cACA,mBACA,oBACA,gBACA,qBACA,SACA,gBACA,YACA,eACA,iBACF;CACA,MAAM,QAAQ,oBAAoB,SAAS,KAAK;CAIhD,MAAM,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