@adea-ai/ui 0.154.0 → 0.154.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/components/composites/about-dialog/about-dialog.d.ts.map +1 -1
- package/dist/components/composites/about-dialog/about-dialog.js +3 -1
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js +20 -9
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +20 -10
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
- package/dist/components/composites/action-button/action-button.js +37 -24
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +7 -3
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +11 -6
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +8 -3
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js +8 -4
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.js +7 -3
- package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +8 -4
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js +3 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.d.ts.map +1 -1
- package/dist/components/composites/chat/chat.js +5 -1
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.d.ts.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.js +3 -1
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.d.ts.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +11 -5
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.d.ts.map +1 -1
- package/dist/components/composites/context/context.js +7 -4
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js +7 -3
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/help-center/help-center.d.ts.map +1 -1
- package/dist/components/composites/help-center/help-center.js +3 -1
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.d.ts +2 -2
- package/dist/components/composites/icon-picker/icon-picker.d.ts.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +77 -71
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.d.ts.map +1 -1
- package/dist/components/composites/icon-picker/shell-icons.js +119 -59
- package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js +5 -2
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.d.ts.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +3 -4
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.d.ts.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js +5 -2
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +9 -5
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/plan/plan.d.ts.map +1 -1
- package/dist/components/composites/plan/plan.js +3 -1
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/queue/queue.d.ts.map +1 -1
- package/dist/components/composites/queue/queue.js +11 -5
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.d.ts.map +1 -1
- package/dist/components/composites/reasoning/reasoning.js +3 -1
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.d.ts.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.js +14 -7
- package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
- package/dist/components/composites/settings/settings.d.ts.map +1 -1
- package/dist/components/composites/settings/settings.js +77 -67
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/sources.d.ts.map +1 -1
- package/dist/components/composites/sources/sources.js +39 -39
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.d.ts.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js +9 -4
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.d.ts.map +1 -1
- package/dist/components/composites/stat/stat.js +4 -1
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
- package/dist/components/composites/subagent/subagent.js +3 -1
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/task/task.d.ts.map +1 -1
- package/dist/components/composites/task/task.js +3 -1
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/ansi.d.ts.map +1 -1
- package/dist/components/composites/terminal/ansi.js +16 -0
- package/dist/components/composites/terminal/ansi.js.map +1 -1
- package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
- package/dist/components/composites/terminal/terminal.js +15 -7
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results.d.ts.map +1 -1
- package/dist/components/composites/test-results/test-results.js +15 -7
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.d.ts.map +1 -1
- package/dist/components/composites/tool/tool.js +3 -1
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.d.ts.map +1 -1
- package/dist/components/composites/tree/tree.js +3 -1
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +34 -24
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.d.ts.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +17 -12
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.d.ts.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +5 -2
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.js +9 -4
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
- package/dist/components/conversation/busy-send-button.js +9 -5
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.d.ts.map +1 -1
- package/dist/components/conversation/conversation-avatar.js +6 -3
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-surface.d.ts.map +1 -1
- package/dist/components/conversation/conversation-surface.js +3 -1
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +9 -4
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.d.ts.map +1 -1
- package/dist/components/conversation/message-composer.js +9 -4
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.d.ts.map +1 -1
- package/dist/components/conversation/message-row.js +11 -5
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/thread-panel.d.ts.map +1 -1
- package/dist/components/conversation/thread-panel.js +3 -1
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
- package/dist/components/conversation/transcript-composition.js +3 -1
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/floating-preview/floating-preview.d.ts.map +1 -1
- package/dist/components/layout/floating-preview/floating-preview.js +5 -2
- package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +3 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.d.ts.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.js +3 -1
- package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +3 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +5 -2
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +3 -1
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts.map +1 -1
- package/dist/components/theme/appearance-panel.js +3 -1
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/theme-mode-toggle.d.ts.map +1 -1
- package/dist/components/theme/theme-mode-toggle.js +6 -3
- package/dist/components/theme/theme-mode-toggle.js.map +1 -1
- package/dist/components/theme/theme-toggle.d.ts.map +1 -1
- package/dist/components/theme/theme-toggle.js +6 -3
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion/accordion.js +3 -1
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.js +15 -9
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.d.ts.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js +5 -4
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/attachment/attachment.d.ts.map +1 -1
- package/dist/components/ui/attachment/attachment.js +18 -9
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.js +30 -11
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js +5 -2
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/button/button.js +37 -13
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/calendar/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar/calendar.js +5 -2
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/carousel/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel/carousel.js +12 -6
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts +13 -0
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +296 -21
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/ui/code-block/code-block.js +9 -6
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.js +8 -11
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/command/command.d.ts.map +1 -1
- package/dist/components/ui/command/command.js +4 -2
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.d.ts.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.js +3 -1
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.js +3 -1
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.js +7 -3
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.d.ts.map +1 -1
- package/dist/components/ui/empty/empty-state.js +3 -1
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/field/field.d.ts.map +1 -1
- package/dist/components/ui/field/field.js +12 -6
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/input/input-control.d.ts +2 -0
- package/dist/components/ui/input/input-control.d.ts.map +1 -1
- package/dist/components/ui/input/input-control.js +24 -6
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input/input.d.ts.map +1 -1
- package/dist/components/ui/input/input.js +47 -48
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/input-group/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group/input-group.js +1 -8
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/message/index.d.ts +1 -1
- package/dist/components/ui/message/index.d.ts.map +1 -1
- package/dist/components/ui/message/index.js +2 -2
- package/dist/components/ui/message/message.d.ts.map +1 -1
- package/dist/components/ui/message/message.js +5 -3
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/message/parse-message-text.d.ts +32 -0
- package/dist/components/ui/message/parse-message-text.d.ts.map +1 -1
- package/dist/components/ui/message/parse-message-text.js +63 -3
- package/dist/components/ui/message/parse-message-text.js.map +1 -1
- package/dist/components/ui/native-select/native-select.d.ts.map +1 -1
- package/dist/components/ui/native-select/native-select.js +4 -9
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js +3 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination/pagination.js +7 -3
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +9 -4
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +4 -9
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable/resizable.js +3 -1
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/select/select.d.ts.map +1 -1
- package/dist/components/ui/select/select.js +7 -3
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet/sheet.js +3 -1
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/spinner/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner/spinner.js +3 -1
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +35 -30
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.d.ts +7 -0
- package/dist/components/ui/switch/switch.d.ts.map +1 -1
- package/dist/components/ui/switch/switch.js +255 -17
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea/textarea.js +1 -8
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.d.ts.map +1 -1
- package/dist/components/ui/toast/toast.js +3 -1
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.js +10 -4
- package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
- package/dist/components/ui/tooltip/index.d.ts +1 -0
- package/dist/components/ui/tooltip/index.d.ts.map +1 -1
- package/dist/components/ui/tooltip/index.js +2 -1
- package/dist/components/ui/tooltip/lazy-tooltip.d.ts +40 -0
- package/dist/components/ui/tooltip/lazy-tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip/lazy-tooltip.js +61 -0
- package/dist/components/ui/tooltip/lazy-tooltip.js.map +1 -0
- package/dist/components/ui/trace/trace.d.ts.map +1 -1
- package/dist/components/ui/trace/trace.js +82 -68
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.d.ts +1 -1
- package/dist/components/ui/typography/typography.d.ts.map +1 -1
- package/dist/components/ui/typography/typography.js +5 -6
- package/dist/components/ui/typography/typography.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/lib/clipboard.d.ts.map +1 -1
- package/dist/lib/clipboard.js +3 -0
- package/dist/lib/clipboard.js.map +1 -1
- package/dist/lib/fast-icon.d.ts +18 -0
- package/dist/lib/fast-icon.d.ts.map +1 -0
- package/dist/lib/fast-icon.js +75 -0
- package/dist/lib/fast-icon.js.map +1 -0
- package/dist/lib/form-field.d.ts +1 -1
- package/dist/lib/form-field.js +3 -1
- package/dist/lib/form-field.js.map +1 -1
- package/dist/lib/observe-resize.d.ts +14 -0
- package/dist/lib/observe-resize.d.ts.map +1 -0
- package/dist/lib/observe-resize.js +19 -0
- package/dist/lib/observe-resize.js.map +1 -0
- package/dist/lint/index.d.ts +1 -0
- package/dist/lint/index.d.ts.map +1 -1
- package/dist/lint.js +251 -118
- package/dist/lint.js.map +1 -1
- package/dist/r/action-button.json +3 -1
- package/dist/r/floating-preview.json +2 -1
- package/dist/r/icon-picker.json +0 -1
- package/dist/r/lib.json +10 -0
- package/dist/r/plan.json +2 -1
- package/dist/r/queue.json +2 -1
- package/dist/r/registry.json +30 -9
- package/dist/r/scene-controls.json +2 -1
- package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +5 -1
- package/dist/r/src/components/composites/accent-picker/accent-picker.tsx +22 -17
- package/dist/r/src/components/composites/account-menu/account-menu.tsx +21 -9
- package/dist/r/src/components/composites/action-button/action-button.tsx +38 -21
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
- package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
- package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
- package/dist/r/src/components/composites/chat/chat.tsx +11 -1
- package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +5 -1
- package/dist/r/src/components/composites/confirmation/confirmation.tsx +15 -1
- package/dist/r/src/components/composites/context/context.tsx +9 -1
- package/dist/r/src/components/composites/file-tree/file-tree.tsx +11 -1
- package/dist/r/src/components/composites/help-center/help-center.tsx +5 -1
- package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +59 -31
- package/dist/r/src/components/composites/icon-picker/shell-icons.ts +121 -59
- package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +6 -1
- package/dist/r/src/components/composites/list-row/list-row-control.tsx +7 -5
- package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +6 -1
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +11 -1
- package/dist/r/src/components/composites/plan/plan.tsx +5 -1
- package/dist/r/src/components/composites/queue/queue.tsx +15 -1
- package/dist/r/src/components/composites/reasoning/reasoning.tsx +5 -1
- package/dist/r/src/components/composites/scene-controls/scene-controls.tsx +17 -1
- package/dist/r/src/components/composites/settings/settings.tsx +23 -14
- package/dist/r/src/components/composites/sources/sources.tsx +27 -20
- package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +13 -1
- package/dist/r/src/components/composites/stat/stat.tsx +9 -1
- package/dist/r/src/components/composites/subagent/subagent.tsx +5 -1
- package/dist/r/src/components/composites/task/task.tsx +5 -1
- package/dist/r/src/components/composites/terminal/ansi.ts +18 -0
- package/dist/r/src/components/composites/terminal/terminal.tsx +17 -7
- package/dist/r/src/components/composites/test-results/test-results.tsx +17 -7
- package/dist/r/src/components/composites/tool/tool.tsx +5 -1
- package/dist/r/src/components/composites/tree/tree.tsx +5 -1
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +35 -15
- package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
- package/dist/r/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
- package/dist/r/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
- package/dist/r/src/components/conversation/busy-send-button.tsx +11 -1
- package/dist/r/src/components/conversation/conversation-avatar.tsx +7 -1
- package/dist/r/src/components/conversation/conversation-surface.tsx +5 -1
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
- package/dist/r/src/components/conversation/message-composer.tsx +13 -1
- package/dist/r/src/components/conversation/message-row.tsx +15 -1
- package/dist/r/src/components/conversation/thread-panel.tsx +5 -1
- package/dist/r/src/components/conversation/transcript-composition.tsx +5 -1
- package/dist/r/src/components/layout/floating-preview/floating-preview.tsx +6 -1
- package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
- package/dist/r/src/components/layout/shell-rail/shell-rail.tsx +5 -1
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +6 -1
- package/dist/r/src/components/layout/top-bar/top-bar.tsx +5 -1
- package/dist/r/src/components/theme/appearance-panel.tsx +6 -1
- package/dist/r/src/components/theme/theme-mode-toggle.tsx +7 -1
- package/dist/r/src/components/theme/theme-toggle.tsx +7 -1
- package/dist/r/src/components/ui/accordion/accordion.tsx +5 -1
- package/dist/r/src/components/ui/alert/alert.tsx +20 -3
- package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
- package/dist/r/src/components/ui/attachment/attachment.tsx +19 -8
- package/dist/r/src/components/ui/badge/badge.tsx +24 -8
- package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
- package/dist/r/src/components/ui/button/button.tsx +47 -16
- package/dist/r/src/components/ui/calendar/calendar.tsx +6 -1
- package/dist/r/src/components/ui/carousel/carousel.tsx +15 -5
- package/dist/r/src/components/ui/checkbox/checkbox.tsx +260 -22
- package/dist/r/src/components/ui/code-block/code-block.tsx +11 -5
- package/dist/r/src/components/ui/combobox/combobox.tsx +8 -9
- package/dist/r/src/components/ui/command/command.tsx +8 -4
- package/dist/r/src/components/ui/detail-panel/detail-panel.tsx +5 -1
- package/dist/r/src/components/ui/dialog/dialog.tsx +5 -1
- package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
- package/dist/r/src/components/ui/empty/empty-state.tsx +5 -1
- package/dist/r/src/components/ui/field/field.tsx +14 -5
- package/dist/r/src/components/ui/input/input-control.tsx +28 -19
- package/dist/r/src/components/ui/input/input.tsx +9 -12
- package/dist/r/src/components/ui/input-group/input-group.tsx +1 -8
- package/dist/r/src/components/ui/message/index.ts +3 -0
- package/dist/r/src/components/ui/message/message.tsx +11 -2
- package/dist/r/src/components/ui/message/parse-message-text.ts +94 -2
- package/dist/r/src/components/ui/native-select/native-select.tsx +6 -9
- package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
- package/dist/r/src/components/ui/pagination/pagination.tsx +11 -1
- package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +13 -1
- package/dist/r/src/components/ui/radio-group/radio-group.tsx +6 -9
- package/dist/r/src/components/ui/resizable/resizable.tsx +5 -1
- package/dist/r/src/components/ui/select/select.tsx +11 -1
- package/dist/r/src/components/ui/sheet/sheet.tsx +5 -1
- package/dist/r/src/components/ui/spinner/spinner.tsx +5 -1
- package/dist/r/src/components/ui/status-chip/status-chip.tsx +14 -7
- package/dist/r/src/components/ui/switch/switch.tsx +235 -28
- package/dist/r/src/components/ui/textarea/textarea.tsx +1 -8
- package/dist/r/src/components/ui/toast/toast.tsx +5 -1
- package/dist/r/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
- package/dist/r/src/components/ui/tooltip/index.ts +1 -0
- package/dist/r/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
- package/dist/r/src/components/ui/trace/trace.tsx +61 -28
- package/dist/r/src/components/ui/typography/typography.tsx +6 -5
- package/dist/r/src/lib/clipboard.ts +4 -0
- package/dist/r/src/lib/fast-icon.ts +88 -0
- package/dist/r/src/lib/form-field.ts +7 -7
- package/dist/r/src/lib/observe-resize.ts +28 -0
- package/dist/r/subagent.json +2 -1
- package/dist/r/tool.json +2 -1
- package/dist/r/tooltip.json +5 -0
- package/dist/r/trace.json +0 -1
- package/package.json +1 -1
- package/registry.json +30 -9
- package/src/components/composites/about-dialog/about-dialog.tsx +5 -1
- package/src/components/composites/accent-picker/accent-picker.tsx +22 -17
- package/src/components/composites/account-menu/account-menu.tsx +21 -9
- package/src/components/composites/action-button/action-button.tsx +38 -21
- package/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
- package/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
- package/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
- package/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
- package/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
- package/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
- package/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
- package/src/components/composites/chat/chat.tsx +11 -1
- package/src/components/composites/checkpoint/checkpoint.tsx +5 -1
- package/src/components/composites/confirmation/confirmation.tsx +15 -1
- package/src/components/composites/context/context.tsx +9 -1
- package/src/components/composites/file-tree/file-tree.tsx +11 -1
- package/src/components/composites/help-center/help-center.tsx +5 -1
- package/src/components/composites/icon-picker/icon-picker.tsx +59 -31
- package/src/components/composites/icon-picker/shell-icons.ts +121 -59
- package/src/components/composites/inline-citation/inline-citation.tsx +6 -1
- package/src/components/composites/list-row/list-row-control.tsx +7 -5
- package/src/components/composites/message-scroller/message-scroller.tsx +6 -1
- package/src/components/composites/model-selector/model-selector.tsx +11 -1
- package/src/components/composites/plan/plan.tsx +5 -1
- package/src/components/composites/queue/queue.tsx +15 -1
- package/src/components/composites/reasoning/reasoning.tsx +5 -1
- package/src/components/composites/scene-controls/scene-controls.tsx +17 -1
- package/src/components/composites/settings/settings.tsx +23 -14
- package/src/components/composites/sources/sources.tsx +27 -20
- package/src/components/composites/stack-trace/stack-trace.tsx +13 -1
- package/src/components/composites/stat/stat.tsx +9 -1
- package/src/components/composites/subagent/subagent.tsx +5 -1
- package/src/components/composites/task/task.tsx +5 -1
- package/src/components/composites/terminal/ansi.ts +18 -0
- package/src/components/composites/terminal/terminal.tsx +17 -7
- package/src/components/composites/test-results/test-results.tsx +17 -7
- package/src/components/composites/tool/tool.tsx +5 -1
- package/src/components/composites/tree/tree.tsx +5 -1
- package/src/components/composites/update-dialog/update-dialog.tsx +35 -15
- package/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
- package/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
- package/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
- package/src/components/conversation/busy-send-button.tsx +11 -1
- package/src/components/conversation/conversation-avatar.tsx +7 -1
- package/src/components/conversation/conversation-surface.tsx +5 -1
- package/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
- package/src/components/conversation/message-composer.tsx +13 -1
- package/src/components/conversation/message-row.tsx +15 -1
- package/src/components/conversation/thread-panel.tsx +5 -1
- package/src/components/conversation/transcript-composition.tsx +5 -1
- package/src/components/layout/floating-preview/floating-preview.tsx +6 -1
- package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
- package/src/components/layout/shell-rail/shell-rail.tsx +5 -1
- package/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
- package/src/components/layout/split-layout/split-layout.tsx +6 -1
- package/src/components/layout/top-bar/top-bar.tsx +5 -1
- package/src/components/theme/appearance-panel.tsx +6 -1
- package/src/components/theme/theme-mode-toggle.tsx +7 -1
- package/src/components/theme/theme-toggle.tsx +7 -1
- package/src/components/ui/accordion/accordion.tsx +5 -1
- package/src/components/ui/alert/alert.tsx +20 -3
- package/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
- package/src/components/ui/attachment/attachment.tsx +19 -8
- package/src/components/ui/badge/badge.tsx +24 -8
- package/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
- package/src/components/ui/button/button.tsx +47 -16
- package/src/components/ui/calendar/calendar.tsx +6 -1
- package/src/components/ui/carousel/carousel.tsx +15 -5
- package/src/components/ui/checkbox/checkbox.tsx +260 -22
- package/src/components/ui/code-block/code-block.tsx +11 -5
- package/src/components/ui/combobox/combobox.tsx +8 -9
- package/src/components/ui/command/command.tsx +8 -4
- package/src/components/ui/detail-panel/detail-panel.tsx +5 -1
- package/src/components/ui/dialog/dialog.tsx +5 -1
- package/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
- package/src/components/ui/empty/empty-state.tsx +5 -1
- package/src/components/ui/field/field.tsx +14 -5
- package/src/components/ui/input/input-control.tsx +28 -19
- package/src/components/ui/input/input.tsx +9 -12
- package/src/components/ui/input-group/input-group.tsx +1 -8
- package/src/components/ui/message/index.ts +3 -0
- package/src/components/ui/message/message.tsx +11 -2
- package/src/components/ui/message/parse-message-text.ts +94 -2
- package/src/components/ui/native-select/native-select.tsx +6 -9
- package/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
- package/src/components/ui/pagination/pagination.tsx +11 -1
- package/src/components/ui/questionnaire/questionnaire.tsx +13 -1
- package/src/components/ui/radio-group/radio-group.tsx +6 -9
- package/src/components/ui/resizable/resizable.tsx +5 -1
- package/src/components/ui/select/select.tsx +11 -1
- package/src/components/ui/sheet/sheet.tsx +5 -1
- package/src/components/ui/spinner/spinner.tsx +5 -1
- package/src/components/ui/status-chip/status-chip.tsx +14 -7
- package/src/components/ui/switch/switch.tsx +235 -28
- package/src/components/ui/textarea/textarea.tsx +1 -8
- package/src/components/ui/toast/toast.tsx +5 -1
- package/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
- package/src/components/ui/tooltip/index.ts +1 -0
- package/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
- package/src/components/ui/trace/trace.tsx +61 -28
- package/src/components/ui/typography/typography.tsx +6 -5
- package/src/lib/clipboard.ts +4 -0
- package/src/lib/fast-icon.ts +88 -0
- package/src/lib/form-field.ts +7 -7
- package/src/lib/observe-resize.ts +28 -0
- package/src/lint/index.ts +199 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"questionnaire.js","names":["Check","CircleHelp","Clock","LoaderCircle","createEffect","createMemo","createSignal","createUniqueId","For","on","Show","splitProps","cn","Button","Checkbox","RadioGroup","RadioGroupItem","Textarea","id","label","description","prompt","options","multiple","allowText","textLabel","textPlaceholder","optional","optionIds","text","EMPTY","answerFor","record","question","Object","hasOwn","undefined","isQuestionAnswered","answer","length","trim","questions","title","status","answers","defaultAnswers","onAnswersChange","onSubmit","disabledReason","error","submitLabel","Questionnaire","props","local","rest","uid","internal","setInternal","step","setStep","settled","hostDisabledReason","locked","count","current","Math","min","last","reasonId","submitReason","questionHeading","answerOf","change","next","value","canAdvance","canSubmit","every","sending","submit","root","focusWithin","wasSettled","done","document","activeElement","body","focus","preventScroll","defer","firstStep","onKeyDown","event","key","metaKey","ctrlKey","preventDefault","summary","map","chosen","filter","option","includes","parts","_el$","_tmpl$5","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","$$focusout","relatedTarget","Node","currentTarget","contains","$$focusin","$$keydown","_$use","element","_$spread","_$mergeProps","class","_$insert","_$createComponent","when","fallback","children","descriptionSlot","_el$1","_tmpl$6","_el$6","_tmpl$","_el$7","_tmpl$2","_el$10","_tmpl$7","each","entry","_el$11","_tmpl$8","_el$12","_el$13","_c$","_$memo","join","keyed","_el$14","_tmpl$11","_el$15","_el$20","_el$16","_tmpl$9","_el$19","_el$21","_tmpl$0","onChange","disabled","variant","_el$22","_tmpl$1","checked","ids","_$effect","_$setAttribute","_el$23","_tmpl$10","_el$24","rows","placeholder","onInput","_el$9","_tmpl$3","errorSlot","_el$25","_tmpl$12","_el$0","_tmpl$4","_tmpl$13","type","size","onClick","max","_$delegateEvents"],"sources":["../../../../src/components/ui/questionnaire/questionnaire.tsx"],"sourcesContent":["import { Check, CircleHelp, Clock, LoaderCircle } from 'lucide-solid'\nimport {\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n For,\n on,\n Show,\n splitProps,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\nimport { Checkbox } from '../checkbox'\nimport { RadioGroup, RadioGroupItem } from '../radio-group'\nimport { Textarea } from '../textarea'\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, rest] = splitProps(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>(local.defaultAnswers ?? {})\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 let wasSettled = settled()\n createEffect(\n on(\n settled,\n (done) => {\n // `settled` is not memoised, so this also runs for open -> submitting.\n if (done === wasSettled) return\n wasSettled = 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\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 let firstStep = true\n createEffect(() => {\n void step()\n if (firstStep) {\n firstStep = false\n return\n }\n questionHeading?.focus()\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) =>\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":";;;;;;;;;;;;;;;;;;;;;;;;AA2EA,IAAM8B,QAA6B;CAAEF,WAAW,CAAA;CAAIC,MAAM;AAAG;;;;;;;AAQ7D,SAAgBE,UACdC,QACAC,UACiC;CACjC,OAAOC,OAAOC,OAAOH,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A,KAAA,sBAAA;UAAA,OACjBd,mBAAmB,IAAIO,WAAWhC,KAAAA;SAAS;SAC7DkJ,eAAe3H,SAASe,UAAUT,KAAKC,IAAIH,MAAM,IAAI,GAAGW,QAAQ,CAAC,CAAC;SAACsD,UAAA;QAAA,CAAA;OAAA;OAAA,IAAAA,WAAA;QAAA,OAAAH,gBAMtEhH,QAAM;SACLuK,MAAI;SACJC,MAAI;SAAA,IACJvB,WAAQ;UAAA,OAAEhG,OAAO,KAAK,CAACc,UAAU,KAAKvB,MAAMN,aAAaX,KAAAA;SAAS;SAAA,KAAA,sBAAA;UAAA,OAChDiC,aAAa,IAAID,WAAWhC,KAAAA;SAAS;SACvDkJ,eAAe,KAAKvG,OAAO;SAAC,IAAAiD,WAAA;UAAA,OAAA,CAAAH,gBAE3BnH,MAAI;WAAA,IAACoH,OAAI;YAAA,OAAEnF,OAAO,MAAM;WAAY;WAAA,IAAAqF,WAAA;YAAA,OAAAH,gBAClC1H,cAAY;aAAA,eAAA;aAAA,SAAA;YAAA,CAAA;WAAA;UAAA,CAAA,GAAA8I,WAEd5F,MAAMH,eAAe,aAAa,CAAA;SAAA;QAAA,CAAA;OAAA;MAAA,CAAA,GAAA,IAAA;MAAA,OAAA+H;KAAA,EAAA,CAAA;IAAA;GAAA;EAAA,CAAA,GAAA,IAAA;EAAA,OAAAzE;CAAA,EAAA,CAAA;AAOjD;AAACgF,eAAA;CAAA;CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"questionnaire.js","names":["Check","LucideCheck","CircleHelp","LucideCircleHelp","Clock","LucideClock","LoaderCircle","LucideLoaderCircle","createEffect","createMemo","createSignal","createUniqueId","For","on","Show","splitProps","cn","Button","Checkbox","RadioGroup","RadioGroupItem","Textarea","fastIcon","id","label","description","prompt","options","multiple","allowText","textLabel","textPlaceholder","optional","optionIds","text","EMPTY","answerFor","record","question","Object","hasOwn","undefined","isQuestionAnswered","answer","length","trim","questions","title","status","answers","defaultAnswers","onAnswersChange","onSubmit","disabledReason","error","submitLabel","Questionnaire","props","local","rest","uid","internal","setInternal","step","setStep","settled","hostDisabledReason","locked","count","current","Math","min","last","reasonId","submitReason","questionHeading","answerOf","change","next","value","canAdvance","canSubmit","every","sending","submit","root","focusWithin","wasSettled","done","document","activeElement","body","focus","preventScroll","defer","firstStep","onKeyDown","event","key","metaKey","ctrlKey","preventDefault","summary","map","chosen","filter","option","includes","parts","_el$","_tmpl$5","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","$$focusout","relatedTarget","Node","currentTarget","contains","$$focusin","$$keydown","_$use","element","_$spread","_$mergeProps","class","_$insert","_$createComponent","when","fallback","children","descriptionSlot","_el$1","_tmpl$6","_el$6","_tmpl$","_el$7","_tmpl$2","_el$10","_tmpl$7","each","entry","_el$11","_tmpl$8","_el$12","_el$13","_c$","_$memo","join","keyed","_el$14","_tmpl$11","_el$15","_el$20","_el$16","_tmpl$9","_el$19","_el$21","_tmpl$0","onChange","disabled","variant","_el$22","_tmpl$1","checked","ids","_$effect","_$setAttribute","_el$23","_tmpl$10","_el$24","rows","placeholder","onInput","_el$9","_tmpl$3","errorSlot","_el$25","_tmpl$12","_el$0","_tmpl$4","_tmpl$13","type","size","onClick","max","_$delegateEvents"],"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 {\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n For,\n on,\n Show,\n splitProps,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\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, rest] = splitProps(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>(local.defaultAnswers ?? {})\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 let wasSettled = settled()\n createEffect(\n on(\n settled,\n (done) => {\n // `settled` is not memoised, so this also runs for open -> submitting.\n if (done === wasSettled) return\n wasSettled = 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\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 let firstStep = true\n createEffect(() => {\n void step()\n if (firstStep) {\n firstStep = false\n return\n }\n questionHeading?.focus()\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) =>\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":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAMA,UAAQsB,SAASrB,KAAW;AAClC,IAAMC,eAAaoB,SAASnB,UAAgB;AAC5C,IAAMC,UAAQkB,SAASjB,KAAW;AAClC,IAAMC,iBAAegB,SAASf,YAAkB;AA0DhD,IAAM4B,QAA6B;CAAEF,WAAW,CAAA;CAAIC,MAAM;AAAG;;;;;;;AAQ7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3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/radio-group/radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAE3E,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AASnD;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,iBAAiB,CAAC,eAwBzE;AAED,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,GAAG;IAChF,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IAC5B,iFAAiF;IACjF,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACpB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,eA0FxD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useFormFieldControl } from "../../../lib/form-field.js";
|
|
2
2
|
import { cn } from "../../../lib/utils.js";
|
|
3
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
3
4
|
import { createComponent, insert, memo, mergeProps, template } from "solid-js/web";
|
|
4
5
|
import { Circle } from "lucide-solid";
|
|
5
6
|
import { Show, children, splitProps } from "solid-js";
|
|
@@ -7,6 +8,7 @@ import { RadioGroup } from "@kobalte/core/radio-group";
|
|
|
7
8
|
// src/components/ui/radio-group/radio-group.tsx
|
|
8
9
|
var _tmpl$ = /*#__PURE__*/ template(`<span data-slot=radio-group-item-media class="flex shrink-0 items-center">`);
|
|
9
10
|
var _tmpl$2 = /*#__PURE__*/ template(`<div class="grid gap-0.5 leading-none">`);
|
|
11
|
+
var Circle$1 = fastIcon(Circle);
|
|
10
12
|
/**
|
|
11
13
|
* RadioGroup.
|
|
12
14
|
*
|
|
@@ -29,14 +31,7 @@ function RadioGroup$1(props) {
|
|
|
29
31
|
"aria-invalid",
|
|
30
32
|
"aria-errormessage"
|
|
31
33
|
]);
|
|
32
|
-
const field = useFormFieldControl("group",
|
|
33
|
-
id: local.id,
|
|
34
|
-
"aria-label": local["aria-label"],
|
|
35
|
-
"aria-labelledby": local["aria-labelledby"],
|
|
36
|
-
"aria-describedby": local["aria-describedby"],
|
|
37
|
-
"aria-invalid": local["aria-invalid"],
|
|
38
|
-
"aria-errormessage": local["aria-errormessage"]
|
|
39
|
-
});
|
|
34
|
+
const field = useFormFieldControl("group", local);
|
|
40
35
|
return createComponent(RadioGroup, mergeProps({
|
|
41
36
|
"data-slot": "radio-group",
|
|
42
37
|
get id() {
|
|
@@ -132,7 +127,7 @@ function RadioGroupItem(props) {
|
|
|
132
127
|
return createComponent(RadioGroup.ItemIndicator, {
|
|
133
128
|
"class": "flex items-center justify-center",
|
|
134
129
|
get children() {
|
|
135
|
-
return createComponent(Circle, { "class": "size-2 fill-current" });
|
|
130
|
+
return createComponent(Circle$1, { "class": "size-2 fill-current" });
|
|
136
131
|
}
|
|
137
132
|
});
|
|
138
133
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.js","names":["RadioGroup","KobalteRadioGroup","Circle","Show","children","resolveChildren","splitProps","useFormFieldControl","cn","props","local","rest","field","
|
|
1
|
+
{"version":3,"file":"radio-group.js","names":["RadioGroup","KobalteRadioGroup","Circle","LucideCircle","Show","children","resolveChildren","splitProps","useFormFieldControl","cn","fastIcon","props","local","rest","field","_$createComponent","_$mergeProps","id","class","Item","controlClass","label","description","variant","media","RadioGroupItem","card","undefined","title","ItemInput","ItemControl","ItemIndicator","when","slot","_el$","_tmpl$","_$insert","_$memo","_el$2","_tmpl$2","_c$","ItemLabel","_c$2","ItemDescription"],"sources":["../../../../src/components/ui/radio-group/radio-group.tsx"],"sourcesContent":["import { RadioGroup as KobalteRadioGroup } from '@kobalte/core/radio-group'\nimport { Circle as LucideCircle } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { Show, children as resolveChildren, splitProps } 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 */\nexport function RadioGroup(props: ComponentProps<typeof KobalteRadioGroup>) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('group', local)\n return (\n <KobalteRadioGroup\n data-slot=\"radio-group\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn('grid gap-2', local.class)}\n {...rest}\n />\n )\n}\n\nexport type RadioGroupItemProps = ComponentProps<typeof KobalteRadioGroup.Item> & {\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\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 input. Wrapping the\n * card in a `<label>` would nest the item's own label inside another.\n */\nexport function RadioGroupItem(props: RadioGroupItemProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'controlClass',\n 'label',\n 'description',\n 'variant',\n 'media',\n 'children',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-busy',\n 'title',\n ])\n const card = () => local.variant === 'card'\n\n const media = resolveChildren(() => local.media)\n return (\n <KobalteRadioGroup.Item\n data-slot=\"radio-group-item\"\n data-variant={card() ? 'card' : undefined}\n title={local.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 'has-[input:focus-visible]:border-ring has-[input:focus-visible]:ring-3 has-[input:focus-visible]:ring-primary-subtle':\n card(),\n },\n local.class\n )}\n {...rest}\n >\n <KobalteRadioGroup.ItemInput\n aria-label={local['aria-label']}\n aria-labelledby={local['aria-labelledby']}\n aria-describedby={local['aria-describedby']}\n aria-invalid={local['aria-invalid']}\n aria-busy={local['aria-busy']}\n title={local.title}\n />\n <KobalteRadioGroup.ItemControl\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 local.controlClass\n )}\n >\n <KobalteRadioGroup.ItemIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </KobalteRadioGroup.ItemIndicator>\n </KobalteRadioGroup.ItemControl>\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 {local.children ?? (\n <div class=\"grid gap-0.5 leading-none\">\n {local.label ? (\n <KobalteRadioGroup.ItemLabel\n class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}\n >\n {local.label}\n </KobalteRadioGroup.ItemLabel>\n ) : null}\n {local.description ? (\n <KobalteRadioGroup.ItemDescription class=\"text-muted-foreground text-sm\">\n {local.description}\n </KobalteRadioGroup.ItemDescription>\n ) : null}\n </div>\n )}\n </KobalteRadioGroup.Item>\n )\n}\n"],"mappings":";;;;;;;;;;AASA,IAAME,WAASQ,SAASP,MAAY;;;;;;;;;;;;;AAcpC,SAAgBH,aAAWW,OAAiD;CAC1E,MAAM,CAACC,OAAOC,QAAQN,WAAWI,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;CAAmB,CACpB;CACD,MAAMG,QAAQN,oBAAoB,SAASI,KAAK;CAChD,OAAAG,gBACGd,YAAiBe,WAAA;EAAA,aAAA;EAAA,IAEhBC,KAAE;GAAA,OAAEH,OAAOG,MAAML,MAAMK;EAAE;EAAA,KAAA,gBAAA;GAAA,OACbL,MAAM;EAAa;EAAA,KAAA,qBAAA;GAAA,OACdE,QAAQ,sBAAsBF,MAAM;EAAkB;EAAA,KAAA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"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAA;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/resizable/resizable.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAA;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AA4B9C,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,kCAa/F;AAgBD,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,kCAchG;AAED,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,GAAG;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC7B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,kCA2B1D"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
2
|
import { resizeGripClass, resizeGripIconClass, resizeSeparatorClass } from "../../../lib/resize-separator.js";
|
|
3
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
3
4
|
import { className, createComponent, effect, insert, memo, mergeProps, template } from "solid-js/web";
|
|
4
5
|
import { GripVertical } from "lucide-solid";
|
|
5
6
|
import { createContext, splitProps, useContext } from "solid-js";
|
|
@@ -7,6 +8,7 @@ import Resizable from "@corvu/resizable";
|
|
|
7
8
|
// src/components/ui/resizable/resizable.tsx
|
|
8
9
|
var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=resizable-grip>`);
|
|
9
10
|
var _tmpl$2 = /*#__PURE__*/ template(`<div>`);
|
|
11
|
+
var GripVertical$1 = fastIcon(GripVertical);
|
|
10
12
|
/**
|
|
11
13
|
* Resizable.
|
|
12
14
|
*
|
|
@@ -86,7 +88,7 @@ function ResizableHandle(props) {
|
|
|
86
88
|
return _el$;
|
|
87
89
|
})() : memo(() => !!local.withHandle)() ? (() => {
|
|
88
90
|
var _el$2 = _tmpl$2();
|
|
89
|
-
insert(_el$2, createComponent(GripVertical, { "class": resizeGripIconClass }));
|
|
91
|
+
insert(_el$2, createComponent(GripVertical$1, { "class": resizeGripIconClass }));
|
|
90
92
|
effect(() => className(_el$2, resizeGripClass.chip));
|
|
91
93
|
return _el$2;
|
|
92
94
|
})() : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable.js","names":["Resizable","GripVertical","createContext","splitProps","useContext","cn","resizeGripClass","resizeGripIconClass","resizeSeparatorClass","GroupSizesContext","ResizablePanelGroup","props","class","local","rest","_$createComponent","Provider","value","initialSizes","undefined","sizes","children","_$mergeProps","remainingSize","left","reduce","total","size","length","ResizablePanel","Panel","group","contextId","groupHasSizes","initialSize","Handle","withHandle","label","ResizableHandle","orientation","_$memo","_el$","_tmpl$","_$effect","_$className","rung","_el$2","_tmpl$2","_$insert","chip"],"sources":["../../../../src/components/ui/resizable/resizable.tsx"],"sourcesContent":["import Resizable from '@corvu/resizable'\nimport { GripVertical } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { createContext, splitProps, useContext } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { resizeGripClass, resizeGripIconClass, resizeSeparatorClass } from '#lib/resize-separator'\n\n/**\n * Resizable.\n *\n * A split layout: panels the user can resize, with a handle between them. This\n * is the shape of every IDE-like surface, rail, file tree, editor, terminal,\n * and the reason it is a primitive rather than something each view improvises.\n *\n * corvu supplies the pointer capture, the min/max constraints and the keyboard\n * resizing, which is what makes a divider operable without a mouse. The handle\n * is a real focusable element with an accessible role, so a split pane can be\n * adjusted from the keyboard; a bare `cursor-col-resize` div cannot.\n */\n/**\n * Whether the group was given `initialSizes` or controlled `sizes`. Those are corvu's to apply, and a\n * panel's own `initialSize` overrides them, so an unsized panel must not invent\n * one when the group already has an answer.\n */\nconst GroupSizesContext = createContext<() => boolean>(() => false)\n\nexport function ResizablePanelGroup(props: ComponentProps<typeof Resizable> & { class?: string }) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <GroupSizesContext.Provider\n value={() => rest.initialSizes !== undefined || rest.sizes !== undefined}\n >\n <Resizable\n class={cn('flex size-full data-[orientation=vertical]:flex-col', local.class)}\n {...rest}\n />\n </GroupSizesContext.Provider>\n )\n}\n\n/**\n * The size an unsized panel registers with: whatever its earlier siblings left.\n *\n * corvu registers a panel without `initialSize` at a flat 50%, so `0.28` beside\n * an unsized panel summed to 78% and left a gap. Panels register in document\n * order, so at registration `sizes` holds exactly the panels before this one.\n * When nothing is left, a second unsized panel, it takes an equal share, and\n * corvu shrinks the earlier panels by that share to keep the total at 100%.\n */\nfunction remainingSize(sizes: readonly number[]): number {\n const left = 1 - sizes.reduce((total, size) => total + size, 0)\n return left > 0.001 ? left : 1 / (sizes.length + 1)\n}\n\nexport function ResizablePanel(props: ComponentProps<typeof Resizable.Panel> & { class?: string }) {\n const [local, rest] = splitProps(props, ['class', 'initialSize'])\n const group = Resizable.useContext(rest.contextId)\n const groupHasSizes = useContext(GroupSizesContext)\n\n return (\n <Resizable.Panel\n initialSize={\n local.initialSize ?? (groupHasSizes() ? undefined : remainingSize(group.sizes()))\n }\n class={cn('min-h-0 min-w-0 overflow-hidden', local.class)}\n {...rest}\n />\n )\n}\n\nexport type ResizableHandleProps = ComponentProps<typeof Resizable.Handle> & {\n class?: string\n /**\n * Draw a visible grip in the middle of the divider: `true` is the bordered\n * chip with its grip icon; `'rung'` is a quieter translucent bar with no\n * icon, for edges that should read as barely there. Either way the divider\n * keeps its full 24px hit target.\n */\n withHandle?: boolean | 'rung'\n /**\n * The divider's accessible name. It is a focusable control, arrow keys move\n * the split, so it needs one; without it a screen reader announces an\n * unlabelled button between the two panels.\n */\n label?: string\n}\n\nexport function ResizableHandle(props: ResizableHandleProps) {\n const [local, rest] = splitProps(props, ['class', 'withHandle', 'label'])\n const group = Resizable.useContext(rest.contextId)\n\n return (\n <Resizable.Handle\n aria-label={local.label ?? 'Resize panels'}\n // A separator's orientation is the line's own, which runs across the\n // group: a row of panels is divided by a vertical line, a column by a\n // horizontal one. corvu reports the group's orientation instead.\n aria-orientation={group.orientation() === 'horizontal' ? 'vertical' : 'horizontal'}\n class={cn(\n resizeSeparatorClass(local.withHandle === 'rung' ? 'rung' : 'chip'),\n 'relative w-px data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full',\n local.class\n )}\n {...rest}\n >\n {local.withHandle === 'rung' ? (\n <div data-slot=\"resizable-grip\" class={resizeGripClass.rung} />\n ) : local.withHandle ? (\n <div class={resizeGripClass.chip}>\n <GripVertical class={resizeGripIconClass} />\n </div>\n ) : null}\n </Resizable.Handle>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resizable.js","names":["Resizable","GripVertical","LucideGripVertical","createContext","splitProps","useContext","cn","resizeGripClass","resizeGripIconClass","resizeSeparatorClass","fastIcon","GroupSizesContext","ResizablePanelGroup","props","class","local","rest","_$createComponent","Provider","value","initialSizes","undefined","sizes","children","_$mergeProps","remainingSize","left","reduce","total","size","length","ResizablePanel","Panel","group","contextId","groupHasSizes","initialSize","Handle","withHandle","label","ResizableHandle","orientation","_$memo","_el$","_tmpl$","_$effect","_$className","rung","_el$2","_tmpl$2","_$insert","chip"],"sources":["../../../../src/components/ui/resizable/resizable.tsx"],"sourcesContent":["import Resizable from '@corvu/resizable'\nimport { GripVertical as LucideGripVertical } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { createContext, splitProps, useContext } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { resizeGripClass, resizeGripIconClass, resizeSeparatorClass } from '#lib/resize-separator'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst GripVertical = fastIcon(LucideGripVertical)\n\n/**\n * Resizable.\n *\n * A split layout: panels the user can resize, with a handle between them. This\n * is the shape of every IDE-like surface, rail, file tree, editor, terminal,\n * and the reason it is a primitive rather than something each view improvises.\n *\n * corvu supplies the pointer capture, the min/max constraints and the keyboard\n * resizing, which is what makes a divider operable without a mouse. The handle\n * is a real focusable element with an accessible role, so a split pane can be\n * adjusted from the keyboard; a bare `cursor-col-resize` div cannot.\n */\n/**\n * Whether the group was given `initialSizes` or controlled `sizes`. Those are corvu's to apply, and a\n * panel's own `initialSize` overrides them, so an unsized panel must not invent\n * one when the group already has an answer.\n */\nconst GroupSizesContext = createContext<() => boolean>(() => false)\n\nexport function ResizablePanelGroup(props: ComponentProps<typeof Resizable> & { class?: string }) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <GroupSizesContext.Provider\n value={() => rest.initialSizes !== undefined || rest.sizes !== undefined}\n >\n <Resizable\n class={cn('flex size-full data-[orientation=vertical]:flex-col', local.class)}\n {...rest}\n />\n </GroupSizesContext.Provider>\n )\n}\n\n/**\n * The size an unsized panel registers with: whatever its earlier siblings left.\n *\n * corvu registers a panel without `initialSize` at a flat 50%, so `0.28` beside\n * an unsized panel summed to 78% and left a gap. Panels register in document\n * order, so at registration `sizes` holds exactly the panels before this one.\n * When nothing is left, a second unsized panel, it takes an equal share, and\n * corvu shrinks the earlier panels by that share to keep the total at 100%.\n */\nfunction remainingSize(sizes: readonly number[]): number {\n const left = 1 - sizes.reduce((total, size) => total + size, 0)\n return left > 0.001 ? left : 1 / (sizes.length + 1)\n}\n\nexport function ResizablePanel(props: ComponentProps<typeof Resizable.Panel> & { class?: string }) {\n const [local, rest] = splitProps(props, ['class', 'initialSize'])\n const group = Resizable.useContext(rest.contextId)\n const groupHasSizes = useContext(GroupSizesContext)\n\n return (\n <Resizable.Panel\n initialSize={\n local.initialSize ?? (groupHasSizes() ? undefined : remainingSize(group.sizes()))\n }\n class={cn('min-h-0 min-w-0 overflow-hidden', local.class)}\n {...rest}\n />\n )\n}\n\nexport type ResizableHandleProps = ComponentProps<typeof Resizable.Handle> & {\n class?: string\n /**\n * Draw a visible grip in the middle of the divider: `true` is the bordered\n * chip with its grip icon; `'rung'` is a quieter translucent bar with no\n * icon, for edges that should read as barely there. Either way the divider\n * keeps its full 24px hit target.\n */\n withHandle?: boolean | 'rung'\n /**\n * The divider's accessible name. It is a focusable control, arrow keys move\n * the split, so it needs one; without it a screen reader announces an\n * unlabelled button between the two panels.\n */\n label?: string\n}\n\nexport function ResizableHandle(props: ResizableHandleProps) {\n const [local, rest] = splitProps(props, ['class', 'withHandle', 'label'])\n const group = Resizable.useContext(rest.contextId)\n\n return (\n <Resizable.Handle\n aria-label={local.label ?? 'Resize panels'}\n // A separator's orientation is the line's own, which runs across the\n // group: a row of panels is divided by a vertical line, a column by a\n // horizontal one. corvu reports the group's orientation instead.\n aria-orientation={group.orientation() === 'horizontal' ? 'vertical' : 'horizontal'}\n class={cn(\n resizeSeparatorClass(local.withHandle === 'rung' ? 'rung' : 'chip'),\n 'relative w-px data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full',\n local.class\n )}\n {...rest}\n >\n {local.withHandle === 'rung' ? (\n <div data-slot=\"resizable-grip\" class={resizeGripClass.rung} />\n ) : local.withHandle ? (\n <div class={resizeGripClass.chip}>\n <GripVertical class={resizeGripIconClass} />\n </div>\n ) : null}\n </Resizable.Handle>\n )\n}\n"],"mappings":";;;;;;;;;;AASA,IAAMC,iBAAeS,SAASR,YAAkB;;;;;;;;;;;;;;;;;;AAmBhD,IAAMS,oBAAoBR,oBAAmC,KAAK;AAElE,SAAgBS,oBAAoBC,OAA8D;CAChG,MAAM,CAACE,OAAOC,QAAQZ,WAAWS,OAAO,CAAC,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aAAa;EAAY;EAAA,KAAA,WAAA;GAAA,OAC3EnC,GACLG,qBAAqBM,MAAMuB,eAAe,SAAS,SAAS,MAAM,GAClE,qFACAvB,MAAMD,KACR;EAAC;CAAA,GACGE,MAAI,EAAA,IAAAO,WAAA;EAAA,OAEPmB,WAAA3B,MAAMuB,eAAe,MAAM,CAAA,CAAA,WAAA;GAAA,IAAAK,OAAAC,OAAA;GAAAC,aAAAC,UAAAH,MACapC,gBAAgBwC,IAAI,CAAA;GAAA,OAAAJ;EAAA,EAAA,CAAA,IACzDD,WAAA,CAAA,CAAA3B,MAAMuB,UAAU,CAAA,CAAA,WAAA;GAAA,IAAAU,QAAAC,QAAA;GAAAC,OAAAF,OAAA/B,gBAEfhB,gBAAY,EAAA,SAAQO,oBAAmB,CAAA,CAAA;GAAAqC,aAAAC,UAAAE,OAD9BzC,gBAAgB4C,IAAI,CAAA;GAAA,OAAAH;EAAA,EAAA,CAAA,IAG9B;CAAI,EAAA,CAAA,CAAA;AAGd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/select/select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/select/select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAM9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAIL,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAA;AASrB;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,EAC7C,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,kCAQ9D;AAED,MAA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,oBAAoB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCAEhE"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { menuItem, menuSwatchTone, topLayerProps } from "../../../lib/overlay.js";
|
|
2
2
|
import { cn } from "../../../lib/utils.js";
|
|
3
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
3
4
|
import { className, createComponent, effect, memo, mergeProps, template } from "solid-js/web";
|
|
4
5
|
import { Check, ChevronDown, ChevronsUpDown } from "lucide-solid";
|
|
5
6
|
import { Show, splitProps } from "solid-js";
|
|
6
7
|
import { Select } from "@kobalte/core/select";
|
|
7
8
|
// src/components/ui/select/select.tsx
|
|
8
9
|
var _tmpl$ = /*#__PURE__*/ template(`<span aria-hidden=true>`);
|
|
10
|
+
var Check$1 = fastIcon(Check);
|
|
11
|
+
var ChevronDown$1 = fastIcon(ChevronDown);
|
|
12
|
+
var ChevronsUpDown$1 = fastIcon(ChevronsUpDown);
|
|
9
13
|
/**
|
|
10
14
|
* Select.
|
|
11
15
|
*
|
|
@@ -50,7 +54,7 @@ function SelectTrigger(props) {
|
|
|
50
54
|
return createComponent(Select.Icon, {
|
|
51
55
|
"class": "text-muted-foreground",
|
|
52
56
|
get children() {
|
|
53
|
-
return createComponent(ChevronDown, {});
|
|
57
|
+
return createComponent(ChevronDown$1, {});
|
|
54
58
|
}
|
|
55
59
|
});
|
|
56
60
|
}
|
|
@@ -136,7 +140,7 @@ function SelectItem(props) {
|
|
|
136
140
|
"data-slot": "select-indicator",
|
|
137
141
|
"class": "absolute end-2 flex size-4 items-center justify-center text-primary",
|
|
138
142
|
get children() {
|
|
139
|
-
return createComponent(Check, { "class": "size-4" });
|
|
143
|
+
return createComponent(Check$1, { "class": "size-4" });
|
|
140
144
|
}
|
|
141
145
|
})
|
|
142
146
|
];
|
|
@@ -156,7 +160,7 @@ function SelectLabel(props) {
|
|
|
156
160
|
}
|
|
157
161
|
/** The chevron pair used when a Select is composed by hand in a field. */
|
|
158
162
|
function SelectChevronsUpDown(props) {
|
|
159
|
-
return createComponent(ChevronsUpDown, mergeProps({ "aria-hidden": "true" }, props));
|
|
163
|
+
return createComponent(ChevronsUpDown$1, mergeProps({ "aria-hidden": "true" }, props));
|
|
160
164
|
}
|
|
161
165
|
export { Select$1 as Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue };
|
|
162
166
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","names":["Select","KobalteSelect","Check","ChevronDown","ChevronsUpDown","Show","splitProps","menuItem","menuSwatchTone","topLayerProps","cn","props","local","rest","_$createComponent","_$mergeProps","gutter","Trigger","size","hideIcon","SelectTrigger","class","undefined","children","_$memo","when","Icon","Value","optionLabel","option","LABEL_FIELDS","labelFromOption","field","value","SelectValue","readLabel","state","selectedOption","Content","portalMount","SelectContent","Portal","mount","Listbox","SelectItem","Item","swatch","_el$","_tmpl$","_$effect","_$className","tone","ItemLabel","ItemIndicator","SelectSection","Section","SelectLabel","Label","SelectChevronsUpDown"],"sources":["../../../../src/components/ui/select/select.tsx"],"sourcesContent":["import { Select as KobalteSelect } from '@kobalte/core/select'\nimport { Check, ChevronDown, ChevronsUpDown } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n menuItem,\n menuSwatchTone,\n type MenuSwatchTone,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Select.\n *\n * A single choice from a list that is too long to show, or whose options are\n * only known at runtime. The distinction from RadioGroup is disclosure: a\n * Select hides the choices behind a click, which is right above roughly seven\n * options and wrong below it.\n *\n * `Select.Value` renders the human-readable label of the selection, not its\n * value, the reason a Select takes both `options` and `optionValue`/`optionText`\n * rather than a bare list of strings, and the reason the trigger never shows a\n * raw id.\n */\nexport function Select<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteSelect<Option, OptGroup>>\n) {\n // Kobalte's own default gutter is 8px; without the arrow (removed below) the\n // popper no longer folds half an arrow box into that offset, and 8px read as\n // a detached list. Four pixels is shadcn's `sideOffset`, attached, with\n // room for the trigger's own border.\n const [local, rest] = splitProps(props, ['gutter'])\n return <KobalteSelect gutter={local.gutter ?? 4} {...rest} />\n}\n\nexport type SelectTriggerProps = ComponentProps<typeof KobalteSelect.Trigger> & {\n size?: 'sm' | 'md' | 'lg'\n /** Hide the chevron, e.g. when a caller draws its own affordance. */\n hideIcon?: boolean\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const [local, rest] = splitProps(props, ['class', 'size', 'hideIcon', 'children'])\n\n return (\n <KobalteSelect.Trigger\n data-slot=\"select-trigger\"\n class={cn(\n 'border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md',\n 'whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none',\n 'data-[placeholder-shown]:text-muted-foreground',\n 'hover:border-input',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n {\n 'h-control-sm text-xs': local.size === 'sm',\n 'h-control-md text-sm': local.size === 'md' || local.size === undefined,\n 'h-control-lg text-sm': local.size === 'lg',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={!local.hideIcon}>\n <KobalteSelect.Icon class=\"text-muted-foreground\">\n <ChevronDown />\n </KobalteSelect.Icon>\n </Show>\n </KobalteSelect.Trigger>\n )\n}\n\n/**\n * What the trigger shows for the current selection.\n *\n * The default renderer is the reason a single-select needs no render prop at all.\n * Kobalte's own `Value` draws *only* its children, so a bare `<SelectValue />`\n * shows the placeholder and then goes blank the moment something is chosen: the\n * value is there, nothing paints it.\n *\n * Kobalte cannot supply a default itself, because an option is the caller's type\n * it has no way to know which field is the label. So this reads a field by\n * convention: `label`, then `name`, then `textValue`. An option shaped\n * `{ value, label }` therefore needs nothing, and anything else passes\n * `optionLabel`.\n *\n * A multiple-select still supplies its own renderer, because \"3 selected\" is a\n * summary a caller has to phrase, not something a component can guess.\n */\ntype SelectValueChildren = ComponentProps<typeof KobalteSelect.Value>['children']\n\nexport type SelectValueProps = ComponentProps<typeof KobalteSelect.Value> & {\n /**\n * Read the display text from the selected option. Supply this when the option's\n * label does not live in a field called `label`, `name` or `textValue`.\n */\n optionLabel?: (option: unknown) => string\n /** Replace the default readout entirely, for a multiple-select summary. */\n children?: SelectValueChildren\n}\n\n/** Fields a label is read from, in order. See `SelectValueProps.optionLabel`. */\nconst LABEL_FIELDS = ['label', 'name', 'textValue'] as const\n\nfunction labelFromOption(option: unknown): string {\n if (option === null || typeof option !== 'object') {\n return typeof option === 'string' ? option : ''\n }\n\n for (const field of LABEL_FIELDS) {\n const value = (option as Record<string, unknown>)[field]\n if (typeof value === 'string') return value\n }\n\n return ''\n}\n\nexport function SelectValue(props: SelectValueProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'optionLabel'])\n\n const readLabel = (state: { selectedOption: () => unknown }): string => {\n const option = state.selectedOption()\n return local.optionLabel ? local.optionLabel(option) : labelFromOption(option)\n }\n\n return (\n <KobalteSelect.Value data-slot=\"select-value\" class={cn('truncate', local.class)} {...rest}>\n {local.children ?? (readLabel as unknown as SelectValueChildren)}\n </KobalteSelect.Value>\n )\n}\n\n/**\n * The option list. The items themselves come from the root's `itemComponent`,\n * which is what makes a Select able to render a typed option rather than a\n * string; `children` here is for content above the list, such as a filter hint.\n */\nexport type SelectContentProps = ComponentProps<typeof KobalteSelect.Content> & {\n /** Keep a nested menu inside its enclosing modal's accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function SelectContent(props: SelectContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'portalMount'])\n\n return (\n <KobalteSelect.Portal mount={local.portalMount}>\n <KobalteSelect.Content\n {...topLayerProps}\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-(--kb-popper-content-available-height) min-w-[8rem] origin-(--kb-select-content-transform-origin) overflow-y-auto overflow-x-hidden',\n menuContentPadding,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n {/* No arrow: the list is the trigger's own value opened up, and Kobalte\n reserves half the arrow's 30px box as popper gutter, which is where\n the reported gap between a form trigger and its options came from. */}\n <KobalteSelect.Listbox class=\"flex flex-col\" />\n </KobalteSelect.Content>\n </KobalteSelect.Portal>\n )\n}\n\nexport function SelectItem(\n props: ComponentProps<typeof KobalteSelect.Item> & {\n /** Draw a leading colour dot from the shared tone ladder, the accent or\n * status role the option's card badge carries. `aria-hidden`; the label\n * carries the meaning. */\n swatch?: MenuSwatchTone\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'children', 'swatch'])\n\n return (\n <KobalteSelect.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <Show when={local.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: local.swatch })} />\n </Show>\n <KobalteSelect.ItemLabel>{local.children}</KobalteSelect.ItemLabel>\n {/* The indicator reads in the accent, like every other selected state in\n the system — the row's own foreground reads as decoration. */}\n <KobalteSelect.ItemIndicator\n data-slot=\"select-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </KobalteSelect.ItemIndicator>\n </KobalteSelect.Item>\n )\n}\n\nexport function SelectSection(props: ComponentProps<typeof KobalteSelect.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteSelect.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\nexport function SelectLabel(props: ComponentProps<typeof KobalteSelect.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteSelect.Label\n class={cn('text-muted-foreground px-2 py-1.5 text-2xs font-medium uppercase', local.class)}\n {...rest}\n />\n )\n}\n\n/** The chevron pair used when a Select is composed by hand in a field. */\nexport function SelectChevronsUpDown(props: ComponentProps<'svg'>) {\n return <ChevronsUpDown aria-hidden=\"true\" {...props} />\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgBA,SACdW,OACA;CAKA,MAAM,CAACC,OAAOC,QAAQP,WAAWK,OAAO,CAAC,QAAQ,CAAC;CAClD,OAAAG,gBAAQb,QAAac,WAAA,EAAA,IAACC,SAAM;EAAA,OAAEJ,MAAMI,UAAU;CAAC,EAAA,GAAMH,IAAI,CAAA;AAC3D;AAQA,SAAgBO,cAAcT,OAA2B;CACvD,MAAM,CAACC,OAAOC,QAAQP,WAAWK,OAAO;EAAC;EAAS;EAAQ;EAAY;CAAU,CAAC;CAEjF,OAAAG,gBACGb,OAAcgB,SAAOF,WAAA;EAAA,aAAA;EAAA,KAAA,WAAA;GAAA,OAEbL,GACL,6GACA,sFACA,kDACA,sBACA,oFACA,4FACA,gFACA,oJACA,+DACA;IACE,wBAAwBE,MAAMM,SAAS;IACvC,wBAAwBN,MAAMM,SAAS,QAAQN,MAAMM,SAASI,KAAAA;IAC9D,wBAAwBV,MAAMM,SAAS;GACzC,GACAN,MAAMS,KACR;EAAC;CAAA,GACGR,MAAI,EAAA,IAAAU,WAAA;EAAA,OAAA,CAAAC,WAEPZ,MAAMW,QAAQ,GAAAT,gBACdT,MAAI;GAAA,IAACoB,OAAI;IAAA,OAAE,CAACb,MAAMO;GAAQ;GAAA,IAAAI,WAAA;IAAA,OAAAT,gBACxBb,OAAcyB,MAAI;KAAA,SAAA;KAAA,IAAAH,WAAA;MAAA,OAAAT,gBAChBX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AAWK,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGb,OAAcwD,OAAK1C,WAAA,EAAA,KAAA,WAAA;EAAA,OACXL,GAAG,oEAAoEE,MAAMS,KAAK;CAAC,EAAA,GACtFR,IAAI,CAAA;AAGd;;AAGA,SAAgB6C,qBAAqB/C,OAA8B;CACjE,OAAAG,gBAAQV,gBAAcW,WAAA,EAAA,eAAA,OAAA,GAAwBJ,KAAK,CAAA;AACrD"}
|
|
1
|
+
{"version":3,"file":"select.js","names":["Select","KobalteSelect","Check","LucideCheck","ChevronDown","LucideChevronDown","ChevronsUpDown","LucideChevronsUpDown","Show","splitProps","menuItem","menuSwatchTone","topLayerProps","cn","fastIcon","props","local","rest","_$createComponent","_$mergeProps","gutter","Trigger","size","hideIcon","SelectTrigger","class","undefined","children","_$memo","when","Icon","Value","optionLabel","option","LABEL_FIELDS","labelFromOption","field","value","SelectValue","readLabel","state","selectedOption","Content","portalMount","SelectContent","Portal","mount","Listbox","SelectItem","Item","swatch","_el$","_tmpl$","_$effect","_$className","tone","ItemLabel","ItemIndicator","SelectSection","Section","SelectLabel","Label","SelectChevronsUpDown"],"sources":["../../../../src/components/ui/select/select.tsx"],"sourcesContent":["import { Select as KobalteSelect } from '@kobalte/core/select'\nimport {\n Check as LucideCheck,\n ChevronDown as LucideChevronDown,\n ChevronsUpDown as LucideChevronsUpDown,\n} from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n menuItem,\n menuSwatchTone,\n type MenuSwatchTone,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst ChevronDown = fastIcon(LucideChevronDown)\nconst ChevronsUpDown = fastIcon(LucideChevronsUpDown)\n\n/**\n * Select.\n *\n * A single choice from a list that is too long to show, or whose options are\n * only known at runtime. The distinction from RadioGroup is disclosure: a\n * Select hides the choices behind a click, which is right above roughly seven\n * options and wrong below it.\n *\n * `Select.Value` renders the human-readable label of the selection, not its\n * value, the reason a Select takes both `options` and `optionValue`/`optionText`\n * rather than a bare list of strings, and the reason the trigger never shows a\n * raw id.\n */\nexport function Select<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteSelect<Option, OptGroup>>\n) {\n // Kobalte's own default gutter is 8px; without the arrow (removed below) the\n // popper no longer folds half an arrow box into that offset, and 8px read as\n // a detached list. Four pixels is shadcn's `sideOffset`, attached, with\n // room for the trigger's own border.\n const [local, rest] = splitProps(props, ['gutter'])\n return <KobalteSelect gutter={local.gutter ?? 4} {...rest} />\n}\n\nexport type SelectTriggerProps = ComponentProps<typeof KobalteSelect.Trigger> & {\n size?: 'sm' | 'md' | 'lg'\n /** Hide the chevron, e.g. when a caller draws its own affordance. */\n hideIcon?: boolean\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const [local, rest] = splitProps(props, ['class', 'size', 'hideIcon', 'children'])\n\n return (\n <KobalteSelect.Trigger\n data-slot=\"select-trigger\"\n class={cn(\n 'border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md',\n 'whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none',\n 'data-[placeholder-shown]:text-muted-foreground',\n 'hover:border-input',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n {\n 'h-control-sm text-xs': local.size === 'sm',\n 'h-control-md text-sm': local.size === 'md' || local.size === undefined,\n 'h-control-lg text-sm': local.size === 'lg',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={!local.hideIcon}>\n <KobalteSelect.Icon class=\"text-muted-foreground\">\n <ChevronDown />\n </KobalteSelect.Icon>\n </Show>\n </KobalteSelect.Trigger>\n )\n}\n\n/**\n * What the trigger shows for the current selection.\n *\n * The default renderer is the reason a single-select needs no render prop at all.\n * Kobalte's own `Value` draws *only* its children, so a bare `<SelectValue />`\n * shows the placeholder and then goes blank the moment something is chosen: the\n * value is there, nothing paints it.\n *\n * Kobalte cannot supply a default itself, because an option is the caller's type\n * it has no way to know which field is the label. So this reads a field by\n * convention: `label`, then `name`, then `textValue`. An option shaped\n * `{ value, label }` therefore needs nothing, and anything else passes\n * `optionLabel`.\n *\n * A multiple-select still supplies its own renderer, because \"3 selected\" is a\n * summary a caller has to phrase, not something a component can guess.\n */\ntype SelectValueChildren = ComponentProps<typeof KobalteSelect.Value>['children']\n\nexport type SelectValueProps = ComponentProps<typeof KobalteSelect.Value> & {\n /**\n * Read the display text from the selected option. Supply this when the option's\n * label does not live in a field called `label`, `name` or `textValue`.\n */\n optionLabel?: (option: unknown) => string\n /** Replace the default readout entirely, for a multiple-select summary. */\n children?: SelectValueChildren\n}\n\n/** Fields a label is read from, in order. See `SelectValueProps.optionLabel`. */\nconst LABEL_FIELDS = ['label', 'name', 'textValue'] as const\n\nfunction labelFromOption(option: unknown): string {\n if (option === null || typeof option !== 'object') {\n return typeof option === 'string' ? option : ''\n }\n\n for (const field of LABEL_FIELDS) {\n const value = (option as Record<string, unknown>)[field]\n if (typeof value === 'string') return value\n }\n\n return ''\n}\n\nexport function SelectValue(props: SelectValueProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'optionLabel'])\n\n const readLabel = (state: { selectedOption: () => unknown }): string => {\n const option = state.selectedOption()\n return local.optionLabel ? local.optionLabel(option) : labelFromOption(option)\n }\n\n return (\n <KobalteSelect.Value data-slot=\"select-value\" class={cn('truncate', local.class)} {...rest}>\n {local.children ?? (readLabel as unknown as SelectValueChildren)}\n </KobalteSelect.Value>\n )\n}\n\n/**\n * The option list. The items themselves come from the root's `itemComponent`,\n * which is what makes a Select able to render a typed option rather than a\n * string; `children` here is for content above the list, such as a filter hint.\n */\nexport type SelectContentProps = ComponentProps<typeof KobalteSelect.Content> & {\n /** Keep a nested menu inside its enclosing modal's accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function SelectContent(props: SelectContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'portalMount'])\n\n return (\n <KobalteSelect.Portal mount={local.portalMount}>\n <KobalteSelect.Content\n {...topLayerProps}\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-(--kb-popper-content-available-height) min-w-[8rem] origin-(--kb-select-content-transform-origin) overflow-y-auto overflow-x-hidden',\n menuContentPadding,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n {/* No arrow: the list is the trigger's own value opened up, and Kobalte\n reserves half the arrow's 30px box as popper gutter, which is where\n the reported gap between a form trigger and its options came from. */}\n <KobalteSelect.Listbox class=\"flex flex-col\" />\n </KobalteSelect.Content>\n </KobalteSelect.Portal>\n )\n}\n\nexport function SelectItem(\n props: ComponentProps<typeof KobalteSelect.Item> & {\n /** Draw a leading colour dot from the shared tone ladder, the accent or\n * status role the option's card badge carries. `aria-hidden`; the label\n * carries the meaning. */\n swatch?: MenuSwatchTone\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'children', 'swatch'])\n\n return (\n <KobalteSelect.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <Show when={local.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: local.swatch })} />\n </Show>\n <KobalteSelect.ItemLabel>{local.children}</KobalteSelect.ItemLabel>\n {/* The indicator reads in the accent, like every other selected state in\n the system — the row's own foreground reads as decoration. */}\n <KobalteSelect.ItemIndicator\n data-slot=\"select-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </KobalteSelect.ItemIndicator>\n </KobalteSelect.Item>\n )\n}\n\nexport function SelectSection(props: ComponentProps<typeof KobalteSelect.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteSelect.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\nexport function SelectLabel(props: ComponentProps<typeof KobalteSelect.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteSelect.Label\n class={cn('text-muted-foreground px-2 py-1.5 text-2xs font-medium uppercase', local.class)}\n {...rest}\n />\n )\n}\n\n/** The chevron pair used when a Select is composed by hand in a field. */\nexport function SelectChevronsUpDown(props: ComponentProps<'svg'>) {\n return <ChevronsUpDown aria-hidden=\"true\" {...props} />\n}\n"],"mappings":";;;;;;;;;AAmBA,IAAME,UAAQY,SAASX,KAAW;AAClC,IAAMC,gBAAcU,SAAST,WAAiB;AAC9C,IAAMC,mBAAiBQ,SAASP,cAAoB;;;;;;;;;;;;;;AAepD,SAAgBP,SACde,OACA;CAKA,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO,CAAC,QAAQ,CAAC;CAClD,OAAAG,gBAAQjB,QAAakB,WAAA,EAAA,IAACC,SAAM;EAAA,OAAEJ,MAAMI,UAAU;CAAC,EAAA,GAAMH,IAAI,CAAA;AAC3D;AAQA,SAAgBO,cAAcT,OAA2B;CACvD,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO;EAAC;EAAS;EAAQ;EAAY;CAAU,CAAC;CAEjF,OAAAG,gBACGjB,OAAcoB,SAAOF,WAAA;EAAA,aAAA;EAAA,KAAA,WAAA;GAAA,OAEbN,GACL,6GACA,sFACA,kDACA,sBACA,oFACA,4FACA,gFACA,oJACA,+DACA;IACE,wBAAwBG,MAAMM,SAAS;IACvC,wBAAwBN,MAAMM,SAA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A;IAAA;GAAA,CAAA;EAAA;CAAA,EAAA,CAAA,CAAA;AAId;AAEA,SAAgBwD,cAAc3C,OAAqD;CACjF,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQjB,OAAc0D,SAAOxC,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQN,GAAG,iBAAiBG,MAAMS,KAAK;CAAC,EAAA,GAAMR,IAAI,CAAA;AACjF;AAEA,SAAgB2C,YAAY7C,OAAmD;CAC7E,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGjB,OAAc4D,OAAK1C,WAAA,EAAA,KAAA,WAAA;EAAA,OACXN,GAAG,oEAAoEG,MAAMS,KAAK;CAAC,EAAA,GACtFR,IAAI,CAAA;AAGd;;AAGA,SAAgB6C,qBAAqB/C,OAA8B;CACjE,OAAAG,gBAAQZ,kBAAca,WAAA,EAAA,eAAA,OAAA,GAAwBJ,KAAK,CAAA;AACrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sheet/sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAG/F,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE7D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sheet/sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAG/F,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAA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,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -3,6 +3,7 @@ import { overlayCornerClose, overlayDescription, overlayTitle } from "../../../l
|
|
|
3
3
|
import { cn } from "../../../lib/utils.js";
|
|
4
4
|
import { DialogOverlay } from "../dialog/dialog.js";
|
|
5
5
|
import { DialogEscapeTarget, createDialogLayer } from "../dialog/dialog-layer.js";
|
|
6
|
+
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
6
7
|
import { createComponent, memo, mergeProps, spread, template } from "solid-js/web";
|
|
7
8
|
import { X } from "lucide-solid";
|
|
8
9
|
import { Show, children, splitProps } from "solid-js";
|
|
@@ -11,6 +12,7 @@ import { Content, Dialog, Root as Sheet, Trigger as SheetTrigger } from "@kobalt
|
|
|
11
12
|
var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=sheet-header>`);
|
|
12
13
|
var _tmpl$2 = /*#__PURE__*/ template(`<div data-slot=sheet-body>`);
|
|
13
14
|
var _tmpl$3 = /*#__PURE__*/ template(`<div data-slot=sheet-footer>`);
|
|
15
|
+
var X$1 = fastIcon(X);
|
|
14
16
|
/**
|
|
15
17
|
* Sheet.
|
|
16
18
|
*
|
|
@@ -170,7 +172,7 @@ function SheetContent(props) {
|
|
|
170
172
|
tabindex: "0",
|
|
171
173
|
"class": overlayCornerClose,
|
|
172
174
|
get children() {
|
|
173
|
-
return closeButton() ?? createComponent(X, { "class": "size-4" });
|
|
175
|
+
return closeButton() ?? createComponent(X$1, { "class": "size-4" });
|
|
174
176
|
}
|
|
175
177
|
});
|
|
176
178
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","names":["KobalteDialog","KobalteDialogContent","X","children","resolveChildren","Show","splitProps","cva","overlayCornerClose","overlayDescription","overlayTitle","cn","DialogOverlay","createDialogLayer","DialogEscapeTarget","sheetVariants","variants","side","top","bottom","start","end","variant","edge","inset","size","default","panel","compoundVariants","class","defaultVariants","sheetVariantFor","closeButton","closeLabel","restoreFocusRef","SheetContent","props","local","rest","layer","onOpenAutoFocus","event","onCloseAutoFocus","_$createComponent","Portal","when","_$mergeProps","onEscapeKeyDown","_$memo","CloseButton","tabindex","SheetCloseButton","SheetHeader","band","_el$","_tmpl$","_$spread","SheetBody","_el$2","_tmpl$2","SheetFooter","_el$3","_tmpl$3","SheetTitle","Title","SheetDescription","Description"],"sources":["../../../../src/components/ui/sheet/sheet.tsx"],"sourcesContent":["import { Dialog as KobalteDialog, Content as KobalteDialogContent } from '@kobalte/core/dialog'\n// AlertDialog shares DialogRoot.Content; Sheet uses the stable named primitive.\nimport { X } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { children as resolveChildren, Show, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { overlayCornerClose, overlayDescription, overlayTitle } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { DialogOverlay } from '../dialog'\nimport { createDialogLayer, DialogEscapeTarget } from '../dialog/dialog-layer'\n\n/**\n * Sheet.\n *\n * A dialog anchored to an edge of the window rather than centred. Use it when\n * the content is a *panel beside* the work — a details inspector, a filter rail,\n * a settings flyout — so the user keeps the context it belongs to in view.\n * A centred dialog interrupts; a sheet is inspected.\n *\n * `side` decides which edge; the panel is a full-height column for `start` and\n * `end`, and a full-width row for `top` and `bottom`. The slide-in direction\n * follows from the side, so a caller never pairs them by hand.\n *\n * `variant` decides how it meets that edge. `inset` — the default for `end` —\n * docks the panel inside the main view: below the top bar, one equal gap from\n * the top bar, the end edge and the bottom, with no scrim, so the work it edits\n * stays visible and the top bar stays reachable. It is the shape for editing one\n * thing beside its context (appearance settings, a task, a record). `edge` runs\n * edge to edge over a scrim — the shape of a navigation drawer, and the default\n * for every other side.\n *\n * Its parts read alike everywhere: `SheetHeader` holds a heading, a description\n * and a full-width rule beneath, with the close button in the corner;\n * `SheetBody` scrolls on its own; `SheetFooter` is a full-width band that holds\n * the decision. Pass `band` to the header, the footer, or both to step those\n * parts onto the ladder's subtle-fill rung (see `SheetFooter`).\n *\n * Like every dialog, a sheet returns focus on close to the element focused\n * before it opened. Pass `restoreFocusRef` when a stable external opener must\n * be used instead, such as when another layer closes before the sheet opens.\n */\n// `overflow-clip`, not `overflow-hidden`: a hidden overflow can still be\n// scrolled programmatically (focus, scrollIntoView, scrollTop), which slid the\n// pinned footer out of view. Only SheetBody scrolls.\nconst sheetVariants = cva(\n 'bg-background text-foreground fixed z-(--z-dialog) flex flex-col overflow-clip border-border shadow-lg',\n {\n variants: {\n side: {\n top: 'data-expanded:slide-in-from-top data-closed:slide-out-to-top',\n bottom: 'data-expanded:slide-in-from-bottom data-closed:slide-out-to-bottom',\n start: 'data-expanded:slide-in-from-left data-closed:slide-out-to-left',\n end: 'data-expanded:slide-in-from-right data-closed:slide-out-to-right',\n },\n variant: {\n edge: '',\n inset: 'panel-dialog-inset w-lg rounded-xl border',\n },\n /**\n * `panel` gives a start or end sheet the shell's panel width\n * (`--panel-width`, 390px) — the width a pane that collapses into a sheet\n * on a narrow window already had beside the work, so its content does not\n * reflow when it moves. Top and bottom sheets span the window either way.\n */\n size: {\n default: '',\n panel: '',\n },\n },\n compoundVariants: [\n {\n side: 'top',\n variant: 'edge',\n class: 'inset-x-0 top-0 h-auto max-h-[85vh] rounded-b-xl border-b',\n },\n {\n side: 'bottom',\n variant: 'edge',\n class: 'inset-x-0 bottom-0 h-auto max-h-[85vh] rounded-t-xl border-t',\n },\n {\n side: 'start',\n variant: 'edge',\n class: 'inset-y-0 start-0 h-full w-80 max-w-[85vw] rounded-e-xl border-e',\n },\n {\n side: 'end',\n variant: 'edge',\n class: 'inset-y-0 end-0 h-full w-80 max-w-[85vw] rounded-s-xl border-s',\n },\n {\n side: ['start', 'end'],\n variant: 'edge',\n size: 'panel',\n class: 'w-panel max-w-[92vw]',\n },\n { side: ['start', 'end'], variant: 'inset', size: 'panel', class: 'w-panel' },\n ],\n defaultVariants: { side: 'end', variant: 'edge', size: 'default' },\n }\n)\n\n/** `inset` for the end edge, `edge` for every other side, unless the caller says. */\nconst sheetVariantFor = (\n side: SheetContentProps['side'],\n variant: SheetContentProps['variant']\n): 'edge' | 'inset' => variant ?? ((side ?? 'end') === 'end' ? 'inset' : 'edge')\n\nexport type SheetContentProps = ComponentProps<typeof KobalteDialogContent> &\n VariantProps<typeof sheetVariants> & {\n closeButton?: JSX.Element | false\n /** The close button's accessible name. Defaults to \"Close\". */\n closeLabel?: string\n /** Supplies the stable external element to focus when the controlled sheet closes. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n }\n\nexport function SheetContent(props: SheetContentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'side',\n 'variant',\n 'size',\n 'children',\n 'closeButton',\n 'closeLabel',\n 'restoreFocusRef',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n ])\n const layer = createDialogLayer({\n restoreFocusRef: local.restoreFocusRef,\n onOpenAutoFocus: (event) => local.onOpenAutoFocus?.(event),\n onCloseAutoFocus: (event) => local.onCloseAutoFocus?.(event),\n })\n\n const variant = () => sheetVariantFor(local.side, local.variant)\n\n const closeButton = resolveChildren(() => local.closeButton)\n return (\n <KobalteDialog.Portal>\n {/* An inset panel is beside the work, so the work stays in view: no scrim.\n It is still modal — focus stays inside and an outside click dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogOverlay />\n </Show>\n <KobalteDialogContent\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: local.side, variant: variant(), size: local.size }),\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:duration-200',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:duration-150',\n local.class\n )}\n {...rest}\n onOpenAutoFocus={layer.onOpenAutoFocus}\n onCloseAutoFocus={layer.onCloseAutoFocus}\n >\n <DialogEscapeTarget onEscapeKeyDown={props.onEscapeKeyDown}>\n {local.children}\n <Show when={closeButton() !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <KobalteDialog.CloseButton\n aria-label={local.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </KobalteDialog.CloseButton>\n </Show>\n </DialogEscapeTarget>\n </KobalteDialogContent>\n </KobalteDialog.Portal>\n )\n}\n\nexport { Root as Sheet, Trigger as SheetTrigger } from '@kobalte/core/dialog'\n\nexport function SheetCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn(local.class)} {...rest} />\n}\n\n/**\n * The sheet's title band: a heading, a description and the full-width rule\n * beneath, with the close button in the corner. `band` steps the band onto the\n * subtle-fill rung (see `SheetFooter`) — the two-toned anatomy of a sheet that\n * reads as a panel beside the work rather than one flat canvas.\n */\nexport function SheetHeader(props: ComponentProps<'div'> & { band?: boolean }) {\n const [local, rest] = splitProps(props, ['class', 'band'])\n return (\n <div\n data-slot=\"sheet-header\"\n class={cn(\n 'flex shrink-0 flex-col gap-1.5 border-b border-border p-4 pe-12 text-start',\n { 'bg-muted': local.band },\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto p-4', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The sheet's decision band: a full-width, hairline-ruled strip that holds the\n * actions. `band` paints it with `--muted` — the elevation ladder's\n * subtle-fill rung, one step up from the panel's `--background` — so the sheet\n * reads two-toned: title band and decision band on the raised rung, scrolling\n * body on the panel surface. The rung already exists for cards, sidebars and\n * input fills; this is the panel-shaped overlay family claiming it. Opt-in\n * because the flat panel is the documented default: the centred modal\n * separates with veil, hairline and shadow instead (the elevated overlay rung\n * amplifies the canvas chroma, which reads as a cast across a large panel),\n * and a host opts a whole sheet family in by passing the prop where it composes\n * the parts — not by restyling them from the outside.\n */\nexport function SheetFooter(props: ComponentProps<'div'> & { band?: boolean }) {\n const [local, rest] = splitProps(props, ['class', 'band'])\n return (\n <div\n data-slot=\"sheet-footer\"\n class={cn(\n 'flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border bg-background px-4 py-3',\n { 'bg-muted': local.band },\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Title class={cn(overlayTitle, local.class)} {...rest} />\n}\n\nexport function SheetDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Description class={cn(overlayDescription, local.class)} {...rest} />\n}\n\nexport { sheetVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAMe,gBAAgBR,IACpB,0GACA;CACES,UAAU;EACRC,MAAM;GACJC,KAAK;GACLC,QAAQ;GACRC,OAAO;GACPC,KAAK;EACP;EACAC,SAAS;GACPC,MAAM;GACNC,OAAO;EACT;;;;;;;EAOAC,MAAM;GACJC,SAAS;GACTC,OAAO;EACT;CACF;CACAC,kBAAkB;EAChB;GACEX,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM,CAAC,SAAS,KAAK;GACrBK,SAAS;GACTG,MAAM;GACNI,OAAO;EACT;EACA;GAAEZ,MAAM,CAAC,SAAS,KAAK;GAAGK,SAAS;GAASG,MAAM;GAASI,OAAO;EAAU;CAAC;CAE/EC,iBAAiB;EAAEb,MAAM;EAAOK,SAAS;EAAQG,MAAM;CAAU;AACnE,CACF;;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,EAAA,GACxDS,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAoB;CAAA,EAAA,CAAA;AAGd;;;;;;;;;;;;;;AAeA,SAAgBE,YAAYxB,OAAmD;CAC7E,MAAM,CAACC,OAAOC,QAAQhC,WAAW8B,OAAO,CAAC,SAAS,MAAM,CAAC;CACzD,cAAA;EAAA,IAAAyB,QAAAC,QAAA;EAAAN,OAAAK,OAAAf,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWnC,GACL,yGACA,EAAE,YAAY0B,MAAMgB,KAAK,GACzBhB,MAAMR,KACR;EAAC,EAAA,GACGS,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAuB;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,WAAW3B,OAAmD;CAC5E,MAAM,CAACC,OAAOC,QAAQhC,WAAW8B,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAO,gBAAQ3C,OAAcgE,OAAKlB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQnC,GAAGD,cAAc2B,MAAMR,KAAK;CAAC,EAAA,GAAMS,IAAI,CAAA;AAC5E;AAEA,SAAgB2B,iBAAiB7B,OAAyD;CACxF,MAAM,CAACC,OAAOC,QAAQhC,WAAW8B,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAO,gBAAQ3C,OAAckE,aAAWpB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQnC,GAAGF,oBAAoB4B,MAAMR,KAAK;CAAC,EAAA,GAAMS,IAAI,CAAA;AACxF"}
|
|
1
|
+
{"version":3,"file":"sheet.js","names":["KobalteDialog","KobalteDialogContent","X","LucideX","children","resolveChildren","Show","splitProps","cva","overlayCornerClose","overlayDescription","overlayTitle","cn","DialogOverlay","createDialogLayer","DialogEscapeTarget","fastIcon","sheetVariants","variants","side","top","bottom","start","end","variant","edge","inset","size","default","panel","compoundVariants","class","defaultVariants","sheetVariantFor","closeButton","closeLabel","restoreFocusRef","SheetContent","props","local","rest","layer","onOpenAutoFocus","event","onCloseAutoFocus","_$createComponent","Portal","when","_$mergeProps","onEscapeKeyDown","_$memo","CloseButton","tabindex","SheetCloseButton","SheetHeader","band","_el$","_tmpl$","_$spread","SheetBody","_el$2","_tmpl$2","SheetFooter","_el$3","_tmpl$3","SheetTitle","Title","SheetDescription","Description"],"sources":["../../../../src/components/ui/sheet/sheet.tsx"],"sourcesContent":["import { Dialog as KobalteDialog, Content as KobalteDialogContent } from '@kobalte/core/dialog'\n// AlertDialog shares DialogRoot.Content; Sheet uses the stable named primitive.\nimport { X as LucideX } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { children as resolveChildren, Show, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { overlayCornerClose, overlayDescription, overlayTitle } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { DialogOverlay } from '../dialog'\nimport { createDialogLayer, DialogEscapeTarget } from '../dialog/dialog-layer'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst X = fastIcon(LucideX)\n\n/**\n * Sheet.\n *\n * A dialog anchored to an edge of the window rather than centred. Use it when\n * the content is a *panel beside* the work — a details inspector, a filter rail,\n * a settings flyout — so the user keeps the context it belongs to in view.\n * A centred dialog interrupts; a sheet is inspected.\n *\n * `side` decides which edge; the panel is a full-height column for `start` and\n * `end`, and a full-width row for `top` and `bottom`. The slide-in direction\n * follows from the side, so a caller never pairs them by hand.\n *\n * `variant` decides how it meets that edge. `inset` — the default for `end` —\n * docks the panel inside the main view: below the top bar, one equal gap from\n * the top bar, the end edge and the bottom, with no scrim, so the work it edits\n * stays visible and the top bar stays reachable. It is the shape for editing one\n * thing beside its context (appearance settings, a task, a record). `edge` runs\n * edge to edge over a scrim — the shape of a navigation drawer, and the default\n * for every other side.\n *\n * Its parts read alike everywhere: `SheetHeader` holds a heading, a description\n * and a full-width rule beneath, with the close button in the corner;\n * `SheetBody` scrolls on its own; `SheetFooter` is a full-width band that holds\n * the decision. Pass `band` to the header, the footer, or both to step those\n * parts onto the ladder's subtle-fill rung (see `SheetFooter`).\n *\n * Like every dialog, a sheet returns focus on close to the element focused\n * before it opened. Pass `restoreFocusRef` when a stable external opener must\n * be used instead, such as when another layer closes before the sheet opens.\n */\n// `overflow-clip`, not `overflow-hidden`: a hidden overflow can still be\n// scrolled programmatically (focus, scrollIntoView, scrollTop), which slid the\n// pinned footer out of view. Only SheetBody scrolls.\nconst sheetVariants = cva(\n 'bg-background text-foreground fixed z-(--z-dialog) flex flex-col overflow-clip border-border shadow-lg',\n {\n variants: {\n side: {\n top: 'data-expanded:slide-in-from-top data-closed:slide-out-to-top',\n bottom: 'data-expanded:slide-in-from-bottom data-closed:slide-out-to-bottom',\n start: 'data-expanded:slide-in-from-left data-closed:slide-out-to-left',\n end: 'data-expanded:slide-in-from-right data-closed:slide-out-to-right',\n },\n variant: {\n edge: '',\n inset: 'panel-dialog-inset w-lg rounded-xl border',\n },\n /**\n * `panel` gives a start or end sheet the shell's panel width\n * (`--panel-width`, 390px) — the width a pane that collapses into a sheet\n * on a narrow window already had beside the work, so its content does not\n * reflow when it moves. Top and bottom sheets span the window either way.\n */\n size: {\n default: '',\n panel: '',\n },\n },\n compoundVariants: [\n {\n side: 'top',\n variant: 'edge',\n class: 'inset-x-0 top-0 h-auto max-h-[85vh] rounded-b-xl border-b',\n },\n {\n side: 'bottom',\n variant: 'edge',\n class: 'inset-x-0 bottom-0 h-auto max-h-[85vh] rounded-t-xl border-t',\n },\n {\n side: 'start',\n variant: 'edge',\n class: 'inset-y-0 start-0 h-full w-80 max-w-[85vw] rounded-e-xl border-e',\n },\n {\n side: 'end',\n variant: 'edge',\n class: 'inset-y-0 end-0 h-full w-80 max-w-[85vw] rounded-s-xl border-s',\n },\n {\n side: ['start', 'end'],\n variant: 'edge',\n size: 'panel',\n class: 'w-panel max-w-[92vw]',\n },\n { side: ['start', 'end'], variant: 'inset', size: 'panel', class: 'w-panel' },\n ],\n defaultVariants: { side: 'end', variant: 'edge', size: 'default' },\n }\n)\n\n/** `inset` for the end edge, `edge` for every other side, unless the caller says. */\nconst sheetVariantFor = (\n side: SheetContentProps['side'],\n variant: SheetContentProps['variant']\n): 'edge' | 'inset' => variant ?? ((side ?? 'end') === 'end' ? 'inset' : 'edge')\n\nexport type SheetContentProps = ComponentProps<typeof KobalteDialogContent> &\n VariantProps<typeof sheetVariants> & {\n closeButton?: JSX.Element | false\n /** The close button's accessible name. Defaults to \"Close\". */\n closeLabel?: string\n /** Supplies the stable external element to focus when the controlled sheet closes. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n }\n\nexport function SheetContent(props: SheetContentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'side',\n 'variant',\n 'size',\n 'children',\n 'closeButton',\n 'closeLabel',\n 'restoreFocusRef',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n ])\n const layer = createDialogLayer({\n restoreFocusRef: local.restoreFocusRef,\n onOpenAutoFocus: (event) => local.onOpenAutoFocus?.(event),\n onCloseAutoFocus: (event) => local.onCloseAutoFocus?.(event),\n })\n\n const variant = () => sheetVariantFor(local.side, local.variant)\n\n const closeButton = resolveChildren(() => local.closeButton)\n return (\n <KobalteDialog.Portal>\n {/* An inset panel is beside the work, so the work stays in view: no scrim.\n It is still modal — focus stays inside and an outside click dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogOverlay />\n </Show>\n <KobalteDialogContent\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: local.side, variant: variant(), size: local.size }),\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:duration-200',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:duration-150',\n local.class\n )}\n {...rest}\n onOpenAutoFocus={layer.onOpenAutoFocus}\n onCloseAutoFocus={layer.onCloseAutoFocus}\n >\n <DialogEscapeTarget onEscapeKeyDown={props.onEscapeKeyDown}>\n {local.children}\n <Show when={closeButton() !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <KobalteDialog.CloseButton\n aria-label={local.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class={overlayCornerClose}\n >\n {closeButton() ?? <X class=\"size-4\" />}\n </KobalteDialog.CloseButton>\n </Show>\n </DialogEscapeTarget>\n </KobalteDialogContent>\n </KobalteDialog.Portal>\n )\n}\n\nexport { Root as Sheet, Trigger as SheetTrigger } from '@kobalte/core/dialog'\n\nexport function SheetCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn(local.class)} {...rest} />\n}\n\n/**\n * The sheet's title band: a heading, a description and the full-width rule\n * beneath, with the close button in the corner. `band` steps the band onto the\n * subtle-fill rung (see `SheetFooter`) — the two-toned anatomy of a sheet that\n * reads as a panel beside the work rather than one flat canvas.\n */\nexport function SheetHeader(props: ComponentProps<'div'> & { band?: boolean }) {\n const [local, rest] = splitProps(props, ['class', 'band'])\n return (\n <div\n data-slot=\"sheet-header\"\n class={cn(\n 'flex shrink-0 flex-col gap-1.5 border-b border-border p-4 pe-12 text-start',\n { 'bg-muted': local.band },\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto p-4', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The sheet's decision band: a full-width, hairline-ruled strip that holds the\n * actions. `band` paints it with `--muted` — the elevation ladder's\n * subtle-fill rung, one step up from the panel's `--background` — so the sheet\n * reads two-toned: title band and decision band on the raised rung, scrolling\n * body on the panel surface. The rung already exists for cards, sidebars and\n * input fills; this is the panel-shaped overlay family claiming it. Opt-in\n * because the flat panel is the documented default: the centred modal\n * separates with veil, hairline and shadow instead (the elevated overlay rung\n * amplifies the canvas chroma, which reads as a cast across a large panel),\n * and a host opts a whole sheet family in by passing the prop where it composes\n * the parts — not by restyling them from the outside.\n */\nexport function SheetFooter(props: ComponentProps<'div'> & { band?: boolean }) {\n const [local, rest] = splitProps(props, ['class', 'band'])\n return (\n <div\n data-slot=\"sheet-footer\"\n class={cn(\n 'flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border bg-background px-4 py-3',\n { 'bg-muted': local.band },\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Title class={cn(overlayTitle, local.class)} {...rest} />\n}\n\nexport function SheetDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Description class={cn(overlayDescription, local.class)} {...rest} />\n}\n\nexport { sheetVariants }\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAME,MAAIc,SAASb,CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmC1B,IAAMc,gBAAgBT,IACpB,0GACA;CACEU,UAAU;EACRC,MAAM;GACJC,KAAK;GACLC,QAAQ;GACRC,OAAO;GACPC,KAAK;EACP;EACAC,SAAS;GACPC,MAAM;GACNC,OAAO;EACT;;;;;;;EAOAC,MAAM;GACJC,SAAS;GACTC,OAAO;EACT;CACF;CACAC,kBAAkB;EAChB;GACEX,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM;GACNK,SAAS;GACTO,OAAO;EACT;EACA;GACEZ,MAAM,CAAC,SAAS,KAAK;GACrBK,SAAS;GACTG,MAAM;GACNI,OAAO;EACT;EACA;GAAEZ,MAAM,CAAC,SAAS,KAAK;GAAGK,SAAS;GAASG,MAAM;GAASI,OAAO;EAAU;CAA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
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/spinner/spinner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAOtD;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,eAAe;;8EAWnB,CAAA;AAEF,KAAK,eAAe,GAAG,YAAY,CAAC,OAAO,eAAe,CAAC,CAAA;AAE3D,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,GAC5D,eAAe,GAAG;IAChB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;CACvB,CAAA;AAEH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,kCAkB1C"}
|