@adea-ai/ui 0.152.3 → 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
package/dist/lib/keyed-rows.js
CHANGED
|
@@ -17,7 +17,8 @@ import { createMemo, createSignal } from "solid-js";
|
|
|
17
17
|
*
|
|
18
18
|
* `equals` decides whether a fresh item replaces the row's stored value. The
|
|
19
19
|
* default treats every new object as a change, which is correct for a projection
|
|
20
|
-
* whose fields are all rendered
|
|
20
|
+
* whose fields are all rendered; the same object passed again is not one, so a
|
|
21
|
+
* list that rebuilds its array around unchanged items updates no row. Pass a field-level comparator — a version
|
|
21
22
|
* stamp, a revision number — to skip redundant downstream updates entirely.
|
|
22
23
|
*
|
|
23
24
|
* ```tsx
|
|
@@ -34,7 +35,7 @@ function keyedRows(list, key, equals = false) {
|
|
|
34
35
|
const itemKey = key(item);
|
|
35
36
|
let entry = next.get(itemKey) ?? entries.get(itemKey);
|
|
36
37
|
if (!entry) {
|
|
37
|
-
const [holder, setHolder] = createSignal([item], { equals: equals === false ?
|
|
38
|
+
const [holder, setHolder] = createSignal([item], { equals: equals === false ? (previousHolder, nextHolder) => previousHolder[0] === nextHolder[0] : (previousHolder, nextHolder) => equals(previousHolder[0], nextHolder[0]) });
|
|
38
39
|
entry = {
|
|
39
40
|
row: { item: () => holder()[0] },
|
|
40
41
|
set: (nextItem) => setHolder([nextItem])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyed-rows.js","names":[],"sources":["../../src/lib/keyed-rows.ts"],"sourcesContent":["import { createMemo, createSignal, type Accessor } from 'solid-js'\n\n/**\n * A stable list entry for `<For>`. The wrapper object never changes identity\n * once the key exists, so the control flow keeps the row's DOM; the row's\n * bindings update through `entry.item()` instead of remounting.\n */\nexport type KeyedRow<T> = Readonly<{ item: Accessor<T> }>\n\n/**\n * Maps a reactive list to stable, key-indexed rows.\n *\n * Server-backed lists — query results, and projections over them — produce fresh\n * object identities on every fetch. Feeding them straight into `<For>` remounts\n * every row on each refetch: open menus close, focus and hover state drop, and\n * the whole subtree's DOM is rebuilt. On a list that refetches on a poll or a\n * websocket tick, that is a visible flicker and a measurable cost.\n *\n * Keying on a stable id keeps each row's DOM alive across refetches and pushes\n * the update through that row's own accessor, so only the bindings whose values\n * actually changed touch the DOM. Removed keys drop their rows; reordered keys\n * keep their rows and move the DOM nodes. Keys must be unique within the list —\n * a duplicate reuses the first entry's row.\n *\n * `equals` decides whether a fresh item replaces the row's stored value. The\n * default treats every new object as a change, which is correct for a projection\n * whose fields are all rendered. Pass a field-level comparator — a version\n * stamp, a revision number — to skip redundant downstream updates entirely.\n *\n * ```tsx\n * const rows = keyedRows(() => tasks(), (task) => task.id, (a, b) => a.version === b.version)\n * return <For each={rows()}>{(row) => <TaskCard task={row.item} />}</For>\n * ```\n */\nexport function keyedRows<T, K>(\n list: () => readonly T[],\n key: (item: T) => K,\n equals: false | ((previous: T, next: T) => boolean) = false\n): Accessor<readonly KeyedRow<T>[]> {\n type Entry = { row: KeyedRow<T>; set(item: T): void }\n let entries = new Map<K, Entry>()\n return createMemo<readonly KeyedRow<T>[]>(() => {\n const items = list()\n const next = new Map<K, Entry>()\n const rows = items.map((item) => {\n const itemKey = key(item)\n let entry = next.get(itemKey) ?? entries.get(itemKey)\n if (!entry) {\n // The tuple wrapper keeps the item out of createSignal's\n // `Exclude<T, Function>` overload, which unconstrained generics cannot\n // satisfy, while giving the custom equality a stable shape to compare.\n const [holder, setHolder] = createSignal<readonly [T]>([item], {\n equals:\n equals === false\n ?
|
|
1
|
+
{"version":3,"file":"keyed-rows.js","names":[],"sources":["../../src/lib/keyed-rows.ts"],"sourcesContent":["import { createMemo, createSignal, type Accessor } from 'solid-js'\n\n/**\n * A stable list entry for `<For>`. The wrapper object never changes identity\n * once the key exists, so the control flow keeps the row's DOM; the row's\n * bindings update through `entry.item()` instead of remounting.\n */\nexport type KeyedRow<T> = Readonly<{ item: Accessor<T> }>\n\n/**\n * Maps a reactive list to stable, key-indexed rows.\n *\n * Server-backed lists — query results, and projections over them — produce fresh\n * object identities on every fetch. Feeding them straight into `<For>` remounts\n * every row on each refetch: open menus close, focus and hover state drop, and\n * the whole subtree's DOM is rebuilt. On a list that refetches on a poll or a\n * websocket tick, that is a visible flicker and a measurable cost.\n *\n * Keying on a stable id keeps each row's DOM alive across refetches and pushes\n * the update through that row's own accessor, so only the bindings whose values\n * actually changed touch the DOM. Removed keys drop their rows; reordered keys\n * keep their rows and move the DOM nodes. Keys must be unique within the list —\n * a duplicate reuses the first entry's row.\n *\n * `equals` decides whether a fresh item replaces the row's stored value. The\n * default treats every new object as a change, which is correct for a projection\n * whose fields are all rendered; the same object passed again is not one, so a\n * list that rebuilds its array around unchanged items updates no row. Pass a field-level comparator — a version\n * stamp, a revision number — to skip redundant downstream updates entirely.\n *\n * ```tsx\n * const rows = keyedRows(() => tasks(), (task) => task.id, (a, b) => a.version === b.version)\n * return <For each={rows()}>{(row) => <TaskCard task={row.item} />}</For>\n * ```\n */\nexport function keyedRows<T, K>(\n list: () => readonly T[],\n key: (item: T) => K,\n equals: false | ((previous: T, next: T) => boolean) = false\n): Accessor<readonly KeyedRow<T>[]> {\n type Entry = { row: KeyedRow<T>; set(item: T): void }\n let entries = new Map<K, Entry>()\n return createMemo<readonly KeyedRow<T>[]>(() => {\n const items = list()\n const next = new Map<K, Entry>()\n const rows = items.map((item) => {\n const itemKey = key(item)\n let entry = next.get(itemKey) ?? entries.get(itemKey)\n if (!entry) {\n // The tuple wrapper keeps the item out of createSignal's\n // `Exclude<T, Function>` overload, which unconstrained generics cannot\n // satisfy, while giving the custom equality a stable shape to compare.\n const [holder, setHolder] = createSignal<readonly [T]>([item], {\n equals:\n equals === false\n ? (previousHolder, nextHolder) => previousHolder[0] === nextHolder[0]\n : (previousHolder, nextHolder) => equals(previousHolder[0], nextHolder[0]),\n })\n entry = { row: { item: () => holder()[0] }, set: (nextItem) => setHolder([nextItem]) }\n } else if (!next.has(itemKey)) {\n entry.set(item)\n }\n next.set(itemKey, entry)\n return entry.row\n })\n entries = next\n return rows\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAgB,UACd,MACA,KACA,SAAsD,OACpB;CAElC,IAAI,0BAAU,IAAI,IAAc;CAChC,OAAO,iBAAyC;EAC9C,MAAM,QAAQ,KAAK;EACnB,MAAM,uBAAO,IAAI,IAAc;EAC/B,MAAM,OAAO,MAAM,KAAK,SAAS;GAC/B,MAAM,UAAU,IAAI,IAAI;GACxB,IAAI,QAAQ,KAAK,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO;GACpD,IAAI,CAAC,OAAO;IAIV,MAAM,CAAC,QAAQ,aAAa,aAA2B,CAAC,IAAI,GAAG,EAC7D,QACE,WAAW,SACN,gBAAgB,eAAe,eAAe,OAAO,WAAW,MAChE,gBAAgB,eAAe,OAAO,eAAe,IAAI,WAAW,EAAE,EAC/E,CAAC;IACD,QAAQ;KAAE,KAAK,EAAE,YAAY,OAAO,CAAC,CAAC,GAAG;KAAG,MAAM,aAAa,UAAU,CAAC,QAAQ,CAAC;IAAE;GACvF,OAAO,IAAI,CAAC,KAAK,IAAI,OAAO,GAC1B,MAAM,IAAI,IAAI;GAEhB,KAAK,IAAI,SAAS,KAAK;GACvB,OAAO,MAAM;EACf,CAAC;EACD,UAAU;EACV,OAAO;CACT,CAAC;AACH"}
|
package/dist/lib/overlay.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* These live here rather than in each component because the overlay family is
|
|
6
6
|
* where consistency is most visible and least likely to survive duplication.
|
|
7
7
|
* A dialog, a sheet and a dropdown that disagree about their border, radius,
|
|
8
|
-
* motion or shadow read as three different apps
|
|
8
|
+
* motion or shadow read as three different apps, and an app that adopts this
|
|
9
9
|
* library would inherit all three. Declaring the surface once is what makes
|
|
10
10
|
* "an overlay looks like this" a fact rather than a convention.
|
|
11
11
|
*/
|
|
@@ -19,8 +19,8 @@ export declare const overlaySurface = "bg-popover text-popover-foreground rounde
|
|
|
19
19
|
*
|
|
20
20
|
* `--popover` is the catalogue's `surfaceElevated`, whose derivation amplifies
|
|
21
21
|
* the canvas hue's chroma on the elevated step. On the dark default's violet
|
|
22
|
-
* canvas that makes the dialog the most chromatic surface in the ladder
|
|
23
|
-
* `oklch(0.2406 0.0088 300.91)`, red above green in sRGB
|
|
22
|
+
* canvas that makes the dialog the most chromatic surface in the ladder,
|
|
23
|
+
* `oklch(0.2406 0.0088 300.91)`, red above green in sRGB, and on a full dialog
|
|
24
24
|
* panel that cast reads as a warm tint the canvas never has. shadcn's own
|
|
25
25
|
* convention already splits the two: a Dialog paints `bg-background`, menus and
|
|
26
26
|
* popovers paint `bg-popover`. The veil, the hairline and the elevation shadow
|
|
@@ -94,7 +94,7 @@ export declare const menuSeparator = "bg-border -mx-1 my-1 h-px";
|
|
|
94
94
|
/**
|
|
95
95
|
* A leading colour swatch on a menu or select row: the sanctioned way to carry
|
|
96
96
|
* a card-tone colour into a list of options. The tones are the system's accent
|
|
97
|
-
* and status roles
|
|
97
|
+
* and status roles, the vocabulary a Badge already speaks, so the colour an
|
|
98
98
|
* option shows in a menu is the colour its badge carries on a card, and a
|
|
99
99
|
* caller never passes a raw colour into a list. The dot is `aria-hidden`; the
|
|
100
100
|
* label carries the meaning, so a tone is never the only signal.
|
|
@@ -107,7 +107,7 @@ export type MenuSwatchTone = NonNullable<VariantProps<typeof menuSwatchTone>['to
|
|
|
107
107
|
/** Padding shared by every menu-list surface. */
|
|
108
108
|
export declare const menuContentPadding = "p-1";
|
|
109
109
|
/**
|
|
110
|
-
* Marks a floating layer
|
|
110
|
+
* Marks a floating layer, a menu, a listbox, a popover, as part of the top
|
|
111
111
|
* layer.
|
|
112
112
|
*
|
|
113
113
|
* A modal dialog hides everything outside itself from assistive technology
|
package/dist/lib/overlay.js
CHANGED
|
@@ -7,7 +7,7 @@ import { cva } from "./variants.js";
|
|
|
7
7
|
* These live here rather than in each component because the overlay family is
|
|
8
8
|
* where consistency is most visible and least likely to survive duplication.
|
|
9
9
|
* A dialog, a sheet and a dropdown that disagree about their border, radius,
|
|
10
|
-
* motion or shadow read as three different apps
|
|
10
|
+
* motion or shadow read as three different apps, and an app that adopts this
|
|
11
11
|
* library would inherit all three. Declaring the surface once is what makes
|
|
12
12
|
* "an overlay looks like this" a fact rather than a convention.
|
|
13
13
|
*/
|
|
@@ -20,8 +20,8 @@ var overlaySurface = "bg-popover text-popover-foreground rounded-xl border borde
|
|
|
20
20
|
*
|
|
21
21
|
* `--popover` is the catalogue's `surfaceElevated`, whose derivation amplifies
|
|
22
22
|
* the canvas hue's chroma on the elevated step. On the dark default's violet
|
|
23
|
-
* canvas that makes the dialog the most chromatic surface in the ladder
|
|
24
|
-
* `oklch(0.2406 0.0088 300.91)`, red above green in sRGB
|
|
23
|
+
* canvas that makes the dialog the most chromatic surface in the ladder,
|
|
24
|
+
* `oklch(0.2406 0.0088 300.91)`, red above green in sRGB, and on a full dialog
|
|
25
25
|
* panel that cast reads as a warm tint the canvas never has. shadcn's own
|
|
26
26
|
* convention already splits the two: a Dialog paints `bg-background`, menus and
|
|
27
27
|
* popovers paint `bg-popover`. The veil, the hairline and the elevation shadow
|
|
@@ -95,7 +95,7 @@ var menuSeparator = "bg-border -mx-1 my-1 h-px";
|
|
|
95
95
|
/**
|
|
96
96
|
* A leading colour swatch on a menu or select row: the sanctioned way to carry
|
|
97
97
|
* a card-tone colour into a list of options. The tones are the system's accent
|
|
98
|
-
* and status roles
|
|
98
|
+
* and status roles, the vocabulary a Badge already speaks, so the colour an
|
|
99
99
|
* option shows in a menu is the colour its badge carries on a card, and a
|
|
100
100
|
* caller never passes a raw colour into a list. The dot is `aria-hidden`; the
|
|
101
101
|
* label carries the meaning, so a tone is never the only signal.
|
|
@@ -114,7 +114,7 @@ var menuSwatchTone = cva("size-2 shrink-0 rounded-full", {
|
|
|
114
114
|
/** Padding shared by every menu-list surface. */
|
|
115
115
|
var menuContentPadding = "p-1";
|
|
116
116
|
/**
|
|
117
|
-
* Marks a floating layer
|
|
117
|
+
* Marks a floating layer, a menu, a listbox, a popover, as part of the top
|
|
118
118
|
* layer.
|
|
119
119
|
*
|
|
120
120
|
* A modal dialog hides everything outside itself from assistive technology
|
package/dist/lib/overlay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.js","names":[],"sources":["../../src/lib/overlay.ts"],"sourcesContent":["/**\n * Shared strings for the overlay layer: dialogs, sheets, menus, popovers,\n * tooltips and the command palette.\n *\n * These live here rather than in each component because the overlay family is\n * where consistency is most visible and least likely to survive duplication.\n * A dialog, a sheet and a dropdown that disagree about their border, radius,\n * motion or shadow read as three different apps — and an app that adopts this\n * library would inherit all three. Declaring the surface once is what makes\n * \"an overlay looks like this\" a fact rather than a convention.\n */\n\nimport { cva, type VariantProps } from '#lib/variants'\n\n/** The panel itself: fill, hairline edge, radius, elevation. Menus, popovers\n * and the command palette float on the elevated overlay rung (`--popover`). */\nexport const overlaySurface =\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * The modal panel: the same hairline edge, radius and elevation, painted on the\n * *neutral* theme surface instead of the elevated overlay rung.\n *\n * `--popover` is the catalogue's `surfaceElevated`, whose derivation amplifies\n * the canvas hue's chroma on the elevated step. On the dark default's violet\n * canvas that makes the dialog the most chromatic surface in the ladder —\n * `oklch(0.2406 0.0088 300.91)`, red above green in sRGB — and on a full dialog\n * panel that cast reads as a warm tint the canvas never has. shadcn's own\n * convention already splits the two: a Dialog paints `bg-background`, menus and\n * popovers paint `bg-popover`. The veil, the hairline and the elevation shadow\n * carry the separation the lighter fill no longer provides.\n */\nexport const dialogSurface =\n 'bg-background text-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * Overlay titles have one fixed typography role. Keep this small recipe shared\n * without loading the configurable Heading component into every dialog.\n */\nexport const overlayTitle = 'font-semibold text-base tracking-tight leading-none'\n\n/** The span of the portal wrapper that centres a dialog-like overlay. */\nexport const overlayPositioner = 'fixed inset-0 z-(--z-dialog) grid place-items-center p-4'\n\n/** The dimming layer behind a modal overlay. */\nexport const overlayScrim =\n 'fixed inset-0 z-(--z-dialog) bg-scrim/50 supports-[backdrop-filter]:backdrop-blur-xs'\n\n/** The scrim fades; it never zooms with the panel above it. */\nexport const overlayScrimMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0'\n\n/** The title block of a dialog-shaped panel. */\nexport const overlayHeader = 'flex flex-col gap-1.5 text-start'\n\n/** The action row of a dialog-shaped panel: stacked on a phone, trailing on a wider window. */\nexport const overlayFooter = 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end'\n\n/** The sentence under an overlay title. */\nexport const overlayDescription = 'text-muted-foreground text-sm'\n\n/** The icon-only close in a dialog or sheet's top-end corner. */\nexport const overlayCornerClose =\n 'absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground ' +\n 'transition-colors ease-out hover:bg-surface-hover hover:text-foreground ' +\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle outline-none'\n\n/**\n * The tip: the card-toned bubble an explanation shows in. The side rail draws\n * it flush to a collapsed row and every floating tooltip composes the same\n * fill, edge, and type, so a control never explains itself in two visual\n * languages.\n */\nexport const tooltipTip =\n 'bg-card text-card-foreground rounded-md border border-border text-sm font-medium shadow-lg'\n\n/**\n * Entrance and exit motion, expressed as data-state classes.\n *\n * `data-expanded` / `data-closed` are Kobalte's; `data-side-*` come from its\n * popper positioning and let a menu slide in from the edge it is anchored to,\n * which is what makes a dropdown feel attached to its trigger rather than\n * dropped on the screen. Exit motion is shorter than entry, because a\n * dismissal should feel immediate while an arrival benefits from being seen.\n */\nexport const overlayZoom =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95 ' +\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95'\n\n/** `overlayZoom` at the panel's pace: menus, dialogs. */\nexport const overlayMotion = `${overlayZoom} data-expanded:duration-200 data-closed:duration-150`\n\n/** `overlayZoom` at a hint's pace: the tooltip and the hover card. */\nexport const tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`\n\n/** Popover-style motion: no zoom, so a panel anchored to a control does not\n * appear to breathe away from it. */\nexport const popoverMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 ' +\n 'data-expanded:duration-150 data-closed:duration-100'\n\n/** The popper arrow. Sized in the component; coloured here. */\nexport const popoverArrow = 'fill-popover stroke-border'\n\n/**\n * A menu row: the shared height, radius, hover fill and focus treatment for\n * every item inside a menu, listbox or command list.\n *\n * The row sizes and dims the icons a caller puts in it, but not the glyph of\n * its selection indicator (any `[data-slot$=-indicator]`): a descendant `svg`\n * rule outranks a single utility on the glyph, so without the exclusion a\n * radio item's `size-2` dot drew as a 16px muted disc and every check lost the\n * indicator's accent.\n */\nexport const menuItem =\n 'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none ' +\n 'transition-colors ease-out ' +\n 'data-[highlighted]:bg-surface-hover data-[highlighted]:text-foreground ' +\n 'data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground ' +\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 ' +\n '[&_svg:not([data-slot$=-indicator]_*)]:size-4 ' +\n '[&_svg:not([class*=text-]):not([data-slot$=-indicator]_*)]:text-muted-foreground'\n\n/** A destructive action keeps readable text and marks its row with a status edge. */\nexport const destructiveMenuItem =\n 'border-s-2 border-destructive ps-1.5 text-foreground data-[highlighted]:bg-destructive-subtle'\n\n/** The label above a group of menu rows. */\nexport const menuLabel =\n 'px-2 py-1.5 text-2xs font-medium tracking-wide text-muted-foreground uppercase'\n\n/** The chord drawn at a row's trailing edge: menus and the command palette. */\nexport const menuShortcut = 'text-muted-foreground ms-auto font-code text-code tracking-widest'\n\n/** The rule between menu groups. */\nexport const menuSeparator = 'bg-border -mx-1 my-1 h-px'\n\n/**\n * A leading colour swatch on a menu or select row: the sanctioned way to carry\n * a card-tone colour into a list of options. The tones are the system's accent\n * and status roles — the vocabulary a Badge already speaks — so the colour an\n * option shows in a menu is the colour its badge carries on a card, and a\n * caller never passes a raw colour into a list. The dot is `aria-hidden`; the\n * label carries the meaning, so a tone is never the only signal.\n */\nexport const menuSwatchTone = cva('size-2 shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-muted-foreground',\n primary: 'bg-primary',\n success: 'bg-success',\n warning: 'bg-warning',\n destructive: 'bg-destructive',\n info: 'bg-info',\n },\n },\n defaultVariants: { tone: 'neutral' },\n})\n\n/** The tones a menu row's swatch can take. */\nexport type MenuSwatchTone = NonNullable<VariantProps<typeof menuSwatchTone>['tone']>\n\n/** Padding shared by every menu-list surface. */\nexport const menuContentPadding = 'p-1'\n\n/**\n * Marks a floating layer — a menu, a listbox, a popover — as part of the top\n * layer.\n *\n * A modal dialog hides everything outside itself from assistive technology\n * (`aria-hidden` on its siblings) and keeps watching `<body>` for new nodes.\n * A menu or select opened from inside the dialog portals to `<body>`, so the\n * dialog hid it too: the list was on screen, focused, and invisible to a\n * screen reader, and an outside-click check could treat a click on it as a\n * click away from the dialog. Kobalte exempts nodes carrying this attribute\n * from both, so every floating layer carries it.\n */\nexport const topLayerProps = { 'data-kb-top-layer': '' } as const\n\n/**\n * Marks a portal mounted while another modal layer is already open as a layer\n * of its own rather than background.\n *\n * Kobalte's hide-outside observer walks body children added after its layer\n * opened and aria-hides them a frame later, so a non-modal dialog portaled in\n * during that window would land outside the accessibility tree. That observer\n * exempts added nodes carrying the React Aria spelling it ported;\n * `data-kb-top-layer` (`topLayerProps`) is only honoured by a newer layer's\n * initial walk, which must still hide this portal.\n */\nexport const lateLayerAttribute = 'data-react-aria-top-layer'\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,IAAa,iBACX;;;;;;;;;;;;;;AAeF,IAAa,gBACX;;;;;AAMF,IAAa,eAAe;;AAG5B,IAAa,oBAAoB;;AAGjC,IAAa,eACX;;AAGF,IAAa,qBACX;;AAGF,IAAa,gBAAgB;;AAG7B,IAAa,gBAAgB;;AAG7B,IAAa,qBAAqB;;AAGlC,IAAa,qBACX;;;;;;;AAUF,IAAa,aACX;;;;;;;;;;AAWF,IAAa,cACX;;AAIF,IAAa,gBAAgB,GAAG,YAAY;;AAG5C,IAAa,gBAAgB,GAAG,YAAY;;;AAI5C,IAAa,gBACX;;AAIF,IAAa,eAAe;;;;;;;;;;;AAY5B,IAAa,WACX;;AASF,IAAa,sBACX;;AAGF,IAAa,YACX;;AAGF,IAAa,eAAe;;AAG5B,IAAa,gBAAgB;;;;;;;;;AAU7B,IAAa,iBAAiB,IAAI,gCAAgC;CAChE,UAAU,EACR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EACT,aAAa;EACb,MAAM;CACR,EACF;CACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CAAC;;AAMD,IAAa,qBAAqB;;;;;;;;;;;;;AAclC,IAAa,gBAAgB,EAAE,qBAAqB,GAAG;;;;;;;;;;;;AAavD,IAAa,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"overlay.js","names":[],"sources":["../../src/lib/overlay.ts"],"sourcesContent":["/**\n * Shared strings for the overlay layer: dialogs, sheets, menus, popovers,\n * tooltips and the command palette.\n *\n * These live here rather than in each component because the overlay family is\n * where consistency is most visible and least likely to survive duplication.\n * A dialog, a sheet and a dropdown that disagree about their border, radius,\n * motion or shadow read as three different apps, and an app that adopts this\n * library would inherit all three. Declaring the surface once is what makes\n * \"an overlay looks like this\" a fact rather than a convention.\n */\n\nimport { cva, type VariantProps } from '#lib/variants'\n\n/** The panel itself: fill, hairline edge, radius, elevation. Menus, popovers\n * and the command palette float on the elevated overlay rung (`--popover`). */\nexport const overlaySurface =\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * The modal panel: the same hairline edge, radius and elevation, painted on the\n * *neutral* theme surface instead of the elevated overlay rung.\n *\n * `--popover` is the catalogue's `surfaceElevated`, whose derivation amplifies\n * the canvas hue's chroma on the elevated step. On the dark default's violet\n * canvas that makes the dialog the most chromatic surface in the ladder,\n * `oklch(0.2406 0.0088 300.91)`, red above green in sRGB, and on a full dialog\n * panel that cast reads as a warm tint the canvas never has. shadcn's own\n * convention already splits the two: a Dialog paints `bg-background`, menus and\n * popovers paint `bg-popover`. The veil, the hairline and the elevation shadow\n * carry the separation the lighter fill no longer provides.\n */\nexport const dialogSurface =\n 'bg-background text-foreground rounded-xl border border-border shadow-lg'\n\n/**\n * Overlay titles have one fixed typography role. Keep this small recipe shared\n * without loading the configurable Heading component into every dialog.\n */\nexport const overlayTitle = 'font-semibold text-base tracking-tight leading-none'\n\n/** The span of the portal wrapper that centres a dialog-like overlay. */\nexport const overlayPositioner = 'fixed inset-0 z-(--z-dialog) grid place-items-center p-4'\n\n/** The dimming layer behind a modal overlay. */\nexport const overlayScrim =\n 'fixed inset-0 z-(--z-dialog) bg-scrim/50 supports-[backdrop-filter]:backdrop-blur-xs'\n\n/** The scrim fades; it never zooms with the panel above it. */\nexport const overlayScrimMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0'\n\n/** The title block of a dialog-shaped panel. */\nexport const overlayHeader = 'flex flex-col gap-1.5 text-start'\n\n/** The action row of a dialog-shaped panel: stacked on a phone, trailing on a wider window. */\nexport const overlayFooter = 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end'\n\n/** The sentence under an overlay title. */\nexport const overlayDescription = 'text-muted-foreground text-sm'\n\n/** The icon-only close in a dialog or sheet's top-end corner. */\nexport const overlayCornerClose =\n 'absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground ' +\n 'transition-colors ease-out hover:bg-surface-hover hover:text-foreground ' +\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle outline-none'\n\n/**\n * The tip: the card-toned bubble an explanation shows in. The side rail draws\n * it flush to a collapsed row and every floating tooltip composes the same\n * fill, edge, and type, so a control never explains itself in two visual\n * languages.\n */\nexport const tooltipTip =\n 'bg-card text-card-foreground rounded-md border border-border text-sm font-medium shadow-lg'\n\n/**\n * Entrance and exit motion, expressed as data-state classes.\n *\n * `data-expanded` / `data-closed` are Kobalte's; `data-side-*` come from its\n * popper positioning and let a menu slide in from the edge it is anchored to,\n * which is what makes a dropdown feel attached to its trigger rather than\n * dropped on the screen. Exit motion is shorter than entry, because a\n * dismissal should feel immediate while an arrival benefits from being seen.\n */\nexport const overlayZoom =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95 ' +\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95'\n\n/** `overlayZoom` at the panel's pace: menus, dialogs. */\nexport const overlayMotion = `${overlayZoom} data-expanded:duration-200 data-closed:duration-150`\n\n/** `overlayZoom` at a hint's pace: the tooltip and the hover card. */\nexport const tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`\n\n/** Popover-style motion: no zoom, so a panel anchored to a control does not\n * appear to breathe away from it. */\nexport const popoverMotion =\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 ' +\n 'data-expanded:duration-150 data-closed:duration-100'\n\n/** The popper arrow. Sized in the component; coloured here. */\nexport const popoverArrow = 'fill-popover stroke-border'\n\n/**\n * A menu row: the shared height, radius, hover fill and focus treatment for\n * every item inside a menu, listbox or command list.\n *\n * The row sizes and dims the icons a caller puts in it, but not the glyph of\n * its selection indicator (any `[data-slot$=-indicator]`): a descendant `svg`\n * rule outranks a single utility on the glyph, so without the exclusion a\n * radio item's `size-2` dot drew as a 16px muted disc and every check lost the\n * indicator's accent.\n */\nexport const menuItem =\n 'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none ' +\n 'transition-colors ease-out ' +\n 'data-[highlighted]:bg-surface-hover data-[highlighted]:text-foreground ' +\n 'data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground ' +\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 ' +\n '[&_svg:not([data-slot$=-indicator]_*)]:size-4 ' +\n '[&_svg:not([class*=text-]):not([data-slot$=-indicator]_*)]:text-muted-foreground'\n\n/** A destructive action keeps readable text and marks its row with a status edge. */\nexport const destructiveMenuItem =\n 'border-s-2 border-destructive ps-1.5 text-foreground data-[highlighted]:bg-destructive-subtle'\n\n/** The label above a group of menu rows. */\nexport const menuLabel =\n 'px-2 py-1.5 text-2xs font-medium tracking-wide text-muted-foreground uppercase'\n\n/** The chord drawn at a row's trailing edge: menus and the command palette. */\nexport const menuShortcut = 'text-muted-foreground ms-auto font-code text-code tracking-widest'\n\n/** The rule between menu groups. */\nexport const menuSeparator = 'bg-border -mx-1 my-1 h-px'\n\n/**\n * A leading colour swatch on a menu or select row: the sanctioned way to carry\n * a card-tone colour into a list of options. The tones are the system's accent\n * and status roles, the vocabulary a Badge already speaks, so the colour an\n * option shows in a menu is the colour its badge carries on a card, and a\n * caller never passes a raw colour into a list. The dot is `aria-hidden`; the\n * label carries the meaning, so a tone is never the only signal.\n */\nexport const menuSwatchTone = cva('size-2 shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-muted-foreground',\n primary: 'bg-primary',\n success: 'bg-success',\n warning: 'bg-warning',\n destructive: 'bg-destructive',\n info: 'bg-info',\n },\n },\n defaultVariants: { tone: 'neutral' },\n})\n\n/** The tones a menu row's swatch can take. */\nexport type MenuSwatchTone = NonNullable<VariantProps<typeof menuSwatchTone>['tone']>\n\n/** Padding shared by every menu-list surface. */\nexport const menuContentPadding = 'p-1'\n\n/**\n * Marks a floating layer, a menu, a listbox, a popover, as part of the top\n * layer.\n *\n * A modal dialog hides everything outside itself from assistive technology\n * (`aria-hidden` on its siblings) and keeps watching `<body>` for new nodes.\n * A menu or select opened from inside the dialog portals to `<body>`, so the\n * dialog hid it too: the list was on screen, focused, and invisible to a\n * screen reader, and an outside-click check could treat a click on it as a\n * click away from the dialog. Kobalte exempts nodes carrying this attribute\n * from both, so every floating layer carries it.\n */\nexport const topLayerProps = { 'data-kb-top-layer': '' } as const\n\n/**\n * Marks a portal mounted while another modal layer is already open as a layer\n * of its own rather than background.\n *\n * Kobalte's hide-outside observer walks body children added after its layer\n * opened and aria-hides them a frame later, so a non-modal dialog portaled in\n * during that window would land outside the accessibility tree. That observer\n * exempts added nodes carrying the React Aria spelling it ported;\n * `data-kb-top-layer` (`topLayerProps`) is only honoured by a newer layer's\n * initial walk, which must still hide this portal.\n */\nexport const lateLayerAttribute = 'data-react-aria-top-layer'\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,IAAa,iBACX;;;;;;;;;;;;;;AAeF,IAAa,gBACX;;;;;AAMF,IAAa,eAAe;;AAG5B,IAAa,oBAAoB;;AAGjC,IAAa,eACX;;AAGF,IAAa,qBACX;;AAGF,IAAa,gBAAgB;;AAG7B,IAAa,gBAAgB;;AAG7B,IAAa,qBAAqB;;AAGlC,IAAa,qBACX;;;;;;;AAUF,IAAa,aACX;;;;;;;;;;AAWF,IAAa,cACX;;AAIF,IAAa,gBAAgB,GAAG,YAAY;;AAG5C,IAAa,gBAAgB,GAAG,YAAY;;;AAI5C,IAAa,gBACX;;AAIF,IAAa,eAAe;;;;;;;;;;;AAY5B,IAAa,WACX;;AASF,IAAa,sBACX;;AAGF,IAAa,YACX;;AAGF,IAAa,eAAe;;AAG5B,IAAa,gBAAgB;;;;;;;;;AAU7B,IAAa,iBAAiB,IAAI,gCAAgC;CAChE,UAAU,EACR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EACT,aAAa;EACb,MAAM;CACR,EACF;CACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CAAC;;AAMD,IAAa,qBAAqB;;;;;;;;;;;;;AAclC,IAAa,gBAAgB,EAAE,qBAAqB,GAAG;;;;;;;;;;;;AAavD,IAAa,qBAAqB"}
|
|
@@ -44,8 +44,8 @@ export type RecoveryEnvelope = Readonly<{
|
|
|
44
44
|
* Run `operation`, or answer `otherwise` if it throws.
|
|
45
45
|
*
|
|
46
46
|
* The one place a storage failure is swallowed. Storage throws for reasons outside
|
|
47
|
-
* the code
|
|
48
|
-
* not JSON
|
|
47
|
+
* the code, blocked by a sandbox or a privacy mode, full, or holding bytes that are
|
|
48
|
+
* not JSON, and a host's codec or persistence is code this system has not seen. In
|
|
49
49
|
* every case the preference is lost for the session and the switch that read or saved
|
|
50
50
|
* it still works.
|
|
51
51
|
*/
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Run `operation`, or answer `otherwise` if it throws.
|
|
4
4
|
*
|
|
5
5
|
* The one place a storage failure is swallowed. Storage throws for reasons outside
|
|
6
|
-
* the code
|
|
7
|
-
* not JSON
|
|
6
|
+
* the code, blocked by a sandbox or a privacy mode, full, or holding bytes that are
|
|
7
|
+
* not JSON, and a host's codec or persistence is code this system has not seen. In
|
|
8
8
|
* every case the preference is lost for the session and the switch that read or saved
|
|
9
9
|
* it still works.
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preference-store.js","names":[],"sources":["../../src/lib/preference-store.ts"],"sourcesContent":["/*\n * Copyright (c) 2026 Wing\n * Licensed under the MIT License.\n *\n * The recovery behaviour here (quarantine before any write, the envelope shape, the\n * legacy key that is read once and never deleted) is Adea's accepted port of Zeron's\n * preference store (https://github.com/zeronsh/zeron),\n * `packages/ui/src/components/appearance.ts`, moved here so the shared provider and\n * Adea run one implementation. See NOTICE.\n */\n\n/**\n * A versioned preference store: read one JSON document, refuse to guess about what\n * it cannot read, and keep what it refused.\n *\n * Nothing here knows what a preference *is*. A host hands the engine a key, a\n * version and (through `createVersionedPersistence`) a codec; the engine owns only\n * the part every versioned store gets wrong the same way, which is what happens to\n * a document that is not the one the code expects:\n *\n * - A document that is not JSON, or not a record, or carries a version the code\n * does not know (usually a newer build's) is **quarantined, byte for byte, into a\n * recovery key** before anything else happens. The store then answers as if\n * nothing were stored. Because the quarantine runs at read time, ahead of any\n * write, saving valid preferences later cannot destroy the unread original.\n * - A legacy key is consulted only when the main key is *absent*, never when it is\n * unreadable: a corrupt main document is not \"no preference\", and falling back to\n * an older, staler key would quietly restore a choice the user has since changed.\n * The legacy key is never deleted.\n * - Blocked storage (a sandboxed iframe, a privacy mode) throws on the mere access\n * of the `localStorage` global. Every path here treats that as \"nothing stored\".\n *\n * The reads and writes are against a {@link PreferenceStorage}, so the rules run in a\n * test without a DOM.\n */\n\n/** The part of `Storage` the engine uses. */\nexport type PreferenceStorage = Pick<Storage, 'getItem' | 'setItem'>\n\n/** Why an unread document was quarantined. */\nexport type RecoveryReason = 'corrupt_json' | 'unsupported_record'\n\n/**\n * What is written to the recovery key.\n *\n * The shape is a compatibility surface: Adea's stored envelopes already have it, and\n * a tool that inspects a user's storage reads it. Do not rename a field.\n */\nexport type RecoveryEnvelope = Readonly<{\n schemaVersion: 1\n reason: RecoveryReason\n /** An ISO-8601 timestamp of the capture; refreshed by each read of the same bytes. */\n capturedAt: string\n /** The document exactly as it was stored. */\n raw: string\n}>\n\n/**\n * Run `operation`, or answer `otherwise` if it throws.\n *\n * The one place a storage failure is swallowed. Storage throws for reasons outside\n * the code
|
|
1
|
+
{"version":3,"file":"preference-store.js","names":[],"sources":["../../src/lib/preference-store.ts"],"sourcesContent":["/*\n * Copyright (c) 2026 Wing\n * Licensed under the MIT License.\n *\n * The recovery behaviour here (quarantine before any write, the envelope shape, the\n * legacy key that is read once and never deleted) is Adea's accepted port of Zeron's\n * preference store (https://github.com/zeronsh/zeron),\n * `packages/ui/src/components/appearance.ts`, moved here so the shared provider and\n * Adea run one implementation. See NOTICE.\n */\n\n/**\n * A versioned preference store: read one JSON document, refuse to guess about what\n * it cannot read, and keep what it refused.\n *\n * Nothing here knows what a preference *is*. A host hands the engine a key, a\n * version and (through `createVersionedPersistence`) a codec; the engine owns only\n * the part every versioned store gets wrong the same way, which is what happens to\n * a document that is not the one the code expects:\n *\n * - A document that is not JSON, or not a record, or carries a version the code\n * does not know (usually a newer build's) is **quarantined, byte for byte, into a\n * recovery key** before anything else happens. The store then answers as if\n * nothing were stored. Because the quarantine runs at read time, ahead of any\n * write, saving valid preferences later cannot destroy the unread original.\n * - A legacy key is consulted only when the main key is *absent*, never when it is\n * unreadable: a corrupt main document is not \"no preference\", and falling back to\n * an older, staler key would quietly restore a choice the user has since changed.\n * The legacy key is never deleted.\n * - Blocked storage (a sandboxed iframe, a privacy mode) throws on the mere access\n * of the `localStorage` global. Every path here treats that as \"nothing stored\".\n *\n * The reads and writes are against a {@link PreferenceStorage}, so the rules run in a\n * test without a DOM.\n */\n\n/** The part of `Storage` the engine uses. */\nexport type PreferenceStorage = Pick<Storage, 'getItem' | 'setItem'>\n\n/** Why an unread document was quarantined. */\nexport type RecoveryReason = 'corrupt_json' | 'unsupported_record'\n\n/**\n * What is written to the recovery key.\n *\n * The shape is a compatibility surface: Adea's stored envelopes already have it, and\n * a tool that inspects a user's storage reads it. Do not rename a field.\n */\nexport type RecoveryEnvelope = Readonly<{\n schemaVersion: 1\n reason: RecoveryReason\n /** An ISO-8601 timestamp of the capture; refreshed by each read of the same bytes. */\n capturedAt: string\n /** The document exactly as it was stored. */\n raw: string\n}>\n\n/**\n * Run `operation`, or answer `otherwise` if it throws.\n *\n * The one place a storage failure is swallowed. Storage throws for reasons outside\n * the code, blocked by a sandbox or a privacy mode, full, or holding bytes that are\n * not JSON, and a host's codec or persistence is code this system has not seen. In\n * every case the preference is lost for the session and the switch that read or saved\n * it still works.\n */\nexport function attemptStorage<T>(operation: () => T, otherwise: T): T {\n try {\n return operation()\n } catch {\n return otherwise\n }\n}\n\n/**\n * The preference store, or nothing.\n *\n * The `typeof` guard is inside the attempt for a reason: where storage is blocked,\n * merely *reading* the `localStorage` global throws, so a guard in front of it is\n * itself the crash.\n */\nexport function defaultPreferenceStorage(): PreferenceStorage | undefined {\n return attemptStorage(\n () => (typeof localStorage === 'undefined' ? undefined : localStorage),\n undefined\n )\n}\n\n/** The envelope for a document, stamped with `now`. */\nexport function recoveryEnvelope(\n raw: string,\n reason: RecoveryReason,\n now: Date = new Date()\n): RecoveryEnvelope {\n return { schemaVersion: 1, reason, capturedAt: now.toISOString(), raw }\n}\n\n/**\n * Quarantine an unread document into `recoveryKey`.\n *\n * Idempotent, so re-reading the same unread value refreshes the capture without\n * losing it. Best effort: a store that cannot be written leaves the caller to fail\n * closed on the defaults, which is the same outcome as not having a recovery key at\n * all. Never throws.\n *\n * Exported so a host quarantines its *other* documents (a theme library, say) with\n * the same envelope. Give each document its own `recoveryKey`: two documents that\n * share one overwrite each other's capture.\n */\nexport function quarantineRecord(\n storage: PreferenceStorage,\n recoveryKey: string,\n raw: string,\n reason: RecoveryReason,\n now: () => Date = () => new Date()\n): void {\n attemptStorage(\n () => storage.setItem(recoveryKey, JSON.stringify(recoveryEnvelope(raw, reason, now()))),\n undefined\n )\n}\n\n/** Where a versioned document lives and which version the code understands. */\nexport type VersionedRecordSchema = {\n /** The storage key of the document. */\n key: string\n /**\n * The only `version` the code reads. Absent, the document is unversioned and any\n * JSON object is accepted; present, a record whose top-level `version` is not\n * exactly this number is unsupported (newer or older), not \"close enough\".\n */\n version?: number\n /** Where an unread document is kept. Default `${key}.recovery`. */\n recoveryKey?: string\n}\n\n/**\n * What reading the document found.\n *\n * - `absent`: nothing is stored under the key.\n * - `record`: a JSON object this code can read; `raw` is the stored text.\n * - `quarantined`: something was stored and cannot be read. It has already been\n * written to the recovery key.\n * - `unavailable`: the store itself could not be read.\n */\nexport type VersionedRead =\n | { status: 'absent' }\n | { status: 'record'; record: Readonly<Record<string, unknown>>; raw: string }\n | { status: 'quarantined'; reason: RecoveryReason; raw: string }\n | { status: 'unavailable' }\n\n/** The default recovery key for a document key. */\nexport function recoveryKeyFor(schema: VersionedRecordSchema): string {\n return schema.recoveryKey ?? `${schema.key}.recovery`\n}\n\n/**\n * Read the document under `schema.key`.\n *\n * The classification is the contract: a value that is not valid JSON, or is JSON but\n * not an object (`null`, a number, a string), is `corrupt_json`; an object (or array)\n * that is not a record of the supported version is `unsupported_record`. Both are\n * quarantined before this returns. An empty string is a stored value, so it is\n * corrupt rather than absent.\n */\nexport function readVersionedRecord(\n storage: PreferenceStorage,\n schema: VersionedRecordSchema,\n now?: () => Date\n): VersionedRead {\n const raw = attemptStorage<string | null | undefined>(\n () => storage.getItem(schema.key),\n undefined\n )\n if (raw === undefined) return { status: 'unavailable' }\n if (raw === null) return { status: 'absent' }\n\n const recoveryKey = recoveryKeyFor(schema)\n const parsed = attemptStorage<unknown>(() => JSON.parse(raw), undefined)\n if (typeof parsed !== 'object' || parsed === null) {\n quarantineRecord(storage, recoveryKey, raw, 'corrupt_json', now)\n return { status: 'quarantined', reason: 'corrupt_json', raw }\n }\n if (\n Array.isArray(parsed) ||\n (schema.version !== undefined && (parsed as { version?: unknown }).version !== schema.version)\n ) {\n quarantineRecord(storage, recoveryKey, raw, 'unsupported_record', now)\n return { status: 'quarantined', reason: 'unsupported_record', raw }\n }\n return { status: 'record', record: parsed as Record<string, unknown>, raw }\n}\n\n/**\n * The legacy single-key value, or `null`.\n *\n * Only the caller decides whether to look: the engine's rule is to ask when the main\n * key is `absent`, not when it was quarantined.\n */\nexport function readLegacyValue(storage: PreferenceStorage, legacyKey: string): string | null {\n return attemptStorage(() => storage.getItem(legacyKey), null)\n}\n\n/**\n * Write `document` to `key` as JSON. Returns whether it was stored; a full or blocked\n * store returns `false` and never throws, because losing a preference must not break\n * the switch that tried to save it.\n */\nexport function writeVersionedRecord(\n storage: PreferenceStorage,\n key: string,\n document: unknown\n): boolean {\n return attemptStorage(() => {\n storage.setItem(key, JSON.stringify(document))\n return true\n }, false)\n}\n"],"mappings":";;;;;;;;;;AAkEA,SAAgB,eAAkB,WAAoB,WAAiB;CACrE,IAAI;EACF,OAAO,UAAU;CACnB,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;AASA,SAAgB,2BAA0D;CACxE,OAAO,qBACE,OAAO,iBAAiB,cAAc,KAAA,IAAY,cACzD,KAAA,CACF;AACF;;AAGA,SAAgB,iBACd,KACA,QACA,sBAAY,IAAI,KAAK,GACH;CAClB,OAAO;EAAE,eAAe;EAAG;EAAQ,YAAY,IAAI,YAAY;EAAG;CAAI;AACxE;;;;;;;;;;;;;AAcA,SAAgB,iBACd,SACA,aACA,KACA,QACA,4BAAwB,IAAI,KAAK,GAC3B;CACN,qBACQ,QAAQ,QAAQ,aAAa,KAAK,UAAU,iBAAiB,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,GACvF,KAAA,CACF;AACF;;AAgCA,SAAgB,eAAe,QAAuC;CACpE,OAAO,OAAO,eAAe,GAAG,OAAO,IAAI;AAC7C;;;;;;;;;;AAWA,SAAgB,oBACd,SACA,QACA,KACe;CACf,MAAM,MAAM,qBACJ,QAAQ,QAAQ,OAAO,GAAG,GAChC,KAAA,CACF;CACA,IAAI,QAAQ,KAAA,GAAW,OAAO,EAAE,QAAQ,cAAc;CACtD,IAAI,QAAQ,MAAM,OAAO,EAAE,QAAQ,SAAS;CAE5C,MAAM,cAAc,eAAe,MAAM;CACzC,MAAM,SAAS,qBAA8B,KAAK,MAAM,GAAG,GAAG,KAAA,CAAS;CACvE,IAAI,OAAO,WAAW,YAAY,WAAW,MAAM;EACjD,iBAAiB,SAAS,aAAa,KAAK,gBAAgB,GAAG;EAC/D,OAAO;GAAE,QAAQ;GAAe,QAAQ;GAAgB;EAAI;CAC9D;CACA,IACE,MAAM,QAAQ,MAAM,KACnB,OAAO,YAAY,KAAA,KAAc,OAAiC,YAAY,OAAO,SACtF;EACA,iBAAiB,SAAS,aAAa,KAAK,sBAAsB,GAAG;EACrE,OAAO;GAAE,QAAQ;GAAe,QAAQ;GAAsB;EAAI;CACpE;CACA,OAAO;EAAE,QAAQ;EAAU,QAAQ;EAAmC;CAAI;AAC5E;;;;;;;AAQA,SAAgB,gBAAgB,SAA4B,WAAkC;CAC5F,OAAO,qBAAqB,QAAQ,QAAQ,SAAS,GAAG,IAAI;AAC9D;;;;;;AAOA,SAAgB,qBACd,SACA,KACA,UACS;CACT,OAAO,qBAAqB;EAC1B,QAAQ,QAAQ,KAAK,KAAK,UAAU,QAAQ,CAAC;EAC7C,OAAO;CACT,GAAG,KAAK;AACV"}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* there: it leaves `<` and `>` alone, so a value containing `</script>` ends the tag
|
|
7
7
|
* early and everything after it is parsed as HTML. That is the classic inline-script
|
|
8
8
|
* injection, and it is a real one even when the value is a developer-supplied prop
|
|
9
|
-
* rather than user input
|
|
9
|
+
* rather than user input, a prop can come from configuration, and a key that happens
|
|
10
10
|
* to contain a closing tag should not be able to execute.
|
|
11
11
|
*
|
|
12
12
|
* The escape is also correct JavaScript: `\u003c` is `<` to the parser, so the value
|
|
13
13
|
* is byte-identical at runtime and inert to the HTML tokenizer. `\u2028` and `\u2029`
|
|
14
|
-
* are escaped for the neighbouring reason
|
|
14
|
+
* are escaped for the neighbouring reason, they are legal inside a JSON string and
|
|
15
15
|
* were, before ES2019, line terminators to a JavaScript parser.
|
|
16
16
|
*
|
|
17
17
|
* CodeQL flags the unescaped form as `js/bad-code-sanitization`, which is how this
|
package/dist/lib/safe-script.js
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
* there: it leaves `<` and `>` alone, so a value containing `<\/script>` ends the tag
|
|
8
8
|
* early and everything after it is parsed as HTML. That is the classic inline-script
|
|
9
9
|
* injection, and it is a real one even when the value is a developer-supplied prop
|
|
10
|
-
* rather than user input
|
|
10
|
+
* rather than user input, a prop can come from configuration, and a key that happens
|
|
11
11
|
* to contain a closing tag should not be able to execute.
|
|
12
12
|
*
|
|
13
13
|
* The escape is also correct JavaScript: `\u003c` is `<` to the parser, so the value
|
|
14
14
|
* is byte-identical at runtime and inert to the HTML tokenizer. `\u2028` and `\u2029`
|
|
15
|
-
* are escaped for the neighbouring reason
|
|
15
|
+
* are escaped for the neighbouring reason, they are legal inside a JSON string and
|
|
16
16
|
* were, before ES2019, line terminators to a JavaScript parser.
|
|
17
17
|
*
|
|
18
18
|
* CodeQL flags the unescaped form as `js/bad-code-sanitization`, which is how this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-script.js","names":[],"sources":["../../src/lib/safe-script.ts"],"sourcesContent":["/**\n * A string as a JavaScript literal that is also safe inside an inline `<script>`.\n * Public as `inlineScriptLiteral` from the theme entries.\n *\n * `JSON.stringify` produces a correct JavaScript literal, and it is **not** safe\n * there: it leaves `<` and `>` alone, so a value containing `</script>` ends the tag\n * early and everything after it is parsed as HTML. That is the classic inline-script\n * injection, and it is a real one even when the value is a developer-supplied prop\n * rather than user input
|
|
1
|
+
{"version":3,"file":"safe-script.js","names":[],"sources":["../../src/lib/safe-script.ts"],"sourcesContent":["/**\n * A string as a JavaScript literal that is also safe inside an inline `<script>`.\n * Public as `inlineScriptLiteral` from the theme entries.\n *\n * `JSON.stringify` produces a correct JavaScript literal, and it is **not** safe\n * there: it leaves `<` and `>` alone, so a value containing `</script>` ends the tag\n * early and everything after it is parsed as HTML. That is the classic inline-script\n * injection, and it is a real one even when the value is a developer-supplied prop\n * rather than user input, a prop can come from configuration, and a key that happens\n * to contain a closing tag should not be able to execute.\n *\n * The escape is also correct JavaScript: `\\u003c` is `<` to the parser, so the value\n * is byte-identical at runtime and inert to the HTML tokenizer. `\\u2028` and `\\u2029`\n * are escaped for the neighbouring reason, they are legal inside a JSON string and\n * were, before ES2019, line terminators to a JavaScript parser.\n *\n * CodeQL flags the unescaped form as `js/bad-code-sanitization`, which is how this\n * was found; `tests/theme-script.test.ts` pins it so it cannot come back.\n */\nexport function safeScriptStringLiteral(value: string): string {\n return JSON.stringify(value).replace(\n /[<>\\u2028\\u2029]/g,\n (character) => `\\\\u${character.charCodeAt(0).toString(16).padStart(4, '0')}`\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,wBAAwB,OAAuB;CAC7D,OAAO,KAAK,UAAU,KAAK,CAAC,CAAC,QAC3B,sBACC,cAAc,MAAM,UAAU,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG,GAC3E;AACF"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* ratios (0.67 CSS px at 150% zoom, 0.8 at 125%): the scroller's resting
|
|
9
9
|
* maximum scrollTop lands on a fractional value, so `|scrollTop - target|`
|
|
10
10
|
* stays just above 0.5 even when the viewport is visually pinned to the
|
|
11
|
-
* bottom
|
|
11
|
+
* bottom, making the pin re-fire on every ResizeObserver tick. Scaling the
|
|
12
12
|
* epsilon to the device pixel (never below 1 CSS px) absorbs that fractional
|
|
13
13
|
* resting error. `devicePixelRatio` is read defensively so a jsdom / SSR
|
|
14
14
|
* environment that leaves it undefined falls back to 1 (→ 1.5px).
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* ratios (0.67 CSS px at 150% zoom, 0.8 at 125%): the scroller's resting
|
|
10
10
|
* maximum scrollTop lands on a fractional value, so `|scrollTop - target|`
|
|
11
11
|
* stays just above 0.5 even when the viewport is visually pinned to the
|
|
12
|
-
* bottom
|
|
12
|
+
* bottom, making the pin re-fire on every ResizeObserver tick. Scaling the
|
|
13
13
|
* epsilon to the device pixel (never below 1 CSS px) absorbs that fractional
|
|
14
14
|
* resting error. `devicePixelRatio` is read defensively so a jsdom / SSR
|
|
15
15
|
* environment that leaves it undefined falls back to 1 (→ 1.5px).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-geometry.js","names":[],"sources":["../../src/lib/scroll-geometry.ts"],"sourcesContent":["/*\n * `atBottomEpsilon` is translated from KiroCrew\n * website/src/hooks/virtualizer/FollowController.ts, pinned at\n * 283e136c0f902e965a535a7c9548c57c7504fed0.\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * This product includes software developed at Amazon.com, Inc.\n * (https://www.amazon.com/).\n * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0\n */\n/**\n * Where a scroll container is relative to its end. Every view that follows\n * appended content (a transcript, a reasoning trace, a terminal) asks the same\n * question, so they share one answer here.\n *\n * \"At the bottom\" tolerance (px) for deciding whether an auto-pin still has\n * work to do. A flat 0.5 is UNDER one device pixel at fractional device-pixel\n * ratios (0.67 CSS px at 150% zoom, 0.8 at 125%): the scroller's resting\n * maximum scrollTop lands on a fractional value, so `|scrollTop - target|`\n * stays just above 0.5 even when the viewport is visually pinned to the\n * bottom
|
|
1
|
+
{"version":3,"file":"scroll-geometry.js","names":[],"sources":["../../src/lib/scroll-geometry.ts"],"sourcesContent":["/*\n * `atBottomEpsilon` is translated from KiroCrew\n * website/src/hooks/virtualizer/FollowController.ts, pinned at\n * 283e136c0f902e965a535a7c9548c57c7504fed0.\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * This product includes software developed at Amazon.com, Inc.\n * (https://www.amazon.com/).\n * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0\n */\n/**\n * Where a scroll container is relative to its end. Every view that follows\n * appended content (a transcript, a reasoning trace, a terminal) asks the same\n * question, so they share one answer here.\n *\n * \"At the bottom\" tolerance (px) for deciding whether an auto-pin still has\n * work to do. A flat 0.5 is UNDER one device pixel at fractional device-pixel\n * ratios (0.67 CSS px at 150% zoom, 0.8 at 125%): the scroller's resting\n * maximum scrollTop lands on a fractional value, so `|scrollTop - target|`\n * stays just above 0.5 even when the viewport is visually pinned to the\n * bottom, making the pin re-fire on every ResizeObserver tick. Scaling the\n * epsilon to the device pixel (never below 1 CSS px) absorbs that fractional\n * resting error. `devicePixelRatio` is read defensively so a jsdom / SSR\n * environment that leaves it undefined falls back to 1 (→ 1.5px).\n */\nexport function atBottomEpsilon(): number {\n const dpr =\n typeof window !== 'undefined' &&\n typeof window.devicePixelRatio === 'number' &&\n window.devicePixelRatio > 0\n ? window.devicePixelRatio\n : 1\n return Math.max(1, 1 / dpr + 0.5)\n}\n\nexport interface ScrollGeom {\n scrollTop: number\n scrollHeight: number\n clientHeight: number\n}\n\nexport function bottomTarget(geom: ScrollGeom): number {\n return Math.max(0, geom.scrollHeight - geom.clientHeight)\n}\n\nexport function distanceFromBottom(geom: ScrollGeom): number {\n return geom.scrollHeight - geom.scrollTop - geom.clientHeight\n}\n\nexport function computeAtBottom(geom: ScrollGeom, threshold: number): boolean {\n return distanceFromBottom(geom) <= threshold\n}\n\n/**\n * Is the view at the very end, within one device pixel? This is the rule every\n * bottom-following scroller shares (the transcript, a reasoning trace, a\n * terminal): \"following\" means the reader is here, and an append should keep\n * them here.\n */\nexport function isAtEnd(geom: ScrollGeom): boolean {\n return distanceFromBottom(geom) <= atBottomEpsilon()\n}\n\nexport function scrollGeometry(element: Element): ScrollGeom {\n return {\n scrollTop: element.scrollTop,\n scrollHeight: element.scrollHeight,\n clientHeight: element.clientHeight,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,SAAgB,kBAA0B;CACxC,MAAM,MACJ,OAAO,WAAW,eAClB,OAAO,OAAO,qBAAqB,YACnC,OAAO,mBAAmB,IACtB,OAAO,mBACP;CACN,OAAO,KAAK,IAAI,GAAG,IAAI,MAAM,EAAG;AAClC;AAQA,SAAgB,aAAa,MAA0B;CACrD,OAAO,KAAK,IAAI,GAAG,KAAK,eAAe,KAAK,YAAY;AAC1D;AAEA,SAAgB,mBAAmB,MAA0B;CAC3D,OAAO,KAAK,eAAe,KAAK,YAAY,KAAK;AACnD;AAEA,SAAgB,gBAAgB,MAAkB,WAA4B;CAC5E,OAAO,mBAAmB,IAAI,KAAK;AACrC;;;;;;;AAQA,SAAgB,QAAQ,MAA2B;CACjD,OAAO,mBAAmB,IAAI,KAAK,gBAAgB;AACrD;AAEA,SAAgB,eAAe,SAA8B;CAC3D,OAAO;EACL,WAAW,QAAQ;EACnB,cAAc,QAAQ;EACtB,cAAc,QAAQ;CACxB;AACF"}
|
package/dist/lib/text.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const REASON_TEXT_LIMIT = 240;
|
|
|
7
7
|
* Untrusted text, made safe to lay out: hidden and direction-overriding
|
|
8
8
|
* characters removed, runs of whitespace (including newlines) collapsed to one
|
|
9
9
|
* space, and clipped to `limit` with an ellipsis. It is still only ever rendered
|
|
10
|
-
* as a text node
|
|
10
|
+
* as a text node, this is about length and spoofing, not escaping.
|
|
11
11
|
*/
|
|
12
12
|
export declare function boundText(value: string, limit: number): string;
|
|
13
13
|
//# sourceMappingURL=text.d.ts.map
|
package/dist/lib/text.js
CHANGED
|
@@ -16,7 +16,7 @@ function stripHidden(value) {
|
|
|
16
16
|
* Untrusted text, made safe to lay out: hidden and direction-overriding
|
|
17
17
|
* characters removed, runs of whitespace (including newlines) collapsed to one
|
|
18
18
|
* space, and clipped to `limit` with an ellipsis. It is still only ever rendered
|
|
19
|
-
* as a text node
|
|
19
|
+
* as a text node, this is about length and spoofing, not escaping.
|
|
20
20
|
*/
|
|
21
21
|
function boundText(value, limit) {
|
|
22
22
|
const clean = stripHidden(value.length > limit * 4 ? value.slice(0, limit * 4) : value).replace(/\s+/g, " ").trim();
|
package/dist/lib/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","names":[],"sources":["../../src/lib/text.ts"],"sourcesContent":["/**\n * The length a host-supplied reason, error or disabled explanation is clipped to\n * when a composite shows it inline beside a control.\n */\nexport const REASON_TEXT_LIMIT = 240\n\n// C0 controls other than tab and newline, DEL, and the bidirectional marks,\n// overrides and isolates: the last group is how a title can be made to read as a\n// different string than the one that is stored. Tested by code point rather than\n// by a regular expression so no control or invisible character appears in this file.\nfunction isHidden(code: number): boolean {\n return (\n code <= 0x08 ||\n code === 0x0b ||\n code === 0x0c ||\n (code >= 0x0e && code <= 0x1f) ||\n code === 0x7f ||\n code === 0x200e ||\n code === 0x200f ||\n (code >= 0x202a && code <= 0x202e) ||\n (code >= 0x2066 && code <= 0x2069)\n )\n}\n\nfunction stripHidden(value: string): string {\n let out = ''\n for (let index = 0; index < value.length; index += 1) {\n if (!isHidden(value.charCodeAt(index))) out += value.charAt(index)\n }\n return out\n}\n\n/**\n * Untrusted text, made safe to lay out: hidden and direction-overriding\n * characters removed, runs of whitespace (including newlines) collapsed to one\n * space, and clipped to `limit` with an ellipsis. It is still only ever rendered\n * as a text node
|
|
1
|
+
{"version":3,"file":"text.js","names":[],"sources":["../../src/lib/text.ts"],"sourcesContent":["/**\n * The length a host-supplied reason, error or disabled explanation is clipped to\n * when a composite shows it inline beside a control.\n */\nexport const REASON_TEXT_LIMIT = 240\n\n// C0 controls other than tab and newline, DEL, and the bidirectional marks,\n// overrides and isolates: the last group is how a title can be made to read as a\n// different string than the one that is stored. Tested by code point rather than\n// by a regular expression so no control or invisible character appears in this file.\nfunction isHidden(code: number): boolean {\n return (\n code <= 0x08 ||\n code === 0x0b ||\n code === 0x0c ||\n (code >= 0x0e && code <= 0x1f) ||\n code === 0x7f ||\n code === 0x200e ||\n code === 0x200f ||\n (code >= 0x202a && code <= 0x202e) ||\n (code >= 0x2066 && code <= 0x2069)\n )\n}\n\nfunction stripHidden(value: string): string {\n let out = ''\n for (let index = 0; index < value.length; index += 1) {\n if (!isHidden(value.charCodeAt(index))) out += value.charAt(index)\n }\n return out\n}\n\n/**\n * Untrusted text, made safe to lay out: hidden and direction-overriding\n * characters removed, runs of whitespace (including newlines) collapsed to one\n * space, and clipped to `limit` with an ellipsis. It is still only ever rendered\n * as a text node, this is about length and spoofing, not escaping.\n */\nexport function boundText(value: string, limit: number): string {\n // Clip before the regex passes so a multi-megabyte value costs a slice, not a scan.\n const head = value.length > limit * 4 ? value.slice(0, limit * 4) : value\n const clean = stripHidden(head).replace(/\\s+/g, ' ').trim()\n if (clean.length <= limit) return clean\n const clipped = clean.slice(0, limit)\n // Never end on half of a surrogate pair: it renders as a replacement glyph.\n const last = clipped.charCodeAt(clipped.length - 1)\n const whole = last >= 0xd800 && last <= 0xdbff ? clipped.slice(0, -1) : clipped\n return `${whole.trimEnd()}…`\n}\n"],"mappings":";;;;;AAIA,IAAa,oBAAoB;AAMjC,SAAS,SAAS,MAAuB;CACvC,OACE,QAAQ,KACR,SAAS,MACT,SAAS,MACR,QAAQ,MAAQ,QAAQ,MACzB,SAAS,OACT,SAAS,QACT,SAAS,QACR,QAAQ,QAAU,QAAQ,QAC1B,QAAQ,QAAU,QAAQ;AAE/B;AAEA,SAAS,YAAY,OAAuB;CAC1C,IAAI,MAAM;CACV,KAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS,GACjD,IAAI,CAAC,SAAS,MAAM,WAAW,KAAK,CAAC,GAAG,OAAO,MAAM,OAAO,KAAK;CAEnE,OAAO;AACT;;;;;;;AAQA,SAAgB,UAAU,OAAe,OAAuB;CAG9D,MAAM,QAAQ,YADD,MAAM,SAAS,QAAQ,IAAI,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,KACtC,CAAC,CAAC,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAAK;CAC1D,IAAI,MAAM,UAAU,OAAO,OAAO;CAClC,MAAM,UAAU,MAAM,MAAM,GAAG,KAAK;CAEpC,MAAM,OAAO,QAAQ,WAAW,QAAQ,SAAS,CAAC;CAElD,OAAO,IADO,QAAQ,SAAU,QAAQ,QAAS,QAAQ,MAAM,GAAG,EAAE,IAAI,QAAA,CACxD,QAAQ,EAAE;AAC5B"}
|
|
@@ -5,16 +5,16 @@ import { ANSI_KEYS } from "@adea-ai/themes/schema";
|
|
|
5
5
|
*
|
|
6
6
|
* `@adea-ai/themes` offers two kinds of accent. The presets (`ACCENTS`) are brand
|
|
7
7
|
* colours, the same six on every theme. Since 0.9 the catalogue also offers the
|
|
8
|
-
* accent-shaped colours a theme carries itself
|
|
8
|
+
* accent-shaped colours a theme carries itself, its ANSI blue, magenta, cyan and
|
|
9
9
|
* green, paired across a light and a dark theme and kept only when they clear the
|
|
10
|
-
* catalogue's accent floors
|
|
10
|
+
* catalogue's accent floors, through `themeAccentPresets`. Those read as part of
|
|
11
11
|
* the palette rather than as visitors on it, which is why they are offered here.
|
|
12
12
|
*
|
|
13
13
|
* Their ids are role-shaped (`ansi-blue`), not value-shaped: a stored theme accent
|
|
14
14
|
* survives switching themes and resolves to the *new* theme's blue. That has one
|
|
15
15
|
* consequence a consumer must handle, and this module is where it is handled once:
|
|
16
16
|
* a stored theme accent may name a slot the current pair does not offer, and then
|
|
17
|
-
* it resolves to nothing and the theme's own primary applies
|
|
17
|
+
* it resolves to nothing and the theme's own primary applies, the same fallback a
|
|
18
18
|
* stale preset id gets.
|
|
19
19
|
*
|
|
20
20
|
* This module holds only the id test, and reads only the schema entry: the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-accents.js","names":[],"sources":["../../src/lib/theme-accents.ts"],"sourcesContent":["/**\n * The accents a theme carries, beside the six presets.\n *\n * `@adea-ai/themes` offers two kinds of accent. The presets (`ACCENTS`) are brand\n * colours, the same six on every theme. Since 0.9 the catalogue also offers the\n * accent-shaped colours a theme carries itself
|
|
1
|
+
{"version":3,"file":"theme-accents.js","names":[],"sources":["../../src/lib/theme-accents.ts"],"sourcesContent":["/**\n * The accents a theme carries, beside the six presets.\n *\n * `@adea-ai/themes` offers two kinds of accent. The presets (`ACCENTS`) are brand\n * colours, the same six on every theme. Since 0.9 the catalogue also offers the\n * accent-shaped colours a theme carries itself, its ANSI blue, magenta, cyan and\n * green, paired across a light and a dark theme and kept only when they clear the\n * catalogue's accent floors, through `themeAccentPresets`. Those read as part of\n * the palette rather than as visitors on it, which is why they are offered here.\n *\n * Their ids are role-shaped (`ansi-blue`), not value-shaped: a stored theme accent\n * survives switching themes and resolves to the *new* theme's blue. That has one\n * consequence a consumer must handle, and this module is where it is handled once:\n * a stored theme accent may name a slot the current pair does not offer, and then\n * it resolves to nothing and the theme's own primary applies, the same fallback a\n * stale preset id gets.\n *\n * This module holds only the id test, and reads only the schema entry: the\n * appearance editor uses it, and the editor's packed renderer gate forbids the\n * catalogue and normalization modules that *computing* a theme accent needs\n * (`themeAccentPresets` measures through `normalize.js`). Resolution lives in\n * `lib/themes.ts`, beside the catalogue it reads.\n */\nimport { ANSI_KEYS } from '@adea-ai/themes/schema'\n\n/** The prefix the catalogue gives every theme-derived accent id. */\nexport const THEME_ACCENT_PREFIX = 'ansi-'\n\n/**\n * Whether an id names a theme-derived accent slot.\n *\n * Deliberately wider than what any one pair offers: the id is valid to *store*\n * whenever it names a slot, because the next theme may offer it even if this one\n * does not. Whether it resolves is `resolveAccentPreset`'s question.\n */\nexport function isThemeAccentId(id: string): boolean {\n // Computed per call rather than held in a module-level set: a top-level\n // `new Set(...)` is a statement a bundler cannot prove pure, and it would keep\n // this module in every bundle that touches the root entry.\n return (\n id.startsWith(THEME_ACCENT_PREFIX) &&\n (ANSI_KEYS as readonly string[]).includes(id.slice(THEME_ACCENT_PREFIX.length))\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAa,sBAAsB;;;;;;;;AASnC,SAAgB,gBAAgB,IAAqB;CAInD,OACE,GAAG,WAAA,OAA8B,KAChC,UAAgC,SAAS,GAAG,MAAM,CAA0B,CAAC;AAElF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-css.js","names":[],"sources":["../../src/lib/theme-css.ts"],"sourcesContent":["/**\n * The mapping from a variant's roles to this system's custom properties, without the\n * catalogue.\n *\n * `themeCssVariables` needs two things only the catalogue can measure for a theme:\n * the strength of its `--primary-subtle` tint and its floor-projected editor ramp.\n * Those are the `hooks`, so this module imports no catalogue data and a host that\n * never loads the catalogue can still paint a variant it already holds. `lib/themes`\n * binds the hooks to the catalogue; `lib/theme-engine-light` binds them to the\n * precomputed default pair.\n */\nimport { primaryHover } from '@adea-ai/themes'\nimport { formatOklch, oklchToHex, parseColor, shiftLightness } from '@adea-ai/themes/oklch'\nimport {\n THEME_EDITOR_PROPERTIES,\n THEME_TERMINAL_PROPERTIES,\n rolesAsProperties,\n type EditorRolesMode,\n type ThemeCssVariableOptions,\n type ThemeEditorPalette,\n type ThemeVariant,\n} from './theme-types'\n\n/** What a variant's custom properties need that depends on the catalogue. */\nexport type ThemeCssHooks = {\n /** The `--primary-subtle` expression of a variant. */\n primarySubtle(theme: Pick<ThemeVariant, 'id' | 'appearance'>): string\n /** The editor ramp of a variant under a projection. */\n editor(theme: ThemeVariant, mode: EditorRolesMode): ThemeEditorPalette\n}\n\n/**\n * `--surface-sunken`: one step below the canvas, a code well or an inset panel.\n *\n * Not a catalogue role, because the catalogue's ladder only goes *up* from the\n * canvas. Darker in both appearances, which is the rule the ladder does not follow:\n * a raised surface is lighter than the canvas on a dark theme and darker on a light\n * one, but a sunken one is *always* darker, because the metaphor is a well cut into\n * the page rather than a panel laid on it.\n *\n * Computed rather than a `color-mix()`, because mixing toward black also drains the\n * hue, and these canvases are tinted.\n */\nexport function sunkenSurface(background: string): string {\n const canvas = parseColor(background)\n return canvas ? formatOklch(shiftLightness(canvas, -0.02)) : background\n}\n\n/**\n * The roles a variant sets, as CSS custom properties.\n *\n * The one place that knows the mapping from a theme's roles to this system's variable\n * names. A provider applies this; nothing else repeats it. The `--terminal-*` and\n * `--editor-*` ramps are presentations of the catalogue's ANSI and syntax data rather\n * than separate roles, which is why they are built here and not in the catalogue.\n *\n * `options.editor` picks the `--editor-*` projection ({@link EditorRolesMode}).\n * Absent it, the result is what it has always been; the generated `theme-variants.css`\n * and the design-system artifact are built without it.\n */\nexport function themeCssVariablesWith(\n hooks: ThemeCssHooks,\n theme: ThemeVariant,\n options: ThemeCssVariableOptions = {}\n): Record<string, string> {\n const c = theme.colors\n const e = hooks.editor(theme, options.editor ?? 'syntax')\n const derived = {\n '--background': c.background,\n '--foreground': c.foreground,\n '--card': c.card,\n '--card-foreground': c.cardForeground,\n '--popover': c.popover,\n '--popover-foreground': c.popoverForeground,\n '--primary': c.primary,\n '--primary-foreground': c.primaryForeground,\n /*\n * The two tokens derived from the primary, and they are here rather than left to\n * `theme.css` because they must follow `--primary` — which this function writes\n * for *any* theme in the catalogue, not just the two defaults `theme.css` carries.\n *\n * `--primary-hover` is a resolved colour, not a `color-mix()`: a uniform hover\n * step cannot be expressed as a mix (see `primaryHover`). Left out, a theme switch\n * would keep the previous theme's hover on the new theme's primary.\n *\n * `--primary-subtle` is a mix over `--primary`, so it follows an accent on its\n * own, but its *strength* is per theme: `primarySubtleCss(record)` lowers the\n * appearance ceiling only as far as this theme needs for body text to clear 4.5:1\n * on the tint, over every surface, for every accent it offers. It has to be\n * written per theme for that reason — the appearance-wide value is not legible on\n * every palette.\n */\n '--primary-hover': primaryHover(c.primary, theme.appearance),\n '--primary-subtle': hooks.primarySubtle(theme),\n '--secondary': c.secondary,\n '--secondary-foreground': c.secondaryForeground,\n '--muted': c.muted,\n '--muted-foreground': c.mutedForeground,\n '--accent': c.accent,\n '--accent-foreground': c.accentForeground,\n '--destructive': c.destructive,\n '--destructive-foreground': c.destructiveForeground,\n '--destructive-subtle': c.destructiveSubtle,\n '--destructive-action': c.destructiveAction,\n '--destructive-action-foreground': c.destructiveActionForeground,\n '--success': c.success,\n '--success-foreground': c.successForeground,\n '--success-subtle': c.successSubtle,\n '--warning': c.warning,\n '--warning-foreground': c.warningForeground,\n '--warning-subtle': c.warningSubtle,\n '--info': c.info,\n '--info-foreground': c.infoForeground,\n '--info-subtle': c.infoSubtle,\n '--border': c.border,\n '--input': c.input,\n '--ring': c.ring,\n '--sidebar': c.sidebar,\n '--sidebar-foreground': c.sidebarForeground,\n '--sidebar-accent': c.sidebarAccent,\n '--sidebar-border': c.sidebarBorder,\n '--sidebar-primary': c.primary,\n '--sidebar-primary-foreground': c.primaryForeground,\n '--sidebar-ring': c.ring,\n '--sidebar-muted-foreground': c.sidebarMutedForeground,\n '--surface-sunken': sunkenSurface(c.background),\n '--surface-hover': c.accent,\n '--surface-active': c.border,\n '--chrome': c.background,\n ...rolesAsProperties(THEME_TERMINAL_PROPERTIES, theme.terminal),\n ...rolesAsProperties(THEME_EDITOR_PROPERTIES, e),\n '--chart-1': theme.chart[0] ?? c.primary,\n '--chart-2': theme.chart[1] ?? c.info,\n '--chart-3': theme.chart[2] ?? c.success,\n '--chart-4': theme.chart[3] ?? c.warning,\n '--chart-5': theme.chart[4] ?? c.destructive,\n '--chart-6': theme.chart[5] ?? c.mutedForeground,\n }\n return theme.tokens ? { ...derived, ...theme.tokens } : derived\n}\n\n/**\n * The `--terminal-*` properties of a variant: the palette a terminal paints.\n *\n * What a pinned terminal theme writes over the interface variant's own. The names\n * are the ones {@link themeCssVariablesWith} writes, and a custom variant's verbatim\n * `tokens` still win, so they can never drift from what the interface variant would\n * have written for the same palette. Built from the terminal palette alone: it needs\n * neither the catalogue nor the rest of the variant's roles.\n */\nexport function terminalCssVariables(theme: ThemeVariant): Record<string, string> {\n const properties = rolesAsProperties(THEME_TERMINAL_PROPERTIES, theme.terminal)\n if (!theme.tokens) return properties\n for (const [name, value] of Object.entries(theme.tokens)) {\n if (name.startsWith('--terminal-')) properties[name] = value\n }\n return properties\n}\n\n/**\n * Token values with every `oklch()` colour written as `#rrggbb`.\n *\n * For a host whose stylesheet, tests or native shell speak hex: the catalogue's\n * roles are `oklch()` strings, and this is the one conversion, gamut-mapped by the\n * catalogue's own `oklchToHex`. A value that is already hex, carries alpha\n * (`rgba()`), or is not a plain colour (`color-mix()`, `var()`) is left byte for\n * byte, because converting would either lose the alpha or be a guess. Suitable as\n * `ThemeProvider`'s `transformTokens`.\n */\nexport function tokensAsHex(tokens: Readonly<Record<string, string>>): Record<string, string> {\n const converted: Record<string, string> = {}\n for (const [name, value] of Object.entries(tokens)) {\n const trimmed = value.trim()\n // `parseOklch` discards alpha, so a translucent oklch() stays as written.\n const opaque = trimmed.startsWith('oklch(') && !trimmed.includes('/')\n const parsed = opaque ? parseColor(trimmed) : undefined\n converted[name] = parsed ? oklchToHex(parsed) : value\n }\n return converted\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,cAAc,YAA4B;CACxD,MAAM,SAAS,WAAW,UAAU;CACpC,OAAO,SAAS,YAAY,eAAe,QAAQ,IAAK,CAAC,IAAI;AAC/D;;;;;;;;;;;;;AAcA,SAAgB,sBACd,OACA,OACA,UAAmC,CAAC,GACZ;CACxB,MAAM,IAAI,MAAM;CAChB,MAAM,IAAI,MAAM,OAAO,OAAO,QAAQ,UAAU,QAAQ;CACxD,MAAM,UAAU;EACd,gBAAgB,EAAE;EAClB,gBAAgB,EAAE;EAClB,UAAU,EAAE;EACZ,qBAAqB,EAAE;EACvB,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,aAAa,EAAE;EACf,wBAAwB,EAAE;EAiB1B,mBAAmB,aAAa,EAAE,SAAS,MAAM,UAAU;EAC3D,oBAAoB,MAAM,cAAc,KAAK;EAC7C,eAAe,EAAE;EACjB,0BAA0B,EAAE;EAC5B,WAAW,EAAE;EACb,sBAAsB,EAAE;EACxB,YAAY,EAAE;EACd,uBAAuB,EAAE;EACzB,iBAAiB,EAAE;EACnB,4BAA4B,EAAE;EAC9B,wBAAwB,EAAE;EAC1B,wBAAwB,EAAE;EAC1B,mCAAmC,EAAE;EACrC,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,oBAAoB,EAAE;EACtB,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,oBAAoB,EAAE;EACtB,UAAU,EAAE;EACZ,qBAAqB,EAAE;EACvB,iBAAiB,EAAE;EACnB,YAAY,EAAE;EACd,WAAW,EAAE;EACb,UAAU,EAAE;EACZ,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,oBAAoB,EAAE;EACtB,oBAAoB,EAAE;EACtB,qBAAqB,EAAE;EACvB,gCAAgC,EAAE;EAClC,kBAAkB,EAAE;EACpB,8BAA8B,EAAE;EAChC,oBAAoB,cAAc,EAAE,UAAU;EAC9C,mBAAmB,EAAE;EACrB,oBAAoB,EAAE;EACtB,YAAY,EAAE;EACd,GAAG,kBAAkB,2BAA2B,MAAM,QAAQ;EAC9D,GAAG,kBAAkB,yBAAyB,CAAC;EAC/C,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;CACnC;CACA,OAAO,MAAM,SAAS;EAAE,GAAG;EAAS,GAAG,MAAM;CAAO,IAAI;AAC1D;;;;;;;;;;AAWA,SAAgB,qBAAqB,OAA6C;CAChF,MAAM,aAAa,kBAAkB,2BAA2B,MAAM,QAAQ;CAC9E,IAAI,CAAC,MAAM,QAAQ,OAAO;CAC1B,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,MAAM,GACrD,IAAI,KAAK,WAAW,aAAa,GAAG,WAAW,QAAQ;CAEzD,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,YAAY,QAAkE;CAC5F,MAAM,YAAoC,CAAC;CAC3C,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,GAAG;EAClD,MAAM,UAAU,MAAM,KAAK;EAG3B,MAAM,SADS,QAAQ,WAAW,QAAQ,KAAK,CAAC,QAAQ,SAAS,GAAG,IAC5C,WAAW,OAAO,IAAI,KAAA;EAC9C,UAAU,QAAQ,SAAS,WAAW,MAAM,IAAI;CAClD;CACA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"theme-css.js","names":[],"sources":["../../src/lib/theme-css.ts"],"sourcesContent":["/**\n * The mapping from a variant's roles to this system's custom properties, without the\n * catalogue.\n *\n * `themeCssVariables` needs two things only the catalogue can measure for a theme:\n * the strength of its `--primary-subtle` tint and its floor-projected editor ramp.\n * Those are the `hooks`, so this module imports no catalogue data and a host that\n * never loads the catalogue can still paint a variant it already holds. `lib/themes`\n * binds the hooks to the catalogue; `lib/theme-engine-light` binds them to the\n * precomputed default pair.\n */\nimport { primaryHover } from '@adea-ai/themes'\nimport { formatOklch, oklchToHex, parseColor, shiftLightness } from '@adea-ai/themes/oklch'\nimport {\n THEME_EDITOR_PROPERTIES,\n THEME_TERMINAL_PROPERTIES,\n rolesAsProperties,\n type EditorRolesMode,\n type ThemeCssVariableOptions,\n type ThemeEditorPalette,\n type ThemeVariant,\n} from './theme-types'\n\n/** What a variant's custom properties need that depends on the catalogue. */\nexport type ThemeCssHooks = {\n /** The `--primary-subtle` expression of a variant. */\n primarySubtle(theme: Pick<ThemeVariant, 'id' | 'appearance'>): string\n /** The editor ramp of a variant under a projection. */\n editor(theme: ThemeVariant, mode: EditorRolesMode): ThemeEditorPalette\n}\n\n/**\n * `--surface-sunken`: one step below the canvas, a code well or an inset panel.\n *\n * Not a catalogue role, because the catalogue's ladder only goes *up* from the\n * canvas. Darker in both appearances, which is the rule the ladder does not follow:\n * a raised surface is lighter than the canvas on a dark theme and darker on a light\n * one, but a sunken one is *always* darker, because the metaphor is a well cut into\n * the page rather than a panel laid on it.\n *\n * Computed rather than a `color-mix()`, because mixing toward black also drains the\n * hue, and these canvases are tinted.\n */\nexport function sunkenSurface(background: string): string {\n const canvas = parseColor(background)\n return canvas ? formatOklch(shiftLightness(canvas, -0.02)) : background\n}\n\n/**\n * The roles a variant sets, as CSS custom properties.\n *\n * The one place that knows the mapping from a theme's roles to this system's variable\n * names. A provider applies this; nothing else repeats it. The `--terminal-*` and\n * `--editor-*` ramps are presentations of the catalogue's ANSI and syntax data rather\n * than separate roles, which is why they are built here and not in the catalogue.\n *\n * `options.editor` picks the `--editor-*` projection ({@link EditorRolesMode}).\n * Absent it, the result is what it has always been; the generated `theme-variants.css`\n * and the design-system artifact are built without it.\n */\nexport function themeCssVariablesWith(\n hooks: ThemeCssHooks,\n theme: ThemeVariant,\n options: ThemeCssVariableOptions = {}\n): Record<string, string> {\n const c = theme.colors\n const e = hooks.editor(theme, options.editor ?? 'syntax')\n const derived = {\n '--background': c.background,\n '--foreground': c.foreground,\n '--card': c.card,\n '--card-foreground': c.cardForeground,\n '--popover': c.popover,\n '--popover-foreground': c.popoverForeground,\n '--primary': c.primary,\n '--primary-foreground': c.primaryForeground,\n /*\n * The two tokens derived from the primary, and they are here rather than left to\n * `theme.css` because they must follow `--primary`, which this function writes\n * for *any* theme in the catalogue, not just the two defaults `theme.css` carries.\n *\n * `--primary-hover` is a resolved colour, not a `color-mix()`: a uniform hover\n * step cannot be expressed as a mix (see `primaryHover`). Left out, a theme switch\n * would keep the previous theme's hover on the new theme's primary.\n *\n * `--primary-subtle` is a mix over `--primary`, so it follows an accent on its\n * own, but its *strength* is per theme: `primarySubtleCss(record)` lowers the\n * appearance ceiling only as far as this theme needs for body text to clear 4.5:1\n * on the tint, over every surface, for every accent it offers. It has to be\n * written per theme for that reason, the appearance-wide value is not legible on\n * every palette.\n */\n '--primary-hover': primaryHover(c.primary, theme.appearance),\n '--primary-subtle': hooks.primarySubtle(theme),\n '--secondary': c.secondary,\n '--secondary-foreground': c.secondaryForeground,\n '--muted': c.muted,\n '--muted-foreground': c.mutedForeground,\n '--accent': c.accent,\n '--accent-foreground': c.accentForeground,\n '--destructive': c.destructive,\n '--destructive-foreground': c.destructiveForeground,\n '--destructive-subtle': c.destructiveSubtle,\n '--destructive-action': c.destructiveAction,\n '--destructive-action-foreground': c.destructiveActionForeground,\n '--success': c.success,\n '--success-foreground': c.successForeground,\n '--success-subtle': c.successSubtle,\n '--warning': c.warning,\n '--warning-foreground': c.warningForeground,\n '--warning-subtle': c.warningSubtle,\n '--info': c.info,\n '--info-foreground': c.infoForeground,\n '--info-subtle': c.infoSubtle,\n '--border': c.border,\n '--input': c.input,\n '--ring': c.ring,\n '--sidebar': c.sidebar,\n '--sidebar-foreground': c.sidebarForeground,\n '--sidebar-accent': c.sidebarAccent,\n '--sidebar-border': c.sidebarBorder,\n '--sidebar-primary': c.primary,\n '--sidebar-primary-foreground': c.primaryForeground,\n '--sidebar-ring': c.ring,\n '--sidebar-muted-foreground': c.sidebarMutedForeground,\n '--surface-sunken': sunkenSurface(c.background),\n '--surface-hover': c.accent,\n '--surface-active': c.border,\n '--chrome': c.background,\n ...rolesAsProperties(THEME_TERMINAL_PROPERTIES, theme.terminal),\n ...rolesAsProperties(THEME_EDITOR_PROPERTIES, e),\n '--chart-1': theme.chart[0] ?? c.primary,\n '--chart-2': theme.chart[1] ?? c.info,\n '--chart-3': theme.chart[2] ?? c.success,\n '--chart-4': theme.chart[3] ?? c.warning,\n '--chart-5': theme.chart[4] ?? c.destructive,\n '--chart-6': theme.chart[5] ?? c.mutedForeground,\n }\n return theme.tokens ? { ...derived, ...theme.tokens } : derived\n}\n\n/**\n * The `--terminal-*` properties of a variant: the palette a terminal paints.\n *\n * What a pinned terminal theme writes over the interface variant's own. The names\n * are the ones {@link themeCssVariablesWith} writes, and a custom variant's verbatim\n * `tokens` still win, so they can never drift from what the interface variant would\n * have written for the same palette. Built from the terminal palette alone: it needs\n * neither the catalogue nor the rest of the variant's roles.\n */\nexport function terminalCssVariables(theme: ThemeVariant): Record<string, string> {\n const properties = rolesAsProperties(THEME_TERMINAL_PROPERTIES, theme.terminal)\n if (!theme.tokens) return properties\n for (const [name, value] of Object.entries(theme.tokens)) {\n if (name.startsWith('--terminal-')) properties[name] = value\n }\n return properties\n}\n\n/**\n * Token values with every `oklch()` colour written as `#rrggbb`.\n *\n * For a host whose stylesheet, tests or native shell speak hex: the catalogue's\n * roles are `oklch()` strings, and this is the one conversion, gamut-mapped by the\n * catalogue's own `oklchToHex`. A value that is already hex, carries alpha\n * (`rgba()`), or is not a plain colour (`color-mix()`, `var()`) is left byte for\n * byte, because converting would either lose the alpha or be a guess. Suitable as\n * `ThemeProvider`'s `transformTokens`.\n */\nexport function tokensAsHex(tokens: Readonly<Record<string, string>>): Record<string, string> {\n const converted: Record<string, string> = {}\n for (const [name, value] of Object.entries(tokens)) {\n const trimmed = value.trim()\n // `parseOklch` discards alpha, so a translucent oklch() stays as written.\n const opaque = trimmed.startsWith('oklch(') && !trimmed.includes('/')\n const parsed = opaque ? parseColor(trimmed) : undefined\n converted[name] = parsed ? oklchToHex(parsed) : value\n }\n return converted\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,cAAc,YAA4B;CACxD,MAAM,SAAS,WAAW,UAAU;CACpC,OAAO,SAAS,YAAY,eAAe,QAAQ,IAAK,CAAC,IAAI;AAC/D;;;;;;;;;;;;;AAcA,SAAgB,sBACd,OACA,OACA,UAAmC,CAAC,GACZ;CACxB,MAAM,IAAI,MAAM;CAChB,MAAM,IAAI,MAAM,OAAO,OAAO,QAAQ,UAAU,QAAQ;CACxD,MAAM,UAAU;EACd,gBAAgB,EAAE;EAClB,gBAAgB,EAAE;EAClB,UAAU,EAAE;EACZ,qBAAqB,EAAE;EACvB,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,aAAa,EAAE;EACf,wBAAwB,EAAE;EAiB1B,mBAAmB,aAAa,EAAE,SAAS,MAAM,UAAU;EAC3D,oBAAoB,MAAM,cAAc,KAAK;EAC7C,eAAe,EAAE;EACjB,0BAA0B,EAAE;EAC5B,WAAW,EAAE;EACb,sBAAsB,EAAE;EACxB,YAAY,EAAE;EACd,uBAAuB,EAAE;EACzB,iBAAiB,EAAE;EACnB,4BAA4B,EAAE;EAC9B,wBAAwB,EAAE;EAC1B,wBAAwB,EAAE;EAC1B,mCAAmC,EAAE;EACrC,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,oBAAoB,EAAE;EACtB,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,oBAAoB,EAAE;EACtB,UAAU,EAAE;EACZ,qBAAqB,EAAE;EACvB,iBAAiB,EAAE;EACnB,YAAY,EAAE;EACd,WAAW,EAAE;EACb,UAAU,EAAE;EACZ,aAAa,EAAE;EACf,wBAAwB,EAAE;EAC1B,oBAAoB,EAAE;EACtB,oBAAoB,EAAE;EACtB,qBAAqB,EAAE;EACvB,gCAAgC,EAAE;EAClC,kBAAkB,EAAE;EACpB,8BAA8B,EAAE;EAChC,oBAAoB,cAAc,EAAE,UAAU;EAC9C,mBAAmB,EAAE;EACrB,oBAAoB,EAAE;EACtB,YAAY,EAAE;EACd,GAAG,kBAAkB,2BAA2B,MAAM,QAAQ;EAC9D,GAAG,kBAAkB,yBAAyB,CAAC;EAC/C,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;CACnC;CACA,OAAO,MAAM,SAAS;EAAE,GAAG;EAAS,GAAG,MAAM;CAAO,IAAI;AAC1D;;;;;;;;;;AAWA,SAAgB,qBAAqB,OAA6C;CAChF,MAAM,aAAa,kBAAkB,2BAA2B,MAAM,QAAQ;CAC9E,IAAI,CAAC,MAAM,QAAQ,OAAO;CAC1B,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,MAAM,GACrD,IAAI,KAAK,WAAW,aAAa,GAAG,WAAW,QAAQ;CAEzD,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,YAAY,QAAkE;CAC5F,MAAM,YAAoC,CAAC;CAC3C,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,GAAG;EAClD,MAAM,UAAU,MAAM,KAAK;EAG3B,MAAM,SADS,QAAQ,WAAW,QAAQ,KAAK,CAAC,QAAQ,SAAS,GAAG,IAC5C,WAAW,OAAO,IAAI,KAAA;EAC9C,UAAU,QAAQ,SAAS,WAAW,MAAM,IAAI;CAClD;CACA,OAAO;AACT"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* The catalogue (`@adea-ai/themes`, 34 themes) is the heavy part of the theme
|
|
6
6
|
* system. Most hosts start on the default pair, paint a catalogue theme from a
|
|
7
|
-
* stylesheet, and open a picker rarely, so the rules every layer applies
|
|
8
|
-
* engines, `lib/themes`, the persistence and the boot script
|
|
7
|
+
* stylesheet, and open a picker rarely, so the rules every layer applies, the
|
|
8
|
+
* engines, `lib/themes`, the persistence and the boot script, live here, beside the
|
|
9
9
|
* few catalogue facts they need: every catalogue id with its appearance and the
|
|
10
10
|
* default pair as complete variants.
|
|
11
11
|
*
|
|
@@ -56,8 +56,8 @@ export declare function storedThemeId(value: unknown, appearance: ThemeAppearanc
|
|
|
56
56
|
/**
|
|
57
57
|
* The variant a stored id means, or the default of the same appearance.
|
|
58
58
|
*
|
|
59
|
-
* An id the registry does not hold
|
|
60
|
-
* catalogue entry that was renamed
|
|
59
|
+
* An id the registry does not hold, an imported theme that was deleted, a
|
|
60
|
+
* catalogue entry that was renamed, must still paint *something of the appearance
|
|
61
61
|
* being shown*. Falling back to whichever variant happens to be first in the
|
|
62
62
|
* registry painted a dark palette under a light `color-scheme` for a light id, so
|
|
63
63
|
* the fallback is the appearance's own default, then any variant of that
|
|
@@ -6,8 +6,8 @@ import { DEFAULT_FLOOR_EDITOR, DEFAULT_PRIMARY_SUBTLE, DEFAULT_THEME_ACCENTS, DE
|
|
|
6
6
|
*
|
|
7
7
|
* The catalogue (`@adea-ai/themes`, 34 themes) is the heavy part of the theme
|
|
8
8
|
* system. Most hosts start on the default pair, paint a catalogue theme from a
|
|
9
|
-
* stylesheet, and open a picker rarely, so the rules every layer applies
|
|
10
|
-
* engines, `lib/themes`, the persistence and the boot script
|
|
9
|
+
* stylesheet, and open a picker rarely, so the rules every layer applies, the
|
|
10
|
+
* engines, `lib/themes`, the persistence and the boot script, live here, beside the
|
|
11
11
|
* few catalogue facts they need: every catalogue id with its appearance and the
|
|
12
12
|
* default pair as complete variants.
|
|
13
13
|
*
|
|
@@ -77,8 +77,8 @@ function storedThemeId(value, appearance) {
|
|
|
77
77
|
/**
|
|
78
78
|
* The variant a stored id means, or the default of the same appearance.
|
|
79
79
|
*
|
|
80
|
-
* An id the registry does not hold
|
|
81
|
-
* catalogue entry that was renamed
|
|
80
|
+
* An id the registry does not hold, an imported theme that was deleted, a
|
|
81
|
+
* catalogue entry that was renamed, must still paint *something of the appearance
|
|
82
82
|
* being shown*. Falling back to whichever variant happens to be first in the
|
|
83
83
|
* registry painted a dark palette under a light `color-scheme` for a light id, so
|
|
84
84
|
* the fallback is the appearance's own default, then any variant of that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-defaults.js","names":[],"sources":["../../src/lib/theme-defaults.ts"],"sourcesContent":["/**\n * The theme policy that needs no catalogue: which ids are the defaults, which ids\n * the catalogue holds, and what an id the registry lacks paints instead.\n *\n * The catalogue (`@adea-ai/themes`, 34 themes) is the heavy part of the theme\n * system. Most hosts start on the default pair, paint a catalogue theme from a\n * stylesheet, and open a picker rarely, so the rules every layer applies
|
|
1
|
+
{"version":3,"file":"theme-defaults.js","names":[],"sources":["../../src/lib/theme-defaults.ts"],"sourcesContent":["/**\n * The theme policy that needs no catalogue: which ids are the defaults, which ids\n * the catalogue holds, and what an id the registry lacks paints instead.\n *\n * The catalogue (`@adea-ai/themes`, 34 themes) is the heavy part of the theme\n * system. Most hosts start on the default pair, paint a catalogue theme from a\n * stylesheet, and open a picker rarely, so the rules every layer applies, the\n * engines, `lib/themes`, the persistence and the boot script, live here, beside the\n * few catalogue facts they need: every catalogue id with its appearance and the\n * default pair as complete variants.\n *\n * It imports no catalogue code and no catalogue data. The facts themselves are in\n * `theme-defaults.generated.ts`, copied from the catalogue by\n * `scripts/build-theme-defaults.ts` and checked against it by\n * `tests/theme-defaults.test.ts`.\n */\nimport { DEFAULT_VARIANTS, THEME_INDEX } from './theme-defaults.generated'\nimport type { ThemeAppearance, ThemePair, ThemeVariant } from './theme-types'\n\nexport {\n DEFAULT_FLOOR_EDITOR,\n DEFAULT_PRIMARY_SUBTLE,\n DEFAULT_THEME_ACCENTS,\n DEFAULT_VARIANTS,\n THEME_INDEX,\n} from './theme-defaults.generated'\n\n/**\n * The id that defers to the theme itself: as an accent, the variant's own primary\n * (the default accent); as a terminal palette, the interface theme.\n */\nexport const THEME_DEFAULT_ID = 'theme'\n\nexport const defaultLightThemeId = 'adea-light'\nexport const defaultDarkThemeId = 'adea-dark'\n\n/** The pair a selection names before anyone chooses. */\nexport const defaultThemePair: Readonly<ThemePair> = Object.freeze({\n lightThemeId: defaultLightThemeId,\n darkThemeId: defaultDarkThemeId,\n})\n\n/** The `localStorage` key a provider and `themeScript` use when the host names none. */\nexport const DEFAULT_THEME_STORAGE_KEY = 'adea-appearance'\n\n/** The default theme id of an appearance. */\nexport function defaultThemeIdFor(appearance: ThemeAppearance): string {\n return appearance === 'dark' ? defaultDarkThemeId : defaultLightThemeId\n}\n\n/** The appearance of a catalogue theme id, or `undefined` for an id the catalogue lacks. */\nexport function catalogueThemeAppearance(id: string): ThemeAppearance | undefined {\n return THEME_INDEX.find(([candidate]) => candidate === id)?.[1]\n}\n\n/** Whether the catalogue holds a theme with this id (loaded or not). */\nexport function isCatalogueThemeId(id: string): boolean {\n return catalogueThemeAppearance(id) !== undefined\n}\n\n/** Whether an id is one of the two default themes, whose data ships with the provider. */\nexport function isDefaultThemeId(id: string): id is keyof typeof DEFAULT_VARIANTS {\n return id === defaultLightThemeId || id === defaultDarkThemeId\n}\n\n/** The default variant of an appearance. */\nexport function defaultVariantFor(appearance: ThemeAppearance): ThemeVariant {\n return DEFAULT_VARIANTS[defaultThemeIdFor(appearance) as keyof typeof DEFAULT_VARIANTS]\n}\n\n/**\n * The catalogue theme a pair resolves to: each id the catalogue holds, and the\n * default of its slot for one it does not.\n */\nexport function cataloguePair(pair: ThemePair): ThemePair {\n return {\n lightThemeId: isCatalogueThemeId(pair.lightThemeId) ? pair.lightThemeId : defaultLightThemeId,\n darkThemeId: isCatalogueThemeId(pair.darkThemeId) ? pair.darkThemeId : defaultDarkThemeId,\n }\n}\n\n/**\n * A stored theme id for one slot, or `undefined` when it cannot be one.\n *\n * Any id is kept, known or not: a host's imported theme is not in the catalogue,\n * and a theme the registry lacks today may come back, so the store is never\n * rewritten by being unresolvable ({@link resolveVariant} paints the fallback).\n * Only a catalogue id of the other appearance is refused, because it is known to\n * be wrong for the slot.\n */\nexport function storedThemeId(value: unknown, appearance: ThemeAppearance): string | undefined {\n if (typeof value !== 'string' || value.trim() === '') return undefined\n const known = catalogueThemeAppearance(value)\n return known === undefined || known === appearance ? value : undefined\n}\n\n/**\n * The variant a stored id means, or the default of the same appearance.\n *\n * An id the registry does not hold, an imported theme that was deleted, a\n * catalogue entry that was renamed, must still paint *something of the appearance\n * being shown*. Falling back to whichever variant happens to be first in the\n * registry painted a dark palette under a light `color-scheme` for a light id, so\n * the fallback is the appearance's own default, then any variant of that\n * appearance, then the registry's first entry only when it holds nothing else.\n *\n * `registry` is the builtin catalogue plus whatever extras the host supplies; the\n * stored id is never rewritten, only resolved, so a host that keeps an unknown id\n * keeps resolving it if the theme comes back.\n *\n * The fallback order is translated from Zeron's `ThemeRegistry::resolve` (MIT,\n * Copyright (c) 2026 Wing); see NOTICE.\n */\nexport function resolveVariant(\n registry: readonly ThemeVariant[],\n id: string,\n appearance: ThemeAppearance\n): ThemeVariant {\n const found = registry.find((variant) => variant.id === id)\n if (found) return found\n const defaultId = defaultThemeIdFor(appearance)\n return (\n registry.find((variant) => variant.id === defaultId) ??\n registry.find((variant) => variant.appearance === appearance) ??\n registry[0]!\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAa,mBAAmB;AAEhC,IAAa,sBAAsB;AACnC,IAAa,qBAAqB;;AAGlC,IAAa,mBAAwC,OAAO,OAAO;CACjE,cAAc;CACd,aAAa;AACf,CAAC;;AAGD,IAAa,4BAA4B;;AAGzC,SAAgB,kBAAkB,YAAqC;CACrE,OAAO,eAAe,SAAS,qBAAqB;AACtD;;AAGA,SAAgB,yBAAyB,IAAyC;CAChF,OAAO,YAAY,MAAM,CAAC,eAAe,cAAc,EAAE,CAAC,GAAG;AAC/D;;AAGA,SAAgB,mBAAmB,IAAqB;CACtD,OAAO,yBAAyB,EAAE,MAAM,KAAA;AAC1C;;AAGA,SAAgB,iBAAiB,IAAiD;CAChF,OAAO,OAAA,gBAA8B,OAAA;AACvC;;AAGA,SAAgB,kBAAkB,YAA2C;CAC3E,OAAO,iBAAiB,kBAAkB,UAAU;AACtD;;;;;AAMA,SAAgB,cAAc,MAA4B;CACxD,OAAO;EACL,cAAc,mBAAmB,KAAK,YAAY,IAAI,KAAK,eAAe;EAC1E,aAAa,mBAAmB,KAAK,WAAW,IAAI,KAAK,cAAc;CACzE;AACF;;;;;;;;;;AAWA,SAAgB,cAAc,OAAgB,YAAiD;CAC7F,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,MAAM,IAAI,OAAO,KAAA;CAC7D,MAAM,QAAQ,yBAAyB,KAAK;CAC5C,OAAO,UAAU,KAAA,KAAa,UAAU,aAAa,QAAQ,KAAA;AAC/D;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,eACd,UACA,IACA,YACc;CACd,MAAM,QAAQ,SAAS,MAAM,YAAY,QAAQ,OAAO,EAAE;CAC1D,IAAI,OAAO,OAAO;CAClB,MAAM,YAAY,kBAAkB,UAAU;CAC9C,OACE,SAAS,MAAM,YAAY,QAAQ,OAAO,SAAS,KACnD,SAAS,MAAM,YAAY,QAAQ,eAAe,UAAU,KAC5D,SAAS;AAEb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-engine-light.js","names":[],"sources":["../../src/lib/theme-engine-light.ts"],"sourcesContent":["/**\n * The light theme engine: the catalogue questions answered from the data that ships\n * with the provider, with no catalogue code or data (see `lib/theme-engine`).\n *\n * It always answers. Where the exact answer needs the catalogue it gives the one the\n * shipped data supports
|
|
1
|
+
{"version":3,"file":"theme-engine-light.js","names":[],"sources":["../../src/lib/theme-engine-light.ts"],"sourcesContent":["/**\n * The light theme engine: the catalogue questions answered from the data that ships\n * with the provider, with no catalogue code or data (see `lib/theme-engine`).\n *\n * It always answers. Where the exact answer needs the catalogue it gives the one the\n * shipped data supports, the appearance's tint strength for a theme it cannot\n * measure, no theme accents for a pair it does not hold, and calls `onIncomplete`,\n * which is how the lazy provider learns to load the catalogue. Painting never relies\n * on such an answer: the provider asks `needsCatalogue` first and waits.\n */\nimport type { AccentPreset } from '@adea-ai/themes'\nimport { primarySubtleCss } from '@adea-ai/themes'\nimport {\n accentOverrideVariables,\n resolveAccentRoles,\n type AccentRoles,\n type AccentTarget,\n} from './accent-roles'\nimport { isThemeAccentId } from './theme-accents'\nimport { themeCssVariablesWith } from './theme-css'\nimport {\n DEFAULT_FLOOR_EDITOR,\n DEFAULT_PRIMARY_SUBTLE,\n DEFAULT_THEME_ACCENTS,\n DEFAULT_VARIANTS,\n THEME_DEFAULT_ID,\n defaultDarkThemeId,\n defaultLightThemeId,\n isDefaultThemeId,\n} from './theme-defaults'\nimport { needsData, pairNeedsData, type ThemeEngine } from './theme-engine'\nimport type {\n AccentVariableOptions,\n EditorRolesMode,\n ThemeAppearance,\n ThemePair,\n ThemeVariant,\n} from './theme-types'\n\nconst defaultVariantList: readonly ThemeVariant[] = [\n DEFAULT_VARIANTS[defaultLightThemeId],\n DEFAULT_VARIANTS[defaultDarkThemeId],\n]\n\nconst isShippedVariant = (variant: ThemeVariant) =>\n isDefaultThemeId(variant.id) && DEFAULT_VARIANTS[variant.id] === variant\n\nfunction lightEditor(theme: ThemeVariant, mode: EditorRolesMode) {\n if (mode !== 'floor' || !isShippedVariant(theme)) return theme.editor\n return DEFAULT_FLOOR_EDITOR[theme.id] ?? theme.editor\n}\n\n/** The measured tint for the defaults; the appearance's ceiling for anything else. */\nfunction lightPrimarySubtle(theme: Pick<ThemeVariant, 'id' | 'appearance'>): string {\n return DEFAULT_PRIMARY_SUBTLE[theme.id] ?? primarySubtleCss(theme.appearance)\n}\n\n/**\n * A light engine. `onIncomplete` is called whenever an answer stands in for one only\n * the whole catalogue can give.\n */\nexport function createLightThemeEngine(onIncomplete: () => void = () => {}): ThemeEngine {\n const themeAccentsFor = (lightThemeId: string, darkThemeId: string) => {\n if (!pairNeedsData({ lightThemeId, darkThemeId })) return DEFAULT_THEME_ACCENTS\n onIncomplete()\n return [] as readonly AccentPreset[]\n }\n\n /**\n * The accent's roles with the appearance standing in for the theme record. The four\n * document properties depend on the appearance alone; `primarySubtle` reads the\n * record, so callers that return it must correct it.\n */\n const accentRoles = (\n accentId: string,\n appearance: ThemeAppearance,\n pair: ThemePair,\n options: AccentVariableOptions\n ): AccentRoles | undefined => {\n if (accentId === THEME_DEFAULT_ID) return undefined\n const context: AccentTarget = {\n target: appearance,\n background: options.background,\n floor: options.floor,\n themeAccents: isThemeAccentId(accentId)\n ? themeAccentsFor(pair.lightThemeId, pair.darkThemeId)\n : undefined,\n }\n return resolveAccentRoles(accentId, context)\n }\n\n return {\n builtinThemes: defaultVariantList,\n isCatalogueVariant: isShippedVariant,\n themeCssVariables(variant, options = {}) {\n if (needsData(variant.id)) onIncomplete()\n return themeCssVariablesWith(\n { primarySubtle: lightPrimarySubtle, editor: lightEditor },\n variant,\n options\n )\n },\n themeAccentsFor,\n accentVariables(accentId, appearance, pair, options = {}) {\n const roles = accentRoles(accentId, appearance, pair, options)\n return roles ? accentOverrideVariables(roles) : undefined\n },\n accentRolesForSelection(accentId, appearance, pair, options = {}) {\n const roles = accentRoles(accentId, appearance, pair, options)\n const variantId = options.variantId\n if (!roles || variantId === undefined) return roles\n if (needsData(variantId)) {\n onIncomplete()\n return roles\n }\n const measured = DEFAULT_PRIMARY_SUBTLE[variantId]\n if (measured === undefined) return roles\n // The theme's own tint strength is shipped for the defaults, and is the right one\n // whenever the accent was not repaired. A repaired accent's tint is measured against\n // the repaired primary, which only the catalogue can do.\n const ungated = accentRoles(accentId, appearance, pair, {\n ...options,\n floor: Number.NEGATIVE_INFINITY,\n })\n if (ungated?.primary === roles.primary) return { ...roles, primarySubtle: measured }\n onIncomplete()\n return roles\n },\n }\n}\n\n/** A light engine with no one to tell when an answer is provisional. */\nexport const lightThemeEngine: ThemeEngine = /* @__PURE__ */ createLightThemeEngine()\n"],"mappings":";;;;;;;;AAuCA,IAAM,qBAA8C,CAClD,iBAAiB,sBACjB,iBAAiB,mBACnB;AAEA,IAAM,oBAAoB,YACxB,iBAAiB,QAAQ,EAAE,KAAK,iBAAiB,QAAQ,QAAQ;AAEnE,SAAS,YAAY,OAAqB,MAAuB;CAC/D,IAAI,SAAS,WAAW,CAAC,iBAAiB,KAAK,GAAG,OAAO,MAAM;CAC/D,OAAO,qBAAqB,MAAM,OAAO,MAAM;AACjD;;AAGA,SAAS,mBAAmB,OAAwD;CAClF,OAAO,uBAAuB,MAAM,OAAO,iBAAiB,MAAM,UAAU;AAC9E;;;;;AAMA,SAAgB,uBAAuB,qBAAiC,CAAC,GAAgB;CACvF,MAAM,mBAAmB,cAAsB,gBAAwB;EACrE,IAAI,CAAC,cAAc;GAAE;GAAc;EAAY,CAAC,GAAG,OAAO;EAC1D,aAAa;EACb,OAAO,CAAC;CACV;;;;;;CAOA,MAAM,eACJ,UACA,YACA,MACA,YAC4B;EAC5B,IAAI,aAAA,SAA+B,OAAO,KAAA;EAC1C,MAAM,UAAwB;GAC5B,QAAQ;GACR,YAAY,QAAQ;GACpB,OAAO,QAAQ;GACf,cAAc,gBAAgB,QAAQ,IAClC,gBAAgB,KAAK,cAAc,KAAK,WAAW,IACnD,KAAA;EACN;EACA,OAAO,mBAAmB,UAAU,OAAO;CAC7C;CAEA,OAAO;EACL,eAAe;EACf,oBAAoB;EACpB,kBAAkB,SAAS,UAAU,CAAC,GAAG;GACvC,IAAI,UAAU,QAAQ,EAAE,GAAG,aAAa;GACxC,OAAO,sBACL;IAAE,eAAe;IAAoB,QAAQ;GAAY,GACzD,SACA,OACF;EACF;EACA;EACA,gBAAgB,UAAU,YAAY,MAAM,UAAU,CAAC,GAAG;GACxD,MAAM,QAAQ,YAAY,UAAU,YAAY,MAAM,OAAO;GAC7D,OAAO,QAAQ,wBAAwB,KAAK,IAAI,KAAA;EAClD;EACA,wBAAwB,UAAU,YAAY,MAAM,UAAU,CAAC,GAAG;GAChE,MAAM,QAAQ,YAAY,UAAU,YAAY,MAAM,OAAO;GAC7D,MAAM,YAAY,QAAQ;GAC1B,IAAI,CAAC,SAAS,cAAc,KAAA,GAAW,OAAO;GAC9C,IAAI,UAAU,SAAS,GAAG;IACxB,aAAa;IACb,OAAO;GACT;GACA,MAAM,WAAW,uBAAuB;GACxC,IAAI,aAAa,KAAA,GAAW,OAAO;GAQnC,IAJgB,YAAY,UAAU,YAAY,MAAM;IACtD,GAAG;IACH,OAAO,OAAO;GAChB,CACI,CAAA,EAAS,YAAY,MAAM,SAAS,OAAO;IAAE,GAAG;IAAO,eAAe;GAAS;GACnF,aAAa;GACb,OAAO;EACT;CACF;AACF;;AAGA,IAAa,mBAAgD,uCAAuB"}
|
|
@@ -57,8 +57,8 @@ export declare function pairNeedsData(pair: ThemePair): boolean;
|
|
|
57
57
|
*
|
|
58
58
|
* True when the variant being shown, the pinned terminal theme, or (for a
|
|
59
59
|
* theme-derived `ansi-*` accent) either theme of the pair is a catalogue theme other
|
|
60
|
-
* than the two defaults. Everything else
|
|
61
|
-
* every preset and custom accent
|
|
60
|
+
* than the two defaults. Everything else, the default pair, a host's own variants,
|
|
61
|
+
* every preset and custom accent, the light engine answers from shipped data.
|
|
62
62
|
*/
|
|
63
63
|
export declare function needsCatalogue(selection: ThemePair & {
|
|
64
64
|
accent: string;
|