@cueplusplus/ui 0.2.0 → 0.5.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/CHANGELOG.md +2250 -0
- package/dist/agent-runtime/_glyphs.js +43 -0
- package/dist/agent-runtime/branch-picker.d.ts +45 -0
- package/dist/agent-runtime/branch-picker.js +87 -0
- package/dist/agent-runtime/index.d.ts +4 -0
- package/dist/agent-runtime/index.js +4 -0
- package/dist/agent-runtime/tool-call-card.d.ts +69 -0
- package/dist/agent-runtime/tool-call-card.js +187 -0
- package/dist/agent-runtime/use-agent-thread.d.ts +164 -0
- package/dist/agent-runtime/use-agent-thread.js +251 -0
- package/dist/brand/_chassis.d.ts +1 -1
- package/dist/brand/cue-mark.d.ts +1 -1
- package/dist/brand/cue-mark.js +1 -1
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/message-list.d.ts +6 -0
- package/dist/chat/message-list.js +35 -0
- package/dist/chrome/_edge-scroller.js +12 -1
- package/dist/chrome/_tabs-scroll.d.ts +1 -1
- package/dist/chrome/_tabs-scroll.js +1 -1
- package/dist/chrome/app-shell.d.ts +52 -2
- package/dist/chrome/app-shell.js +80 -8
- package/dist/chrome/index.d.ts +2 -2
- package/dist/configurator/_export.js +3 -2
- package/dist/configurator/_overrides.d.ts +1 -1
- package/dist/configurator/_overrides.js +18 -6
- package/dist/configurator/token-editor.js +4 -1
- package/dist/date/_segments.js +37 -2
- package/dist/elements/activity-graph.d.ts +40 -0
- package/dist/elements/activity-graph.js +81 -0
- package/dist/elements/agent-card.d.ts +49 -0
- package/dist/elements/agent-card.js +91 -0
- package/dist/elements/agent-handoff.d.ts +24 -0
- package/dist/elements/agent-handoff.js +53 -0
- package/dist/elements/agent-mode-badge.d.ts +72 -0
- package/dist/elements/agent-mode-badge.js +110 -0
- package/dist/elements/agent-plan.d.ts +24 -0
- package/dist/elements/agent-plan.js +74 -0
- package/dist/elements/agent-status.d.ts +29 -0
- package/dist/elements/agent-status.js +46 -0
- package/dist/elements/agent-surface.d.ts +65 -0
- package/dist/elements/agent-surface.js +68 -0
- package/dist/elements/animated-number.d.ts +86 -0
- package/dist/elements/animated-number.js +118 -0
- package/dist/elements/approval-card.d.ts +40 -0
- package/dist/elements/approval-card.js +78 -0
- package/dist/elements/artifact-card.d.ts +30 -0
- package/dist/elements/artifact-card.js +58 -0
- package/dist/elements/background-inbox.d.ts +39 -0
- package/dist/elements/background-inbox.js +60 -0
- package/dist/elements/canvas-split.d.ts +77 -0
- package/dist/elements/canvas-split.js +138 -0
- package/dist/elements/chart.d.ts +41 -0
- package/dist/elements/chart.js +117 -0
- package/dist/elements/chat-panel.d.ts +46 -0
- package/dist/elements/chat-panel.js +104 -0
- package/dist/elements/checkpoint-history.d.ts +31 -0
- package/dist/elements/checkpoint-history.js +65 -0
- package/dist/elements/clamp.d.ts +90 -0
- package/dist/elements/clamp.js +109 -0
- package/dist/elements/code-diff.d.ts +42 -0
- package/dist/elements/code-diff.js +69 -0
- package/dist/elements/code-runner.d.ts +38 -0
- package/dist/elements/code-runner.js +84 -0
- package/dist/elements/command-palette.d.ts +48 -0
- package/dist/elements/command-palette.js +129 -0
- package/dist/elements/compaction-row.d.ts +63 -0
- package/dist/elements/compaction-row.js +110 -0
- package/dist/elements/comparison-card.d.ts +47 -0
- package/dist/elements/comparison-card.js +69 -0
- package/dist/elements/composer.d.ts +274 -0
- package/dist/elements/composer.js +505 -0
- package/dist/elements/computer-use.d.ts +40 -0
- package/dist/elements/computer-use.js +92 -0
- package/dist/elements/confidence-marker.d.ts +39 -0
- package/dist/elements/confidence-marker.js +64 -0
- package/dist/elements/connection-state.d.ts +29 -0
- package/dist/elements/connection-state.js +66 -0
- package/dist/elements/context-breakdown.d.ts +30 -0
- package/dist/elements/context-breakdown.js +86 -0
- package/dist/elements/context-usage.d.ts +99 -0
- package/dist/elements/context-usage.js +225 -0
- package/dist/elements/conversation-search.d.ts +48 -0
- package/dist/elements/conversation-search.js +88 -0
- package/dist/elements/cost-meter.d.ts +33 -0
- package/dist/elements/cost-meter.js +75 -0
- package/dist/elements/data-table.d.ts +31 -0
- package/dist/elements/data-table.js +67 -0
- package/dist/elements/day-separator.d.ts +34 -0
- package/dist/elements/day-separator.js +50 -0
- package/dist/elements/diagram.d.ts +34 -0
- package/dist/elements/diagram.js +75 -0
- package/dist/elements/document-reference.d.ts +37 -0
- package/dist/elements/document-reference.js +66 -0
- package/dist/elements/draft-restore.d.ts +27 -0
- package/dist/elements/draft-restore.js +54 -0
- package/dist/elements/edit-message.d.ts +36 -0
- package/dist/elements/edit-message.js +77 -0
- package/dist/elements/elements.css +459 -0
- package/dist/elements/elicitation-form.d.ts +48 -0
- package/dist/elements/elicitation-form.js +106 -0
- package/dist/elements/empty-state.d.ts +52 -0
- package/dist/elements/empty-state.js +98 -0
- package/dist/elements/end-of-turn-summary.d.ts +60 -0
- package/dist/elements/end-of-turn-summary.js +75 -0
- package/dist/elements/error-state.d.ts +29 -0
- package/dist/elements/error-state.js +55 -0
- package/dist/elements/feedback-dialog.d.ts +36 -0
- package/dist/elements/feedback-dialog.js +81 -0
- package/dist/elements/file-tree.d.ts +45 -0
- package/dist/elements/file-tree.js +84 -0
- package/dist/elements/flow-graph.d.ts +45 -0
- package/dist/elements/flow-graph.js +78 -0
- package/dist/elements/generative/chart.js +200 -0
- package/dist/elements/generative/faults.js +111 -0
- package/dist/elements/generative/icons.d.ts +41 -0
- package/dist/elements/generative/icons.js +190 -0
- package/dist/elements/generative/intrinsics.js +483 -0
- package/dist/elements/generative/spec.d.ts +110 -0
- package/dist/elements/generative/spec.js +366 -0
- package/dist/elements/generative.css +1145 -0
- package/dist/elements/generative.d.ts +144 -0
- package/dist/elements/generative.js +126 -0
- package/dist/elements/guardrail-notice.d.ts +29 -0
- package/dist/elements/guardrail-notice.js +63 -0
- package/dist/elements/image-generation.d.ts +18 -0
- package/dist/elements/image-generation.js +64 -0
- package/dist/elements/index.d.ts +116 -0
- package/dist/elements/index.js +115 -0
- package/dist/elements/inline-citation.d.ts +43 -0
- package/dist/elements/inline-citation.js +93 -0
- package/dist/elements/job-progress.d.ts +49 -0
- package/dist/elements/job-progress.js +74 -0
- package/dist/elements/launcher-bubble.d.ts +34 -0
- package/dist/elements/launcher-bubble.js +72 -0
- package/dist/elements/live-region-announcer.d.ts +130 -0
- package/dist/elements/live-region-announcer.js +230 -0
- package/dist/elements/loading-state.d.ts +27 -0
- package/dist/elements/loading-state.js +36 -0
- package/dist/elements/map-answer.d.ts +38 -0
- package/dist/elements/map-answer.js +93 -0
- package/dist/elements/markdown.d.ts +131 -0
- package/dist/elements/markdown.js +528 -0
- package/dist/elements/math-block.d.ts +51 -0
- package/dist/elements/math-block.js +70 -0
- package/dist/elements/mcp-server-panel.d.ts +41 -0
- package/dist/elements/mcp-server-panel.js +115 -0
- package/dist/elements/memory-chips.d.ts +30 -0
- package/dist/elements/memory-chips.js +43 -0
- package/dist/elements/message-actions.d.ts +38 -0
- package/dist/elements/message-actions.js +71 -0
- package/dist/elements/message-attachment.d.ts +48 -0
- package/dist/elements/message-attachment.js +63 -0
- package/dist/elements/message-branches.d.ts +25 -0
- package/dist/elements/message-branches.js +65 -0
- package/dist/elements/message-pair.d.ts +33 -0
- package/dist/elements/message-pair.js +65 -0
- package/dist/elements/message-queue.d.ts +31 -0
- package/dist/elements/message-queue.js +80 -0
- package/dist/elements/message-timing.d.ts +33 -0
- package/dist/elements/message-timing.js +37 -0
- package/dist/elements/mobile-composer.d.ts +44 -0
- package/dist/elements/mobile-composer.js +88 -0
- package/dist/elements/model-picker.d.ts +38 -0
- package/dist/elements/model-picker.js +69 -0
- package/dist/elements/number-ticker.d.ts +18 -0
- package/dist/elements/number-ticker.js +47 -0
- package/dist/elements/onboarding.d.ts +30 -0
- package/dist/elements/onboarding.js +75 -0
- package/dist/elements/permission-grant.d.ts +35 -0
- package/dist/elements/permission-grant.js +86 -0
- package/dist/elements/permission-scopes.d.ts +215 -0
- package/dist/elements/permission-scopes.js +249 -0
- package/dist/elements/prompt-library.d.ts +43 -0
- package/dist/elements/prompt-library.js +117 -0
- package/dist/elements/queue-dock.d.ts +101 -0
- package/dist/elements/queue-dock.js +132 -0
- package/dist/elements/quota-banner.d.ts +26 -0
- package/dist/elements/quota-banner.js +66 -0
- package/dist/elements/quote-reply.d.ts +44 -0
- package/dist/elements/quote-reply.js +79 -0
- package/dist/elements/range.d.ts +29 -0
- package/dist/elements/range.js +45 -0
- package/dist/elements/read-aloud.d.ts +45 -0
- package/dist/elements/read-aloud.js +75 -0
- package/dist/elements/reasoning-effort.d.ts +36 -0
- package/dist/elements/reasoning-effort.js +67 -0
- package/dist/elements/reasoning-panel.d.ts +46 -0
- package/dist/elements/reasoning-panel.js +75 -0
- package/dist/elements/recommendation-card.d.ts +45 -0
- package/dist/elements/recommendation-card.js +83 -0
- package/dist/elements/regenerate-menu.d.ts +45 -0
- package/dist/elements/regenerate-menu.js +51 -0
- package/dist/elements/replay.d.ts +217 -0
- package/dist/elements/replay.js +498 -0
- package/dist/elements/research-report.d.ts +38 -0
- package/dist/elements/research-report.js +69 -0
- package/dist/elements/retrieval-chunks.d.ts +43 -0
- package/dist/elements/retrieval-chunks.js +81 -0
- package/dist/elements/revert-dock.d.ts +159 -0
- package/dist/elements/revert-dock.js +327 -0
- package/dist/elements/reviewable-diff.d.ts +45 -0
- package/dist/elements/reviewable-diff.js +110 -0
- package/dist/elements/risk-badge.d.ts +52 -0
- package/dist/elements/risk-badge.js +91 -0
- package/dist/elements/schedule-card.d.ts +42 -0
- package/dist/elements/schedule-card.js +90 -0
- package/dist/elements/score-breakdown.d.ts +47 -0
- package/dist/elements/score-breakdown.js +82 -0
- package/dist/elements/scroll-anchor.d.ts +32 -0
- package/dist/elements/scroll-anchor.js +121 -0
- package/dist/elements/settings-panel.d.ts +52 -0
- package/dist/elements/settings-panel.js +107 -0
- package/dist/elements/shared-conversation.d.ts +39 -0
- package/dist/elements/shared-conversation.js +68 -0
- package/dist/elements/sources.d.ts +33 -0
- package/dist/elements/sources.js +61 -0
- package/dist/elements/speaker-identity.d.ts +32 -0
- package/dist/elements/speaker-identity.js +51 -0
- package/dist/elements/spec-sheet.d.ts +31 -0
- package/dist/elements/spec-sheet.js +45 -0
- package/dist/elements/stopped-run.d.ts +22 -0
- package/dist/elements/stopped-run.js +50 -0
- package/dist/elements/streaming-text.d.ts +31 -0
- package/dist/elements/streaming-text.js +45 -0
- package/dist/elements/subagent-list.d.ts +37 -0
- package/dist/elements/subagent-list.js +79 -0
- package/dist/elements/suggestions.d.ts +30 -0
- package/dist/elements/suggestions.js +36 -0
- package/dist/elements/surfaces.d.ts +85 -0
- package/dist/elements/surfaces.js +107 -0
- package/dist/elements/tail-status.d.ts +131 -0
- package/dist/elements/tail-status.js +94 -0
- package/dist/elements/terminal-block.d.ts +29 -0
- package/dist/elements/terminal-block.js +54 -0
- package/dist/elements/thinking-indicator.d.ts +18 -0
- package/dist/elements/thinking-indicator.js +36 -0
- package/dist/elements/thread-list.d.ts +35 -0
- package/dist/elements/thread-list.js +68 -0
- package/dist/elements/thread-search.d.ts +42 -0
- package/dist/elements/thread-search.js +99 -0
- package/dist/elements/timeline.d.ts +37 -0
- package/dist/elements/timeline.js +46 -0
- package/dist/elements/todo-list.d.ts +42 -0
- package/dist/elements/todo-list.js +59 -0
- package/dist/elements/tool-call.d.ts +41 -0
- package/dist/elements/tool-call.js +85 -0
- package/dist/elements/tool-error.d.ts +39 -0
- package/dist/elements/tool-error.js +76 -0
- package/dist/elements/tool-group.d.ts +45 -0
- package/dist/elements/tool-group.js +71 -0
- package/dist/elements/tool-timeline.d.ts +65 -0
- package/dist/elements/tool-timeline.js +88 -0
- package/dist/elements/trace-waterfall.d.ts +37 -0
- package/dist/elements/trace-waterfall.js +69 -0
- package/dist/elements/transcript-rules.d.ts +67 -0
- package/dist/elements/transcript-rules.js +95 -0
- package/dist/elements/turn-footer.d.ts +74 -0
- package/dist/elements/turn-footer.js +101 -0
- package/dist/elements/typing-indicator.d.ts +16 -0
- package/dist/elements/typing-indicator.js +51 -0
- package/dist/elements/verdict-row.d.ts +89 -0
- package/dist/elements/verdict-row.js +150 -0
- package/dist/elements/vocabulary.d.ts +612 -0
- package/dist/elements/vocabulary.js +611 -0
- package/dist/elements/voice-conversation.d.ts +49 -0
- package/dist/elements/voice-conversation.js +123 -0
- package/dist/elements/web-preview.d.ts +32 -0
- package/dist/elements/web-preview.js +66 -0
- package/dist/elements/web-search.d.ts +37 -0
- package/dist/elements/web-search.js +66 -0
- package/dist/elements/work-collapse.d.ts +103 -0
- package/dist/elements/work-collapse.js +131 -0
- package/dist/icons/containers.d.ts +89 -0
- package/dist/icons/containers.js +295 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/index.d.ts +9 -7
- package/dist/index.js +3 -2
- package/dist/instruments/index.d.ts +2 -2
- package/dist/instruments/index.js +2 -2
- package/dist/instruments/table.d.ts +14 -1
- package/dist/instruments/table.js +20 -1
- package/dist/instruments/two-step-button.js +25 -6
- package/dist/layout/sidebar.d.ts +19 -1
- package/dist/layout/sidebar.js +19 -1
- package/dist/primitives/button.js +11 -1
- package/dist/primitives/chip.d.ts +34 -8
- package/dist/primitives/chip.js +97 -11
- package/dist/styles.css +11 -1
- package/dist/system/agent-skin.d.ts +27 -0
- package/dist/system/agent-skin.js +20 -0
- package/dist/system/index.d.ts +3 -3
- package/dist/system/portal.d.ts +5 -3
- package/dist/system/portal.js +36 -8
- package/dist/system/prepaint.d.ts +20 -2
- package/dist/system/prepaint.js +39 -33
- package/dist/system/theme-provider.d.ts +13 -2
- package/dist/system/theme-provider.js +107 -26
- package/dist/system/use-density.d.ts +9 -0
- package/dist/system/use-density.js +9 -0
- package/dist/system/use-isomorphic-layout-effect.js +19 -1
- package/dist/theming/_presets.d.ts +1 -1
- package/dist/theming/_presets.js +124 -8
- package/dist/theming/contrast.d.ts +16 -4
- package/dist/theming/contrast.js +33 -6
- package/dist/theming/create-theme.d.ts +8 -4
- package/dist/theming/create-theme.js +56 -20
- package/dist/theming/serialize.d.ts +11 -2
- package/dist/theming/serialize.js +87 -9
- package/manifest/components/accordion.json +154 -0
- package/manifest/components/activity-graph.json +88 -0
- package/manifest/components/agent-card.json +120 -0
- package/manifest/components/agent-handoff.json +87 -0
- package/manifest/components/agent-mode-badge.json +84 -0
- package/manifest/components/agent-pile.json +116 -0
- package/manifest/components/agent-plan.json +67 -0
- package/manifest/components/agent-status.json +73 -0
- package/manifest/components/agent-surface.json +78 -0
- package/manifest/components/alert-dialog.json +190 -0
- package/manifest/components/animated-number.json +67 -0
- package/manifest/components/app-bar.json +244 -0
- package/manifest/components/app-shell.json +383 -0
- package/manifest/components/app-window-frame.json +102 -0
- package/manifest/components/approval-card.json +106 -0
- package/manifest/components/artifact-card.json +81 -0
- package/manifest/components/ask-box.json +209 -0
- package/manifest/components/audience-icon.json +52 -0
- package/manifest/components/autocomplete.json +197 -0
- package/manifest/components/avatar-group.json +72 -0
- package/manifest/components/avatar.json +95 -0
- package/manifest/components/background-inbox.json +71 -0
- package/manifest/components/branch-picker.json +124 -0
- package/manifest/components/breadcrumb.json +74 -0
- package/manifest/components/button-group.json +74 -0
- package/manifest/components/button.json +126 -0
- package/manifest/components/calendar.json +65 -0
- package/manifest/components/canvas-split-body.json +62 -0
- package/manifest/components/canvas-split-document.json +54 -0
- package/manifest/components/canvas-split-header.json +83 -0
- package/manifest/components/canvas-split-line.json +62 -0
- package/manifest/components/canvas-split-message.json +62 -0
- package/manifest/components/canvas-split-thread.json +54 -0
- package/manifest/components/canvas-split.json +60 -0
- package/manifest/components/card.json +140 -0
- package/manifest/components/carousel.json +200 -0
- package/manifest/components/catalogue-icon.json +52 -0
- package/manifest/components/channel-beta-icon.json +52 -0
- package/manifest/components/channel-matrix.json +173 -0
- package/manifest/components/channel-released-icon.json +52 -0
- package/manifest/components/chart-container.json +111 -0
- package/manifest/components/chart-ramp.json +72 -0
- package/manifest/components/chart-swatch.json +65 -0
- package/manifest/components/chart-tooltip-content.json +114 -0
- package/manifest/components/chart.json +93 -0
- package/manifest/components/chat-empty-state.json +55 -0
- package/manifest/components/chat-panel-assistant-message.json +51 -0
- package/manifest/components/chat-panel-composer.json +66 -0
- package/manifest/components/chat-panel-messages.json +51 -0
- package/manifest/components/chat-panel-typing.json +51 -0
- package/manifest/components/chat-panel-user-message.json +51 -0
- package/manifest/components/chat-panel.json +57 -0
- package/manifest/components/checkbox-group.json +68 -0
- package/manifest/components/checkbox.json +93 -0
- package/manifest/components/checkpoint-history.json +80 -0
- package/manifest/components/chip.json +144 -0
- package/manifest/components/clamp.json +102 -0
- package/manifest/components/cli-tool-icon.json +52 -0
- package/manifest/components/code-diff.json +87 -0
- package/manifest/components/code-runner.json +97 -0
- package/manifest/components/collapsible.json +120 -0
- package/manifest/components/color-area.json +59 -0
- package/manifest/components/color-field.json +79 -0
- package/manifest/components/color-picker.json +175 -0
- package/manifest/components/color-slider.json +75 -0
- package/manifest/components/color-swatch.json +68 -0
- package/manifest/components/colors-section.json +66 -0
- package/manifest/components/combobox.json +198 -0
- package/manifest/components/command-palette.json +177 -0
- package/manifest/components/compaction-row.json +100 -0
- package/manifest/components/comparison-card.json +83 -0
- package/manifest/components/composer-actions.json +65 -0
- package/manifest/components/composer-attach-button.json +65 -0
- package/manifest/components/composer-attachment-chip.json +75 -0
- package/manifest/components/composer-attachments.json +60 -0
- package/manifest/components/composer-bar.json +73 -0
- package/manifest/components/composer-command-item.json +79 -0
- package/manifest/components/composer-context.json +67 -0
- package/manifest/components/composer-input.json +73 -0
- package/manifest/components/composer-menu-item.json +72 -0
- package/manifest/components/composer-menu.json +79 -0
- package/manifest/components/composer-model-item.json +75 -0
- package/manifest/components/composer-model-trigger.json +75 -0
- package/manifest/components/composer-person-item.json +79 -0
- package/manifest/components/composer-send.json +80 -0
- package/manifest/components/composer-toolbar.json +65 -0
- package/manifest/components/composer-voice-button.json +68 -0
- package/manifest/components/composer-voice.json +75 -0
- package/manifest/components/composer.json +176 -0
- package/manifest/components/computer-use.json +84 -0
- package/manifest/components/confidence-marker.json +74 -0
- package/manifest/components/connection-state.json +84 -0
- package/manifest/components/container.json +60 -0
- package/manifest/components/context-breakdown.json +65 -0
- package/manifest/components/context-menu.json +121 -0
- package/manifest/components/context-usage.json +85 -0
- package/manifest/components/conversation-search.json +92 -0
- package/manifest/components/copy-button.json +93 -0
- package/manifest/components/cost-meter.json +74 -0
- package/manifest/components/cue-logotype.json +96 -0
- package/manifest/components/cue-mark.json +97 -0
- package/manifest/components/cue-portal-frame.json +55 -0
- package/manifest/components/data-table-pagination.json +83 -0
- package/manifest/components/data-table-toolbar.json +104 -0
- package/manifest/components/date-field.json +80 -0
- package/manifest/components/date-picker.json +191 -0
- package/manifest/components/date-range-picker.json +191 -0
- package/manifest/components/day-separator.json +58 -0
- package/manifest/components/delegation-card.json +144 -0
- package/manifest/components/density.json +58 -0
- package/manifest/components/description-list.json +84 -0
- package/manifest/components/diagram.json +100 -0
- package/manifest/components/dialog.json +198 -0
- package/manifest/components/disclosure.json +109 -0
- package/manifest/components/dmx-bar.json +94 -0
- package/manifest/components/dmx-strip.json +101 -0
- package/manifest/components/document-reference.json +90 -0
- package/manifest/components/draft-restore.json +82 -0
- package/manifest/components/drawer.json +179 -0
- package/manifest/components/dropdown-menu.json +229 -0
- package/manifest/components/edit-message.json +105 -0
- package/manifest/components/elements-command-palette.json +100 -0
- package/manifest/components/elements-composer.json +71 -0
- package/manifest/components/elements-data-table.json +68 -0
- package/manifest/components/elements-timeline.json +69 -0
- package/manifest/components/elicitation-form.json +103 -0
- package/manifest/components/empty-state-composer.json +64 -0
- package/manifest/components/empty-state-greeting.json +49 -0
- package/manifest/components/empty-state-suggestion.json +57 -0
- package/manifest/components/empty-state-suggestions.json +49 -0
- package/manifest/components/empty-state.json +90 -0
- package/manifest/components/end-of-turn-summary.json +77 -0
- package/manifest/components/env-var-input.json +150 -0
- package/manifest/components/error-state.json +80 -0
- package/manifest/components/export-dialog.json +84 -0
- package/manifest/components/eyebrow.json +56 -0
- package/manifest/components/feedback-dialog.json +107 -0
- package/manifest/components/field-description.json +63 -0
- package/manifest/components/field-error.json +77 -0
- package/manifest/components/field-label.json +63 -0
- package/manifest/components/field.json +79 -0
- package/manifest/components/file-tree.json +83 -0
- package/manifest/components/file-upload.json +159 -0
- package/manifest/components/flow-background.json +50 -0
- package/manifest/components/flow-controls.json +50 -0
- package/manifest/components/flow-graph.json +75 -0
- package/manifest/components/folder-icon.json +52 -0
- package/manifest/components/footer.json +112 -0
- package/manifest/components/frac.json +59 -0
- package/manifest/components/generation-loader.json +64 -0
- package/manifest/components/generative-ui.json +93 -0
- package/manifest/components/grid.json +81 -0
- package/manifest/components/group-bar.json +102 -0
- package/manifest/components/guardrail-notice.json +91 -0
- package/manifest/components/hover-card.json +151 -0
- package/manifest/components/icon-button.json +88 -0
- package/manifest/components/image-generation.json +67 -0
- package/manifest/components/info-tip.json +98 -0
- package/manifest/components/inline-citation.json +77 -0
- package/manifest/components/input-group.json +91 -0
- package/manifest/components/input.json +89 -0
- package/manifest/components/item.json +129 -0
- package/manifest/components/job-progress.json +96 -0
- package/manifest/components/kbd.json +52 -0
- package/manifest/components/launcher-bubble.json +105 -0
- package/manifest/components/link.json +81 -0
- package/manifest/components/live-region-announcer.json +79 -0
- package/manifest/components/log-viewer.json +139 -0
- package/manifest/components/map-answer.json +83 -0
- package/manifest/components/markdown-text.json +94 -0
- package/manifest/components/math-block.json +74 -0
- package/manifest/components/mcp-server-icon.json +52 -0
- package/manifest/components/mcp-server-panel.json +87 -0
- package/manifest/components/memory-chips.json +65 -0
- package/manifest/components/menubar.json +157 -0
- package/manifest/components/message-actions.json +99 -0
- package/manifest/components/message-attachments.json +63 -0
- package/manifest/components/message-branches.json +71 -0
- package/manifest/components/message-list.json +100 -0
- package/manifest/components/message-pair.json +86 -0
- package/manifest/components/message-queue.json +74 -0
- package/manifest/components/message-timing.json +62 -0
- package/manifest/components/message.json +116 -0
- package/manifest/components/meter.json +114 -0
- package/manifest/components/mobile-composer.json +126 -0
- package/manifest/components/model-picker.json +76 -0
- package/manifest/components/multi-select.json +190 -0
- package/manifest/components/musical-time-input.json +113 -0
- package/manifest/components/navigation-menu.json +226 -0
- package/manifest/components/node-card.json +109 -0
- package/manifest/components/node-handle.json +69 -0
- package/manifest/components/number-field.json +107 -0
- package/manifest/components/number-ticker.json +61 -0
- package/manifest/components/onboarding.json +84 -0
- package/manifest/components/otp-field.json +128 -0
- package/manifest/components/page-shell.json +96 -0
- package/manifest/components/pagination.json +92 -0
- package/manifest/components/panel-header.json +77 -0
- package/manifest/components/panel.json +71 -0
- package/manifest/components/password-input.json +119 -0
- package/manifest/components/permission-grant.json +92 -0
- package/manifest/components/permission-scopes.json +139 -0
- package/manifest/components/piano-keyboard.json +120 -0
- package/manifest/components/plussie.json +111 -0
- package/manifest/components/popover.json +193 -0
- package/manifest/components/preset-section.json +73 -0
- package/manifest/components/progress.json +95 -0
- package/manifest/components/prompt-library.json +99 -0
- package/manifest/components/queue-dock.json +110 -0
- package/manifest/components/quota-banner.json +94 -0
- package/manifest/components/quote-reply.json +105 -0
- package/manifest/components/radio-group.json +73 -0
- package/manifest/components/radio.json +80 -0
- package/manifest/components/rating.json +141 -0
- package/manifest/components/read-aloud.json +111 -0
- package/manifest/components/reasoning-effort.json +81 -0
- package/manifest/components/reasoning-panel.json +108 -0
- package/manifest/components/recommendation-card.json +107 -0
- package/manifest/components/regenerate-menu.json +89 -0
- package/manifest/components/replay-player.json +102 -0
- package/manifest/components/research-report.json +76 -0
- package/manifest/components/resizable.json +88 -0
- package/manifest/components/retrieval-chunks.json +84 -0
- package/manifest/components/revert-dock.json +150 -0
- package/manifest/components/reviewable-diff.json +93 -0
- package/manifest/components/risk-badge.json +74 -0
- package/manifest/components/row.json +109 -0
- package/manifest/components/schedule-card.json +101 -0
- package/manifest/components/score-breakdown.json +91 -0
- package/manifest/components/scroll-anchor.json +72 -0
- package/manifest/components/scroll-area.json +91 -0
- package/manifest/components/scrollable-tabs-list.json +83 -0
- package/manifest/components/scrub-input.json +200 -0
- package/manifest/components/seam-cell.json +75 -0
- package/manifest/components/seam-grid.json +75 -0
- package/manifest/components/seam-list.json +56 -0
- package/manifest/components/search-input.json +134 -0
- package/manifest/components/section-header.json +112 -0
- package/manifest/components/segmented-control.json +138 -0
- package/manifest/components/select.json +194 -0
- package/manifest/components/separator.json +53 -0
- package/manifest/components/settings-panel.json +118 -0
- package/manifest/components/shape-section.json +66 -0
- package/manifest/components/shared-conversation.json +89 -0
- package/manifest/components/sheet.json +186 -0
- package/manifest/components/shimmer-label.json +59 -0
- package/manifest/components/sidebar.json +198 -0
- package/manifest/components/signal-edge.json +56 -0
- package/manifest/components/skeleton.json +46 -0
- package/manifest/components/skill-icon.json +52 -0
- package/manifest/components/slider.json +89 -0
- package/manifest/components/sources.json +83 -0
- package/manifest/components/sparkline.json +76 -0
- package/manifest/components/speaker-identity.json +61 -0
- package/manifest/components/spec-sheet.json +80 -0
- package/manifest/components/spectrum-visualizer.json +115 -0
- package/manifest/components/spinner.json +61 -0
- package/manifest/components/stack-icon.json +52 -0
- package/manifest/components/stack.json +96 -0
- package/manifest/components/stacks-matrix-icon.json +52 -0
- package/manifest/components/stat.json +87 -0
- package/manifest/components/status-bar.json +58 -0
- package/manifest/components/status-dot.json +78 -0
- package/manifest/components/stepper.json +89 -0
- package/manifest/components/stopped-run.json +81 -0
- package/manifest/components/streaming-text.json +71 -0
- package/manifest/components/sub.json +44 -0
- package/manifest/components/subagent-list.json +88 -0
- package/manifest/components/suggestions.json +84 -0
- package/manifest/components/sup.json +44 -0
- package/manifest/components/swap-label.json +71 -0
- package/manifest/components/switch.json +87 -0
- package/manifest/components/table-scroll-region.json +69 -0
- package/manifest/components/table.json +155 -0
- package/manifest/components/tabs.json +145 -0
- package/manifest/components/tags-input.json +190 -0
- package/manifest/components/tail-status.json +109 -0
- package/manifest/components/terminal-block.json +91 -0
- package/manifest/components/terminal-frame.json +119 -0
- package/manifest/components/textarea.json +76 -0
- package/manifest/components/theme-configurator.json +124 -0
- package/manifest/components/theme-provider.json +134 -0
- package/manifest/components/thinking-indicator.json +63 -0
- package/manifest/components/thread-list.json +76 -0
- package/manifest/components/thread-search.json +90 -0
- package/manifest/components/threshold-rail.json +160 -0
- package/manifest/components/time-boundary.json +62 -0
- package/manifest/components/time-field.json +80 -0
- package/manifest/components/timeline-ruler.json +139 -0
- package/manifest/components/timeline.json +115 -0
- package/manifest/components/title-bar.json +82 -0
- package/manifest/components/toast.json +130 -0
- package/manifest/components/todo-list.json +69 -0
- package/manifest/components/toggle-group.json +106 -0
- package/manifest/components/toggle.json +109 -0
- package/manifest/components/token-editor.json +90 -0
- package/manifest/components/tool-call-card.json +200 -0
- package/manifest/components/tool-call.json +119 -0
- package/manifest/components/tool-error.json +114 -0
- package/manifest/components/tool-group.json +83 -0
- package/manifest/components/tool-timeline.json +119 -0
- package/manifest/components/toolbar.json +163 -0
- package/manifest/components/tooltip.json +164 -0
- package/manifest/components/trace-waterfall.json +74 -0
- package/manifest/components/tree-visibility-toggle.json +84 -0
- package/manifest/components/tree.json +140 -0
- package/manifest/components/turn-footer.json +105 -0
- package/manifest/components/two-step-button.json +113 -0
- package/manifest/components/typing-indicator.json +53 -0
- package/manifest/components/universe-grid.json +127 -0
- package/manifest/components/unread-divider.json +55 -0
- package/manifest/components/usage-chart.json +124 -0
- package/manifest/components/verdict-row.json +91 -0
- package/manifest/components/voice-conversation.json +109 -0
- package/manifest/components/web-preview.json +87 -0
- package/manifest/components/web-search.json +92 -0
- package/manifest/components/work-collapse.json +102 -0
- package/manifest/manifest.json +4779 -0
- package/manifest/tokens.json +159 -0
- package/package.json +54 -5
|
@@ -2,21 +2,36 @@ import { ClassProp, VariantProps } from "../lib/cva.js";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
//#region src/primitives/chip.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* The tinted-chip recipe: `bg-<tone>/10 border-<tone>/35 text-<tone
|
|
5
|
+
* The tinted-chip recipe: `bg-<tone>/10 border-<tone>/35 text-<tone>`, and the
|
|
6
|
+
* two quieter readings of it — `outline`, which drops the fill, and `tag`,
|
|
7
|
+
* which drops the fill and the voice with it.
|
|
6
8
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `bg-transparent`
|
|
10
|
-
* utilities in the class string and
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* Every property that varies is emitted from exactly one place: one rim, one
|
|
10
|
+
* ink, one fill, one gutter, one type size, always. Emitting `bg-<tone>/10`
|
|
11
|
+
* from the tone map and then cancelling it with `bg-transparent` would leave
|
|
12
|
+
* two competing utilities in the class string, and `chipVariants` is exported —
|
|
13
|
+
* a caller who uses it without `cn` gets a raw string where the winner is
|
|
14
|
+
* decided by stylesheet order rather than by which utility was written last.
|
|
15
|
+
* `h-chip h-4` proves the point at the other end: `tailwind-merge` cannot even
|
|
16
|
+
* see that as a conflict, because `chip` is a token name and not a scale step.
|
|
17
|
+
* So nothing here cancels anything. What varies moves into `variants` or
|
|
18
|
+
* `compoundVariants` until only one of it is ever emitted.
|
|
19
|
+
*
|
|
20
|
+
* That is why `neutral` carries no rim of its own. The other six tones rim
|
|
21
|
+
* themselves at `/35` in all three variants, but the neutral line has two
|
|
22
|
+
* weights in this system: `--cue-border` is a box edge, and a chip is a box;
|
|
23
|
+
* `--cue-hair-strong` is the rule between things, and a tag is a mark on the
|
|
24
|
+
* page rather than a container. The rim is therefore a compound of tone and
|
|
25
|
+
* variant, exactly as the fill is.
|
|
13
26
|
*
|
|
14
27
|
* @example
|
|
15
28
|
* <span className={chipVariants({ tone: "danger", variant: "outline" })}>fault</span>
|
|
29
|
+
* @example
|
|
30
|
+
* <span className={chipVariants({ variant: "tag" })}>mcp</span>
|
|
16
31
|
*/
|
|
17
32
|
declare const chipVariants: (props?: ({
|
|
18
33
|
tone?: "danger" | "info" | "warn" | "accent" | "ok" | "busy" | "neutral" | null | undefined;
|
|
19
|
-
variant?: "outline" | "tinted" | null | undefined;
|
|
34
|
+
variant?: "outline" | "tinted" | "tag" | null | undefined;
|
|
20
35
|
interactive?: boolean | null | undefined;
|
|
21
36
|
} & ClassProp) | undefined) => string;
|
|
22
37
|
interface ChipProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof chipVariants> {
|
|
@@ -37,10 +52,21 @@ interface ChipProps extends React.HTMLAttributes<HTMLElement>, VariantProps<type
|
|
|
37
52
|
* plus `neutral` and `accent`, so a chip, a `StatusDot` and a `Meter` always
|
|
38
53
|
* agree on what "warn" looks like.
|
|
39
54
|
*
|
|
55
|
+
* `variant` sets how loudly it says it. `tinted` is the chip proper — a tone
|
|
56
|
+
* tint behind tone ink. `outline` drops the fill and keeps the voice, for a
|
|
57
|
+
* chip on an already-busy ground. `tag` drops both: a hairline rim, micro type
|
|
58
|
+
* and closed tracking, for the facts that sit *beside* a row's name — a kind, a
|
|
59
|
+
* lifecycle, a scope — where a row full of tinted chips would read as a row of
|
|
60
|
+
* buttons. All three keep `h-chip`, so a mixed row still has one baseline.
|
|
61
|
+
*
|
|
40
62
|
* @example
|
|
41
63
|
* <Chip tone="ok">online</Chip>
|
|
42
64
|
* @example
|
|
43
65
|
* <Chip tone="accent" variant="outline" interactive onClick={toggle}>dimmer</Chip>
|
|
66
|
+
* @example
|
|
67
|
+
* <Chip variant="tag">mcp</Chip>
|
|
68
|
+
* @example
|
|
69
|
+
* <Chip tone="danger" variant="tag">needs auth</Chip>
|
|
44
70
|
*/
|
|
45
71
|
declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLElement>>;
|
|
46
72
|
//#endregion
|
package/dist/primitives/chip.js
CHANGED
|
@@ -5,22 +5,37 @@ import * as React from "react";
|
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/primitives/chip.tsx
|
|
7
7
|
/**
|
|
8
|
-
* The tinted-chip recipe: `bg-<tone>/10 border-<tone>/35 text-<tone
|
|
8
|
+
* The tinted-chip recipe: `bg-<tone>/10 border-<tone>/35 text-<tone>`, and the
|
|
9
|
+
* two quieter readings of it — `outline`, which drops the fill, and `tag`,
|
|
10
|
+
* which drops the fill and the voice with it.
|
|
9
11
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* `bg-transparent`
|
|
13
|
-
* utilities in the class string and
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* Every property that varies is emitted from exactly one place: one rim, one
|
|
13
|
+
* ink, one fill, one gutter, one type size, always. Emitting `bg-<tone>/10`
|
|
14
|
+
* from the tone map and then cancelling it with `bg-transparent` would leave
|
|
15
|
+
* two competing utilities in the class string, and `chipVariants` is exported —
|
|
16
|
+
* a caller who uses it without `cn` gets a raw string where the winner is
|
|
17
|
+
* decided by stylesheet order rather than by which utility was written last.
|
|
18
|
+
* `h-chip h-4` proves the point at the other end: `tailwind-merge` cannot even
|
|
19
|
+
* see that as a conflict, because `chip` is a token name and not a scale step.
|
|
20
|
+
* So nothing here cancels anything. What varies moves into `variants` or
|
|
21
|
+
* `compoundVariants` until only one of it is ever emitted.
|
|
22
|
+
*
|
|
23
|
+
* That is why `neutral` carries no rim of its own. The other six tones rim
|
|
24
|
+
* themselves at `/35` in all three variants, but the neutral line has two
|
|
25
|
+
* weights in this system: `--cue-border` is a box edge, and a chip is a box;
|
|
26
|
+
* `--cue-hair-strong` is the rule between things, and a tag is a mark on the
|
|
27
|
+
* page rather than a container. The rim is therefore a compound of tone and
|
|
28
|
+
* variant, exactly as the fill is.
|
|
16
29
|
*
|
|
17
30
|
* @example
|
|
18
31
|
* <span className={chipVariants({ tone: "danger", variant: "outline" })}>fault</span>
|
|
32
|
+
* @example
|
|
33
|
+
* <span className={chipVariants({ variant: "tag" })}>mcp</span>
|
|
19
34
|
*/
|
|
20
|
-
const chipVariants = cva("inline-flex h-chip select-none items-center justify-center gap-(--cue-space-2) whitespace-nowrap rounded-(--radius-control) border
|
|
35
|
+
const chipVariants = cva("inline-flex h-chip select-none items-center justify-center gap-(--cue-space-2) whitespace-nowrap rounded-(--radius-control) border font-mono leading-none uppercase outline-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-1 focus-visible:outline-accent", {
|
|
21
36
|
variants: {
|
|
22
37
|
tone: {
|
|
23
|
-
neutral: "
|
|
38
|
+
neutral: "text-fg-muted",
|
|
24
39
|
accent: "border-accent/35 text-accent",
|
|
25
40
|
ok: "border-ok/35 text-ok",
|
|
26
41
|
busy: "border-busy/35 text-busy",
|
|
@@ -29,8 +44,9 @@ const chipVariants = cva("inline-flex h-chip select-none items-center justify-ce
|
|
|
29
44
|
info: "border-info/35 text-info"
|
|
30
45
|
},
|
|
31
46
|
variant: {
|
|
32
|
-
tinted: "",
|
|
33
|
-
outline: "bg-transparent"
|
|
47
|
+
tinted: "px-(--cue-space-3) text-(length:--cue-text-label) tracking-[0.15em]",
|
|
48
|
+
outline: "bg-transparent px-(--cue-space-3) text-(length:--cue-text-label) tracking-[0.15em]",
|
|
49
|
+
tag: "bg-transparent px-(--cue-space-2) text-(length:--cue-text-micro) tracking-[0.06em]"
|
|
34
50
|
},
|
|
35
51
|
interactive: {
|
|
36
52
|
true: "cursor-pointer disabled:pointer-events-none disabled:opacity-40",
|
|
@@ -38,6 +54,16 @@ const chipVariants = cva("inline-flex h-chip select-none items-center justify-ce
|
|
|
38
54
|
}
|
|
39
55
|
},
|
|
40
56
|
compoundVariants: [
|
|
57
|
+
{
|
|
58
|
+
tone: "neutral",
|
|
59
|
+
variant: ["tinted", "outline"],
|
|
60
|
+
class: "border-border"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
tone: "neutral",
|
|
64
|
+
variant: "tag",
|
|
65
|
+
class: "border-(--cue-hair-strong)"
|
|
66
|
+
},
|
|
41
67
|
{
|
|
42
68
|
tone: "neutral",
|
|
43
69
|
variant: "tinted",
|
|
@@ -75,38 +101,87 @@ const chipVariants = cva("inline-flex h-chip select-none items-center justify-ce
|
|
|
75
101
|
},
|
|
76
102
|
{
|
|
77
103
|
tone: "neutral",
|
|
104
|
+
variant: ["tinted", "outline"],
|
|
78
105
|
interactive: true,
|
|
79
106
|
class: "hover:border-border-strong hover:text-fg"
|
|
80
107
|
},
|
|
108
|
+
{
|
|
109
|
+
tone: "neutral",
|
|
110
|
+
variant: "tag",
|
|
111
|
+
interactive: true,
|
|
112
|
+
class: "hover:border-border hover:text-fg"
|
|
113
|
+
},
|
|
81
114
|
{
|
|
82
115
|
tone: "accent",
|
|
116
|
+
variant: ["tinted", "outline"],
|
|
83
117
|
interactive: true,
|
|
84
118
|
class: "hover:border-accent/60 hover:bg-accent/20"
|
|
85
119
|
},
|
|
120
|
+
{
|
|
121
|
+
tone: "accent",
|
|
122
|
+
variant: "tag",
|
|
123
|
+
interactive: true,
|
|
124
|
+
class: "hover:border-accent/60"
|
|
125
|
+
},
|
|
86
126
|
{
|
|
87
127
|
tone: "ok",
|
|
128
|
+
variant: ["tinted", "outline"],
|
|
88
129
|
interactive: true,
|
|
89
130
|
class: "hover:border-ok/60 hover:bg-ok/20"
|
|
90
131
|
},
|
|
132
|
+
{
|
|
133
|
+
tone: "ok",
|
|
134
|
+
variant: "tag",
|
|
135
|
+
interactive: true,
|
|
136
|
+
class: "hover:border-ok/60"
|
|
137
|
+
},
|
|
91
138
|
{
|
|
92
139
|
tone: "busy",
|
|
140
|
+
variant: ["tinted", "outline"],
|
|
93
141
|
interactive: true,
|
|
94
142
|
class: "hover:border-busy/60 hover:bg-busy/20"
|
|
95
143
|
},
|
|
144
|
+
{
|
|
145
|
+
tone: "busy",
|
|
146
|
+
variant: "tag",
|
|
147
|
+
interactive: true,
|
|
148
|
+
class: "hover:border-busy/60"
|
|
149
|
+
},
|
|
96
150
|
{
|
|
97
151
|
tone: "warn",
|
|
152
|
+
variant: ["tinted", "outline"],
|
|
98
153
|
interactive: true,
|
|
99
154
|
class: "hover:border-warn/60 hover:bg-warn/20"
|
|
100
155
|
},
|
|
156
|
+
{
|
|
157
|
+
tone: "warn",
|
|
158
|
+
variant: "tag",
|
|
159
|
+
interactive: true,
|
|
160
|
+
class: "hover:border-warn/60"
|
|
161
|
+
},
|
|
101
162
|
{
|
|
102
163
|
tone: "danger",
|
|
164
|
+
variant: ["tinted", "outline"],
|
|
103
165
|
interactive: true,
|
|
104
166
|
class: "hover:border-danger/60 hover:bg-danger/20"
|
|
105
167
|
},
|
|
168
|
+
{
|
|
169
|
+
tone: "danger",
|
|
170
|
+
variant: "tag",
|
|
171
|
+
interactive: true,
|
|
172
|
+
class: "hover:border-danger/60"
|
|
173
|
+
},
|
|
106
174
|
{
|
|
107
175
|
tone: "info",
|
|
176
|
+
variant: ["tinted", "outline"],
|
|
108
177
|
interactive: true,
|
|
109
178
|
class: "hover:border-info/60 hover:bg-info/20"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
tone: "info",
|
|
182
|
+
variant: "tag",
|
|
183
|
+
interactive: true,
|
|
184
|
+
class: "hover:border-info/60"
|
|
110
185
|
}
|
|
111
186
|
],
|
|
112
187
|
defaultVariants: {
|
|
@@ -122,10 +197,21 @@ const chipVariants = cva("inline-flex h-chip select-none items-center justify-ce
|
|
|
122
197
|
* plus `neutral` and `accent`, so a chip, a `StatusDot` and a `Meter` always
|
|
123
198
|
* agree on what "warn" looks like.
|
|
124
199
|
*
|
|
200
|
+
* `variant` sets how loudly it says it. `tinted` is the chip proper — a tone
|
|
201
|
+
* tint behind tone ink. `outline` drops the fill and keeps the voice, for a
|
|
202
|
+
* chip on an already-busy ground. `tag` drops both: a hairline rim, micro type
|
|
203
|
+
* and closed tracking, for the facts that sit *beside* a row's name — a kind, a
|
|
204
|
+
* lifecycle, a scope — where a row full of tinted chips would read as a row of
|
|
205
|
+
* buttons. All three keep `h-chip`, so a mixed row still has one baseline.
|
|
206
|
+
*
|
|
125
207
|
* @example
|
|
126
208
|
* <Chip tone="ok">online</Chip>
|
|
127
209
|
* @example
|
|
128
210
|
* <Chip tone="accent" variant="outline" interactive onClick={toggle}>dimmer</Chip>
|
|
211
|
+
* @example
|
|
212
|
+
* <Chip variant="tag">mcp</Chip>
|
|
213
|
+
* @example
|
|
214
|
+
* <Chip tone="danger" variant="tag">needs auth</Chip>
|
|
129
215
|
*/
|
|
130
216
|
const Chip = React.forwardRef(function Chip({ className, tone, variant, interactive = false, disabled, children, ...elementProps }, ref) {
|
|
131
217
|
const classes = cn(chipVariants({
|
package/dist/styles.css
CHANGED
|
@@ -28,7 +28,17 @@
|
|
|
28
28
|
@custom-variant density-normal (&:where([data-density="normal"], [data-density="normal"] *));
|
|
29
29
|
@custom-variant density-large (&:where([data-density="large"], [data-density="large"] *));
|
|
30
30
|
@custom-variant density-ultra-large (&:where([data-density="ultra-large"], [data-density="ultra-large"] *));
|
|
31
|
-
@custom-variant mode-light
|
|
31
|
+
@custom-variant mode-light {
|
|
32
|
+
&:where([data-mode="light"], [data-mode="light"] *) {
|
|
33
|
+
@slot;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media (prefers-color-scheme: light) {
|
|
37
|
+
&:where([data-mode="system"], [data-mode="system"] *) {
|
|
38
|
+
@slot;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
32
42
|
|
|
33
43
|
/* The one keyframe this library's core needs, and the reason it cannot be a
|
|
34
44
|
* utility: `<Plussie idle />` blinks, and Tailwind has no `animate-*` for a
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
//#region src/system/agent-skin.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Which value-set paints the elements family inside this subtree.
|
|
5
|
+
*
|
|
6
|
+
* - `cue` — the default, and the one that needs no stylesheet: the vendored
|
|
7
|
+
* elements were rewritten onto `--cue-*` tokens, so they are already this
|
|
8
|
+
* system's components.
|
|
9
|
+
* - `aui` — supersede mode. `@cueplusplus/ui/elements.css` re-points those same
|
|
10
|
+
* tokens to assistant-ui's own values under `[data-cue-skin="aui"]`, so one
|
|
11
|
+
* DOM paints two ways with no branching in any component.
|
|
12
|
+
*/
|
|
13
|
+
type AgentSkin = "cue" | "aui";
|
|
14
|
+
/**
|
|
15
|
+
* How far the supersede island goes: colour only, or colour and geometry.
|
|
16
|
+
*
|
|
17
|
+
* - `cue-metrics` — the default. Colour is re-pointed; cue's type scale, radius
|
|
18
|
+
* ladder and density ladder still apply, so an island tracks the density of
|
|
19
|
+
* the console around it.
|
|
20
|
+
* - `upstream` — assistant-ui's metrics too: their radii, their literal 13.5 /
|
|
21
|
+
* 12 / 11 px type, `--spacing` pinned at Tailwind's default. Density stops at
|
|
22
|
+
* the island edge, which is the point — this is the mode for showing an
|
|
23
|
+
* element exactly as its authors drew it.
|
|
24
|
+
*/
|
|
25
|
+
type AgentFidelity = "upstream" | "cue-metrics";
|
|
26
|
+
//#endregion
|
|
27
|
+
export { AgentFidelity, AgentSkin };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/system/agent-skin.ts
|
|
4
|
+
/**
|
|
5
|
+
* Nearest ambient skin island. `null` means there is none, which is the case
|
|
6
|
+
* for almost every tree — and is why the portal stamp *removes* these two
|
|
7
|
+
* attributes rather than defaulting them.
|
|
8
|
+
*
|
|
9
|
+
* It lives in `system/` rather than beside `AgentSurface` for one reason: the
|
|
10
|
+
* portal stamp reads its axes from React context, never from the DOM (a portal
|
|
11
|
+
* is mounted outside its owner's subtree, so DOM discovery would read the
|
|
12
|
+
* body's values). `system/portal.tsx` is in the core barrel's import graph and
|
|
13
|
+
* `elements/` is behind an optional peer, so the context has to sit on the side
|
|
14
|
+
* that both can reach.
|
|
15
|
+
*
|
|
16
|
+
* @internal Consumers use `<AgentSurface>` from `@cueplusplus/ui/elements`.
|
|
17
|
+
*/
|
|
18
|
+
const AgentSkinContext = React.createContext(null);
|
|
19
|
+
//#endregion
|
|
20
|
+
export { AgentSkinContext };
|
package/dist/system/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ResolvedMode, ThemeContextValue, ThemeProvider, ThemeProviderProps } from "./theme-provider.js";
|
|
1
|
+
import { FontFamilies, ResolvedMode, ThemeContextValue, ThemeProvider, ThemeProviderProps } from "./theme-provider.js";
|
|
2
2
|
import { Density, DensityProps } from "./density.js";
|
|
3
3
|
import { CuePortalFrame, CuePortalFrameProps, useCuePortalProps } from "./portal.js";
|
|
4
|
-
import { DEFAULT_STORAGE_KEY, PersistedPreferences, prepaintScript } from "./prepaint.js";
|
|
4
|
+
import { DEFAULT_STORAGE_KEY, PersistedPreferences, PrepaintDefaults, PrepaintOptions, prepaintScript } from "./prepaint.js";
|
|
5
5
|
import { ControlSize, useControlHeight, useDensity } from "./use-density.js";
|
|
6
6
|
import { useTheme } from "./use-theme.js";
|
|
7
7
|
import { Density as DensityLevel, FontName, Mode, ThemeName } from "@cueplusplus/tokens";
|
|
8
|
-
export { type ControlSize, CuePortalFrame, type CuePortalFrameProps, DEFAULT_STORAGE_KEY, Density, type DensityLevel, type DensityProps, type FontName, type Mode, type PersistedPreferences, type ResolvedMode, type ThemeContextValue, type ThemeName, ThemeProvider, type ThemeProviderProps, prepaintScript, useControlHeight, useCuePortalProps, useDensity, useTheme };
|
|
8
|
+
export { type ControlSize, CuePortalFrame, type CuePortalFrameProps, DEFAULT_STORAGE_KEY, Density, type DensityLevel, type DensityProps, type FontFamilies, type FontName, type Mode, type PersistedPreferences, type PrepaintDefaults, type PrepaintOptions, type ResolvedMode, type ThemeContextValue, type ThemeName, ThemeProvider, type ThemeProviderProps, prepaintScript, useControlHeight, useCuePortalProps, useDensity, useTheme };
|
package/dist/system/portal.d.ts
CHANGED
|
@@ -6,7 +6,9 @@ import * as React from "react";
|
|
|
6
6
|
*
|
|
7
7
|
* Returns a `container` element appended to `document.body` and stamped with
|
|
8
8
|
* `data-theme` / `data-density` / `data-font` / `data-mode` (plus
|
|
9
|
-
* `--cue-font-scale`) copied from the nearest provider and density island
|
|
9
|
+
* `--cue-font-scale`) copied from the nearest provider and density island, and
|
|
10
|
+
* with `data-cue-skin` / `data-cue-fidelity` when the caller sits inside an
|
|
11
|
+
* `AgentSurface` island. The container is
|
|
10
12
|
* `display: contents`, so it changes no layout and creates no containing block —
|
|
11
13
|
* fixed-position overlay content behaves exactly as if it were a direct child of
|
|
12
14
|
* `<body>`.
|
|
@@ -38,8 +40,8 @@ interface CuePortalFrameProps {
|
|
|
38
40
|
* chosen (a third-party overlay, or content already portaled by something else).
|
|
39
41
|
*
|
|
40
42
|
* Wraps `children` in a `display: contents` element carrying the same
|
|
41
|
-
* `data-theme` / `data-density` / `data-font` / `data-mode`
|
|
42
|
-
* `--cue-font-scale` as {@link useCuePortalProps}. Prefer the hook — a stamped container costs one
|
|
43
|
+
* `data-theme` / `data-density` / `data-font` / `data-mode` / `data-cue-skin` /
|
|
44
|
+
* `data-cue-fidelity` stamp and `--cue-font-scale` as {@link useCuePortalProps}. Prefer the hook — a stamped container costs one
|
|
43
45
|
* element per overlay instead of one per render tree — and reach for this only
|
|
44
46
|
* when the container prop is not available.
|
|
45
47
|
*
|
package/dist/system/portal.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
3
|
+
import { AgentSkinContext } from "./agent-skin.js";
|
|
3
4
|
import { DensityContext } from "./density.js";
|
|
4
|
-
import { FontScaleContext, ThemeContext } from "./theme-provider.js";
|
|
5
|
+
import { FontFamiliesContext, FontScaleContext, ThemeContext } from "./theme-provider.js";
|
|
5
6
|
import * as React from "react";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
import { DEFAULT_FONT } from "@cueplusplus/tokens";
|
|
8
9
|
//#region src/system/portal.tsx
|
|
9
10
|
const DEFAULT_THEME = "cue";
|
|
10
|
-
const
|
|
11
|
+
const DEFAULT_MODE = "dark";
|
|
11
12
|
/** Custom property the density text ladder multiplies by; see `FontScaleContext`. */
|
|
12
13
|
const FONT_SCALE_PROPERTY = "--cue-font-scale";
|
|
14
|
+
const FONT_SANS_PROPERTY = "--cue-font-sans";
|
|
15
|
+
const FONT_MONO_PROPERTY = "--cue-font-mono";
|
|
13
16
|
/**
|
|
14
17
|
* Read the stamp from React context — never from the DOM. A portal is mounted
|
|
15
18
|
* outside its owner's DOM subtree, so `getComputedStyle`-style discovery would
|
|
@@ -22,12 +25,17 @@ function usePortalStamp() {
|
|
|
22
25
|
const theme = React.useContext(ThemeContext);
|
|
23
26
|
const island = React.useContext(DensityContext);
|
|
24
27
|
const fontScale = React.useContext(FontScaleContext);
|
|
28
|
+
const fontFamilies = React.useContext(FontFamiliesContext);
|
|
29
|
+
const skin = React.useContext(AgentSkinContext);
|
|
25
30
|
return {
|
|
26
31
|
theme: theme?.theme ?? DEFAULT_THEME,
|
|
27
32
|
density: island ?? theme?.density ?? "compact",
|
|
33
|
+
mode: theme?.mode ?? DEFAULT_MODE,
|
|
28
34
|
font: theme?.font ?? DEFAULT_FONT,
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
fontScale,
|
|
36
|
+
fontFamilies,
|
|
37
|
+
skin: skin?.skin ?? null,
|
|
38
|
+
fidelity: skin?.fidelity ?? null
|
|
31
39
|
};
|
|
32
40
|
}
|
|
33
41
|
/**
|
|
@@ -36,7 +44,9 @@ function usePortalStamp() {
|
|
|
36
44
|
*
|
|
37
45
|
* Returns a `container` element appended to `document.body` and stamped with
|
|
38
46
|
* `data-theme` / `data-density` / `data-font` / `data-mode` (plus
|
|
39
|
-
* `--cue-font-scale`) copied from the nearest provider and density island
|
|
47
|
+
* `--cue-font-scale`) copied from the nearest provider and density island, and
|
|
48
|
+
* with `data-cue-skin` / `data-cue-fidelity` when the caller sits inside an
|
|
49
|
+
* `AgentSurface` island. The container is
|
|
40
50
|
* `display: contents`, so it changes no layout and creates no containing block —
|
|
41
51
|
* fixed-position overlay content behaves exactly as if it were a direct child of
|
|
42
52
|
* `<body>`.
|
|
@@ -79,7 +89,11 @@ function useCuePortalProps() {
|
|
|
79
89
|
stamp.density,
|
|
80
90
|
stamp.font,
|
|
81
91
|
stamp.mode,
|
|
82
|
-
stamp.fontScale
|
|
92
|
+
stamp.fontScale,
|
|
93
|
+
stamp.fontFamilies?.sans,
|
|
94
|
+
stamp.fontFamilies?.mono,
|
|
95
|
+
stamp.skin,
|
|
96
|
+
stamp.fidelity
|
|
83
97
|
]);
|
|
84
98
|
return React.useMemo(() => container === null ? {} : { container }, [container]);
|
|
85
99
|
}
|
|
@@ -89,16 +103,26 @@ function applyStamp(element, stamp) {
|
|
|
89
103
|
element.setAttribute("data-density", stamp.density);
|
|
90
104
|
element.setAttribute("data-font", stamp.font);
|
|
91
105
|
element.setAttribute("data-mode", stamp.mode);
|
|
106
|
+
if (stamp.skin === null) element.removeAttribute("data-cue-skin");
|
|
107
|
+
else element.setAttribute("data-cue-skin", stamp.skin);
|
|
108
|
+
if (stamp.fidelity === null) element.removeAttribute("data-cue-fidelity");
|
|
109
|
+
else element.setAttribute("data-cue-fidelity", stamp.fidelity);
|
|
92
110
|
if (stamp.fontScale === null) element.style.removeProperty(FONT_SCALE_PROPERTY);
|
|
93
111
|
else element.style.setProperty(FONT_SCALE_PROPERTY, String(stamp.fontScale));
|
|
112
|
+
setOptionalProperty(element, FONT_SANS_PROPERTY, stamp.fontFamilies?.sans);
|
|
113
|
+
setOptionalProperty(element, FONT_MONO_PROPERTY, stamp.fontFamilies?.mono);
|
|
114
|
+
}
|
|
115
|
+
function setOptionalProperty(element, property, value) {
|
|
116
|
+
if (value === void 0) element.style.removeProperty(property);
|
|
117
|
+
else element.style.setProperty(property, value);
|
|
94
118
|
}
|
|
95
119
|
/**
|
|
96
120
|
* Inline version of the portal contract, for portals whose container cannot be
|
|
97
121
|
* chosen (a third-party overlay, or content already portaled by something else).
|
|
98
122
|
*
|
|
99
123
|
* Wraps `children` in a `display: contents` element carrying the same
|
|
100
|
-
* `data-theme` / `data-density` / `data-font` / `data-mode`
|
|
101
|
-
* `--cue-font-scale` as {@link useCuePortalProps}. Prefer the hook — a stamped container costs one
|
|
124
|
+
* `data-theme` / `data-density` / `data-font` / `data-mode` / `data-cue-skin` /
|
|
125
|
+
* `data-cue-fidelity` stamp and `--cue-font-scale` as {@link useCuePortalProps}. Prefer the hook — a stamped container costs one
|
|
102
126
|
* element per overlay instead of one per render tree — and reach for this only
|
|
103
127
|
* when the container prop is not available.
|
|
104
128
|
*
|
|
@@ -110,6 +134,8 @@ function CuePortalFrame({ children, className, style }) {
|
|
|
110
134
|
const frameStyle = {
|
|
111
135
|
display: "contents",
|
|
112
136
|
...stamp.fontScale === null ? null : { [FONT_SCALE_PROPERTY]: stamp.fontScale },
|
|
137
|
+
...stamp.fontFamilies?.sans === void 0 ? null : { [FONT_SANS_PROPERTY]: stamp.fontFamilies.sans },
|
|
138
|
+
...stamp.fontFamilies?.mono === void 0 ? null : { [FONT_MONO_PROPERTY]: stamp.fontFamilies.mono },
|
|
113
139
|
...style
|
|
114
140
|
};
|
|
115
141
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -118,6 +144,8 @@ function CuePortalFrame({ children, className, style }) {
|
|
|
118
144
|
"data-density": stamp.density,
|
|
119
145
|
"data-font": stamp.font,
|
|
120
146
|
"data-mode": stamp.mode,
|
|
147
|
+
"data-cue-skin": stamp.skin ?? void 0,
|
|
148
|
+
"data-cue-fidelity": stamp.fidelity ?? void 0,
|
|
121
149
|
className,
|
|
122
150
|
style: frameStyle,
|
|
123
151
|
children
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Density, FontName, ThemeName } from "@cueplusplus/tokens";
|
|
1
|
+
import { Density, FontName, Mode, ThemeName } from "@cueplusplus/tokens";
|
|
2
2
|
//#region src/system/prepaint.d.ts
|
|
3
3
|
/** localStorage key the ThemeProvider and the pre-paint script share by default. */
|
|
4
4
|
declare const DEFAULT_STORAGE_KEY = "cue-ui";
|
|
@@ -13,6 +13,23 @@ interface PersistedPreferences {
|
|
|
13
13
|
/** Last font pairing the user picked. */
|
|
14
14
|
font?: string;
|
|
15
15
|
}
|
|
16
|
+
/** Complete server-authoritative fallback stamped when storage is absent or ignored. */
|
|
17
|
+
interface PrepaintDefaults {
|
|
18
|
+
theme: ThemeName;
|
|
19
|
+
density: Density;
|
|
20
|
+
mode: Mode;
|
|
21
|
+
/** Initial document-wide font pairing. Defaults to the token package's system pairing. */
|
|
22
|
+
font?: FontName;
|
|
23
|
+
}
|
|
24
|
+
/** Options form for apps whose server projection, not localStorage, owns first paint. */
|
|
25
|
+
interface PrepaintOptions {
|
|
26
|
+
/** localStorage key shared with ThemeProvider. */
|
|
27
|
+
storageKey?: string;
|
|
28
|
+
/** Complete validated fallback triple. */
|
|
29
|
+
defaults: PrepaintDefaults;
|
|
30
|
+
/** Whether valid stored axes may override `defaults`. Defaults to `true`. */
|
|
31
|
+
readStoredPreferences?: boolean;
|
|
32
|
+
}
|
|
16
33
|
/**
|
|
17
34
|
* Build the blocking inline script that stamps `data-theme`, `data-density`,
|
|
18
35
|
* `data-font`, `data-mode` and `color-scheme` on `<html>` from localStorage
|
|
@@ -41,5 +58,6 @@ interface PersistedPreferences {
|
|
|
41
58
|
* prepaintScript(DEFAULT_STORAGE_KEY, "terminal", "normal");
|
|
42
59
|
*/
|
|
43
60
|
declare function prepaintScript(storageKey?: string, defaultTheme?: ThemeName, defaultDensity?: Density, defaultFont?: FontName): string;
|
|
61
|
+
declare function prepaintScript(options: PrepaintOptions): string;
|
|
44
62
|
//#endregion
|
|
45
|
-
export { DEFAULT_STORAGE_KEY, PersistedPreferences, prepaintScript };
|
|
63
|
+
export { DEFAULT_STORAGE_KEY, PersistedPreferences, PrepaintDefaults, PrepaintOptions, prepaintScript };
|
package/dist/system/prepaint.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_DENSITY, DEFAULT_FONT, DENSITIES, FONTS } from "@cueplusplus/tokens";
|
|
1
|
+
import { DEFAULT_DENSITY, DEFAULT_FONT, DENSITIES, FONTS, MODES, THEMES } from "@cueplusplus/tokens";
|
|
2
2
|
//#region src/system/prepaint.ts
|
|
3
3
|
/**
|
|
4
4
|
* Pre-paint stamping. Server-safe by design: no `"use client"`, no React, no
|
|
@@ -16,39 +16,45 @@ const scriptSafe = (json) => json.replace(/</g, "\\u003c").replace(/>/g, "\\u003
|
|
|
16
16
|
function jsStringLiteral(value) {
|
|
17
17
|
return scriptSafe(JSON.stringify(value));
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
* fallback, which is what an app that passes no `density` renders at.
|
|
41
|
-
* @returns One line of JavaScript, safe to inline verbatim.
|
|
42
|
-
* @example
|
|
43
|
-
* // An app whose provider is <ThemeProvider theme="terminal" density="normal">:
|
|
44
|
-
* prepaintScript(DEFAULT_STORAGE_KEY, "terminal", "normal");
|
|
45
|
-
*/
|
|
46
|
-
function prepaintScript(storageKey = DEFAULT_STORAGE_KEY, defaultTheme = "cue", defaultDensity = DEFAULT_DENSITY, defaultFont = DEFAULT_FONT) {
|
|
19
|
+
function prepaintScript(storageKeyOrOptions = DEFAULT_STORAGE_KEY, defaultTheme = "cue", defaultDensity = DEFAULT_DENSITY, defaultFont = DEFAULT_FONT) {
|
|
20
|
+
const options = typeof storageKeyOrOptions === "string" ? {
|
|
21
|
+
storageKey: storageKeyOrOptions,
|
|
22
|
+
defaults: {
|
|
23
|
+
theme: defaultTheme,
|
|
24
|
+
density: defaultDensity,
|
|
25
|
+
mode: "dark"
|
|
26
|
+
},
|
|
27
|
+
readStoredPreferences: true
|
|
28
|
+
} : storageKeyOrOptions;
|
|
29
|
+
if (options === null || typeof options !== "object" || options.defaults === void 0) throw new TypeError("prepaintScript options require a complete default triple");
|
|
30
|
+
const defaults = options.defaults;
|
|
31
|
+
if (defaults.theme === void 0 || defaults.density === void 0 || defaults.mode === void 0) throw new TypeError("prepaintScript options require a complete default triple");
|
|
32
|
+
if (!THEMES.includes(defaults.theme)) throw new TypeError("prepaintScript defaults contain an invalid theme");
|
|
33
|
+
if (!DENSITIES.includes(defaults.density)) throw new TypeError("prepaintScript defaults contain an invalid density");
|
|
34
|
+
if (!MODES.includes(defaults.mode)) throw new TypeError("prepaintScript defaults contain an invalid mode");
|
|
35
|
+
if (defaults.font !== void 0 && !FONTS.includes(defaults.font)) throw new TypeError("prepaintScript defaults contain an invalid font");
|
|
36
|
+
if (options.readStoredPreferences !== void 0 && typeof options.readStoredPreferences !== "boolean") throw new TypeError("prepaintScript readStoredPreferences must be boolean");
|
|
37
|
+
const storageKey = options.storageKey ?? "cue-ui";
|
|
38
|
+
if (typeof storageKey !== "string") throw new TypeError("prepaintScript storageKey must be a string");
|
|
39
|
+
const readStoredPreferences = options.readStoredPreferences ?? true;
|
|
47
40
|
const key = jsStringLiteral(storageKey);
|
|
48
|
-
const fallbackTheme = jsStringLiteral(
|
|
49
|
-
const fallbackDensity = jsStringLiteral(
|
|
50
|
-
const
|
|
51
|
-
|
|
41
|
+
const fallbackTheme = jsStringLiteral(defaults.theme);
|
|
42
|
+
const fallbackDensity = jsStringLiteral(defaults.density);
|
|
43
|
+
const fallbackMode = jsStringLiteral(defaults.mode);
|
|
44
|
+
const fallbackFont = jsStringLiteral(defaults.font ?? defaultFont);
|
|
45
|
+
const themes = scriptSafe(JSON.stringify([...THEMES]));
|
|
46
|
+
const densities = scriptSafe(JSON.stringify([...DENSITIES]));
|
|
47
|
+
const modes = scriptSafe(JSON.stringify([...MODES]));
|
|
48
|
+
/**
|
|
49
|
+
* The pairings, from the package that authors them, for the same reason.
|
|
50
|
+
*
|
|
51
|
+
* This is also the axis where an unvalidated read is worst: a stale or
|
|
52
|
+
* hand-edited `font` would stamp an attribute the stylesheet has no block
|
|
53
|
+
* for, `--cue-font-sans` would keep the base stack, and the page would render
|
|
54
|
+
* in a family the picker says is not selected.
|
|
55
|
+
*/
|
|
56
|
+
const pairings = scriptSafe(JSON.stringify([...FONTS]));
|
|
57
|
+
return `!function(){try{var k=${key},e=document.documentElement,s=null;` + (readStoredPreferences ? "try{var r=localStorage.getItem(k);s=r?JSON.parse(r):null}catch(_){}" : "") + `s=s&&typeof s=="object"?s:{};var t=${themes}.indexOf(s.theme)>-1?s.theme:${fallbackTheme};var d=${densities}.indexOf(s.density)>-1?s.density:${fallbackDensity};var f=${pairings}.indexOf(s.font)>-1?s.font:${fallbackFont};var m=${modes}.indexOf(s.mode)>-1?s.mode:${fallbackMode};e.setAttribute("data-theme",t);e.setAttribute("data-density",d);e.setAttribute("data-font",f);e.setAttribute("data-mode",m);e.style.colorScheme=m==="system"?"light dark":m}catch(_){}}()`;
|
|
52
58
|
}
|
|
53
59
|
//#endregion
|
|
54
60
|
export { DEFAULT_STORAGE_KEY, prepaintScript };
|
|
@@ -24,6 +24,13 @@ interface ThemeContextValue {
|
|
|
24
24
|
/** Switch the font pairing and persist the new preference. */
|
|
25
25
|
setFont: (font: FontName) => void;
|
|
26
26
|
}
|
|
27
|
+
/** Provider-owned font-family overrides that detached portals must republish. */
|
|
28
|
+
interface FontFamilies {
|
|
29
|
+
/** Value for `--cue-font-sans`. */
|
|
30
|
+
sans?: string;
|
|
31
|
+
/** Value for `--cue-font-mono`. */
|
|
32
|
+
mono?: string;
|
|
33
|
+
}
|
|
27
34
|
interface ThemeProviderProps {
|
|
28
35
|
/** Initial theme preset. Defaults to `"cue"`. Changing it after mount adopts the new value. */
|
|
29
36
|
theme?: ThemeName;
|
|
@@ -49,12 +56,16 @@ interface ThemeProviderProps {
|
|
|
49
56
|
font?: FontName;
|
|
50
57
|
/** Multiplier on every text token, published as `--cue-font-scale`. Defaults to `1`. */
|
|
51
58
|
fontScale?: number;
|
|
59
|
+
/** Optional app-owned font stacks, published as inline CUE font custom properties. */
|
|
60
|
+
fontFamilies?: FontFamilies;
|
|
52
61
|
/**
|
|
53
62
|
* localStorage key holding `{ theme, density, font, mode }`. Defaults to `"cue-ui"`.
|
|
54
63
|
* Only the outermost provider reads or writes it — a nested provider is an
|
|
55
64
|
* island whose explicit props are the point, not a second preference store.
|
|
56
65
|
*/
|
|
57
66
|
storageKey?: string;
|
|
67
|
+
/** Restore and write root preferences in localStorage. Defaults to `true`. */
|
|
68
|
+
persistPreferences?: boolean;
|
|
58
69
|
/** Stamp the single child element instead of rendering a wrapper `<div>`. */
|
|
59
70
|
asChild?: boolean;
|
|
60
71
|
/** Extra classes for the provider root. */
|
|
@@ -93,6 +104,6 @@ interface ThemeProviderProps {
|
|
|
93
104
|
* <App />
|
|
94
105
|
* </ThemeProvider>
|
|
95
106
|
*/
|
|
96
|
-
declare function ThemeProvider({ theme: themeProp, density: densityProp, mode: modeProp, font: fontProp, fontScale, storageKey, asChild, className, style: styleProp, children }: ThemeProviderProps): React.JSX.Element;
|
|
107
|
+
declare function ThemeProvider({ theme: themeProp, density: densityProp, mode: modeProp, font: fontProp, fontScale, fontFamilies, storageKey, persistPreferences, asChild, className, style: styleProp, children }: ThemeProviderProps): React.JSX.Element;
|
|
97
108
|
//#endregion
|
|
98
|
-
export { ResolvedMode, ThemeContextValue, ThemeProvider, ThemeProviderProps };
|
|
109
|
+
export { FontFamilies, ResolvedMode, ThemeContextValue, ThemeProvider, ThemeProviderProps };
|