@adea-ai/ui 0.152.4 → 0.153.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +469 -580
- package/dist/components/composites/account-menu/account-menu.d.ts +5 -0
- package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +37 -13
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.d.ts +2 -1
- package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
- package/dist/components/composites/action-button/action-button.js +92 -66
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts +3 -3
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.d.ts +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +1 -1
- 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 +57 -57
- 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 +9 -9
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-types.d.ts +7 -7
- package/dist/components/composites/appearance-editor/theme-preview.d.ts +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +6 -10
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js +36 -36
- package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts +4 -4
- 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 +33 -37
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint-model.d.ts +3 -3
- package/dist/components/composites/checkpoint/checkpoint-model.js +2 -2
- package/dist/components/composites/checkpoint/checkpoint-model.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.d.ts +2 -2
- 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 +1 -1
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.d.ts +2 -2
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/build-file-tree.d.ts +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.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/icon-picker/icon-picker.js +1 -3
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/inline-citation/citation.d.ts +1 -1
- package/dist/components/composites/inline-citation/citation.js +1 -1
- package/dist/components/composites/inline-citation/citation.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.d.ts +2 -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 +22 -22
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/list-row/list-row.d.ts +5 -0
- package/dist/components/composites/list-row/list-row.d.ts.map +1 -1
- package/dist/components/composites/list-row/list-row.js +75 -83
- package/dist/components/composites/list-row/list-row.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.d.ts +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.d.ts +4 -4
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/model-selector/models.d.ts +2 -2
- package/dist/components/composites/model-selector/models.js +1 -1
- package/dist/components/composites/model-selector/models.js.map +1 -1
- package/dist/components/composites/plan/plan.d.ts.map +1 -1
- package/dist/components/composites/plan/plan.js +17 -15
- 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 +5 -7
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.d.ts +4 -4
- package/dist/components/composites/reasoning/reasoning.js +4 -4
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/settings/settings-navigation.d.ts.map +1 -1
- package/dist/components/composites/settings/settings-navigation.js +63 -14
- package/dist/components/composites/settings/settings-navigation.js.map +1 -1
- package/dist/components/composites/settings/settings.d.ts.map +1 -1
- package/dist/components/composites/settings/settings.js +32 -32
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/source.d.ts +1 -1
- package/dist/components/composites/sources/source.js.map +1 -1
- package/dist/components/composites/sources/sources.d.ts +2 -2
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/parse-stack-trace.d.ts +3 -3
- package/dist/components/composites/stack-trace/parse-stack-trace.js +4 -4
- package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.d.ts +3 -3
- 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 +14 -16
- 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 +6 -4
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/task/task.d.ts +1 -1
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/ansi.d.ts +3 -3
- package/dist/components/composites/terminal/ansi.js.map +1 -1
- package/dist/components/composites/terminal/terminal-model.d.ts +3 -3
- package/dist/components/composites/terminal/terminal-model.d.ts.map +1 -1
- package/dist/components/composites/terminal/terminal-model.js +1 -1
- package/dist/components/composites/terminal/terminal-model.js.map +1 -1
- package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
- package/dist/components/composites/terminal/terminal.js +24 -11
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results-model.d.ts +4 -4
- package/dist/components/composites/test-results/test-results-model.js +2 -2
- package/dist/components/composites/test-results/test-results-model.js.map +1 -1
- package/dist/components/composites/test-results/test-results.d.ts +1 -1
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.d.ts +4 -4
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.d.ts +1 -1
- package/dist/components/composites/tree/tree.d.ts.map +1 -1
- package/dist/components/composites/tree/tree.js +25 -18
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.d.ts +10 -4
- package/dist/components/composites/update-dialog/channel-control.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.js +14 -19
- package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
- package/dist/components/composites/update-dialog/index.d.ts +1 -1
- package/dist/components/composites/update-dialog/index.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +4 -5
- 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 +19 -20
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
- package/dist/components/conversation/busy-send-button.js +18 -20
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/composer-menu.d.ts +3 -3
- package/dist/components/conversation/composer-menu.js +3 -3
- package/dist/components/conversation/composer-menu.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.js +2 -4
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-pane.d.ts.map +1 -1
- package/dist/components/conversation/conversation-pane.js +6 -5
- package/dist/components/conversation/conversation-pane.js.map +1 -1
- package/dist/components/conversation/conversation-surface.js +3 -7
- 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 +76 -76
- 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 +32 -38
- 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 +79 -73
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/scroll-follow-core.d.ts +7 -7
- package/dist/components/conversation/scroll-follow-core.js +4 -4
- package/dist/components/conversation/scroll-follow-core.js.map +1 -1
- package/dist/components/conversation/scroll-follow.d.ts.map +1 -1
- package/dist/components/conversation/scroll-follow.js +19 -4
- package/dist/components/conversation/scroll-follow.js.map +1 -1
- package/dist/components/conversation/thread-panel.d.ts.map +1 -1
- package/dist/components/conversation/thread-panel.js +23 -23
- 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 +2 -2
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/app-shell/app-shell.d.ts +1 -1
- package/dist/components/layout/app-shell/app-shell.js +1 -1
- package/dist/components/layout/app-shell/app-shell.js.map +1 -1
- package/dist/components/layout/app-shell/skip-link.d.ts.map +1 -1
- package/dist/components/layout/app-shell/skip-link.js +4 -6
- package/dist/components/layout/app-shell/skip-link.js.map +1 -1
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +17 -17
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/panel/panel.js +2 -4
- package/dist/components/layout/panel/panel.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 +16 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail-context.d.ts +1 -1
- package/dist/components/layout/side-rail/side-rail-context.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +35 -34
- package/dist/components/layout/side-rail/side-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 +23 -23
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.d.ts.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js +25 -7
- package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.d.ts.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js +25 -7
- package/dist/components/layout/split-layout/resize-controller-core.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 +2 -2
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/status-bar/status-bar.d.ts +1 -1
- package/dist/components/layout/status-bar/status-bar.js +1 -1
- package/dist/components/layout/status-bar/status-bar.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +7 -7
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/motion/presence.d.ts +2 -2
- package/dist/components/motion/presence.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts +5 -5
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/lazy.d.ts +1 -1
- package/dist/components/theme/lazy.js.map +1 -1
- package/dist/components/theme/theme-catalogue-source.d.ts +2 -2
- package/dist/components/theme/theme-catalogue-source.js +2 -2
- package/dist/components/theme/theme-catalogue-source.js.map +1 -1
- package/dist/components/theme/theme-context.d.ts +2 -2
- package/dist/components/theme/theme-context.js +3 -3
- package/dist/components/theme/theme-context.js.map +1 -1
- package/dist/components/theme/theme-document.d.ts.map +1 -1
- package/dist/components/theme/theme-document.js +14 -9
- package/dist/components/theme/theme-document.js.map +1 -1
- package/dist/components/theme/theme-picker.d.ts +5 -5
- package/dist/components/theme/theme-picker.js.map +1 -1
- package/dist/components/theme/theme-provider-value.d.ts +0 -6
- package/dist/components/theme/theme-provider-value.d.ts.map +1 -1
- package/dist/components/theme/theme-provider-value.js +9 -3
- package/dist/components/theme/theme-provider-value.js.map +1 -1
- package/dist/components/theme/theme-script.d.ts +14 -0
- package/dist/components/theme/theme-script.d.ts.map +1 -1
- package/dist/components/theme/theme-script.js +1 -0
- package/dist/components/theme/theme-script.js.map +1 -1
- package/dist/components/theme/theme-state.d.ts +7 -7
- package/dist/components/theme/theme-state.js.map +1 -1
- package/dist/components/theme/theme-toggle.d.ts +1 -1
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.js +4 -3
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js +3 -3
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/badge/badge.js +2 -2
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/board/board.d.ts.map +1 -1
- package/dist/components/ui/board/board.js +10 -6
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/bubble/bubble.d.ts.map +1 -1
- package/dist/components/ui/bubble/bubble.js +6 -4
- package/dist/components/ui/bubble/bubble.js.map +1 -1
- package/dist/components/ui/button/button.js +2 -2
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/button-group/button-group.d.ts +1 -1
- package/dist/components/ui/button-group/button-group.js +1 -1
- package/dist/components/ui/button-group/button-group.js.map +1 -1
- package/dist/components/ui/calendar/calendar.js +6 -6
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/callout/callout.d.ts +4 -4
- package/dist/components/ui/callout/callout.js +4 -4
- package/dist/components/ui/callout/callout.js.map +1 -1
- package/dist/components/ui/card/card.d.ts +2 -2
- package/dist/components/ui/card/card.js +2 -2
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/carousel/carousel.d.ts +4 -4
- package/dist/components/ui/carousel/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/chart/chart-options.d.ts +7 -7
- package/dist/components/ui/chart/chart-options.js +9 -9
- package/dist/components/ui/chart/chart-options.js.map +1 -1
- package/dist/components/ui/chart/chart.d.ts.map +1 -1
- package/dist/components/ui/chart/chart.js +16 -7
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +8 -6
- 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 +8 -6
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/command/command.d.ts +4 -4
- package/dist/components/ui/command/command.js +4 -4
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.d.ts +1 -1
- package/dist/components/ui/context-menu/context-menu.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 +13 -13
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.d.ts +0 -4
- package/dist/components/ui/dialog/dialog-layer.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.js +17 -1
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.js +4 -3
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/diff-block/diff-block.d.ts +6 -6
- package/dist/components/ui/diff-block/diff-block.js +3 -3
- package/dist/components/ui/diff-block/diff-block.js.map +1 -1
- package/dist/components/ui/drawer/drawer.d.ts +3 -3
- package/dist/components/ui/drawer/drawer.js +2 -2
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +5 -5
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.d.ts +3 -3
- package/dist/components/ui/dropdown-menu/menu-parts.js +1 -1
- 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 +33 -36
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/empty/empty.d.ts +1 -1
- package/dist/components/ui/empty/empty.js +1 -1
- package/dist/components/ui/empty/empty.js.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.d.ts.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.js +7 -7
- package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
- package/dist/components/ui/field/field.d.ts.map +1 -1
- package/dist/components/ui/field/field.js +15 -15
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/field/number-field.d.ts +1 -1
- package/dist/components/ui/field/number-field.js +1 -1
- package/dist/components/ui/field/number-field.js.map +1 -1
- package/dist/components/ui/hover-card/hover-card.d.ts +1 -1
- package/dist/components/ui/hover-card/hover-card.js.map +1 -1
- package/dist/components/ui/input-group/input-group.d.ts +1 -1
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/input-otp/input-otp.d.ts +1 -1
- package/dist/components/ui/input-otp/input-otp.js.map +1 -1
- package/dist/components/ui/item/item.d.ts.map +1 -1
- package/dist/components/ui/item/item.js +26 -26
- package/dist/components/ui/item/item.js.map +1 -1
- package/dist/components/ui/kbd/kbd.d.ts +2 -2
- package/dist/components/ui/kbd/kbd.js +2 -2
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/kbd/platform-modifier.d.ts +3 -3
- package/dist/components/ui/kbd/platform-modifier.js +3 -3
- package/dist/components/ui/kbd/platform-modifier.js.map +1 -1
- package/dist/components/ui/label/label.d.ts +1 -1
- package/dist/components/ui/label/label.js +1 -1
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/marker/marker.d.ts.map +1 -1
- package/dist/components/ui/marker/marker.js +17 -19
- package/dist/components/ui/marker/marker.js.map +1 -1
- package/dist/components/ui/menubar/menubar.d.ts +2 -2
- package/dist/components/ui/menubar/menubar.js +1 -1
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/message/message.d.ts.map +1 -1
- package/dist/components/ui/message/message.js +16 -18
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.js +7 -11
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/ui/native-select/native-select.d.ts +1 -1
- 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 +5 -4
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.js +2 -4
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/popover/popover.d.ts.map +1 -1
- package/dist/components/ui/popover/popover.js +11 -4
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/progress/progress.d.ts.map +1 -1
- package/dist/components/ui/progress/progress.js +6 -8
- package/dist/components/ui/progress/progress.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +73 -73
- 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 +12 -6
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.d.ts +2 -2
- package/dist/components/ui/resizable/resizable.js +3 -3
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/select/select.d.ts +3 -3
- package/dist/components/ui/select/select.js +1 -1
- 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 +4 -3
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/skeleton/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton/skeleton.js +1 -1
- package/dist/components/ui/skeleton/skeleton.js.map +1 -1
- package/dist/components/ui/slider/slider.d.ts +1 -1
- package/dist/components/ui/slider/slider.js.map +1 -1
- package/dist/components/ui/spinner/spinner.d.ts +1 -1
- package/dist/components/ui/spinner/spinner.js +1 -1
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.d.ts +13 -13
- package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +11 -11
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.d.ts.map +1 -1
- package/dist/components/ui/switch/switch.js +8 -6
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/tabs/tabs.d.ts +4 -4
- package/dist/components/ui/tabs/tabs.js +4 -4
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts +1 -1
- package/dist/components/ui/textarea/textarea.js +1 -1
- 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 +13 -15
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/toggle/toggle.d.ts +1 -1
- package/dist/components/ui/toggle/toggle.js +1 -1
- package/dist/components/ui/toggle/toggle.js.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.d.ts +51 -0
- package/dist/components/ui/tooltip/deferred-tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip/deferred-tooltip.js +103 -0
- package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -0
- 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 +3 -1
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip/tooltip.js +6 -5
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/components/ui/trace/trace.d.ts.map +1 -1
- package/dist/components/ui/trace/trace.js +17 -17
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.d.ts +3 -3
- package/dist/components/ui/typography/typography.js +5 -5
- package/dist/components/ui/typography/typography.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/lib/accent-presets.d.ts +1 -1
- package/dist/lib/accent-presets.js.map +1 -1
- package/dist/lib/accent-roles.d.ts +2 -2
- package/dist/lib/accent-roles.js +2 -2
- package/dist/lib/accent-roles.js.map +1 -1
- package/dist/lib/appearance-font-settings.d.ts.map +1 -1
- package/dist/lib/appearance-font-settings.js +15 -7
- package/dist/lib/appearance-font-settings.js.map +1 -1
- package/dist/lib/create-poll.d.ts +39 -0
- package/dist/lib/create-poll.d.ts.map +1 -0
- package/dist/lib/create-poll.js +116 -0
- package/dist/lib/create-poll.js.map +1 -0
- package/dist/lib/font-zoom.d.ts +1 -1
- package/dist/lib/font-zoom.js +1 -1
- package/dist/lib/font-zoom.js.map +1 -1
- package/dist/lib/keyed-rows.d.ts +2 -1
- package/dist/lib/keyed-rows.d.ts.map +1 -1
- package/dist/lib/keyed-rows.js +3 -2
- package/dist/lib/keyed-rows.js.map +1 -1
- package/dist/lib/overlay.d.ts +5 -5
- package/dist/lib/overlay.js +5 -5
- package/dist/lib/overlay.js.map +1 -1
- package/dist/lib/preference-store.d.ts +2 -2
- package/dist/lib/preference-store.js +2 -2
- package/dist/lib/preference-store.js.map +1 -1
- package/dist/lib/safe-script.d.ts +2 -2
- package/dist/lib/safe-script.js +2 -2
- package/dist/lib/safe-script.js.map +1 -1
- package/dist/lib/scroll-geometry.d.ts +1 -1
- package/dist/lib/scroll-geometry.js +1 -1
- package/dist/lib/scroll-geometry.js.map +1 -1
- package/dist/lib/text.d.ts +1 -1
- package/dist/lib/text.js +1 -1
- package/dist/lib/text.js.map +1 -1
- package/dist/lib/theme-accents.js +3 -3
- package/dist/lib/theme-accents.js.map +1 -1
- package/dist/lib/theme-css.js.map +1 -1
- package/dist/lib/theme-defaults.d.ts +4 -4
- package/dist/lib/theme-defaults.js +4 -4
- package/dist/lib/theme-defaults.js.map +1 -1
- package/dist/lib/theme-engine-light.js.map +1 -1
- package/dist/lib/theme-engine.d.ts +2 -2
- package/dist/lib/theme-engine.js +2 -2
- package/dist/lib/theme-engine.js.map +1 -1
- package/dist/lib/theme-projection.d.ts +1 -1
- package/dist/lib/theme-projection.js +2 -2
- package/dist/lib/theme-projection.js.map +1 -1
- package/dist/lib/theme-records.d.ts +2 -2
- package/dist/lib/theme-records.js +2 -2
- package/dist/lib/theme-records.js.map +1 -1
- package/dist/lib/theme-types.d.ts +1 -1
- package/dist/lib/theme-types.js.map +1 -1
- package/dist/lib/themes.d.ts +13 -13
- package/dist/lib/themes.js +13 -13
- package/dist/lib/themes.js.map +1 -1
- package/dist/lib/tokens.d.ts +2 -2
- package/dist/lib/tokens.js +1 -1
- package/dist/lib/tokens.js.map +1 -1
- package/dist/lib/tooltip-focus-gate.d.ts +2 -2
- package/dist/lib/tooltip-focus-gate.js +2 -2
- package/dist/lib/tooltip-focus-gate.js.map +1 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/lib/variants.d.ts +4 -4
- package/dist/lib/variants.js +1 -1
- package/dist/lib/variants.js.map +1 -1
- package/dist/lib/version-notes.d.ts +4 -4
- package/dist/lib/version-notes.js +4 -4
- package/dist/lib/version-notes.js.map +1 -1
- package/dist/lint.js.map +1 -1
- package/dist/r/account-menu.json +1 -0
- package/dist/r/lib.json +5 -0
- package/dist/r/registry.json +11 -0
- package/dist/r/src/components/composites/account-menu/account-menu.tsx +22 -2
- package/dist/r/src/components/composites/action-button/action-button.tsx +124 -78
- package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -3
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +3 -3
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +15 -9
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +3 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-types.ts +7 -7
- package/dist/r/src/components/composites/appearance-editor/theme-preview.tsx +1 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +6 -2
- package/dist/r/src/components/composites/catalog-browser/catalog-detail.tsx +15 -6
- package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +4 -4
- package/dist/r/src/components/composites/chat/chat.tsx +15 -9
- package/dist/r/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
- package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +2 -2
- package/dist/r/src/components/composites/confirmation/confirmation.tsx +8 -4
- package/dist/r/src/components/composites/context/context.tsx +2 -2
- package/dist/r/src/components/composites/file-tree/build-file-tree.ts +1 -1
- package/dist/r/src/components/composites/file-tree/file-tree.tsx +16 -2
- package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +1 -1
- package/dist/r/src/components/composites/inline-citation/citation.ts +1 -1
- package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +2 -2
- package/dist/r/src/components/composites/list-row/list-row-control.tsx +31 -22
- package/dist/r/src/components/composites/list-row/list-row.tsx +69 -73
- package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +1 -1
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +4 -4
- package/dist/r/src/components/composites/model-selector/models.ts +2 -2
- package/dist/r/src/components/composites/plan/plan.tsx +19 -11
- package/dist/r/src/components/composites/queue/queue.tsx +5 -3
- package/dist/r/src/components/composites/reasoning/reasoning.tsx +4 -4
- package/dist/r/src/components/composites/settings/settings-navigation.tsx +57 -17
- package/dist/r/src/components/composites/settings/settings.tsx +14 -6
- package/dist/r/src/components/composites/sources/source.ts +1 -1
- package/dist/r/src/components/composites/sources/sources.tsx +2 -2
- package/dist/r/src/components/composites/stack-trace/parse-stack-trace.ts +7 -7
- package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +3 -3
- package/dist/r/src/components/composites/stat/stat.tsx +20 -16
- package/dist/r/src/components/composites/subagent/subagent.tsx +6 -4
- package/dist/r/src/components/composites/task/task.tsx +1 -1
- package/dist/r/src/components/composites/terminal/ansi.ts +3 -3
- package/dist/r/src/components/composites/terminal/terminal-model.ts +3 -3
- package/dist/r/src/components/composites/terminal/terminal.tsx +24 -12
- package/dist/r/src/components/composites/test-results/test-results-model.ts +4 -4
- package/dist/r/src/components/composites/test-results/test-results.tsx +1 -1
- package/dist/r/src/components/composites/tool/tool.tsx +4 -4
- package/dist/r/src/components/composites/tree/tree.tsx +31 -15
- package/dist/r/src/components/composites/update-dialog/channel-control.tsx +17 -8
- package/dist/r/src/components/composites/update-dialog/index.ts +1 -0
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +7 -7
- package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +15 -12
- package/dist/r/src/components/conversation/busy-send-button.tsx +6 -2
- package/dist/r/src/components/conversation/composer-menu.tsx +3 -3
- package/dist/r/src/components/conversation/conversation-avatar.tsx +1 -1
- package/dist/r/src/components/conversation/conversation-pane.tsx +8 -5
- package/dist/r/src/components/conversation/conversation-surface.tsx +2 -2
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +18 -12
- package/dist/r/src/components/conversation/message-composer.tsx +4 -6
- package/dist/r/src/components/conversation/message-row.tsx +34 -26
- package/dist/r/src/components/conversation/scroll-follow-core.ts +8 -8
- package/dist/r/src/components/conversation/scroll-follow.ts +24 -8
- package/dist/r/src/components/conversation/thread-panel.tsx +7 -3
- package/dist/r/src/components/conversation/transcript-composition.tsx +4 -2
- package/dist/r/src/components/layout/app-shell/app-shell.tsx +1 -1
- package/dist/r/src/components/layout/app-shell/skip-link.tsx +3 -2
- package/dist/r/src/components/layout/page/page.tsx +15 -11
- package/dist/r/src/components/layout/panel/panel.tsx +1 -1
- package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +21 -1
- package/dist/r/src/components/layout/side-rail/side-rail-context.ts +1 -1
- package/dist/r/src/components/layout/side-rail/side-rail.tsx +38 -22
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +22 -16
- package/dist/r/src/components/layout/split-layout/resize-controller-core-retry.tsx +25 -7
- package/dist/r/src/components/layout/split-layout/resize-controller-core.tsx +25 -7
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +6 -2
- package/dist/r/src/components/layout/status-bar/status-bar.tsx +1 -1
- package/dist/r/src/components/layout/top-bar/top-bar.tsx +8 -6
- package/dist/r/src/components/motion/presence.tsx +2 -2
- package/dist/r/src/components/theme/appearance-panel.tsx +5 -5
- package/dist/r/src/components/theme/lazy.ts +1 -1
- package/dist/r/src/components/theme/theme-catalogue-source.ts +2 -2
- package/dist/r/src/components/theme/theme-context.ts +3 -3
- package/dist/r/src/components/theme/theme-document.ts +22 -11
- package/dist/r/src/components/theme/theme-picker.tsx +5 -5
- package/dist/r/src/components/theme/theme-provider-value.ts +15 -3
- package/dist/r/src/components/theme/theme-script.ts +20 -0
- package/dist/r/src/components/theme/theme-state.ts +7 -7
- package/dist/r/src/components/theme/theme-toggle.tsx +1 -1
- package/dist/r/src/components/ui/alert/alert.tsx +4 -3
- package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +4 -4
- package/dist/r/src/components/ui/badge/badge.tsx +2 -2
- package/dist/r/src/components/ui/board/board.tsx +17 -5
- package/dist/r/src/components/ui/bubble/bubble.tsx +6 -4
- package/dist/r/src/components/ui/button/button.tsx +2 -2
- package/dist/r/src/components/ui/button-group/button-group.tsx +1 -1
- package/dist/r/src/components/ui/calendar/calendar.tsx +2 -2
- package/dist/r/src/components/ui/callout/callout.tsx +4 -4
- package/dist/r/src/components/ui/card/card.tsx +2 -2
- package/dist/r/src/components/ui/carousel/carousel.tsx +6 -6
- package/dist/r/src/components/ui/chart/chart-options.ts +9 -9
- package/dist/r/src/components/ui/chart/chart.tsx +14 -1
- package/dist/r/src/components/ui/checkbox/checkbox.tsx +9 -6
- package/dist/r/src/components/ui/code-block/code-block.tsx +14 -7
- package/dist/r/src/components/ui/command/command.tsx +7 -7
- package/dist/r/src/components/ui/context-menu/context-menu.tsx +1 -1
- package/dist/r/src/components/ui/detail-panel/detail-panel.tsx +5 -3
- package/dist/r/src/components/ui/dialog/dialog-layer.tsx +27 -1
- package/dist/r/src/components/ui/dialog/dialog.tsx +4 -3
- package/dist/r/src/components/ui/diff-block/diff-block.tsx +6 -6
- package/dist/r/src/components/ui/drawer/drawer.tsx +3 -3
- package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +6 -6
- package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +5 -5
- package/dist/r/src/components/ui/empty/empty-state.tsx +23 -18
- package/dist/r/src/components/ui/empty/empty.tsx +1 -1
- package/dist/r/src/components/ui/entity-icon/entity-icon.tsx +5 -1
- package/dist/r/src/components/ui/field/field.tsx +15 -7
- package/dist/r/src/components/ui/field/number-field.tsx +1 -1
- package/dist/r/src/components/ui/hover-card/hover-card.tsx +1 -1
- package/dist/r/src/components/ui/input-group/input-group.tsx +1 -1
- package/dist/r/src/components/ui/input-otp/input-otp.tsx +1 -1
- package/dist/r/src/components/ui/item/item.tsx +24 -18
- package/dist/r/src/components/ui/kbd/kbd.tsx +2 -2
- package/dist/r/src/components/ui/kbd/platform-modifier.ts +3 -3
- package/dist/r/src/components/ui/label/label.tsx +1 -1
- package/dist/r/src/components/ui/marker/marker.tsx +9 -5
- package/dist/r/src/components/ui/menubar/menubar.tsx +2 -2
- package/dist/r/src/components/ui/message/message.tsx +14 -13
- package/dist/r/src/components/ui/modal-dialog/modal-dialog.tsx +9 -5
- package/dist/r/src/components/ui/native-select/native-select.tsx +1 -1
- package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +5 -4
- package/dist/r/src/components/ui/pagination/pagination.tsx +1 -1
- package/dist/r/src/components/ui/popover/popover.tsx +4 -2
- package/dist/r/src/components/ui/progress/progress.tsx +5 -3
- package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +10 -5
- package/dist/r/src/components/ui/radio-group/radio-group.tsx +9 -6
- package/dist/r/src/components/ui/resizable/resizable.tsx +5 -5
- package/dist/r/src/components/ui/select/select.tsx +4 -4
- package/dist/r/src/components/ui/sheet/sheet.tsx +4 -3
- package/dist/r/src/components/ui/skeleton/skeleton.tsx +1 -1
- package/dist/r/src/components/ui/slider/slider.tsx +1 -1
- package/dist/r/src/components/ui/spinner/spinner.tsx +1 -1
- package/dist/r/src/components/ui/status-chip/status-chip.tsx +13 -13
- package/dist/r/src/components/ui/switch/switch.tsx +9 -6
- package/dist/r/src/components/ui/tabs/tabs.tsx +4 -4
- package/dist/r/src/components/ui/textarea/textarea.tsx +1 -1
- package/dist/r/src/components/ui/toast/toast.tsx +6 -4
- package/dist/r/src/components/ui/toggle/toggle.tsx +1 -1
- package/dist/r/src/components/ui/tooltip/deferred-tooltip.tsx +131 -0
- package/dist/r/src/components/ui/tooltip/index.ts +1 -0
- package/dist/r/src/components/ui/tooltip/tooltip.tsx +6 -4
- package/dist/r/src/components/ui/trace/trace.tsx +13 -9
- package/dist/r/src/components/ui/typography/typography.tsx +5 -5
- package/dist/r/src/lib/accent-presets.ts +1 -1
- package/dist/r/src/lib/accent-roles.ts +2 -2
- package/dist/r/src/lib/appearance-font-settings.ts +18 -7
- package/dist/r/src/lib/create-poll.ts +150 -0
- package/dist/r/src/lib/font-zoom.ts +3 -3
- package/dist/r/src/lib/keyed-rows.ts +3 -2
- package/dist/r/src/lib/overlay.ts +5 -5
- package/dist/r/src/lib/preference-store.ts +2 -2
- package/dist/r/src/lib/safe-script.ts +2 -2
- package/dist/r/src/lib/scroll-geometry.ts +1 -1
- package/dist/r/src/lib/text.ts +1 -1
- package/dist/r/src/lib/theme-accents.ts +3 -3
- package/dist/r/src/lib/theme-css.ts +2 -2
- package/dist/r/src/lib/theme-defaults.ts +4 -4
- package/dist/r/src/lib/theme-engine-light.ts +2 -2
- package/dist/r/src/lib/theme-engine.ts +2 -2
- package/dist/r/src/lib/theme-projection.ts +2 -2
- package/dist/r/src/lib/theme-records.ts +2 -2
- package/dist/r/src/lib/theme-types.ts +1 -1
- package/dist/r/src/lib/themes.ts +14 -14
- package/dist/r/src/lib/tokens.ts +2 -2
- package/dist/r/src/lib/tooltip-focus-gate.ts +11 -11
- package/dist/r/src/lib/utils.ts +1 -1
- package/dist/r/src/lib/variants.ts +4 -4
- package/dist/r/src/lib/version-notes.ts +4 -4
- package/dist/r/src/styles/base.css +12 -43
- package/dist/r/src/styles/fonts.css +1 -1
- package/dist/r/src/styles/theme.css +35 -35
- package/dist/r/tooltip.json +5 -0
- package/package.json +2 -1
- package/registry.json +11 -0
- package/src/components/composites/account-menu/account-menu.tsx +22 -2
- package/src/components/composites/action-button/action-button.tsx +124 -78
- package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -3
- package/src/components/composites/appearance-editor/appearance-choices.tsx +3 -3
- package/src/components/composites/appearance-editor/appearance-editor.tsx +15 -9
- package/src/components/composites/appearance-editor/appearance-rows.tsx +3 -1
- package/src/components/composites/appearance-editor/appearance-types.ts +7 -7
- package/src/components/composites/appearance-editor/theme-preview.tsx +1 -1
- package/src/components/composites/catalog-browser/catalog-browser.tsx +6 -2
- package/src/components/composites/catalog-browser/catalog-detail.tsx +15 -6
- package/src/components/composites/chain-of-thought/chain-of-thought.tsx +4 -4
- package/src/components/composites/chat/chat.tsx +15 -9
- package/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
- package/src/components/composites/checkpoint/checkpoint.tsx +2 -2
- package/src/components/composites/confirmation/confirmation.tsx +8 -4
- package/src/components/composites/context/context.tsx +2 -2
- package/src/components/composites/file-tree/build-file-tree.ts +1 -1
- package/src/components/composites/file-tree/file-tree.tsx +16 -2
- package/src/components/composites/icon-picker/icon-picker.tsx +1 -1
- package/src/components/composites/inline-citation/citation.ts +1 -1
- package/src/components/composites/inline-citation/inline-citation.tsx +2 -2
- package/src/components/composites/list-row/list-row-control.tsx +31 -22
- package/src/components/composites/list-row/list-row.tsx +69 -73
- package/src/components/composites/message-scroller/message-scroller.tsx +1 -1
- package/src/components/composites/model-selector/model-selector.tsx +4 -4
- package/src/components/composites/model-selector/models.ts +2 -2
- package/src/components/composites/plan/plan.tsx +19 -11
- package/src/components/composites/queue/queue.tsx +5 -3
- package/src/components/composites/reasoning/reasoning.tsx +4 -4
- package/src/components/composites/settings/settings-navigation.tsx +57 -17
- package/src/components/composites/settings/settings.tsx +14 -6
- package/src/components/composites/sources/source.ts +1 -1
- package/src/components/composites/sources/sources.tsx +2 -2
- package/src/components/composites/stack-trace/parse-stack-trace.ts +7 -7
- package/src/components/composites/stack-trace/stack-trace.tsx +3 -3
- package/src/components/composites/stat/stat.tsx +20 -16
- package/src/components/composites/subagent/subagent.tsx +6 -4
- package/src/components/composites/task/task.tsx +1 -1
- package/src/components/composites/terminal/ansi.ts +3 -3
- package/src/components/composites/terminal/terminal-model.ts +3 -3
- package/src/components/composites/terminal/terminal.tsx +24 -12
- package/src/components/composites/test-results/test-results-model.ts +4 -4
- package/src/components/composites/test-results/test-results.tsx +1 -1
- package/src/components/composites/tool/tool.tsx +4 -4
- package/src/components/composites/tree/tree.tsx +31 -15
- package/src/components/composites/update-dialog/channel-control.tsx +17 -8
- package/src/components/composites/update-dialog/index.ts +1 -0
- package/src/components/composites/update-dialog/update-dialog.tsx +7 -7
- package/src/components/composites/workspace-mark/workspace-mark.tsx +15 -12
- package/src/components/conversation/busy-send-button.tsx +6 -2
- package/src/components/conversation/composer-menu.tsx +3 -3
- package/src/components/conversation/conversation-avatar.tsx +1 -1
- package/src/components/conversation/conversation-pane.tsx +8 -5
- package/src/components/conversation/conversation-surface.tsx +2 -2
- package/src/components/conversation/internal/chat-composer-shell.tsx +18 -12
- package/src/components/conversation/message-composer.tsx +4 -6
- package/src/components/conversation/message-row.tsx +34 -26
- package/src/components/conversation/scroll-follow-core.ts +8 -8
- package/src/components/conversation/scroll-follow.ts +24 -8
- package/src/components/conversation/thread-panel.tsx +7 -3
- package/src/components/conversation/transcript-composition.tsx +4 -2
- package/src/components/layout/app-shell/app-shell.tsx +1 -1
- package/src/components/layout/app-shell/skip-link.tsx +3 -2
- package/src/components/layout/page/page.tsx +15 -11
- package/src/components/layout/panel/panel.tsx +1 -1
- package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +21 -1
- package/src/components/layout/side-rail/side-rail-context.ts +1 -1
- package/src/components/layout/side-rail/side-rail.tsx +38 -22
- package/src/components/layout/sidebar-nav/sidebar-nav.tsx +22 -16
- package/src/components/layout/split-layout/resize-controller-core-retry.tsx +25 -7
- package/src/components/layout/split-layout/resize-controller-core.tsx +25 -7
- package/src/components/layout/split-layout/split-layout.tsx +6 -2
- package/src/components/layout/status-bar/status-bar.tsx +1 -1
- package/src/components/layout/top-bar/top-bar.tsx +8 -6
- package/src/components/motion/presence.tsx +2 -2
- package/src/components/theme/appearance-panel.tsx +5 -5
- package/src/components/theme/lazy.ts +1 -1
- package/src/components/theme/theme-catalogue-source.ts +2 -2
- package/src/components/theme/theme-context.ts +3 -3
- package/src/components/theme/theme-document.ts +22 -11
- package/src/components/theme/theme-picker.tsx +5 -5
- package/src/components/theme/theme-provider-value.ts +15 -3
- package/src/components/theme/theme-script.ts +20 -0
- package/src/components/theme/theme-state.ts +7 -7
- package/src/components/theme/theme-toggle.tsx +1 -1
- package/src/components/ui/alert/alert.tsx +4 -3
- package/src/components/ui/alert-dialog/alert-dialog.tsx +4 -4
- package/src/components/ui/badge/badge.tsx +2 -2
- package/src/components/ui/board/board.tsx +17 -5
- package/src/components/ui/bubble/bubble.tsx +6 -4
- package/src/components/ui/button/button.tsx +2 -2
- package/src/components/ui/button-group/button-group.tsx +1 -1
- package/src/components/ui/calendar/calendar.tsx +2 -2
- package/src/components/ui/callout/callout.tsx +4 -4
- package/src/components/ui/card/card.tsx +2 -2
- package/src/components/ui/carousel/carousel.tsx +6 -6
- package/src/components/ui/chart/chart-options.ts +9 -9
- package/src/components/ui/chart/chart.tsx +14 -1
- package/src/components/ui/checkbox/checkbox.tsx +9 -6
- package/src/components/ui/code-block/code-block.tsx +14 -7
- package/src/components/ui/command/command.tsx +7 -7
- package/src/components/ui/context-menu/context-menu.tsx +1 -1
- package/src/components/ui/detail-panel/detail-panel.tsx +5 -3
- package/src/components/ui/dialog/dialog-layer.tsx +27 -1
- package/src/components/ui/dialog/dialog.tsx +4 -3
- package/src/components/ui/diff-block/diff-block.tsx +6 -6
- package/src/components/ui/drawer/drawer.tsx +3 -3
- package/src/components/ui/dropdown-menu/dropdown-menu.tsx +6 -6
- package/src/components/ui/dropdown-menu/menu-parts.tsx +5 -5
- package/src/components/ui/empty/empty-state.tsx +23 -18
- package/src/components/ui/empty/empty.tsx +1 -1
- package/src/components/ui/entity-icon/entity-icon.tsx +5 -1
- package/src/components/ui/field/field.tsx +15 -7
- package/src/components/ui/field/number-field.tsx +1 -1
- package/src/components/ui/hover-card/hover-card.tsx +1 -1
- package/src/components/ui/input-group/input-group.tsx +1 -1
- package/src/components/ui/input-otp/input-otp.tsx +1 -1
- package/src/components/ui/item/item.tsx +24 -18
- package/src/components/ui/kbd/kbd.tsx +2 -2
- package/src/components/ui/kbd/platform-modifier.ts +3 -3
- package/src/components/ui/label/label.tsx +1 -1
- package/src/components/ui/marker/marker.tsx +9 -5
- package/src/components/ui/menubar/menubar.tsx +2 -2
- package/src/components/ui/message/message.tsx +14 -13
- package/src/components/ui/modal-dialog/modal-dialog.tsx +9 -5
- package/src/components/ui/native-select/native-select.tsx +1 -1
- package/src/components/ui/navigation-menu/navigation-menu.tsx +5 -4
- package/src/components/ui/pagination/pagination.tsx +1 -1
- package/src/components/ui/popover/popover.tsx +4 -2
- package/src/components/ui/progress/progress.tsx +5 -3
- package/src/components/ui/questionnaire/questionnaire.tsx +10 -5
- package/src/components/ui/radio-group/radio-group.tsx +9 -6
- package/src/components/ui/resizable/resizable.tsx +5 -5
- package/src/components/ui/select/select.tsx +4 -4
- package/src/components/ui/sheet/sheet.tsx +4 -3
- package/src/components/ui/skeleton/skeleton.tsx +1 -1
- package/src/components/ui/slider/slider.tsx +1 -1
- package/src/components/ui/spinner/spinner.tsx +1 -1
- package/src/components/ui/status-chip/status-chip.tsx +13 -13
- package/src/components/ui/switch/switch.tsx +9 -6
- package/src/components/ui/tabs/tabs.tsx +4 -4
- package/src/components/ui/textarea/textarea.tsx +1 -1
- package/src/components/ui/toast/toast.tsx +6 -4
- package/src/components/ui/toggle/toggle.tsx +1 -1
- package/src/components/ui/tooltip/deferred-tooltip.tsx +131 -0
- package/src/components/ui/tooltip/index.ts +1 -0
- package/src/components/ui/tooltip/tooltip.tsx +6 -4
- package/src/components/ui/trace/trace.tsx +13 -9
- package/src/components/ui/typography/typography.tsx +5 -5
- package/src/index.ts +1 -0
- package/src/lib/accent-presets.ts +1 -1
- package/src/lib/accent-roles.ts +2 -2
- package/src/lib/appearance-font-settings.ts +18 -7
- package/src/lib/create-poll.ts +150 -0
- package/src/lib/font-zoom.ts +3 -3
- package/src/lib/keyed-rows.ts +3 -2
- package/src/lib/overlay.ts +5 -5
- package/src/lib/preference-store.ts +2 -2
- package/src/lib/safe-script.ts +2 -2
- package/src/lib/scroll-geometry.ts +1 -1
- package/src/lib/text.ts +1 -1
- package/src/lib/theme-accents.ts +3 -3
- package/src/lib/theme-css.ts +2 -2
- package/src/lib/theme-defaults.ts +4 -4
- package/src/lib/theme-engine-light.ts +2 -2
- package/src/lib/theme-engine.ts +2 -2
- package/src/lib/theme-projection.ts +2 -2
- package/src/lib/theme-records.ts +2 -2
- package/src/lib/theme-types.ts +1 -1
- package/src/lib/themes.ts +14 -14
- package/src/lib/tokens.ts +2 -2
- package/src/lib/tooltip-focus-gate.ts +11 -11
- package/src/lib/utils.ts +1 -1
- package/src/lib/variants.ts +4 -4
- package/src/lib/version-notes.ts +4 -4
- package/src/lint/index.ts +1 -1
- package/src/styles/base.css +12 -43
- package/src/styles/fonts.css +1 -1
- package/src/styles/theme.css +35 -35
- package/src/styles/themes/aardvark-blue.css +98 -0
- package/src/styles/themes/aardvark-ink.css +98 -0
- package/src/styles/themes/adea-dark-colorblind.css +98 -0
- package/src/styles/themes/adea-dark-high-contrast.css +98 -0
- package/src/styles/themes/adea-dark.css +47 -0
- package/src/styles/themes/adea-light-colorblind.css +141 -0
- package/src/styles/themes/adea-light-high-contrast.css +141 -0
- package/src/styles/themes/adea-light.css +47 -0
- package/src/styles/themes/ayu-light.css +141 -0
- package/src/styles/themes/ayu-mirage.css +98 -0
- package/src/styles/themes/ayu.css +98 -0
- package/src/styles/themes/catppuccin-frappe.css +98 -0
- package/src/styles/themes/catppuccin-latte.css +141 -0
- package/src/styles/themes/catppuccin-macchiato.css +98 -0
- package/src/styles/themes/catppuccin-mocha.css +98 -0
- package/src/styles/themes/dracula.css +98 -0
- package/src/styles/themes/everforest-dark.css +98 -0
- package/src/styles/themes/everforest-light.css +141 -0
- package/src/styles/themes/gruvbox-dark.css +98 -0
- package/src/styles/themes/gruvbox-light.css +141 -0
- package/src/styles/themes/kanagawa.css +98 -0
- package/src/styles/themes/monokai.css +98 -0
- package/src/styles/themes/nord-light.css +141 -0
- package/src/styles/themes/nord.css +98 -0
- package/src/styles/themes/one-dark.css +98 -0
- package/src/styles/themes/rosepine-dawn.css +141 -0
- package/src/styles/themes/rosepine-moon.css +98 -0
- package/src/styles/themes/rosepine.css +98 -0
- package/src/styles/themes/solarized-dark.css +98 -0
- package/src/styles/themes/solarized-light.css +141 -0
- package/src/styles/themes/tokyonight-day.css +141 -0
- package/src/styles/themes/tokyonight-night.css +98 -0
- package/src/styles/themes/tokyonight-storm.css +98 -0
- package/src/styles/themes/vesper.css +98 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning.js","names":["Brain","createEffect","createSignal","on","splitProps","isAtEnd","scrollGeometry","MessageText","ScrollArea","formatDuration","TraceDetail","TraceLine","reasoningTitle","state","streaming","duration","text","title","ReasoningBody","props","scroller","following","scrollTop","scrollHeight","_$createComponent","children","ref","element","role","onScroll","event","currentTarget","codeBlockProps","maxHeight","wrap","Reasoning","local","rest","chosen","setChosen","open","hasBody","trim","undefined","defer","body","_$mergeProps","icon","status","statusLabel","onOpenChange","value"],"sources":["../../../../src/components/composites/reasoning/reasoning.tsx"],"sourcesContent":["import { Brain } from 'lucide-solid'\nimport { createEffect, createSignal, on, splitProps, type JSX } from 'solid-js'\nimport { isAtEnd, scrollGeometry } from '#lib/scroll-geometry'\nimport { MessageText } from '../../ui/message'\nimport { ScrollArea } from '../../ui/scroll-area'\nimport { formatDuration, TraceDetail, TraceLine, type TraceLineProps } from '../../ui/trace'\n\nexport { formatDuration }\n\n/**\n * Reasoning.\n *\n * The agent's thinking, as a `TraceLine`: a title that says what state it is in,\n * and a body that is the text the host chose to show. Reach for `ChainOfThought`\n * when the thinking is a sequence of discrete steps with their own status, and\n * for a plain `MessageText` when the text is simply part of the answer.\n *\n * ## It shows what it is given, and nothing else\n *\n * `text` is whatever the host has decided is user-visible
|
|
1
|
+
{"version":3,"file":"reasoning.js","names":["Brain","createEffect","createSignal","on","splitProps","isAtEnd","scrollGeometry","MessageText","ScrollArea","formatDuration","TraceDetail","TraceLine","reasoningTitle","state","streaming","duration","text","title","ReasoningBody","props","scroller","following","scrollTop","scrollHeight","_$createComponent","children","ref","element","role","onScroll","event","currentTarget","codeBlockProps","maxHeight","wrap","Reasoning","local","rest","chosen","setChosen","open","hasBody","trim","undefined","defer","body","_$mergeProps","icon","status","statusLabel","onOpenChange","value"],"sources":["../../../../src/components/composites/reasoning/reasoning.tsx"],"sourcesContent":["import { Brain } from 'lucide-solid'\nimport { createEffect, createSignal, on, splitProps, type JSX } from 'solid-js'\nimport { isAtEnd, scrollGeometry } from '#lib/scroll-geometry'\nimport { MessageText } from '../../ui/message'\nimport { ScrollArea } from '../../ui/scroll-area'\nimport { formatDuration, TraceDetail, TraceLine, type TraceLineProps } from '../../ui/trace'\n\nexport { formatDuration }\n\n/**\n * Reasoning.\n *\n * The agent's thinking, as a `TraceLine`: a title that says what state it is in,\n * and a body that is the text the host chose to show. Reach for `ChainOfThought`\n * when the thinking is a sequence of discrete steps with their own status, and\n * for a plain `MessageText` when the text is simply part of the answer.\n *\n * ## It shows what it is given, and nothing else\n *\n * `text` is whatever the host has decided is user-visible, a provider's reasoning\n * summary, a model's visible scratchpad. This component never implies there is\n * more behind it: no \"show full reasoning\" control, no placeholder body, no\n * ellipsis standing in for hidden content. With no `text` and no `streaming` the\n * line is a plain, non-expandable line titled \"Reasoning\", because there is\n * nothing to open.\n *\n * ## The title is the state\n *\n * - `streaming`: \"Thinking…\", with the running mark and shimmer.\n * - finished with a `duration` (seconds): \"Thought for 4s\".\n * - finished without one: \"Reasoning\". A duration the host did not measure is\n * not invented.\n *\n * ## Open while it is arriving, closed once it is done\n *\n * While streaming the body is open so the reader can follow along; when the\n * stream ends it folds away so the settled transcript stays one quiet column. The\n * reader's own toggle wins in both directions and is remembered until the next\n * stream begins, so someone who closed it mid-stream is not re-opened and\n * someone who opened it afterwards is not folded. Pass `open` and `onOpenChange`\n * to own the state instead.\n *\n * ## Bounded, and stable while it grows\n *\n * The body is `MessageText`, so the text is untrusted and rendered as text (see\n * its doc comment), and earlier paragraphs keep their DOM while the last one\n * grows. The scroller is capped; while streaming it follows the newest text only\n * if the reader has not scrolled up, so reading the start of a long thought is\n * not interrupted by the end of it.\n */\n\n/** The line's title for a state. Exported so a host can say the same thing elsewhere. */\nexport function reasoningTitle(state: { streaming?: boolean; duration?: number }): string {\n if (state.streaming) return 'Thinking…'\n const duration = formatDuration(state.duration)\n return duration ? `Thought for ${duration}` : 'Reasoning'\n}\n\nexport type ReasoningProps = Omit<\n TraceLineProps,\n | 'title'\n | 'description'\n | 'status'\n | 'statusLabel'\n | 'defaultOpen'\n | 'children'\n | 'href'\n | 'onSelect'\n | 'selectHaspopup'\n> & {\n /** The reasoning the host marked as user-visible. Untrusted text. */\n text?: string\n /** True while text may still arrive. */\n streaming?: boolean\n /** Seconds the thinking took, if the host measured it. */\n duration?: number\n /** Replaces the state-derived title, e.g. for another language. */\n title?: JSX.Element\n}\n\nfunction ReasoningBody(props: { text: string; streaming?: boolean }) {\n let scroller: HTMLDivElement | undefined\n let following = true\n\n createEffect(() => {\n // Read for the dependency: new text is the event that may need following.\n void props.text\n if (props.streaming && following && scroller) scroller.scrollTop = scroller.scrollHeight\n })\n\n return (\n <TraceDetail>\n <ScrollArea\n ref={(element) => (scroller = element)}\n role=\"region\"\n aria-label=\"Reasoning text\"\n class=\"max-h-72\"\n onScroll={(event) => {\n following = isAtEnd(scrollGeometry(event.currentTarget))\n }}\n >\n <MessageText\n text={props.text}\n streaming={props.streaming}\n codeBlockProps={{ maxHeight: '16rem', wrap: true }}\n />\n </ScrollArea>\n </TraceDetail>\n )\n}\n\nexport function Reasoning(props: ReasoningProps) {\n const [local, rest] = splitProps(props, [\n 'text',\n 'streaming',\n 'duration',\n 'title',\n 'icon',\n 'open',\n 'onOpenChange',\n ])\n // `undefined` means \"the reader has not decided\", which is what lets the stream\n // open and close the line on its own.\n const [chosen, setChosen] = createSignal<boolean>()\n const open = () => local.open ?? chosen() ?? local.streaming === true\n const hasBody = () => (local.text ?? '').trim() !== '' || local.streaming === true\n\n createEffect(\n on(\n () => local.streaming,\n (streaming) => {\n if (streaming) setChosen(undefined)\n },\n { defer: true }\n )\n )\n\n const body = () => <ReasoningBody text={local.text ?? ''} streaming={local.streaming} />\n\n return (\n <TraceLine\n icon={local.icon ?? <Brain />}\n title={\n local.title ?? reasoningTitle({ streaming: local.streaming, duration: local.duration })\n }\n status={local.streaming ? 'running' : undefined}\n statusLabel=\"In progress\"\n open={open()}\n onOpenChange={(value) => {\n setChosen(value)\n local.onOpenChange?.(value)\n }}\n {...rest}\n >\n {hasBody() ? body : undefined}\n </TraceLine>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,SAAgBY,eAAeC,OAA2D;CACxF,IAAIA,MAAMC,WAAW,OAAO;CAC5B,MAAMC,WAAWN,eAAeI,MAAME,QAAQ;CAC9C,OAAOA,WAAW,eA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AEpF,OAAAU,gBACGb,WAASmC,WAAA;EAAA,IACRC,OAAI;GAAA,OAAEX,MAAMW,QAAIvB,gBAAKxB,OAAK,CAAA,CAAA;EAAG;EAAA,IAC7BiB,QAAK;GAAA,OACHmB,MAAMnB,SAASL,eAAe;IAAEE,WAAWsB,MAAMtB;IAAWC,UAAUqB,MAAMrB;GAAS,CAAC;EAAC;EAAA,IAEzFiC,SAAM;GAAA,OAAEZ,MAAMtB,YAAY,YAAY6B,KAAAA;EAAS;EAC/CM,aAAW;EAAA,IACXT,OAAI;GAAA,OAAEA,KAAK;EAAC;EACZU,eAAeC,UAAU;GACvBZ,UAAUY,KAAK;GACff,MAAMc,eAAeC,KAAK;EAC5B;CAAC,GACGd,MAAI,EAAA,IAAAZ,WAAA;EAAA,OAEPgB,QAAQ,IAAII,OAAOF,KAAAA;CAAS,EAAA,CAAA,CAAA;AAGnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-navigation.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/settings/settings-navigation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAOnC,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAGzE,gFAAgF;AAChF,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,kEAAkE;AAClE,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,sBAAsB,EAAE,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,aAAa,EACb,YAAY,GAAG,UAAU,GAAG,aAAa,CAC1C,GAAG;IACF,6EAA6E;IAC7E,MAAM,EAAE,SAAS,uBAAuB,EAAE,CAAA;IAC1C,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC;iGAC6F;IAC7F,cAAc,CAAC,EACX,OAAO,GACP,CAAC,CACC,OAAO,EAAE,iBAAiB,GAAG,SAAS,KACnC,IAAI,CAAC,CAAA,CAAC,8EAA8E;IAC7F,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;
|
|
1
|
+
{"version":3,"file":"settings-navigation.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/settings/settings-navigation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAOnC,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAGzE,gFAAgF;AAChF,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,kEAAkE;AAClE,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,sBAAsB,EAAE,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,aAAa,EACb,YAAY,GAAG,UAAU,GAAG,aAAa,CAC1C,GAAG;IACF,6EAA6E;IAC7E,MAAM,EAAE,SAAS,uBAAuB,EAAE,CAAA;IAC1C,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC;iGAC6F;IAC7F,cAAc,CAAC,EACX,OAAO,GACP,CAAC,CACC,OAAO,EAAE,iBAAiB,GAAG,SAAS,KACnC,IAAI,CAAC,CAAA,CAAC,8EAA8E;IAC7F,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AA8ED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,eAuHhE"}
|
|
@@ -29,29 +29,67 @@ var _tmpl$2 = /*#__PURE__*/ template(`<span>`);
|
|
|
29
29
|
* `revealSelected={false}` when the surrounding layout does not use an internal
|
|
30
30
|
* scrolling viewport.
|
|
31
31
|
*/
|
|
32
|
+
function scrollsOn(value) {
|
|
33
|
+
return value === "auto" || value === "scroll";
|
|
34
|
+
}
|
|
35
|
+
/** The nearest-edge delta that brings `[start, end]` inside `[min, max]`. */
|
|
36
|
+
function nearestDelta(start, end, min, max) {
|
|
37
|
+
if (start < min) return start - min;
|
|
38
|
+
if (end > max) return end - max;
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
32
41
|
/**
|
|
33
42
|
* Reveal by scrolling only the ancestors that expose a scroll affordance
|
|
34
43
|
* (`auto` or `scroll`), by the exact nearest-edge delta. `scrollIntoView` also
|
|
35
44
|
* pans `overflow: hidden` ancestors, which are programmatically scrollable but
|
|
36
45
|
* give the user no way back, so one over-pan left earlier rows permanently
|
|
37
46
|
* clipped outside the viewport with no scroll to recover them (#182).
|
|
47
|
+
*
|
|
48
|
+
* All reads happen before any write. Reading a box after a `scrollTop` write
|
|
49
|
+
* forces a fresh layout, and walking the ancestors that way laid the page out
|
|
50
|
+
* once per ancestor on every open (52 ms of forced layout at 4x CPU in the
|
|
51
|
+
* Cortana audit). The row box is read once and shifted by each inner scroll,
|
|
52
|
+
* which is exactly where the browser would report it after that write.
|
|
38
53
|
*/
|
|
39
|
-
function
|
|
40
|
-
const
|
|
41
|
-
|
|
54
|
+
function revealNearest(row) {
|
|
55
|
+
const scrollers = [];
|
|
56
|
+
for (let container = row.parentElement; container; container = container.parentElement) {
|
|
57
|
+
const style = window.getComputedStyle(container);
|
|
58
|
+
const x = scrollsOn(style.overflowX);
|
|
59
|
+
const y = scrollsOn(style.overflowY);
|
|
60
|
+
if (x || y) scrollers.push({
|
|
61
|
+
container,
|
|
62
|
+
x,
|
|
63
|
+
y,
|
|
64
|
+
box: container.getBoundingClientRect()
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (scrollers.length === 0) return;
|
|
42
68
|
const rowBox = row.getBoundingClientRect();
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
69
|
+
let left = rowBox.left;
|
|
70
|
+
let right = rowBox.right;
|
|
71
|
+
let top = rowBox.top;
|
|
72
|
+
let bottom = rowBox.bottom;
|
|
73
|
+
const writes = [];
|
|
74
|
+
for (const { container, x, y, box } of scrollers) {
|
|
75
|
+
const dx = x ? nearestDelta(left, right, box.left, box.right) : 0;
|
|
76
|
+
const dy = y ? nearestDelta(top, bottom, box.top, box.bottom) : 0;
|
|
77
|
+
if (dx === 0 && dy === 0) continue;
|
|
78
|
+
writes.push({
|
|
79
|
+
container,
|
|
80
|
+
dx,
|
|
81
|
+
dy
|
|
82
|
+
});
|
|
83
|
+
left -= dx;
|
|
84
|
+
right -= dx;
|
|
85
|
+
top -= dy;
|
|
86
|
+
bottom -= dy;
|
|
46
87
|
}
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
|
|
88
|
+
for (const { container, dx, dy } of writes) {
|
|
89
|
+
if (dx !== 0) container.scrollLeft += dx;
|
|
90
|
+
if (dy !== 0) container.scrollTop += dy;
|
|
50
91
|
}
|
|
51
92
|
}
|
|
52
|
-
function revealNearest(row) {
|
|
53
|
-
for (let container = row.parentElement; container; container = container.parentElement) scrollContainerNearest(container, row);
|
|
54
|
-
}
|
|
55
93
|
function SettingsNavigation(props) {
|
|
56
94
|
const [local, rest] = splitProps(props, [
|
|
57
95
|
"class",
|
|
@@ -76,8 +114,19 @@ function SettingsNavigation(props) {
|
|
|
76
114
|
else if (trigger) revealNearest(trigger);
|
|
77
115
|
};
|
|
78
116
|
revealCurrent();
|
|
79
|
-
|
|
80
|
-
|
|
117
|
+
let frame = 0;
|
|
118
|
+
const onResize = () => {
|
|
119
|
+
if (frame) return;
|
|
120
|
+
frame = requestAnimationFrame(() => {
|
|
121
|
+
frame = 0;
|
|
122
|
+
revealCurrent();
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
window.addEventListener("resize", onResize);
|
|
126
|
+
onCleanup(() => {
|
|
127
|
+
window.removeEventListener("resize", onResize);
|
|
128
|
+
if (frame) cancelAnimationFrame(frame);
|
|
129
|
+
});
|
|
81
130
|
});
|
|
82
131
|
return createComponent(TabsList, mergeProps({
|
|
83
132
|
"data-slot": "settings-navigation",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-navigation.js","names":["useTabsContext","createEffect","createUniqueId","onCleanup","Show","splitProps","cn","sidebarNavItemClass","sidebarNavItemStateClass","TabsList","TabsTrigger","Text","value","label","icon","disabled","items","groups","onReselect","revealSelected","trigger","scrollContainerNearest","container","row","style","window","getComputedStyle","box","getBoundingClientRect","rowBox","overflowX","left","scrollLeft","right","overflowY","top","scrollTop","bottom","revealNearest","parentElement","SettingsNavigation","props","local","rest","tabs","strip","orientation","triggers","Map","groupIdPrefix","reveal","revealCurrent","get","addEventListener","removeEventListener","_$createComponent","_$mergeProps","class","children","map","group","groupIndex","groupId","_el$","_tmpl$","_el$2","firstChild","_$setAttribute","_$insert","when","variant","tone","item","ref","element","set","delete","onClick","idle","_$memo","_el$3","_tmpl$2","_$effect","_$className","truncate"],"sources":["../../../../src/components/composites/settings/settings-navigation.tsx"],"sourcesContent":["import { useTabsContext } from '@kobalte/core/tabs'\nimport type { JSX } from 'solid-js'\nimport { createEffect, createUniqueId, onCleanup, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport {\n sidebarNavItemClass,\n sidebarNavItemStateClass,\n} from '../../layout/sidebar-nav/sidebar-nav-classes'\nimport { TabsList, TabsTrigger, type TabsListProps } from '../../ui/tabs'\nimport { Text } from '../../ui/typography'\n\n/** One host-owned destination in a settings tab list. Values must be unique. */\nexport type SettingsNavigationItem = {\n value: string\n label: string\n icon?: JSX.Element\n disabled?: boolean\n}\n\n/** A visible, accessibly named group of settings destinations. */\nexport type SettingsNavigationGroup = {\n label: string\n items: readonly SettingsNavigationItem[]\n}\n\nexport type SettingsNavigationProps = Omit<\n TabsListProps,\n 'appearance' | 'children' | 'orientation'\n> & {\n /** Groups are presentation only; the host owns the tab values and panels. */\n groups: readonly SettingsNavigationGroup[]\n /** The same controlled value supplied to the enclosing `Tabs`. */\n value: string\n /** Called when the already-selected destination is activated again. */\n onReselect?: (value: string) => void\n /** Reveal the selected row on value changes and window resizes. Defaults to nearest scrolling\n * of the ancestors that expose a scroll affordance; hidden-overflow ancestors never move. */\n revealSelected?:\n | boolean\n | ((\n trigger: HTMLButtonElement | undefined\n ) => void) /** Every tab list needs a label independent of its visible group headings. */\n 'aria-label': string\n}\n\n/**\n * SettingsNavigation.\n *\n * A grouped vertical tab list for sibling settings panels. It composes the\n * shared Tabs behaviour with the shared sidebar row recipe; the host supplies\n * the controlled value, panel content, icons and any persistence or routing.\n * Use ordinary tabs for a short, ungrouped row of view choices.\n *\n * The shape follows the enclosing `Tabs` orientation rather than a prop of its\n * own, so the visual axis can never disagree with the arrow keys Kobalte\n * binds: `vertical` is the grouped rail, `horizontal` is a single scrollable\n * strip of tabs (what `SettingsLayout` shows below 48rem). The strip keeps the\n * groups in order, separated by a rule; their visible headings drop out, since\n * an overline between tabs reads as another tab, but each tab still carries its\n * group as its accessible description.\n *\n * Kobalte owns roving focus, arrow keys, selection and tab/panel ARIA. This\n * component adds no URL, storage or host-specific state. Set\n * `revealSelected={false}` when the surrounding layout does not use an internal\n * scrolling viewport.\n */\n/**\n * Reveal by scrolling only the ancestors that expose a scroll affordance\n * (`auto` or `scroll`), by the exact nearest-edge delta. `scrollIntoView` also\n * pans `overflow: hidden` ancestors, which are programmatically scrollable but\n * give the user no way back, so one over-pan left earlier rows permanently\n * clipped outside the viewport with no scroll to recover them (#182).\n */\nfunction scrollContainerNearest(container: HTMLElement, row: HTMLElement): void {\n const style = window.getComputedStyle(container)\n const box = container.getBoundingClientRect()\n const rowBox = row.getBoundingClientRect()\n if (style.overflowX === 'auto' || style.overflowX === 'scroll') {\n if (rowBox.left < box.left) container.scrollLeft += rowBox.left - box.left\n else if (rowBox.right > box.right) container.scrollLeft += rowBox.right - box.right\n }\n if (style.overflowY === 'auto' || style.overflowY === 'scroll') {\n if (rowBox.top < box.top) container.scrollTop += rowBox.top - box.top\n else if (rowBox.bottom > box.bottom) container.scrollTop += rowBox.bottom - box.bottom\n }\n}\n\nfunction revealNearest(row: HTMLElement): void {\n for (let container = row.parentElement; container; container = container.parentElement) {\n scrollContainerNearest(container, row)\n }\n}\n\nexport function SettingsNavigation(props: SettingsNavigationProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'aria-label',\n 'groups',\n 'value',\n 'onReselect',\n 'revealSelected',\n ])\n const tabs = useTabsContext()\n const strip = () => tabs.orientation() === 'horizontal'\n const triggers = new Map<string, HTMLButtonElement>()\n const groupIdPrefix = `settings-navigation-${createUniqueId()}`\n\n createEffect(() => {\n const value = local.value\n const reveal = local.revealSelected\n // Tracked so a rail that becomes a strip (or back) re-reveals on the new axis.\n strip()\n if (reveal === false) return\n\n const revealCurrent = () => {\n const trigger = triggers.get(value)\n if (typeof reveal === 'function') reveal(trigger)\n else if (trigger) revealNearest(trigger)\n }\n\n revealCurrent()\n window.addEventListener('resize', revealCurrent)\n onCleanup(() => window.removeEventListener('resize', revealCurrent))\n })\n\n return (\n <TabsList\n data-slot=\"settings-navigation\"\n aria-label={local['aria-label']}\n orientation={tabs.orientation()}\n class={cn(\n // Positioned so the visually hidden group names are laid out (and\n // clipped) inside the list: unpositioned, their absolute boxes escape a\n // scrolled strip and widen the page by however far it has scrolled.\n 'relative flex min-w-0 shrink-0 justify-start',\n strip()\n ? // The block padding is the room the focus ring needs: a scroller\n // clips at its padding edge, and this one scrolls sideways only.\n 'scroll-fade w-full flex-row items-center gap-1 overflow-x-auto overflow-y-hidden border-b border-border px-2 py-1.5'\n : 'max-h-full min-h-0 flex-col items-stretch gap-2 overflow-x-hidden overflow-y-auto px-2 py-2',\n local.class\n )}\n {...rest}\n >\n {local.groups.map((group, groupIndex) => {\n const groupId = `${groupIdPrefix}-group-${groupIndex}`\n return (\n <div\n role=\"none\"\n data-slot=\"settings-navigation-group\"\n class={cn(\n 'flex gap-0.5',\n strip()\n ? 'shrink-0 flex-row items-center not-first:ms-1 not-first:border-s not-first:border-border not-first:ps-2'\n : 'min-w-0 flex-col'\n )}\n >\n <span id={groupId} class=\"sr-only\">\n {group.label}\n </span>\n <Show when={!strip()}>\n {/* The overline role on the sidebar's own muted foreground. */}\n <Text\n variant=\"overline\"\n tone=\"inherit\"\n aria-hidden=\"true\"\n class=\"px-2 py-1.5 text-sidebar-muted-foreground\"\n >\n {group.label}\n </Text>\n </Show>\n {group.items.map((item) => (\n <TabsTrigger\n data-slot=\"settings-navigation-trigger\"\n aria-describedby={groupId}\n value={item.value}\n disabled={item.disabled}\n ref={(element: HTMLButtonElement | undefined) => {\n if (element) triggers.set(item.value, element)\n else triggers.delete(item.value)\n }}\n onClick={() => {\n if (local.value === item.value) local.onReselect?.(item.value)\n }}\n class={cn(\n sidebarNavItemClass,\n sidebarNavItemStateClass.idle,\n 'h-row-lg justify-start border-0 px-3 py-2 text-left text-foreground data-[selected]:bg-primary-subtle',\n strip() ? 'w-auto shrink-0' : 'w-full'\n )}\n >\n {item.icon}\n <span class={cn('min-w-0', { truncate: !strip() })}>{item.label}</span>\n </TabsTrigger>\n ))}\n </div>\n )\n })}\n </TabsList>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,SAASqB,uBAAuBC,WAAwBC,KAAwB;CAC9E,MAAMC,QAAQC,OAAOC,iBAAiBJ,SAAS;CAC/C,MAAMK,MAAML,UAAUM,sBAAsB;CAC5C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A,WAAA;MAAA,OACMN,GACLC,qBACAC,yBAAyBsE,MACzB,yGACAjC,MAAM,IAAI,oBAAoB,QAChC;KAAC;KAAA,IAAAa,WAAA;MAAA,OAAA,CAAAqB,WAEAP,KAAK1D,IAAI,UAAA;OAAA,IAAAkE,QAAAC,QAAA;OAAAb,OAAAY,aAC2CR,KAAK3D,KAAK;OAAAqE,aAAAC,UAAAH,OAAlD1E,GAAG,WAAW,EAAE8E,UAAU,CAACvC,MAAM,EAAE,CAAC,CAAC,CAAA;OAAA,OAAAmC;MAAA,EAAA,CAAA,CAAA;KAAA;IAAA,CAAA,CAErD,GAAC,IAAA;IAAAE,aAAAC,UAAApB,MA5CKzD,GACL,gBACAuC,MAAM,IACF,4GACA,kBACN,CAAC,CAAA;IAAA,OAAAkB;GAAA,EAAA,CAAA;EA0CP,CAAC;CAAC,EAAA,CAAA,CAAA;AAGR"}
|
|
1
|
+
{"version":3,"file":"settings-navigation.js","names":["useTabsContext","createEffect","createUniqueId","onCleanup","Show","splitProps","cn","sidebarNavItemClass","sidebarNavItemStateClass","TabsList","TabsTrigger","Text","value","label","icon","disabled","items","groups","onReselect","revealSelected","trigger","scrollsOn","nearestDelta","start","end","min","max","revealNearest","row","scrollers","container","x","y","box","parentElement","style","window","getComputedStyle","overflowX","overflowY","push","getBoundingClientRect","length","rowBox","left","right","top","bottom","writes","dx","dy","scrollLeft","scrollTop","SettingsNavigation","props","local","rest","tabs","strip","orientation","triggers","Map","groupIdPrefix","reveal","revealCurrent","get","frame","onResize","requestAnimationFrame","addEventListener","removeEventListener","cancelAnimationFrame","_$createComponent","_$mergeProps","class","children","map","group","groupIndex","groupId","_el$","_tmpl$","_el$2","firstChild","_$setAttribute","_$insert","when","variant","tone","item","ref","element","set","delete","onClick","idle","_$memo","_el$3","_tmpl$2","_$effect","_$className","truncate"],"sources":["../../../../src/components/composites/settings/settings-navigation.tsx"],"sourcesContent":["import { useTabsContext } from '@kobalte/core/tabs'\nimport type { JSX } from 'solid-js'\nimport { createEffect, createUniqueId, onCleanup, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport {\n sidebarNavItemClass,\n sidebarNavItemStateClass,\n} from '../../layout/sidebar-nav/sidebar-nav-classes'\nimport { TabsList, TabsTrigger, type TabsListProps } from '../../ui/tabs'\nimport { Text } from '../../ui/typography'\n\n/** One host-owned destination in a settings tab list. Values must be unique. */\nexport type SettingsNavigationItem = {\n value: string\n label: string\n icon?: JSX.Element\n disabled?: boolean\n}\n\n/** A visible, accessibly named group of settings destinations. */\nexport type SettingsNavigationGroup = {\n label: string\n items: readonly SettingsNavigationItem[]\n}\n\nexport type SettingsNavigationProps = Omit<\n TabsListProps,\n 'appearance' | 'children' | 'orientation'\n> & {\n /** Groups are presentation only; the host owns the tab values and panels. */\n groups: readonly SettingsNavigationGroup[]\n /** The same controlled value supplied to the enclosing `Tabs`. */\n value: string\n /** Called when the already-selected destination is activated again. */\n onReselect?: (value: string) => void\n /** Reveal the selected row on value changes and window resizes. Defaults to nearest scrolling\n * of the ancestors that expose a scroll affordance; hidden-overflow ancestors never move. */\n revealSelected?:\n | boolean\n | ((\n trigger: HTMLButtonElement | undefined\n ) => void) /** Every tab list needs a label independent of its visible group headings. */\n 'aria-label': string\n}\n\n/**\n * SettingsNavigation.\n *\n * A grouped vertical tab list for sibling settings panels. It composes the\n * shared Tabs behaviour with the shared sidebar row recipe; the host supplies\n * the controlled value, panel content, icons and any persistence or routing.\n * Use ordinary tabs for a short, ungrouped row of view choices.\n *\n * The shape follows the enclosing `Tabs` orientation rather than a prop of its\n * own, so the visual axis can never disagree with the arrow keys Kobalte\n * binds: `vertical` is the grouped rail, `horizontal` is a single scrollable\n * strip of tabs (what `SettingsLayout` shows below 48rem). The strip keeps the\n * groups in order, separated by a rule; their visible headings drop out, since\n * an overline between tabs reads as another tab, but each tab still carries its\n * group as its accessible description.\n *\n * Kobalte owns roving focus, arrow keys, selection and tab/panel ARIA. This\n * component adds no URL, storage or host-specific state. Set\n * `revealSelected={false}` when the surrounding layout does not use an internal\n * scrolling viewport.\n */\nfunction scrollsOn(value: string): boolean {\n return value === 'auto' || value === 'scroll'\n}\n\n/** The nearest-edge delta that brings `[start, end]` inside `[min, max]`. */\nfunction nearestDelta(start: number, end: number, min: number, max: number): number {\n if (start < min) return start - min\n if (end > max) return end - max\n return 0\n}\n\n/**\n * Reveal by scrolling only the ancestors that expose a scroll affordance\n * (`auto` or `scroll`), by the exact nearest-edge delta. `scrollIntoView` also\n * pans `overflow: hidden` ancestors, which are programmatically scrollable but\n * give the user no way back, so one over-pan left earlier rows permanently\n * clipped outside the viewport with no scroll to recover them (#182).\n *\n * All reads happen before any write. Reading a box after a `scrollTop` write\n * forces a fresh layout, and walking the ancestors that way laid the page out\n * once per ancestor on every open (52 ms of forced layout at 4x CPU in the\n * Cortana audit). The row box is read once and shifted by each inner scroll,\n * which is exactly where the browser would report it after that write.\n */\nfunction revealNearest(row: HTMLElement): void {\n const scrollers: { container: HTMLElement; x: boolean; y: boolean; box: DOMRect }[] = []\n for (let container = row.parentElement; container; container = container.parentElement) {\n const style = window.getComputedStyle(container)\n const x = scrollsOn(style.overflowX)\n const y = scrollsOn(style.overflowY)\n if (x || y) scrollers.push({ container, x, y, box: container.getBoundingClientRect() })\n }\n if (scrollers.length === 0) return\n const rowBox = row.getBoundingClientRect()\n let left = rowBox.left\n let right = rowBox.right\n let top = rowBox.top\n let bottom = rowBox.bottom\n const writes: { container: HTMLElement; dx: number; dy: number }[] = []\n for (const { container, x, y, box } of scrollers) {\n const dx = x ? nearestDelta(left, right, box.left, box.right) : 0\n const dy = y ? nearestDelta(top, bottom, box.top, box.bottom) : 0\n if (dx === 0 && dy === 0) continue\n writes.push({ container, dx, dy })\n left -= dx\n right -= dx\n top -= dy\n bottom -= dy\n }\n for (const { container, dx, dy } of writes) {\n if (dx !== 0) container.scrollLeft += dx\n if (dy !== 0) container.scrollTop += dy\n }\n}\n\nexport function SettingsNavigation(props: SettingsNavigationProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'aria-label',\n 'groups',\n 'value',\n 'onReselect',\n 'revealSelected',\n ])\n const tabs = useTabsContext()\n const strip = () => tabs.orientation() === 'horizontal'\n const triggers = new Map<string, HTMLButtonElement>()\n const groupIdPrefix = `settings-navigation-${createUniqueId()}`\n\n createEffect(() => {\n const value = local.value\n const reveal = local.revealSelected\n // Tracked so a rail that becomes a strip (or back) re-reveals on the new axis.\n strip()\n if (reveal === false) return\n\n const revealCurrent = () => {\n const trigger = triggers.get(value)\n if (typeof reveal === 'function') reveal(trigger)\n else if (trigger) revealNearest(trigger)\n }\n\n revealCurrent()\n // A window drag fires resize per pointer move; one reveal per frame is enough.\n let frame = 0\n const onResize = () => {\n if (frame) return\n frame = requestAnimationFrame(() => {\n frame = 0\n revealCurrent()\n })\n }\n window.addEventListener('resize', onResize)\n onCleanup(() => {\n window.removeEventListener('resize', onResize)\n if (frame) cancelAnimationFrame(frame)\n })\n })\n\n return (\n <TabsList\n data-slot=\"settings-navigation\"\n aria-label={local['aria-label']}\n orientation={tabs.orientation()}\n class={cn(\n // Positioned so the visually hidden group names are laid out (and\n // clipped) inside the list: unpositioned, their absolute boxes escape a\n // scrolled strip and widen the page by however far it has scrolled.\n 'relative flex min-w-0 shrink-0 justify-start',\n strip()\n ? // The block padding is the room the focus ring needs: a scroller\n // clips at its padding edge, and this one scrolls sideways only.\n 'scroll-fade w-full flex-row items-center gap-1 overflow-x-auto overflow-y-hidden border-b border-border px-2 py-1.5'\n : 'max-h-full min-h-0 flex-col items-stretch gap-2 overflow-x-hidden overflow-y-auto px-2 py-2',\n local.class\n )}\n {...rest}\n >\n {local.groups.map((group, groupIndex) => {\n const groupId = `${groupIdPrefix}-group-${groupIndex}`\n return (\n <div\n role=\"none\"\n data-slot=\"settings-navigation-group\"\n class={cn(\n 'flex gap-0.5',\n strip()\n ? 'shrink-0 flex-row items-center not-first:ms-1 not-first:border-s not-first:border-border not-first:ps-2'\n : 'min-w-0 flex-col'\n )}\n >\n <span id={groupId} class=\"sr-only\">\n {group.label}\n </span>\n <Show when={!strip()}>\n {/* The overline role on the sidebar's own muted foreground. */}\n <Text\n variant=\"overline\"\n tone=\"inherit\"\n aria-hidden=\"true\"\n class=\"px-2 py-1.5 text-sidebar-muted-foreground\"\n >\n {group.label}\n </Text>\n </Show>\n {group.items.map((item) => (\n <TabsTrigger\n data-slot=\"settings-navigation-trigger\"\n aria-describedby={groupId}\n value={item.value}\n disabled={item.disabled}\n ref={(element: HTMLButtonElement | undefined) => {\n if (element) triggers.set(item.value, element)\n else triggers.delete(item.value)\n }}\n onClick={() => {\n if (local.value === item.value) local.onReselect?.(item.value)\n }}\n class={cn(\n sidebarNavItemClass,\n sidebarNavItemStateClass.idle,\n 'h-row-lg justify-start border-0 px-3 py-2 text-left text-foreground data-[selected]:bg-primary-subtle',\n strip() ? 'w-auto shrink-0' : 'w-full'\n )}\n >\n {item.icon}\n <span class={cn('min-w-0', { truncate: !strip() })}>{item.label}</span>\n </TabsTrigger>\n ))}\n </div>\n )\n })}\n </TabsList>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,SAASqB,UAAUT,OAAwB;CACzC,OAAOA,UAAU,UAAUA,UAAU;AACvC;;AAGA,SAASU,aAAaC,OAAeC,KAAaC,KAAaC,KAAqB;CAClF,IAAIH,QAAQE,KAAK,OAAOF,QAAQE;CAChC,IAAID,MAAME,KAAK,OAAOF,MAAME;CAC5B,OAAO;AACT;;;;;;;;;;;;;;AAeA,SAASC,cAAcC,KAAwB;CAC7C,MAAMC,YAAgF,CAAA;CACtF,KAAK,IAAIC,YAAYF,IAAIM,eAAeJ,WAAWA,YAAYA,UAAUI,eAAe;EACtF,MAAMC,QAAQC,OAAOC,iBAAiBP,SAAS;EAC/C,MAAMC,IAAIV,UAAUc,MAAMG,SAAS;EACnC,MAAMN,IAAIX,UAAUc,MAAMI,SAAS;EACnC,IAAIR,KAAKC,GAAGH,UAAUW,KAAK;GAAE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Ka,SAAIjB,gBACnB9D,aAAW;KAAA,aAAA;KAAA,oBAEQqE;KAAO,IACzBnE,QAAK;MAAA,OAAE6E,KAAK7E;KAAK;KAAA,IACjBG,WAAQ;MAAA,OAAE0E,KAAK1E;KAAQ;KAAA2E,MACjBC,YAA2C;MAC/C,IAAIA,SAAS/B,SAASgC,IAAIH,KAAK7E,OAAO+E,OAAO;WACxC/B,SAASiC,OAAOJ,KAAK7E,KAAK;KACjC;KACAkF,eAAe;MACb,IAAIvC,MAAM3C,UAAU6E,KAAK7E,OAAO2C,MAAMrC,aAAauE,KAAK7E,KAAK;KAC/D;KAAC,KAAA,WAAA;MAAA,OACMN,GACLC,qBACAC,yBAAyBuF,MACzB,yGACArC,MAAM,IAAI,oBAAoB,QAChC;KAAC;KAAA,IAAAiB,WAAA;MAAA,OAAA,CAAAqB,WAEAP,KAAK3E,IAAI,UAAA;OAAA,IAAAmF,QAAAC,QAAA;OAAAb,OAAAY,aAC2CR,KAAK5E,KAAK;OAAAsF,aAAAC,UAAAH,OAAlD3F,GAAG,WAAW,EAAE+F,UAAU,CAAC3C,MAAM,EAAE,CAAC,CAAC,CAAA;OAAA,OAAAuC;MAAA,EAAA,CAAA,CAAA;KAAA;IAAA,CAAA,CAErD,GAAC,IAAA;IAAAE,aAAAC,UAAApB,MA5CK1E,GACL,gBACAoD,MAAM,IACF,4GACA,kBACN,CAAC,CAAA;IAAA,OAAAsB;GAAA,EAAA,CAAA;EA0CP,CAAC;CAAC,EAAA,CAAA,CAAA;AAGR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/settings/settings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAsCnD,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gGAAgG;IAChG,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kEAAkE;IAClE,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAChC,
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/settings/settings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAsCnD,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gGAAgG;IAChG,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kEAAkE;IAClE,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAChC,eAkDF;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,qEAAqE;IACrE,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACvC,4DAA4D;IAC5D,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,eA8DF;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAC3B,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,eAmBzF;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eASxD"}
|
|
@@ -6,9 +6,9 @@ import { className, createComponent, effect, insert, mergeProps, setAttribute, s
|
|
|
6
6
|
import { CircleHelp } from "lucide-solid";
|
|
7
7
|
import { Show, createUniqueId, splitProps } from "solid-js";
|
|
8
8
|
// src/components/composites/settings/settings.tsx
|
|
9
|
-
var _tmpl$ = /*#__PURE__*/ template(`<
|
|
10
|
-
var _tmpl$2 = /*#__PURE__*/ template(`<
|
|
11
|
-
var _tmpl$3 = /*#__PURE__*/ template(`<
|
|
9
|
+
var _tmpl$ = /*#__PURE__*/ template(`<section data-slot=settings-section><div class="flex items-start justify-between gap-4"><div class="flex min-w-0 flex-col gap-0.5"><div class="flex items-center gap-1.5"></div></div></div><div data-slot=settings-section-body>`);
|
|
10
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<p class="max-w-prose text-sm text-muted-foreground text-pretty">`);
|
|
11
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<div class="flex shrink-0 items-center gap-2">`);
|
|
12
12
|
var _tmpl$4 = /*#__PURE__*/ template(`<div data-slot=settings-row><div class="flex min-w-0 flex-col gap-0.5"><div class="flex items-center gap-1.5"><div data-slot=settings-row-label class="text-sm font-medium"></div></div></div><div data-slot=settings-row-control>`);
|
|
13
13
|
var _tmpl$5 = /*#__PURE__*/ template(`<div data-slot=settings-field><div class="flex flex-col gap-0.5"><label class="text-sm font-medium"></label></div><div>`);
|
|
14
14
|
var _tmpl$6 = /*#__PURE__*/ template(`<div data-slot=settings-page>`);
|
|
@@ -58,7 +58,7 @@ function SettingsSection(props) {
|
|
|
58
58
|
"children"
|
|
59
59
|
]);
|
|
60
60
|
return (() => {
|
|
61
|
-
var _el$ = _tmpl$
|
|
61
|
+
var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$2.nextSibling;
|
|
62
62
|
spread(_el$, mergeProps({ get ["class"]() {
|
|
63
63
|
return cn("flex flex-col gap-4 px-5 py-5", local.class);
|
|
64
64
|
} }, rest), false, true);
|
|
@@ -86,24 +86,24 @@ function SettingsSection(props) {
|
|
|
86
86
|
get when() {
|
|
87
87
|
return local.description;
|
|
88
88
|
},
|
|
89
|
-
|
|
90
|
-
var _el$
|
|
91
|
-
insert(_el$
|
|
92
|
-
return _el$
|
|
93
|
-
}
|
|
89
|
+
children: (descriptionSlot) => (() => {
|
|
90
|
+
var _el$6 = _tmpl$2();
|
|
91
|
+
insert(_el$6, descriptionSlot);
|
|
92
|
+
return _el$6;
|
|
93
|
+
})()
|
|
94
94
|
}), null);
|
|
95
95
|
insert(_el$2, createComponent(Show, {
|
|
96
96
|
get when() {
|
|
97
97
|
return local.action;
|
|
98
98
|
},
|
|
99
|
-
|
|
100
|
-
var _el$
|
|
101
|
-
insert(_el$
|
|
102
|
-
return _el$
|
|
103
|
-
}
|
|
99
|
+
children: (actionSlot) => (() => {
|
|
100
|
+
var _el$7 = _tmpl$3();
|
|
101
|
+
insert(_el$7, actionSlot);
|
|
102
|
+
return _el$7;
|
|
103
|
+
})()
|
|
104
104
|
}), null);
|
|
105
|
-
insert(_el$
|
|
106
|
-
effect(() => className(_el$
|
|
105
|
+
insert(_el$5, () => local.children);
|
|
106
|
+
effect(() => className(_el$5, cn(local.bodyLayout === "content" ? "flex flex-col gap-4" : "divide-y divide-border rounded-xl border border-border [&>[data-slot=empty-description]]:p-4")));
|
|
107
107
|
return _el$;
|
|
108
108
|
})();
|
|
109
109
|
}
|
|
@@ -140,7 +140,7 @@ function SettingsRow(props) {
|
|
|
140
140
|
return createComponent(FormFieldContext.Provider, {
|
|
141
141
|
value: field,
|
|
142
142
|
get children() {
|
|
143
|
-
var _el$8 = _tmpl$4(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$
|
|
143
|
+
var _el$8 = _tmpl$4(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$10 = _el$9.nextSibling;
|
|
144
144
|
spread(_el$8, mergeProps({ get ["class"]() {
|
|
145
145
|
return cn("flex gap-4", local.flush ? "p-0" : "p-4", local.orientation === "vertical" ? "flex-col" : "flex-col sm:flex-row sm:items-center sm:justify-between", local.class);
|
|
146
146
|
} }, rest), false, true);
|
|
@@ -163,15 +163,15 @@ function SettingsRow(props) {
|
|
|
163
163
|
get when() {
|
|
164
164
|
return local.description;
|
|
165
165
|
},
|
|
166
|
-
|
|
167
|
-
var _el$
|
|
168
|
-
setAttribute(_el$
|
|
169
|
-
insert(_el$
|
|
170
|
-
return _el$
|
|
171
|
-
}
|
|
166
|
+
children: (descriptionSlot) => (() => {
|
|
167
|
+
var _el$11 = _tmpl$2();
|
|
168
|
+
setAttribute(_el$11, "id", descriptionId);
|
|
169
|
+
insert(_el$11, descriptionSlot);
|
|
170
|
+
return _el$11;
|
|
171
|
+
})()
|
|
172
172
|
}), null);
|
|
173
|
-
insert(_el$
|
|
174
|
-
effect(() => className(_el$
|
|
173
|
+
insert(_el$10, () => local.children);
|
|
174
|
+
effect(() => className(_el$10, cn("shrink-0", local.orientation === "vertical" && "w-full")));
|
|
175
175
|
return _el$8;
|
|
176
176
|
}
|
|
177
177
|
});
|
|
@@ -186,7 +186,7 @@ function SettingsField(props) {
|
|
|
186
186
|
"children"
|
|
187
187
|
]);
|
|
188
188
|
return (() => {
|
|
189
|
-
var _el$12 = _tmpl$5(), _el$13 = _el$12.firstChild, _el$14 = _el$13.firstChild, _el$
|
|
189
|
+
var _el$12 = _tmpl$5(), _el$13 = _el$12.firstChild, _el$14 = _el$13.firstChild, _el$15 = _el$13.nextSibling;
|
|
190
190
|
spread(_el$12, mergeProps({ get ["class"]() {
|
|
191
191
|
return cn("flex flex-col gap-2 p-4", local.class);
|
|
192
192
|
} }, rest), false, true);
|
|
@@ -195,13 +195,13 @@ function SettingsField(props) {
|
|
|
195
195
|
get when() {
|
|
196
196
|
return local.description;
|
|
197
197
|
},
|
|
198
|
-
|
|
199
|
-
var _el$
|
|
200
|
-
insert(_el$
|
|
201
|
-
return _el$
|
|
202
|
-
}
|
|
198
|
+
children: (descriptionSlot) => (() => {
|
|
199
|
+
var _el$16 = _tmpl$2();
|
|
200
|
+
insert(_el$16, descriptionSlot);
|
|
201
|
+
return _el$16;
|
|
202
|
+
})()
|
|
203
203
|
}), null);
|
|
204
|
-
insert(_el$
|
|
204
|
+
insert(_el$15, () => local.children);
|
|
205
205
|
effect(() => setAttribute(_el$14, "for", local.htmlFor));
|
|
206
206
|
return _el$12;
|
|
207
207
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","names":["CircleHelp","createUniqueId","Show","splitProps","createFormFieldContext","FormFieldContext","cn","Tooltip","TooltipContent","TooltipTrigger","Heading","HelpTip","props","label","help","_$createComponent","children","as","type","SettingsSection","title","description","action","bodyLayout","local","rest","_el$","_tmpl$3","_el$2","firstChild","_el$3","_el$4","_el$7","nextSibling","_$spread","_$mergeProps","class","_$insert","size","when","_el$5","_tmpl$","_el$6","_tmpl$2","_$effect","_$className","SettingsRow","orientation","flush","rowId","labelId","descriptionId","field","defaultControlId","hint","error","undefined","group","Provider","value","_el$8","_tmpl$4","_el$9","_el$0","_el$1","_el$11","_$setAttribute","_el$10","SettingsField","htmlFor","_el$12","_tmpl$5","_el$13","_el$14","_el$16","_el$15","SettingsPage","_el$17","_tmpl$6"],"sources":["../../../../src/components/composites/settings/settings.tsx"],"sourcesContent":["import { CircleHelp } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { createUniqueId, Show, splitProps } from 'solid-js'\nimport { createFormFieldContext, FormFieldContext } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip'\nimport { Heading } from '../../ui/typography'\n\n/**\n * SettingsSection and SettingsRow.\n *\n * A settings page is the most repetitive surface in any application, and the\n * one where drift is most visible: label sizes, control widths and description\n * placement all wander unless something fixes them.\n *\n * The row puts the label and description at the start and the control at the\n * end (stacked on a narrow window), so controls line up down the page's end\n * edge regardless of how long the labels are. `SettingsRow` also\n * exposes its label and description through the shared form-field context to\n * the first control inside it. `SettingsField` is the visual stacked layout;\n * use `FormField` when the control needs label, help, or validation wiring.\n */\nfunction HelpTip(props: { label: string; help: string }) {\n return (\n <Tooltip>\n <TooltipTrigger\n as=\"button\"\n type=\"button\"\n data-slot=\"settings-row-help\"\n aria-label={`About ${props.label}`}\n class=\"inline-flex size-4 items-center justify-center rounded-full text-muted-foreground hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none\"\n >\n <CircleHelp class=\"size-3.5\" aria-hidden=\"true\" />\n </TooltipTrigger>\n <TooltipContent>{props.help}</TooltipContent>\n </Tooltip>\n )\n}\n\nexport function SettingsSection(\n props: ComponentProps<'section'> & {\n title: string\n description?: string\n /** A short explanation behind a help icon beside the title; prefer it to a long description. */\n help?: string\n /** A control for the section as a whole, e.g. a master toggle. */\n action?: JSX.Element\n /** Use a spaced content stack for fields, alerts, and cards instead of divided rows. */\n bodyLayout?: 'rows' | 'content'\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'title',\n 'description',\n 'help',\n 'action',\n 'bodyLayout',\n 'children',\n ])\n\n return (\n <section\n data-slot=\"settings-section\"\n class={cn('flex flex-col gap-4 px-5 py-5', local.class)}\n {...rest}\n >\n <div class=\"flex items-start justify-between gap-4\">\n <div class=\"flex min-w-0 flex-col gap-0.5\">\n <div class=\"flex items-center gap-1.5\">\n <Heading as=\"h2\" size=\"card\">\n {local.title}\n </Heading>\n <Show when={local.help}>{(help) => <HelpTip label={local.title} help={help()} />}</Show>\n </div>\n <Show when={local.description}>\n <p class=\"max-w-prose text-sm text-muted-foreground text-pretty\">{local.description}</p>\n </Show>\n </div>\n <Show when={local.action}>\n <div class=\"flex shrink-0 items-center gap-2\">{local.action}</div>\n </Show>\n </div>\n <div\n data-slot=\"settings-section-body\"\n class={cn(\n local.bodyLayout === 'content'\n ? 'flex flex-col gap-4'\n : 'divide-y divide-border rounded-xl border border-border [&>[data-slot=empty-description]]:p-4'\n )}\n >\n {local.children}\n </div>\n </section>\n )\n}\n\n/**\n * One setting: a label and description on the leading side, a control on the\n * trailing side.\n *\n * The label and description are linked to a shared control through field\n * context. An explicit `aria-label` or `aria-labelledby` on the control keeps\n * precedence; otherwise the visible row label names it.\n */\nexport function SettingsRow(\n props: ComponentProps<'div'> & {\n label: string\n description?: string\n /**\n * A short explanation behind a help icon beside the label. Prefer it to a\n * long description: the row stays quiet and the explanation is one hover or\n * focus away.\n */\n help?: string\n /** Render a vertical stack when the control needs the full width. */\n orientation?: 'horizontal' | 'vertical'\n /** Hide the divider this row would otherwise contribute. */\n bare?: boolean\n /**\n * Drop the row's own 16px padding so its label and control sit on the same\n * edges as the fields around it. For a row placed loose in a\n * `bodyLayout=\"content\"` section, where nothing encloses it and the section's\n * gap already spaces it from its neighbours. Leave it off inside a divided\n * rows body or a `Card`, whose edge the padding is there to clear.\n */\n flush?: boolean\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'description',\n 'help',\n 'orientation',\n 'bare',\n 'flush',\n 'children',\n ])\n const rowId = createUniqueId()\n const labelId = `${rowId}-label`\n const descriptionId = `${rowId}-description`\n const field = createFormFieldContext({\n defaultControlId: rowId,\n labelId,\n descriptionId,\n hint: () => local.description,\n error: () => undefined,\n group: () => false,\n })\n\n return (\n <FormFieldContext.Provider value={field}>\n <div\n data-slot=\"settings-row\"\n class={cn(\n 'flex gap-4',\n local.flush ? 'p-0' : 'p-4',\n local.orientation === 'vertical'\n ? 'flex-col'\n : 'flex-col sm:flex-row sm:items-center sm:justify-between',\n local.class\n )}\n {...rest}\n >\n <div class=\"flex min-w-0 flex-col gap-0.5\">\n <div class=\"flex items-center gap-1.5\">\n <div id={labelId} data-slot=\"settings-row-label\" class=\"text-sm font-medium\">\n {local.label}\n </div>\n <Show when={local.help}>{(help) => <HelpTip label={local.label} help={help()} />}</Show>\n </div>\n <Show when={local.description}>\n <p id={descriptionId} class=\"max-w-prose text-sm text-muted-foreground text-pretty\">\n {local.description}\n </p>\n </Show>\n </div>\n <div\n data-slot=\"settings-row-control\"\n class={cn('shrink-0', local.orientation === 'vertical' && 'w-full')}\n >\n {local.children}\n </div>\n </div>\n </FormFieldContext.Provider>\n )\n}\n\n/** A stacked label-and-control pair, for a control too wide for a row. */\nexport function SettingsField(\n props: ComponentProps<'div'> & { label: string; description?: string; htmlFor?: string }\n) {\n const [local, rest] = splitProps(props, ['class', 'label', 'description', 'htmlFor', 'children'])\n\n return (\n <div data-slot=\"settings-field\" class={cn('flex flex-col gap-2 p-4', local.class)} {...rest}>\n <div class=\"flex flex-col gap-0.5\">\n <label for={local.htmlFor} class=\"text-sm font-medium\">\n {local.label}\n </label>\n <Show when={local.description}>\n <p class=\"max-w-prose text-sm text-muted-foreground text-pretty\">{local.description}</p>\n </Show>\n </div>\n <div>{local.children}</div>\n </div>\n )\n}\n\n/** A settings page's scrolling body, with the header sticky at the top. */\nexport function SettingsPage(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"settings-page\"\n class={cn('flex min-h-0 flex-1 flex-col overflow-y-auto', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAASW,QAAQC,OAAwC;CACvD,OAAAG,gBACGR,SAAO,EAAA,IAAAS,WAAA;EAAA,OAAA,CAAAD,gBACLN,gBAAc;GACbQ,IAAE;GACFC,MAAI;GAAA,aAAA;GAAA,KAAA,gBAAA;IAAA,OAEQ,SAASN,MAAMC;GAAO;GAAA,SAAA;GAAA,IAAAG,WAAA;IAAA,OAAAD,gBAGjCf,YAAU;KAAA,SAAA;KAAA,eAAA;IAAA,CAAA;GA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CAAA,EAAA,CAAA;AAUjC;;AAGA,SAAgBM,aAAahE,OAA8B;CACzD,MAAM,CAACY,OAAOC,QAAQtB,WAAWS,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAiE,SAAAC,QAAA;EAAA5C,OAAA2C,QAAA1C,WAAA,EAAA,KAAA,WAAA;GAAA,OAGW7B,GAAG,gDAAgDkB,MAAMY,KAAK;EAAC,EAAA,GAClEX,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAoD;CAAA,EAAA,CAAA;AAGd"}
|
|
1
|
+
{"version":3,"file":"settings.js","names":["CircleHelp","createUniqueId","Show","splitProps","createFormFieldContext","FormFieldContext","cn","Tooltip","TooltipContent","TooltipTrigger","Heading","HelpTip","props","label","help","_$createComponent","children","as","type","SettingsSection","title","description","action","bodyLayout","local","rest","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","_el$5","nextSibling","_$spread","_$mergeProps","class","_$insert","size","when","descriptionSlot","_el$6","_tmpl$2","actionSlot","_el$7","_tmpl$3","_$effect","_$className","SettingsRow","orientation","flush","rowId","labelId","descriptionId","field","defaultControlId","hint","error","undefined","group","Provider","value","_el$8","_tmpl$4","_el$9","_el$0","_el$1","_el$10","_$setAttribute","_el$11","SettingsField","htmlFor","_el$12","_tmpl$5","_el$13","_el$14","_el$15","_el$16","SettingsPage","_el$17","_tmpl$6"],"sources":["../../../../src/components/composites/settings/settings.tsx"],"sourcesContent":["import { CircleHelp } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { createUniqueId, Show, splitProps } from 'solid-js'\nimport { createFormFieldContext, FormFieldContext } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip'\nimport { Heading } from '../../ui/typography'\n\n/**\n * SettingsSection and SettingsRow.\n *\n * A settings page is the most repetitive surface in any application, and the\n * one where drift is most visible: label sizes, control widths and description\n * placement all wander unless something fixes them.\n *\n * The row puts the label and description at the start and the control at the\n * end (stacked on a narrow window), so controls line up down the page's end\n * edge regardless of how long the labels are. `SettingsRow` also\n * exposes its label and description through the shared form-field context to\n * the first control inside it. `SettingsField` is the visual stacked layout;\n * use `FormField` when the control needs label, help, or validation wiring.\n */\nfunction HelpTip(props: { label: string; help: string }) {\n return (\n <Tooltip>\n <TooltipTrigger\n as=\"button\"\n type=\"button\"\n data-slot=\"settings-row-help\"\n aria-label={`About ${props.label}`}\n class=\"inline-flex size-4 items-center justify-center rounded-full text-muted-foreground hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none\"\n >\n <CircleHelp class=\"size-3.5\" aria-hidden=\"true\" />\n </TooltipTrigger>\n <TooltipContent>{props.help}</TooltipContent>\n </Tooltip>\n )\n}\n\nexport function SettingsSection(\n props: ComponentProps<'section'> & {\n title: string\n description?: string\n /** A short explanation behind a help icon beside the title; prefer it to a long description. */\n help?: string\n /** A control for the section as a whole, e.g. a master toggle. */\n action?: JSX.Element\n /** Use a spaced content stack for fields, alerts, and cards instead of divided rows. */\n bodyLayout?: 'rows' | 'content'\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'title',\n 'description',\n 'help',\n 'action',\n 'bodyLayout',\n 'children',\n ])\n\n return (\n <section\n data-slot=\"settings-section\"\n class={cn('flex flex-col gap-4 px-5 py-5', local.class)}\n {...rest}\n >\n <div class=\"flex items-start justify-between gap-4\">\n <div class=\"flex min-w-0 flex-col gap-0.5\">\n <div class=\"flex items-center gap-1.5\">\n <Heading as=\"h2\" size=\"card\">\n {local.title}\n </Heading>\n <Show when={local.help}>{(help) => <HelpTip label={local.title} help={help()} />}</Show>\n </div>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"max-w-prose text-sm text-muted-foreground text-pretty\">\n {descriptionSlot()}\n </p>\n )}\n </Show>\n </div>\n <Show when={local.action}>\n {(actionSlot) => <div class=\"flex shrink-0 items-center gap-2\">{actionSlot()}</div>}\n </Show>\n </div>\n <div\n data-slot=\"settings-section-body\"\n class={cn(\n local.bodyLayout === 'content'\n ? 'flex flex-col gap-4'\n : 'divide-y divide-border rounded-xl border border-border [&>[data-slot=empty-description]]:p-4'\n )}\n >\n {local.children}\n </div>\n </section>\n )\n}\n\n/**\n * One setting: a label and description on the leading side, a control on the\n * trailing side.\n *\n * The label and description are linked to a shared control through field\n * context. An explicit `aria-label` or `aria-labelledby` on the control keeps\n * precedence; otherwise the visible row label names it.\n */\nexport function SettingsRow(\n props: ComponentProps<'div'> & {\n label: string\n description?: string\n /**\n * A short explanation behind a help icon beside the label. Prefer it to a\n * long description: the row stays quiet and the explanation is one hover or\n * focus away.\n */\n help?: string\n /** Render a vertical stack when the control needs the full width. */\n orientation?: 'horizontal' | 'vertical'\n /** Hide the divider this row would otherwise contribute. */\n bare?: boolean\n /**\n * Drop the row's own 16px padding so its label and control sit on the same\n * edges as the fields around it. For a row placed loose in a\n * `bodyLayout=\"content\"` section, where nothing encloses it and the section's\n * gap already spaces it from its neighbours. Leave it off inside a divided\n * rows body or a `Card`, whose edge the padding is there to clear.\n */\n flush?: boolean\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'description',\n 'help',\n 'orientation',\n 'bare',\n 'flush',\n 'children',\n ])\n const rowId = createUniqueId()\n const labelId = `${rowId}-label`\n const descriptionId = `${rowId}-description`\n const field = createFormFieldContext({\n defaultControlId: rowId,\n labelId,\n descriptionId,\n hint: () => local.description,\n error: () => undefined,\n group: () => false,\n })\n\n return (\n <FormFieldContext.Provider value={field}>\n <div\n data-slot=\"settings-row\"\n class={cn(\n 'flex gap-4',\n local.flush ? 'p-0' : 'p-4',\n local.orientation === 'vertical'\n ? 'flex-col'\n : 'flex-col sm:flex-row sm:items-center sm:justify-between',\n local.class\n )}\n {...rest}\n >\n <div class=\"flex min-w-0 flex-col gap-0.5\">\n <div class=\"flex items-center gap-1.5\">\n <div id={labelId} data-slot=\"settings-row-label\" class=\"text-sm font-medium\">\n {local.label}\n </div>\n <Show when={local.help}>{(help) => <HelpTip label={local.label} help={help()} />}</Show>\n </div>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p id={descriptionId} class=\"max-w-prose text-sm text-muted-foreground text-pretty\">\n {descriptionSlot()}\n </p>\n )}\n </Show>\n </div>\n <div\n data-slot=\"settings-row-control\"\n class={cn('shrink-0', local.orientation === 'vertical' && 'w-full')}\n >\n {local.children}\n </div>\n </div>\n </FormFieldContext.Provider>\n )\n}\n\n/** A stacked label-and-control pair, for a control too wide for a row. */\nexport function SettingsField(\n props: ComponentProps<'div'> & { label: string; description?: string; htmlFor?: string }\n) {\n const [local, rest] = splitProps(props, ['class', 'label', 'description', 'htmlFor', 'children'])\n\n return (\n <div data-slot=\"settings-field\" class={cn('flex flex-col gap-2 p-4', local.class)} {...rest}>\n <div class=\"flex flex-col gap-0.5\">\n <label for={local.htmlFor} class=\"text-sm font-medium\">\n {local.label}\n </label>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"max-w-prose text-sm text-muted-foreground text-pretty\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <div>{local.children}</div>\n </div>\n )\n}\n\n/** A settings page's scrolling body, with the header sticky at the top. */\nexport function SettingsPage(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"settings-page\"\n class={cn('flex min-h-0 flex-1 flex-col overflow-y-auto', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAASW,QAAQC,OAAwC;CACvD,OAAAG,gBACGR,SAAO,EAAA,IAAAS,WAAA;EAAA,OAAA,CAAAD,gBACLN,gBAAc;GACbQ,IAAE;GACFC,MAAI;GAAA,aAAA;GAAA,KAAA,gBAAA;IAAA,OAEQ,SAASN,MAAMC;GAAO;GAAA,SAAA;GAAA,IAAAG,WAAA;IAAA,OAAAD,gBAGjCf,YAAU;KAAA,SAAA;KAAA,eAAA;IAAA,CAAA;GAAA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O,CAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAYjC;;AAGA,SAAgBM,aAAalE,OAA8B;CACzD,MAAM,CAACY,OAAOC,QAAQtB,WAAWS,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAmE,SAAAC,QAAA;EAAA9C,OAAA6C,QAAA5C,WAAA,EAAA,KAAA,WAAA;GAAA,OAGW7B,GAAG,gDAAgDkB,MAAMY,KAAK;EAAC,EAAA,GAClEX,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAsD;CAAA,EAAA,CAAA;AAGd"}
|
|
@@ -6,7 +6,7 @@ export { boundText };
|
|
|
6
6
|
* Every field except `title` is optional because a source is only as much as the
|
|
7
7
|
* host knew: a search result has a snippet, a file has no URL, a tool result has
|
|
8
8
|
* neither. Nothing is inferred from what is missing, and two entries that share a
|
|
9
|
-
* URL stay two entries
|
|
9
|
+
* URL stay two entries, the host may have cited two passages of one page, and a
|
|
10
10
|
* list that quietly merged them would also renumber every citation after it.
|
|
11
11
|
*/
|
|
12
12
|
export type Source = Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","names":[],"sources":["../../../../src/components/composites/sources/source.ts"],"sourcesContent":["import { safeHref } from '#lib/url'\nimport { boundText } from '#lib/text'\n\nexport { boundText }\n\n/**\n * What a reply drew on.\n *\n * Every field except `title` is optional because a source is only as much as the\n * host knew: a search result has a snippet, a file has no URL, a tool result has\n * neither. Nothing is inferred from what is missing, and two entries that share a\n * URL stay two entries
|
|
1
|
+
{"version":3,"file":"source.js","names":[],"sources":["../../../../src/components/composites/sources/source.ts"],"sourcesContent":["import { safeHref } from '#lib/url'\nimport { boundText } from '#lib/text'\n\nexport { boundText }\n\n/**\n * What a reply drew on.\n *\n * Every field except `title` is optional because a source is only as much as the\n * host knew: a search result has a snippet, a file has no URL, a tool result has\n * neither. Nothing is inferred from what is missing, and two entries that share a\n * URL stay two entries, the host may have cited two passages of one page, and a\n * list that quietly merged them would also renumber every citation after it.\n */\nexport type Source = Readonly<{\n /** A stable key for streaming updates. Falls back to position. */\n id?: string\n title: string\n url?: string\n snippet?: string\n}>\n\n/** Titles and snippets come from the open web; these keep one of them from owning the layout. */\nexport const SOURCE_TITLE_LIMIT = 160\nexport const SOURCE_SNIPPET_LIMIT = 480\n\n/**\n * A URL a link may point at: `http:`, `https:` or `mailto:`, no embedded\n * credentials. `safeHref` already refuses other\n * schemes, whitespace and control characters and over-long values; credentials are\n * refused here as well because `https://trusted.example@evil.example/` shows a\n * host that is not the one the link goes to.\n */\nexport function safeSourceUrl(value: string | undefined): string | undefined {\n if (value === undefined) return undefined\n const href = safeHref(value)\n if (href === undefined) return undefined\n const url = new URL(href)\n return url.username === '' && url.password === '' ? href : undefined\n}\n\n/**\n * The host to show beside a title, taken from the parsed URL (so an\n * internationalised name appears in its `xn--` form and a look-alike cannot pass\n * for the real one). A mailto source shows its address. Undefined when the URL is\n * absent or unsafe: nothing is guessed.\n */\nexport function sourceHost(value: string | undefined): string | undefined {\n const href = safeSourceUrl(value)\n if (href === undefined) return undefined\n try {\n const url = new URL(href)\n if (url.protocol === 'mailto:') {\n return boundText(decodeURIComponent(url.pathname), 80) || undefined\n }\n return url.hostname || undefined\n } catch {\n return undefined\n }\n}\n\n/** The line a collapsed list shows. One source is singular; the count is the list's length. */\nexport function sourcesLabel(count: number): string {\n return `Used ${count} ${count === 1 ? 'source' : 'sources'}`\n}\n\n/** What to call a source: its title, else its host, else an honest placeholder. */\nexport function sourceTitle(source: Source): string {\n return boundText(source.title, SOURCE_TITLE_LIMIT) || sourceHost(source.url) || 'Untitled source'\n}\n"],"mappings":";;;;AAuBA,IAAa,qBAAqB;AAClC,IAAa,uBAAuB;;;;;;;;AASpC,SAAgB,cAAc,OAA+C;CAC3E,IAAI,UAAU,KAAA,GAAW,OAAO,KAAA;CAChC,MAAM,OAAO,SAAS,KAAK;CAC3B,IAAI,SAAS,KAAA,GAAW,OAAO,KAAA;CAC/B,MAAM,MAAM,IAAI,IAAI,IAAI;CACxB,OAAO,IAAI,aAAa,MAAM,IAAI,aAAa,KAAK,OAAO,KAAA;AAC7D;;;;;;;AAQA,SAAgB,WAAW,OAA+C;CACxE,MAAM,OAAO,cAAc,KAAK;CAChC,IAAI,SAAS,KAAA,GAAW,OAAO,KAAA;CAC/B,IAAI;EACF,MAAM,MAAM,IAAI,IAAI,IAAI;EACxB,IAAI,IAAI,aAAa,WACnB,OAAO,UAAU,mBAAmB,IAAI,QAAQ,GAAG,EAAE,KAAK,KAAA;EAE5D,OAAO,IAAI,YAAY,KAAA;CACzB,QAAQ;EACN;CACF;AACF;;AAGA,SAAgB,aAAa,OAAuB;CAClD,OAAO,QAAQ,MAAM,GAAG,UAAU,IAAI,WAAW;AACnD;;AAGA,SAAgB,YAAY,QAAwB;CAClD,OAAO,UAAU,OAAO,OAAA,GAAyB,KAAK,WAAW,OAAO,GAAG,KAAK;AAClF"}
|
|
@@ -3,7 +3,7 @@ import { type Source } from './source';
|
|
|
3
3
|
/**
|
|
4
4
|
* Sources.
|
|
5
5
|
*
|
|
6
|
-
* The links a reply used, as one `Trace` line
|
|
6
|
+
* The links a reply used, as one `Trace` line, "Used 4 sources", that expands
|
|
7
7
|
* into the list. It lives under the answer with the rest of the agent's activity
|
|
8
8
|
* rather than as a card of its own, because a reader who wants to check a claim
|
|
9
9
|
* will open it and one who does not should not have to scroll past it. For a
|
|
@@ -16,7 +16,7 @@ import { type Source } from './source';
|
|
|
16
16
|
* claim about an answer that may simply not have been grounded.
|
|
17
17
|
* - **A row is a link only with a safe address.** `http:`, `https:` and `mailto:`
|
|
18
18
|
* without embedded credentials (`safeSourceUrl`). Any other address is not
|
|
19
|
-
* linked and not printed
|
|
19
|
+
* linked and not printed, the row says the address was not linked, so the
|
|
20
20
|
* reader knows something was withheld instead of finding a dead title.
|
|
21
21
|
* - **The host is read from the parsed URL**, never from the title, so a title
|
|
22
22
|
* that reads "docs.example.com" cannot make a link to somewhere else look like it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sources.js","names":["BookOpen","createSignal","For","Show","splitProps","Button","TextLink","Trace","TraceDetail","TraceLine","boundText","safeSourceUrl","sourceHost","sourceTitle","sourcesLabel","sources","label","open","defaultOpen","onOpenChange","initialVisible","DEFAULT_VISIBLE","Sources","props","local","rest","expanded","setExpanded","limit","Math","max","floor","hidden","length","visible","slice","_$createComponent","when","children","_$mergeProps","icon","title","_el$","_tmpl$","_$insert","each","source","index","SourceRow","position","type","variant","size","onClick","value","_$memo","href","url","host","snippet","withheld","undefined","_el$2","_tmpl$4","_el$3","firstChild","_el$4","nextSibling","fallback","_el$7","_tmpl$5","_el$8","_el$1","target","rel","_el$10","_tmpl$6","_el$13","_tmpl$7","_el$5","_tmpl$2","_el$6","_tmpl$3"],"sources":["../../../../src/components/composites/sources/sources.tsx"],"sourcesContent":["import { BookOpen } from 'lucide-solid'\nimport { createSignal, For, Show, splitProps } from 'solid-js'\nimport { Button } from '../../ui/button'\nimport { TextLink } from '../../ui/text-link'\nimport { Trace, TraceDetail, TraceLine, type TraceProps } from '../../ui/trace'\nimport {\n SOURCE_SNIPPET_LIMIT,\n boundText,\n safeSourceUrl,\n sourceHost,\n sourceTitle,\n sourcesLabel,\n type Source,\n} from './source'\n\n/**\n * Sources.\n *\n * The links a reply used, as one `Trace` line — \"Used 4 sources\" — that expands\n * into the list. It lives under the answer with the rest of the agent's activity\n * rather than as a card of its own, because a reader who wants to check a claim\n * will open it and one who does not should not have to scroll past it. For a\n * marker inside a sentence use `InlineCitation`, which points at the same\n * `Source` shape; the two are numbered the same way (position in this list).\n *\n * ## What it will and will not say\n *\n * - **No sources, no line.** An empty list renders nothing: \"Used 0 sources\" is a\n * claim about an answer that may simply not have been grounded.\n * - **A row is a link only with a safe address.** `http:`, `https:` and `mailto:`\n * without embedded credentials (`safeSourceUrl`). Any other address is not\n * linked and not printed — the row says the address was not linked, so the\n * reader knows something was withheld instead of finding a dead title.\n * - **The host is read from the parsed URL**, never from the title, so a title\n * that reads \"docs.example.com\" cannot make a link to somewhere else look like it.\n * - **Nothing is merged.** Two entries that share a URL are two rows, with their\n * own numbers; the host may have cited two passages and the citations point at\n * positions.\n * - **Hostile and long values are bounded.** Titles, hosts and snippets are\n * clipped and stripped of direction overrides (`boundText`), and are only ever\n * text nodes.\n * - **A long list is shown in pages.** Past `initialVisible` the rest is behind a\n * button that names how many there are, so a 200-source answer is not 200 rows\n * the moment it opens. The button stays in place and toggles, so focus is never\n * left on a control that has just disappeared.\n */\nexport type SourcesProps = Omit<TraceProps, 'children'> & {\n sources: readonly Source[]\n /** Replaces the default \"Used N sources\" for another language or a different verb. */\n label?: string\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /** Rows shown before the \"Show all\" button. Default 25. */\n initialVisible?: number\n}\n\nconst DEFAULT_VISIBLE = 25\n\nexport function Sources(props: SourcesProps) {\n const [local, rest] = splitProps(props, [\n 'sources',\n 'label',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'initialVisible',\n ])\n const [expanded, setExpanded] = createSignal(false)\n const limit = () => Math.max(1, Math.floor(local.initialVisible ?? DEFAULT_VISIBLE))\n const hidden = () => Math.max(0, local.sources.length - limit())\n const visible = () => (expanded() ? local.sources : local.sources.slice(0, limit()))\n\n return (\n <Show when={local.sources.length > 0}>\n <Trace aria-label=\"Sources\" data-slot=\"sources\" {...rest}>\n <TraceLine\n icon={<BookOpen />}\n title={local.label ?? sourcesLabel(local.sources.length)}\n open={local.open}\n defaultOpen={local.defaultOpen}\n onOpenChange={local.onOpenChange}\n >\n <TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded()}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>\n </TraceLine>\n </Trace>\n </Show>\n )\n}\n\nfunction SourceRow(props: { source: Source; position: number }) {\n const href = () => safeSourceUrl(props.source.url)\n const host = () => sourceHost(props.source.url)\n const title = () => sourceTitle(props.source)\n const snippet = () =>\n props.source.snippet ? boundText(props.source.snippet, SOURCE_SNIPPET_LIMIT) : ''\n // An address was supplied but is not one we link: say so rather than go silent.\n const withheld = () => props.source.url !== undefined && props.source.url !== '' && !href()\n\n return (\n <li data-slot=\"source\" class=\"flex min-w-0 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"w-5 shrink-0 text-end text-xs text-muted-foreground tabular-nums\"\n >\n {props.position}\n </span>\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <Show\n when={href()}\n fallback={\n <span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>\n }\n >\n {(url) => (\n <TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>\n )}\n </Show>\n <Show when={host() || withheld()}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {host()}\n <Show when={withheld()}>{host() ? ' · ' : ''}Address not linked</Show>\n </span>\n </Show>\n <Show when={snippet()}>\n <p class=\"m-0 line-clamp-3 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {snippet()}\n </p>\n </Show>\n </div>\n </li>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyDA,IAAMqB,kBAAkB;AAExB,SAAgBC,QAAQC,OAAqB;CAC3C,MAAM,CAACC,OAAOC,QAAQrB,WAAWmB,OAAO;EACtC;EACA;EACA;E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show","splitProps","Button","TextLink","Trace","TraceDetail","TraceLine","boundText","safeSourceUrl","sourceHost","sourceTitle","sourcesLabel","sources","label","open","defaultOpen","onOpenChange","initialVisible","DEFAULT_VISIBLE","Sources","props","local","rest","expanded","setExpanded","limit","Math","max","floor","hidden","length","visible","slice","_$createComponent","when","children","_$mergeProps","icon","title","_el$","_tmpl$","_$insert","each","source","index","SourceRow","position","type","variant","size","onClick","value","_$memo","href","url","host","snippet","withheld","undefined","_el$2","_tmpl$4","_el$3","firstChild","_el$4","nextSibling","fallback","_el$7","_tmpl$5","_el$8","_el$1","target","rel","_el$10","_tmpl$6","_el$13","_tmpl$7","_el$5","_tmpl$2","_el$6","_tmpl$3"],"sources":["../../../../src/components/composites/sources/sources.tsx"],"sourcesContent":["import { BookOpen } from 'lucide-solid'\nimport { createSignal, For, Show, splitProps } from 'solid-js'\nimport { Button } from '../../ui/button'\nimport { TextLink } from '../../ui/text-link'\nimport { Trace, TraceDetail, TraceLine, type TraceProps } from '../../ui/trace'\nimport {\n SOURCE_SNIPPET_LIMIT,\n boundText,\n safeSourceUrl,\n sourceHost,\n sourceTitle,\n sourcesLabel,\n type Source,\n} from './source'\n\n/**\n * Sources.\n *\n * The links a reply used, as one `Trace` line, \"Used 4 sources\", that expands\n * into the list. It lives under the answer with the rest of the agent's activity\n * rather than as a card of its own, because a reader who wants to check a claim\n * will open it and one who does not should not have to scroll past it. For a\n * marker inside a sentence use `InlineCitation`, which points at the same\n * `Source` shape; the two are numbered the same way (position in this list).\n *\n * ## What it will and will not say\n *\n * - **No sources, no line.** An empty list renders nothing: \"Used 0 sources\" is a\n * claim about an answer that may simply not have been grounded.\n * - **A row is a link only with a safe address.** `http:`, `https:` and `mailto:`\n * without embedded credentials (`safeSourceUrl`). Any other address is not\n * linked and not printed, the row says the address was not linked, so the\n * reader knows something was withheld instead of finding a dead title.\n * - **The host is read from the parsed URL**, never from the title, so a title\n * that reads \"docs.example.com\" cannot make a link to somewhere else look like it.\n * - **Nothing is merged.** Two entries that share a URL are two rows, with their\n * own numbers; the host may have cited two passages and the citations point at\n * positions.\n * - **Hostile and long values are bounded.** Titles, hosts and snippets are\n * clipped and stripped of direction overrides (`boundText`), and are only ever\n * text nodes.\n * - **A long list is shown in pages.** Past `initialVisible` the rest is behind a\n * button that names how many there are, so a 200-source answer is not 200 rows\n * the moment it opens. The button stays in place and toggles, so focus is never\n * left on a control that has just disappeared.\n */\nexport type SourcesProps = Omit<TraceProps, 'children'> & {\n sources: readonly Source[]\n /** Replaces the default \"Used N sources\" for another language or a different verb. */\n label?: string\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /** Rows shown before the \"Show all\" button. Default 25. */\n initialVisible?: number\n}\n\nconst DEFAULT_VISIBLE = 25\n\nexport function Sources(props: SourcesProps) {\n const [local, rest] = splitProps(props, [\n 'sources',\n 'label',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'initialVisible',\n ])\n const [expanded, setExpanded] = createSignal(false)\n const limit = () => Math.max(1, Math.floor(local.initialVisible ?? DEFAULT_VISIBLE))\n const hidden = () => Math.max(0, local.sources.length - limit())\n const visible = () => (expanded() ? local.sources : local.sources.slice(0, limit()))\n\n return (\n <Show when={local.sources.length > 0}>\n <Trace aria-label=\"Sources\" data-slot=\"sources\" {...rest}>\n <TraceLine\n icon={<BookOpen />}\n title={local.label ?? sourcesLabel(local.sources.length)}\n open={local.open}\n defaultOpen={local.defaultOpen}\n onOpenChange={local.onOpenChange}\n >\n <TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded()}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>\n </TraceLine>\n </Trace>\n </Show>\n )\n}\n\nfunction SourceRow(props: { source: Source; position: number }) {\n const href = () => safeSourceUrl(props.source.url)\n const host = () => sourceHost(props.source.url)\n const title = () => sourceTitle(props.source)\n const snippet = () =>\n props.source.snippet ? boundText(props.source.snippet, SOURCE_SNIPPET_LIMIT) : ''\n // An address was supplied but is not one we link: say so rather than go silent.\n const withheld = () => props.source.url !== undefined && props.source.url !== '' && !href()\n\n return (\n <li data-slot=\"source\" class=\"flex min-w-0 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"w-5 shrink-0 text-end text-xs text-muted-foreground tabular-nums\"\n >\n {props.position}\n </span>\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <Show\n when={href()}\n fallback={\n <span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>\n }\n >\n {(url) => (\n <TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>\n )}\n </Show>\n <Show when={host() || withheld()}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {host()}\n <Show when={withheld()}>{host() ? ' · ' : ''}Address not linked</Show>\n </span>\n </Show>\n <Show when={snippet()}>\n <p class=\"m-0 line-clamp-3 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {snippet()}\n </p>\n </Show>\n </div>\n </li>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyDA,IAAMqB,kBAAkB;AAExB,SAAgBC,QAAQC,OAAqB;CAC3C,MAAM,CAACC,OAAOC,QAAQrB,WAAWmB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAgB,CACjB;CACD,MAAM,CAACG,UAAUC,eAAe1B,aA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language writes it
|
|
5
|
-
* differently. This parses the three a coding agent meets most
|
|
5
|
+
* differently. This parses the three a coding agent meets most: V8/Node
|
|
6
6
|
* (`at fn (file:line:col)`), Python (`File "x", line N, in fn`) and Rust panic
|
|
7
|
-
* backtraces (` 0: symbol` then `at file:line:col`)
|
|
7
|
+
* backtraces (` 0: symbol` then `at file:line:col`), into frames, and does
|
|
8
8
|
* three things a formatter would not:
|
|
9
9
|
*
|
|
10
10
|
* - **It never hides a line.** Every input line ends up in `entries`, as a frame
|
|
@@ -89,7 +89,7 @@ export type StackBlock = Readonly<{
|
|
|
89
89
|
* Fold runs of dependency and runtime frames into groups, so a trace reads as
|
|
90
90
|
* the code the reader owns with the framework's frames one click away.
|
|
91
91
|
*
|
|
92
|
-
* A run of one stays a frame
|
|
92
|
+
* A run of one stays a frame, a disclosure around a single line costs more than
|
|
93
93
|
* it saves. When there is no first-party frame at all nothing is grouped:
|
|
94
94
|
* collapsing everything would hide the entire trace behind a button, which is the
|
|
95
95
|
* opposite of what a reader who owns none of the frames needs.
|
|
@@ -28,7 +28,7 @@ function splitLocation(location) {
|
|
|
28
28
|
/**
|
|
29
29
|
* Split the pre-1.78 Rust panic suffix `'message', location`. The message may
|
|
30
30
|
* contain `', ` itself, and the greedy pattern this replaces took the last
|
|
31
|
-
* occurrence with a non-space behind it
|
|
31
|
+
* occurrence with a non-space behind it, this scan keeps that last-wins
|
|
32
32
|
* answer, in one pass, so a message repeating the marker stays linear.
|
|
33
33
|
*/
|
|
34
34
|
function splitRustOldPanic(after) {
|
|
@@ -103,8 +103,8 @@ function isDigit(code) {
|
|
|
103
103
|
*
|
|
104
104
|
* Scanned, not matched. A line repeating the frame shape many times must still
|
|
105
105
|
* cost one pass, so the closing `", line ` is found by walking its candidates
|
|
106
|
-
* left to right. The last valid candidate wins
|
|
107
|
-
* replaces would have settled on
|
|
106
|
+
* left to right. The last valid candidate wins, what the greedy pattern this
|
|
107
|
+
* replaces would have settled on, so a file path containing a quote still
|
|
108
108
|
* parses exactly as it always did.
|
|
109
109
|
*/
|
|
110
110
|
function parsePython(trimmed) {
|
|
@@ -341,7 +341,7 @@ function isBlank(entry) {
|
|
|
341
341
|
* Fold runs of dependency and runtime frames into groups, so a trace reads as
|
|
342
342
|
* the code the reader owns with the framework's frames one click away.
|
|
343
343
|
*
|
|
344
|
-
* A run of one stays a frame
|
|
344
|
+
* A run of one stays a frame, a disclosure around a single line costs more than
|
|
345
345
|
* it saves. When there is no first-party frame at all nothing is grouped:
|
|
346
346
|
* collapsing everything would hide the entire trace behind a button, which is the
|
|
347
347
|
* opposite of what a reader who owns none of the frames needs.
|