@agimon-ai/doompi-web-components 0.0.1-alpha.4 → 0.0.1-alpha.41
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 +7 -7
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +18 -6
- package/dist/index.mjs +1 -1
- package/dist/src/components/Accordion.cjs +1 -1
- package/dist/src/components/Accordion.cjs.map +1 -1
- package/dist/src/components/Accordion.d.mts +5 -5
- package/dist/src/components/Accordion.d.mts.map +1 -1
- package/dist/src/components/Accordion.mjs +1 -1
- package/dist/src/components/Accordion.mjs.map +1 -1
- package/dist/src/components/AnsiText.cjs +4 -0
- package/dist/src/components/AnsiText.cjs.map +1 -0
- package/dist/src/components/AnsiText.d.mts +16 -0
- package/dist/src/components/AnsiText.d.mts.map +1 -0
- package/dist/src/components/AnsiText.mjs +4 -0
- package/dist/src/components/AnsiText.mjs.map +1 -0
- package/dist/src/components/Avatar.cjs +1 -1
- package/dist/src/components/Avatar.cjs.map +1 -1
- package/dist/src/components/Avatar.d.mts +4 -4
- package/dist/src/components/Avatar.d.mts.map +1 -1
- package/dist/src/components/Avatar.mjs +1 -1
- package/dist/src/components/Avatar.mjs.map +1 -1
- package/dist/src/components/Badge.cjs +1 -1
- package/dist/src/components/Badge.cjs.map +1 -1
- package/dist/src/components/Badge.d.mts +5 -6
- package/dist/src/components/Badge.d.mts.map +1 -1
- package/dist/src/components/Badge.mjs +1 -1
- package/dist/src/components/Badge.mjs.map +1 -1
- package/dist/src/components/Breadcrumb.cjs +1 -1
- package/dist/src/components/Breadcrumb.cjs.map +1 -1
- package/dist/src/components/Breadcrumb.d.mts +4 -5
- package/dist/src/components/Breadcrumb.d.mts.map +1 -1
- package/dist/src/components/Breadcrumb.mjs +1 -1
- package/dist/src/components/Breadcrumb.mjs.map +1 -1
- package/dist/src/components/Button.cjs +1 -1
- package/dist/src/components/Button.cjs.map +1 -1
- package/dist/src/components/Button.d.mts +6 -7
- package/dist/src/components/Button.d.mts.map +1 -1
- package/dist/src/components/Button.mjs +1 -1
- package/dist/src/components/Button.mjs.map +1 -1
- package/dist/src/components/Checkbox.cjs +1 -1
- package/dist/src/components/Checkbox.cjs.map +1 -1
- package/dist/src/components/Checkbox.d.mts +1 -1
- package/dist/src/components/Checkbox.d.mts.map +1 -1
- package/dist/src/components/Checkbox.mjs +1 -1
- package/dist/src/components/Checkbox.mjs.map +1 -1
- package/dist/src/components/CodeBlock.cjs +2 -0
- package/dist/src/components/CodeBlock.cjs.map +1 -0
- package/dist/src/components/CodeBlock.mjs +2 -0
- package/dist/src/components/CodeBlock.mjs.map +1 -0
- package/dist/src/components/CodeEditor.cjs +1 -1
- package/dist/src/components/CodeEditor.cjs.map +1 -1
- package/dist/src/components/CodeEditor.d.mts +1 -2
- package/dist/src/components/CodeEditor.d.mts.map +1 -1
- package/dist/src/components/CodeEditor.mjs +1 -1
- package/dist/src/components/CodeEditor.mjs.map +1 -1
- package/dist/src/components/CodeEditorView.cjs +1 -1
- package/dist/src/components/CodeEditorView.cjs.map +1 -1
- package/dist/src/components/CodeEditorView.mjs +1 -1
- package/dist/src/components/CodeEditorView.mjs.map +1 -1
- package/dist/src/components/Collapsible.cjs +1 -1
- package/dist/src/components/Collapsible.cjs.map +1 -1
- package/dist/src/components/Collapsible.d.mts +4 -4
- package/dist/src/components/Collapsible.d.mts.map +1 -1
- package/dist/src/components/Collapsible.mjs +1 -1
- package/dist/src/components/Collapsible.mjs.map +1 -1
- package/dist/src/components/Command.cjs +1 -1
- package/dist/src/components/Command.cjs.map +1 -1
- package/dist/src/components/Command.d.mts +11 -12
- package/dist/src/components/Command.d.mts.map +1 -1
- package/dist/src/components/Command.mjs +1 -1
- package/dist/src/components/Command.mjs.map +1 -1
- package/dist/src/components/CopyButton.cjs +2 -0
- package/dist/src/components/CopyButton.cjs.map +1 -0
- package/dist/src/components/CopyButton.mjs +2 -0
- package/dist/src/components/CopyButton.mjs.map +1 -0
- package/dist/src/components/Dialog.cjs +1 -1
- package/dist/src/components/Dialog.cjs.map +1 -1
- package/dist/src/components/Dialog.d.mts +15 -15
- package/dist/src/components/Dialog.d.mts.map +1 -1
- package/dist/src/components/Dialog.mjs +1 -1
- package/dist/src/components/Dialog.mjs.map +1 -1
- package/dist/src/components/Dot.cjs +1 -1
- package/dist/src/components/Dot.cjs.map +1 -1
- package/dist/src/components/Dot.d.mts +5 -6
- package/dist/src/components/Dot.d.mts.map +1 -1
- package/dist/src/components/Dot.mjs +1 -1
- package/dist/src/components/Dot.mjs.map +1 -1
- package/dist/src/components/Drawer.cjs +2 -0
- package/dist/src/components/Drawer.cjs.map +1 -0
- package/dist/src/components/Drawer.d.mts +17 -0
- package/dist/src/components/Drawer.d.mts.map +1 -0
- package/dist/src/components/Drawer.mjs +2 -0
- package/dist/src/components/Drawer.mjs.map +1 -0
- package/dist/src/components/DropdownMenu.cjs +1 -1
- package/dist/src/components/DropdownMenu.cjs.map +1 -1
- package/dist/src/components/DropdownMenu.d.mts +20 -20
- package/dist/src/components/DropdownMenu.d.mts.map +1 -1
- package/dist/src/components/DropdownMenu.mjs +1 -1
- package/dist/src/components/DropdownMenu.mjs.map +1 -1
- package/dist/src/components/EmptyState.cjs +1 -1
- package/dist/src/components/EmptyState.cjs.map +1 -1
- package/dist/src/components/EmptyState.d.mts +2 -3
- package/dist/src/components/EmptyState.d.mts.map +1 -1
- package/dist/src/components/EmptyState.mjs +1 -1
- package/dist/src/components/EmptyState.mjs.map +1 -1
- package/dist/src/components/HashlineLines.cjs +2 -0
- package/dist/src/components/HashlineLines.cjs.map +1 -0
- package/dist/src/components/HashlineLines.d.mts +23 -0
- package/dist/src/components/HashlineLines.d.mts.map +1 -0
- package/dist/src/components/HashlineLines.mjs +2 -0
- package/dist/src/components/HashlineLines.mjs.map +1 -0
- package/dist/src/components/Input.cjs +1 -1
- package/dist/src/components/Input.cjs.map +1 -1
- package/dist/src/components/Input.d.mts +6 -7
- package/dist/src/components/Input.d.mts.map +1 -1
- package/dist/src/components/Input.mjs +1 -1
- package/dist/src/components/Input.mjs.map +1 -1
- package/dist/src/components/Kbd.cjs +1 -1
- package/dist/src/components/Kbd.cjs.map +1 -1
- package/dist/src/components/Kbd.d.mts +1 -2
- package/dist/src/components/Kbd.d.mts.map +1 -1
- package/dist/src/components/Kbd.mjs +1 -1
- package/dist/src/components/Kbd.mjs.map +1 -1
- package/dist/src/components/Label.cjs +1 -1
- package/dist/src/components/Label.cjs.map +1 -1
- package/dist/src/components/Label.d.mts +1 -1
- package/dist/src/components/Label.d.mts.map +1 -1
- package/dist/src/components/Label.mjs +1 -1
- package/dist/src/components/Label.mjs.map +1 -1
- package/dist/src/components/Markdown.cjs +2 -1
- package/dist/src/components/Markdown.cjs.map +1 -1
- package/dist/src/components/Markdown.d.mts +12 -3
- package/dist/src/components/Markdown.d.mts.map +1 -1
- package/dist/src/components/Markdown.mjs +2 -1
- package/dist/src/components/Markdown.mjs.map +1 -1
- package/dist/src/components/MediaPreview.cjs +1 -1
- package/dist/src/components/MediaPreview.cjs.map +1 -1
- package/dist/src/components/MediaPreview.d.mts +39 -3
- package/dist/src/components/MediaPreview.d.mts.map +1 -1
- package/dist/src/components/MediaPreview.mjs +1 -1
- package/dist/src/components/MediaPreview.mjs.map +1 -1
- package/dist/src/components/MermaidDiagram.cjs +2 -0
- package/dist/src/components/MermaidDiagram.cjs.map +1 -0
- package/dist/src/components/MermaidDiagram.mjs +2 -0
- package/dist/src/components/MermaidDiagram.mjs.map +1 -0
- package/dist/src/components/MessageItem.cjs +1 -1
- package/dist/src/components/MessageItem.cjs.map +1 -1
- package/dist/src/components/MessageItem.d.mts +48 -17
- package/dist/src/components/MessageItem.d.mts.map +1 -1
- package/dist/src/components/MessageItem.mjs +1 -1
- package/dist/src/components/MessageItem.mjs.map +1 -1
- package/dist/src/components/MessageLines.cjs +1 -1
- package/dist/src/components/MessageLines.cjs.map +1 -1
- package/dist/src/components/MessageLines.d.mts +5 -6
- package/dist/src/components/MessageLines.d.mts.map +1 -1
- package/dist/src/components/MessageLines.mjs +1 -1
- package/dist/src/components/MessageLines.mjs.map +1 -1
- package/dist/src/components/OptionList.cjs +1 -1
- package/dist/src/components/OptionList.cjs.map +1 -1
- package/dist/src/components/OptionList.d.mts +9 -10
- package/dist/src/components/OptionList.d.mts.map +1 -1
- package/dist/src/components/OptionList.mjs +1 -1
- package/dist/src/components/OptionList.mjs.map +1 -1
- package/dist/src/components/Panel.cjs +1 -1
- package/dist/src/components/Panel.cjs.map +1 -1
- package/dist/src/components/Panel.d.mts +4 -5
- package/dist/src/components/Panel.d.mts.map +1 -1
- package/dist/src/components/Panel.mjs +1 -1
- package/dist/src/components/Panel.mjs.map +1 -1
- package/dist/src/components/PdfPreview.cjs +2 -0
- package/dist/src/components/PdfPreview.cjs.map +1 -0
- package/dist/src/components/PdfPreview.d.mts +52 -0
- package/dist/src/components/PdfPreview.d.mts.map +1 -0
- package/dist/src/components/PdfPreview.mjs +2 -0
- package/dist/src/components/PdfPreview.mjs.map +1 -0
- package/dist/src/components/Popover.cjs +1 -1
- package/dist/src/components/Popover.cjs.map +1 -1
- package/dist/src/components/Popover.d.mts +8 -8
- package/dist/src/components/Popover.d.mts.map +1 -1
- package/dist/src/components/Popover.mjs +1 -1
- package/dist/src/components/Popover.mjs.map +1 -1
- package/dist/src/components/Progress.cjs +1 -1
- package/dist/src/components/Progress.cjs.map +1 -1
- package/dist/src/components/Progress.d.mts +1 -1
- package/dist/src/components/Progress.d.mts.map +1 -1
- package/dist/src/components/Progress.mjs +1 -1
- package/dist/src/components/Progress.mjs.map +1 -1
- package/dist/src/components/RadioGroup.cjs +1 -1
- package/dist/src/components/RadioGroup.cjs.map +1 -1
- package/dist/src/components/RadioGroup.d.mts +4 -4
- package/dist/src/components/RadioGroup.d.mts.map +1 -1
- package/dist/src/components/RadioGroup.mjs +1 -1
- package/dist/src/components/RadioGroup.mjs.map +1 -1
- package/dist/src/components/ScrollArea.cjs +1 -1
- package/dist/src/components/ScrollArea.cjs.map +1 -1
- package/dist/src/components/ScrollArea.d.mts +3 -3
- package/dist/src/components/ScrollArea.d.mts.map +1 -1
- package/dist/src/components/ScrollArea.mjs +1 -1
- package/dist/src/components/ScrollArea.mjs.map +1 -1
- package/dist/src/components/SectionLabel.cjs +1 -1
- package/dist/src/components/SectionLabel.cjs.map +1 -1
- package/dist/src/components/SectionLabel.d.mts +1 -2
- package/dist/src/components/SectionLabel.d.mts.map +1 -1
- package/dist/src/components/SectionLabel.mjs +1 -1
- package/dist/src/components/SectionLabel.mjs.map +1 -1
- package/dist/src/components/Select.cjs +1 -1
- package/dist/src/components/Select.cjs.map +1 -1
- package/dist/src/components/Select.d.mts +9 -9
- package/dist/src/components/Select.d.mts.map +1 -1
- package/dist/src/components/Select.mjs +1 -1
- package/dist/src/components/Select.mjs.map +1 -1
- package/dist/src/components/Separator.cjs +1 -1
- package/dist/src/components/Separator.cjs.map +1 -1
- package/dist/src/components/Separator.d.mts +1 -1
- package/dist/src/components/Separator.d.mts.map +1 -1
- package/dist/src/components/Separator.mjs +1 -1
- package/dist/src/components/Separator.mjs.map +1 -1
- package/dist/src/components/Sheet.cjs +2 -0
- package/dist/src/components/Sheet.cjs.map +1 -0
- package/dist/src/components/Sheet.d.mts +35 -0
- package/dist/src/components/Sheet.d.mts.map +1 -0
- package/dist/src/components/Sheet.mjs +2 -0
- package/dist/src/components/Sheet.mjs.map +1 -0
- package/dist/src/components/Skeleton.cjs +1 -1
- package/dist/src/components/Skeleton.cjs.map +1 -1
- package/dist/src/components/Skeleton.d.mts +1 -2
- package/dist/src/components/Skeleton.d.mts.map +1 -1
- package/dist/src/components/Skeleton.mjs +1 -1
- package/dist/src/components/Skeleton.mjs.map +1 -1
- package/dist/src/components/Spinner.cjs +1 -1
- package/dist/src/components/Spinner.cjs.map +1 -1
- package/dist/src/components/Spinner.d.mts +2 -3
- package/dist/src/components/Spinner.d.mts.map +1 -1
- package/dist/src/components/Spinner.mjs +1 -1
- package/dist/src/components/Spinner.mjs.map +1 -1
- package/dist/src/components/StatusBadge.cjs +1 -1
- package/dist/src/components/StatusBadge.cjs.map +1 -1
- package/dist/src/components/StatusBadge.d.mts +6 -7
- package/dist/src/components/StatusBadge.d.mts.map +1 -1
- package/dist/src/components/StatusBadge.mjs +1 -1
- package/dist/src/components/StatusBadge.mjs.map +1 -1
- package/dist/src/components/StreamCursor.cjs +1 -1
- package/dist/src/components/StreamCursor.cjs.map +1 -1
- package/dist/src/components/StreamCursor.d.mts +1 -2
- package/dist/src/components/StreamCursor.d.mts.map +1 -1
- package/dist/src/components/StreamCursor.mjs +1 -1
- package/dist/src/components/StreamCursor.mjs.map +1 -1
- package/dist/src/components/Switch.cjs +1 -1
- package/dist/src/components/Switch.cjs.map +1 -1
- package/dist/src/components/Switch.d.mts +1 -1
- package/dist/src/components/Switch.d.mts.map +1 -1
- package/dist/src/components/Switch.mjs +1 -1
- package/dist/src/components/Switch.mjs.map +1 -1
- package/dist/src/components/SyntaxText.cjs +4 -0
- package/dist/src/components/SyntaxText.cjs.map +1 -0
- package/dist/src/components/SyntaxText.d.mts +50 -0
- package/dist/src/components/SyntaxText.d.mts.map +1 -0
- package/dist/src/components/SyntaxText.mjs +4 -0
- package/dist/src/components/SyntaxText.mjs.map +1 -0
- package/dist/src/components/Tabs.cjs +1 -1
- package/dist/src/components/Tabs.cjs.map +1 -1
- package/dist/src/components/Tabs.d.mts +11 -11
- package/dist/src/components/Tabs.d.mts.map +1 -1
- package/dist/src/components/Tabs.mjs +1 -1
- package/dist/src/components/Tabs.mjs.map +1 -1
- package/dist/src/components/TerminalView.cjs +2 -0
- package/dist/src/components/TerminalView.cjs.map +1 -0
- package/dist/src/components/TerminalView.d.mts +31 -0
- package/dist/src/components/TerminalView.d.mts.map +1 -0
- package/dist/src/components/TerminalView.mjs +2 -0
- package/dist/src/components/TerminalView.mjs.map +1 -0
- package/dist/src/components/Textarea.cjs +1 -1
- package/dist/src/components/Textarea.cjs.map +1 -1
- package/dist/src/components/Textarea.d.mts +3 -4
- package/dist/src/components/Textarea.d.mts.map +1 -1
- package/dist/src/components/Textarea.mjs +1 -1
- package/dist/src/components/Textarea.mjs.map +1 -1
- package/dist/src/components/Toast.cjs +1 -1
- package/dist/src/components/Toast.cjs.map +1 -1
- package/dist/src/components/Toast.d.mts +11 -11
- package/dist/src/components/Toast.d.mts.map +1 -1
- package/dist/src/components/Toast.mjs +1 -1
- package/dist/src/components/Toast.mjs.map +1 -1
- package/dist/src/components/ToolPathLink.cjs +2 -0
- package/dist/src/components/ToolPathLink.cjs.map +1 -0
- package/dist/src/components/ToolPathLink.d.mts +22 -0
- package/dist/src/components/ToolPathLink.d.mts.map +1 -0
- package/dist/src/components/ToolPathLink.mjs +2 -0
- package/dist/src/components/ToolPathLink.mjs.map +1 -0
- package/dist/src/components/Tooltip.cjs +1 -1
- package/dist/src/components/Tooltip.cjs.map +1 -1
- package/dist/src/components/Tooltip.d.mts +5 -5
- package/dist/src/components/Tooltip.d.mts.map +1 -1
- package/dist/src/components/Tooltip.mjs +1 -1
- package/dist/src/components/Tooltip.mjs.map +1 -1
- package/dist/src/icons/icons.cjs +1 -1
- package/dist/src/icons/icons.d.mts +2 -2
- package/dist/src/icons/icons.mjs +1 -1
- package/dist/src/lib/ansiSpans.cjs +2 -0
- package/dist/src/lib/ansiSpans.cjs.map +1 -0
- package/dist/src/lib/ansiSpans.d.mts +42 -0
- package/dist/src/lib/ansiSpans.d.mts.map +1 -0
- package/dist/src/lib/ansiSpans.mjs +2 -0
- package/dist/src/lib/ansiSpans.mjs.map +1 -0
- package/dist/src/lib/cn.d.mts +1 -2
- package/dist/src/lib/cn.d.mts.map +1 -1
- package/dist/src/lib/collapse.d.mts +2 -3
- package/dist/src/lib/collapse.d.mts.map +1 -1
- package/dist/src/lib/editorController.cjs +2 -0
- package/dist/src/lib/editorController.cjs.map +1 -0
- package/dist/src/lib/editorController.mjs +2 -0
- package/dist/src/lib/editorController.mjs.map +1 -0
- package/dist/src/lib/editorLanguage.d.mts +2 -3
- package/dist/src/lib/editorLanguage.d.mts.map +1 -1
- package/dist/src/lib/editorTheme.cjs +1 -1
- package/dist/src/lib/editorTheme.cjs.map +1 -1
- package/dist/src/lib/editorTheme.d.mts +76 -0
- package/dist/src/lib/editorTheme.d.mts.map +1 -0
- package/dist/src/lib/editorTheme.mjs +1 -1
- package/dist/src/lib/editorTheme.mjs.map +1 -1
- package/dist/src/lib/fenceGrammar.cjs +2 -0
- package/dist/src/lib/fenceGrammar.cjs.map +1 -0
- package/dist/src/lib/fenceGrammar.mjs +2 -0
- package/dist/src/lib/fenceGrammar.mjs.map +1 -0
- package/dist/src/lib/hashlineHighlight.cjs +3 -0
- package/dist/src/lib/hashlineHighlight.cjs.map +1 -0
- package/dist/src/lib/hashlineHighlight.d.mts +30 -0
- package/dist/src/lib/hashlineHighlight.d.mts.map +1 -0
- package/dist/src/lib/hashlineHighlight.mjs +3 -0
- package/dist/src/lib/hashlineHighlight.mjs.map +1 -0
- package/dist/src/lib/hashlineView.cjs +6 -0
- package/dist/src/lib/hashlineView.cjs.map +1 -0
- package/dist/src/lib/hashlineView.d.mts +60 -0
- package/dist/src/lib/hashlineView.d.mts.map +1 -0
- package/dist/src/lib/hashlineView.mjs +6 -0
- package/dist/src/lib/hashlineView.mjs.map +1 -0
- package/dist/src/lib/media.cjs.map +1 -1
- package/dist/src/lib/media.d.mts +1 -2
- package/dist/src/lib/media.d.mts.map +1 -1
- package/dist/src/lib/media.mjs.map +1 -1
- package/dist/src/lib/mediaPlayback.cjs +2 -0
- package/dist/src/lib/mediaPlayback.cjs.map +1 -0
- package/dist/src/lib/mediaPlayback.mjs +2 -0
- package/dist/src/lib/mediaPlayback.mjs.map +1 -0
- package/dist/src/lib/mermaidDiagram.cjs +2 -0
- package/dist/src/lib/mermaidDiagram.cjs.map +1 -0
- package/dist/src/lib/mermaidDiagram.mjs +2 -0
- package/dist/src/lib/mermaidDiagram.mjs.map +1 -0
- package/dist/src/lib/optionList.d.mts +4 -5
- package/dist/src/lib/optionList.d.mts.map +1 -1
- package/dist/src/lib/syntaxHighlight.cjs +3 -0
- package/dist/src/lib/syntaxHighlight.cjs.map +1 -0
- package/dist/src/lib/syntaxHighlight.d.mts +54 -0
- package/dist/src/lib/syntaxHighlight.d.mts.map +1 -0
- package/dist/src/lib/syntaxHighlight.mjs +3 -0
- package/dist/src/lib/syntaxHighlight.mjs.map +1 -0
- package/dist/src/lib/tone.cjs.map +1 -1
- package/dist/src/lib/tone.d.mts +4 -5
- package/dist/src/lib/tone.d.mts.map +1 -1
- package/dist/src/lib/tone.mjs.map +1 -1
- package/dist/src/theme/apply.cjs.map +1 -1
- package/dist/src/theme/apply.d.mts +5 -6
- package/dist/src/theme/apply.d.mts.map +1 -1
- package/dist/src/theme/apply.mjs.map +1 -1
- package/dist/src/theme/builtinThemes.cjs.map +1 -1
- package/dist/src/theme/builtinThemes.d.mts +4 -5
- package/dist/src/theme/builtinThemes.d.mts.map +1 -1
- package/dist/src/theme/builtinThemes.mjs.map +1 -1
- package/dist/src/theme/derive.cjs.map +1 -1
- package/dist/src/theme/derive.d.mts +4 -5
- package/dist/src/theme/derive.d.mts.map +1 -1
- package/dist/src/theme/derive.mjs.map +1 -1
- package/dist/src/theme/parse.cjs.map +1 -1
- package/dist/src/theme/parse.d.mts +1 -2
- package/dist/src/theme/parse.d.mts.map +1 -1
- package/dist/src/theme/parse.mjs.map +1 -1
- package/dist/src/theme/piTheme.cjs.map +1 -1
- package/dist/src/theme/piTheme.d.mts +2 -3
- package/dist/src/theme/piTheme.d.mts.map +1 -1
- package/dist/src/theme/piTheme.mjs.map +1 -1
- package/dist/src/theme/preference.d.mts +4 -5
- package/dist/src/theme/preference.d.mts.map +1 -1
- package/dist/src/types/editor.cjs.map +1 -1
- package/dist/src/types/editor.d.mts +39 -5
- package/dist/src/types/editor.d.mts.map +1 -1
- package/dist/src/types/editor.mjs.map +1 -1
- package/dist/src/types/theme.d.mts +11 -12
- package/dist/src/types/theme.d.mts.map +1 -1
- package/dist/src/types/tone.d.mts +10 -11
- package/dist/src/types/tone.d.mts.map +1 -1
- package/package.json +21 -17
- package/styles/preview.css +17 -0
- package/styles/tokens.css +72 -0
- package/dist/components/Accordion.d.cts +0 -11
- package/dist/components/Accordion.d.cts.map +0 -1
- package/dist/components/Avatar.d.cts +0 -10
- package/dist/components/Avatar.d.cts.map +0 -1
- package/dist/components/Badge.d.cts +0 -18
- package/dist/components/Badge.d.cts.map +0 -1
- package/dist/components/Breadcrumb.d.cts +0 -37
- package/dist/components/Breadcrumb.d.cts.map +0 -1
- package/dist/components/Button.d.cts +0 -25
- package/dist/components/Button.d.cts.map +0 -1
- package/dist/components/Checkbox.d.cts +0 -8
- package/dist/components/Checkbox.d.cts.map +0 -1
- package/dist/components/CodeEditor.d.cts +0 -6
- package/dist/components/CodeEditor.d.cts.map +0 -1
- package/dist/components/Collapsible.d.cts +0 -10
- package/dist/components/Collapsible.d.cts.map +0 -1
- package/dist/components/Command.d.cts +0 -42
- package/dist/components/Command.d.cts.map +0 -1
- package/dist/components/Dialog.d.cts +0 -39
- package/dist/components/Dialog.d.cts.map +0 -1
- package/dist/components/Dot.d.cts +0 -16
- package/dist/components/Dot.d.cts.map +0 -1
- package/dist/components/DropdownMenu.d.cts +0 -34
- package/dist/components/DropdownMenu.d.cts.map +0 -1
- package/dist/components/EmptyState.d.cts +0 -18
- package/dist/components/EmptyState.d.cts.map +0 -1
- package/dist/components/Input.d.cts +0 -20
- package/dist/components/Input.d.cts.map +0 -1
- package/dist/components/Kbd.d.cts +0 -7
- package/dist/components/Kbd.d.cts.map +0 -1
- package/dist/components/Label.d.cts +0 -8
- package/dist/components/Label.d.cts.map +0 -1
- package/dist/components/Markdown.d.cts +0 -8
- package/dist/components/Markdown.d.cts.map +0 -1
- package/dist/components/MediaPreview.d.cts +0 -25
- package/dist/components/MediaPreview.d.cts.map +0 -1
- package/dist/components/MessageItem.d.cts +0 -71
- package/dist/components/MessageItem.d.cts.map +0 -1
- package/dist/components/MessageLines.d.cts +0 -24
- package/dist/components/MessageLines.d.cts.map +0 -1
- package/dist/components/OptionList.d.cts +0 -50
- package/dist/components/OptionList.d.cts.map +0 -1
- package/dist/components/Panel.d.cts +0 -15
- package/dist/components/Panel.d.cts.map +0 -1
- package/dist/components/Popover.d.cts +0 -19
- package/dist/components/Popover.d.cts.map +0 -1
- package/dist/components/Progress.d.cts +0 -8
- package/dist/components/Progress.d.cts.map +0 -1
- package/dist/components/RadioGroup.d.cts +0 -15
- package/dist/components/RadioGroup.d.cts.map +0 -1
- package/dist/components/ScrollArea.d.cts +0 -13
- package/dist/components/ScrollArea.d.cts.map +0 -1
- package/dist/components/SectionLabel.d.cts +0 -7
- package/dist/components/SectionLabel.d.cts.map +0 -1
- package/dist/components/Select.d.cts +0 -19
- package/dist/components/Select.d.cts.map +0 -1
- package/dist/components/Separator.d.cts +0 -13
- package/dist/components/Separator.d.cts.map +0 -1
- package/dist/components/Skeleton.d.cts +0 -11
- package/dist/components/Skeleton.d.cts.map +0 -1
- package/dist/components/Spinner.d.cts +0 -15
- package/dist/components/Spinner.d.cts.map +0 -1
- package/dist/components/StatusBadge.d.cts +0 -24
- package/dist/components/StatusBadge.d.cts.map +0 -1
- package/dist/components/StreamCursor.d.cts +0 -7
- package/dist/components/StreamCursor.d.cts.map +0 -1
- package/dist/components/Switch.d.cts +0 -8
- package/dist/components/Switch.d.cts.map +0 -1
- package/dist/components/Tabs.d.cts +0 -36
- package/dist/components/Tabs.d.cts.map +0 -1
- package/dist/components/Textarea.d.cts +0 -10
- package/dist/components/Textarea.d.cts.map +0 -1
- package/dist/components/Toast.d.cts +0 -24
- package/dist/components/Toast.d.cts.map +0 -1
- package/dist/components/Tooltip.d.cts +0 -11
- package/dist/components/Tooltip.d.cts.map +0 -1
- package/dist/icons/icons.d.cts +0 -2
- package/dist/index.d.cts +0 -48
- package/dist/lib/cn.d.cts +0 -7
- package/dist/lib/cn.d.cts.map +0 -1
- package/dist/lib/collapse.d.cts +0 -15
- package/dist/lib/collapse.d.cts.map +0 -1
- package/dist/lib/editorLanguage.d.cts +0 -22
- package/dist/lib/editorLanguage.d.cts.map +0 -1
- package/dist/lib/media.d.cts +0 -12
- package/dist/lib/media.d.cts.map +0 -1
- package/dist/lib/optionList.d.cts +0 -22
- package/dist/lib/optionList.d.cts.map +0 -1
- package/dist/lib/tone.d.cts +0 -26
- package/dist/lib/tone.d.cts.map +0 -1
- package/dist/theme/apply.d.cts +0 -26
- package/dist/theme/apply.d.cts.map +0 -1
- package/dist/theme/builtinThemes.d.cts +0 -12
- package/dist/theme/builtinThemes.d.cts.map +0 -1
- package/dist/theme/derive.d.cts +0 -15
- package/dist/theme/derive.d.cts.map +0 -1
- package/dist/theme/parse.d.cts +0 -11
- package/dist/theme/parse.d.cts.map +0 -1
- package/dist/theme/piTheme.d.cts +0 -20
- package/dist/theme/piTheme.d.cts.map +0 -1
- package/dist/theme/preference.d.cts +0 -16
- package/dist/theme/preference.d.cts.map +0 -1
- package/dist/theme.d.cts +0 -8
- package/dist/types/editor.d.cts +0 -44
- package/dist/types/editor.d.cts.map +0 -1
- package/dist/types/theme.d.cts +0 -39
- package/dist/types/theme.d.cts.map +0 -1
- package/dist/types/tone.d.cts +0 -29
- package/dist/types/tone.d.cts.map +0 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { GrammarKey } from "../lib/editorLanguage.mjs";
|
|
2
|
+
import { SyntaxLines, SyntaxSpan } from "../lib/syntaxHighlight.mjs";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
//#region src/components/SyntaxText.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Read-only code with the editor's colours.
|
|
7
|
+
*
|
|
8
|
+
* Two shapes over one hook, because the cards need both: `SyntaxText` for a
|
|
9
|
+
* block of code that owns its own element, and `SyntaxLine` for a card that
|
|
10
|
+
* already renders a line at a time next to a gutter. Highlighting is
|
|
11
|
+
* asynchronous, so both show the plain text first and swap in spans once the
|
|
12
|
+
* grammar has loaded; a result that never highlights simply stays plain.
|
|
13
|
+
*
|
|
14
|
+
* DESIGN PATTERNS:
|
|
15
|
+
* - Plain text is the fallback, never a spinner: colour is decoration.
|
|
16
|
+
* - The hook keys on the text, so a streaming result re-highlights as it grows.
|
|
17
|
+
*
|
|
18
|
+
* AVOID:
|
|
19
|
+
* - Highlighting one line at a time. A line is not a parse unit; pass the whole
|
|
20
|
+
* block to `useSyntaxLines` and render the line you want out of the result.
|
|
21
|
+
*/
|
|
22
|
+
export interface SyntaxQuery {
|
|
23
|
+
/** The file the code came from, when the tool knows one. */
|
|
24
|
+
path?: string | undefined;
|
|
25
|
+
/** Skips detection when the caller already knows the grammar. */
|
|
26
|
+
grammar?: GrammarKey | undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Colours `text`, or hands back undefined while that is still loading and for
|
|
30
|
+
* anything with no grammar. Rendering the result is the caller's business.
|
|
31
|
+
*
|
|
32
|
+
* The finished spans are stored with the text they belong to, so text that has
|
|
33
|
+
* changed since reads as plain during render rather than showing the previous
|
|
34
|
+
* result's colours over the new lines.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useSyntaxLines(text: string, query?: SyntaxQuery): SyntaxLines | undefined;
|
|
37
|
+
export interface SyntaxLineProps extends Omit<ComponentProps<'span'>, 'children'> {
|
|
38
|
+
/** The line's spans from `useSyntaxLines`, or undefined to show `text` plain. */
|
|
39
|
+
spans?: readonly SyntaxSpan[] | undefined;
|
|
40
|
+
text: string;
|
|
41
|
+
}
|
|
42
|
+
/** One line: coloured when its spans are in, the plain text until then. */
|
|
43
|
+
export declare function SyntaxLine({ spans, text, ...props }: SyntaxLineProps): import("react").JSX.Element;
|
|
44
|
+
export interface SyntaxTextProps extends Omit<ComponentProps<'pre'>, 'children'>, SyntaxQuery {
|
|
45
|
+
text: string;
|
|
46
|
+
}
|
|
47
|
+
/** A block of code, wrapped rather than clipped, coloured when a grammar is known. */
|
|
48
|
+
export declare function SyntaxText({ className, text, path, grammar, ...props }: SyntaxTextProps): import("react").JSX.Element;
|
|
49
|
+
//#endregion
|
|
50
|
+
//# sourceMappingURL=SyntaxText.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyntaxText.d.mts","names":[],"sources":["../../../src/components/SyntaxText.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBA8BiB;;EAEf;;EAEA,UAAU;;;;;;;;;;wBAWI,eAAe,cAAc,QAAO,cAAmB;iBAyBtD,wBAAwB,KAAK;;EAE5C,iBAAiB;EACjB;;;wBAIc,aAAa,OAAO,SAAS,SAAS,kCAAe,IAAA;iBAapD,wBAAwB,KAAK,oCAAoC;EAChF;;;wBAIc,aAAa,WAAW,MAAM,MAAM,YAAY,SAAS,kCAAe,IAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{detectGrammar as t,highlightToLines as n,syntaxStyleOf as r}from"../lib/syntaxHighlight.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{Fragment as o,useEffect as s,useState as c}from"react";function l(e,r={}){let{path:i,grammar:a}=r,o=a??t({path:i,text:e}),l=`${o??``}\u0000${e}`,[u,d]=c(void 0);return s(()=>{if(o===void 0)return;let t=!0;return n(e,o).then(e=>{t&&e!==void 0&&d({signature:l,lines:e})},()=>void 0),()=>{t=!1}},[e,o,l]),u?.signature===l?u.lines:void 0}function u({spans:e,text:t,...n}){return e===void 0?/* @__PURE__ */ i(`span`,{...n,children:t}):/* @__PURE__ */ i(`span`,{...n,children:e.map((e,t)=>/* @__PURE__ */ i(`span`,{style:r(e.token),children:e.text},t))})}function d({className:t,text:n,path:r,grammar:s,...c}){let d=l(n,{path:r,grammar:s}),f=n.split(`
|
|
2
|
+
`);return/* @__PURE__ */ i(`pre`,{"data-slot":`syntax-text`,"data-highlighted":d!==void 0,className:e(`whitespace-pre-wrap break-words [overflow-wrap:anywhere] font-mono`,t),...c,children:(d??f).map((e,t)=>/* @__PURE__ */ a(o,{children:[t>0?`
|
|
3
|
+
`:null,/* @__PURE__ */ i(u,{spans:typeof e==`string`?void 0:e,text:typeof e==`string`?e:``})]},t))})}export{u as SyntaxLine,d as SyntaxText,l as useSyntaxLines};
|
|
4
|
+
//# sourceMappingURL=SyntaxText.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyntaxText.mjs","names":["Fragment"],"sources":["../../../src/components/SyntaxText.tsx"],"sourcesContent":["import { type ComponentProps, Fragment, useEffect, useState } from 'react';\n\nimport { cn } from '../lib/cn';\nimport type { GrammarKey } from '../lib/editorLanguage';\nimport {\n detectGrammar,\n highlightToLines,\n type SyntaxLines,\n type SyntaxSpan,\n syntaxStyleOf,\n} from '../lib/syntaxHighlight';\n\n/**\n * Read-only code with the editor's colours.\n *\n * Two shapes over one hook, because the cards need both: `SyntaxText` for a\n * block of code that owns its own element, and `SyntaxLine` for a card that\n * already renders a line at a time next to a gutter. Highlighting is\n * asynchronous, so both show the plain text first and swap in spans once the\n * grammar has loaded; a result that never highlights simply stays plain.\n *\n * DESIGN PATTERNS:\n * - Plain text is the fallback, never a spinner: colour is decoration.\n * - The hook keys on the text, so a streaming result re-highlights as it grows.\n *\n * AVOID:\n * - Highlighting one line at a time. A line is not a parse unit; pass the whole\n * block to `useSyntaxLines` and render the line you want out of the result.\n */\n\nexport interface SyntaxQuery {\n /** The file the code came from, when the tool knows one. */\n path?: string | undefined;\n /** Skips detection when the caller already knows the grammar. */\n grammar?: GrammarKey | undefined;\n}\n\n/**\n * Colours `text`, or hands back undefined while that is still loading and for\n * anything with no grammar. Rendering the result is the caller's business.\n *\n * The finished spans are stored with the text they belong to, so text that has\n * changed since reads as plain during render rather than showing the previous\n * result's colours over the new lines.\n */\nexport function useSyntaxLines(text: string, query: SyntaxQuery = {}): SyntaxLines | undefined {\n const { path, grammar } = query;\n const key = grammar ?? detectGrammar({ path, text });\n const signature = `${key ?? ''}\\u0000${text}`;\n const [done, setDone] = useState<{ signature: string; lines: SyntaxLines } | undefined>(undefined);\n\n useEffect(() => {\n if (key === undefined) return;\n let live = true;\n void highlightToLines(text, key).then(\n (result) => {\n if (live && result !== undefined) setDone({ signature, lines: result });\n },\n // A grammar chunk that fails to load leaves the plain text in place: the\n // card stays readable and the network failure is the browser's to report.\n () => undefined,\n );\n return () => {\n live = false;\n };\n }, [text, key, signature]);\n\n return done?.signature === signature ? done.lines : undefined;\n}\n\nexport interface SyntaxLineProps extends Omit<ComponentProps<'span'>, 'children'> {\n /** The line's spans from `useSyntaxLines`, or undefined to show `text` plain. */\n spans?: readonly SyntaxSpan[] | undefined;\n text: string;\n}\n\n/** One line: coloured when its spans are in, the plain text until then. */\nexport function SyntaxLine({ spans, text, ...props }: SyntaxLineProps) {\n if (spans === undefined) return <span {...props}>{text}</span>;\n return (\n <span {...props}>\n {spans.map((span, index) => (\n <span key={index} style={syntaxStyleOf(span.token)}>\n {span.text}\n </span>\n ))}\n </span>\n );\n}\n\nexport interface SyntaxTextProps extends Omit<ComponentProps<'pre'>, 'children'>, SyntaxQuery {\n text: string;\n}\n\n/** A block of code, wrapped rather than clipped, coloured when a grammar is known. */\nexport function SyntaxText({ className, text, path, grammar, ...props }: SyntaxTextProps) {\n const lines = useSyntaxLines(text, { path, grammar });\n const plain = text.split('\\n');\n return (\n <pre\n data-slot=\"syntax-text\"\n data-highlighted={lines !== undefined}\n className={cn('whitespace-pre-wrap break-words [overflow-wrap:anywhere] font-mono', className)}\n {...props}\n >\n {(lines ?? plain).map((entry, index) => (\n <Fragment key={index}>\n {index > 0 ? '\\n' : null}\n <SyntaxLine\n spans={typeof entry === 'string' ? undefined : entry}\n text={typeof entry === 'string' ? entry : ''}\n />\n </Fragment>\n ))}\n </pre>\n );\n}\n"],"mappings":"uPA6CA,SAAgB,EAAe,EAAc,EAAqB,CAAC,EAA4B,CAC7F,GAAM,CAAE,OAAM,WAAY,EACpB,EAAM,GAAW,EAAc,CAAE,OAAM,MAAK,CAAC,EAC7C,EAAY,GAAG,GAAO,GAAG,QAAQ,IACjC,CAAC,EAAM,GAAW,EAAgE,IAAA,EAAS,EAkBjG,OAhBA,MAAgB,CACd,GAAI,IAAQ,IAAA,GAAW,OACvB,IAAI,EAAO,GASX,OARA,EAAsB,EAAM,CAAG,CAAC,CAAC,KAC9B,GAAW,CACN,GAAQ,IAAW,IAAA,IAAW,EAAQ,CAAE,YAAW,MAAO,CAAO,CAAC,CACxE,MAGM,IAAA,EACR,MACa,CACX,EAAO,EACT,CACF,EAAG,CAAC,EAAM,EAAK,CAAS,CAAC,EAElB,GAAM,YAAc,EAAY,EAAK,MAAQ,IAAA,EACtD,CASA,SAAgB,EAAW,CAAE,QAAO,OAAM,GAAG,GAA0B,CAErE,OADI,IAAU,IAAA,GAAkB,kBAAC,OAAD,CAAM,GAAI,EAAQ,SAAA,CAAW,CAAA,EAE3D,kBAAC,OAAD,CAAM,GAAI,EACP,SAAA,EAAM,KAAK,EAAM,IAChB,kBAAC,OAAD,CAAkB,MAAO,EAAc,EAAK,KAAK,EAC9C,SAAA,EAAK,IACF,EAFK,CAEL,CACP,CACG,CAAA,CAEV,CAOA,SAAgB,EAAW,CAAE,YAAW,OAAM,OAAM,UAAS,GAAG,GAA0B,CACxF,IAAM,EAAQ,EAAe,EAAM,CAAE,OAAM,SAAQ,CAAC,EAC9C,EAAQ,EAAK,MAAM;CAAI,EAC7B,MACE,kBAAC,MAAD,CACE,YAAU,cACV,mBAAkB,IAAU,IAAA,GAC5B,UAAW,EAAG,qEAAsE,CAAS,EAC7F,GAAI,EAEF,UAAA,GAAS,EAAA,CAAO,KAAK,EAAO,IAC5B,kBAACA,EAAD,CAAA,SAAA,CACG,EAAQ,EAAI;EAAO,KACpB,kBAAC,EAAD,CACE,MAAO,OAAO,GAAU,SAAW,IAAA,GAAY,EAC/C,KAAM,OAAO,GAAU,SAAW,EAAQ,EAC3C,CAAA,CACO,CAAA,EANK,CAML,CACX,CACE,CAAA,CAET"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime"),r=require("class-variance-authority");const i=(0,r.cva)(`flex cursor-pointer items-center gap-1.5 rounded px-2 py-1 text-
|
|
1
|
+
const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime"),r=require("class-variance-authority");const i=(0,r.cva)(`flex cursor-pointer items-center gap-1.5 rounded px-2 py-1 text-xs transition-colors outline-none`,{variants:{active:{true:`bg-doom-tint-blue font-bold text-doom-blue`,false:`text-doom-dim hover:bg-doom-panel hover:text-doom-hi`}},defaultVariants:{active:!1}}),a=(0,r.cva)(`flex h-[15px] min-w-[15px] items-center justify-center rounded-full px-1 text-2xs font-bold`,{variants:{active:{true:`bg-doom-blue text-doom-rail`,false:`bg-doom-panel text-doom-dim`}},defaultVariants:{active:!1}});function o({className:r,active:a,asChild:o=!1,...s}){let c=o?t.Slot.Root:`a`;return/* @__PURE__ */ (0,n.jsx)(c,{"data-slot":`nav-tab`,"data-active":a??!1,className:e.cn(i({active:a}),r),...s})}function s({className:t,active:r,...i}){return/* @__PURE__ */ (0,n.jsx)(`span`,{"data-slot":`nav-tab-badge`,className:e.cn(a({active:r}),t),...i})}function c(e){return/* @__PURE__ */ (0,n.jsx)(t.Tabs.Root,{"data-slot":`tabs`,...e})}function l({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Tabs.List,{"data-slot":`tabs-list`,className:e.cn(`flex items-center gap-1`,r),...i})}function u({className:r,...a}){return/* @__PURE__ */ (0,n.jsx)(t.Tabs.Trigger,{"data-slot":`tabs-trigger`,className:e.cn(i({active:!1}),`data-[state=active]:bg-doom-tint-blue data-[state=active]:font-bold data-[state=active]:text-doom-blue`,r),...a})}function d({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Tabs.Content,{"data-slot":`tabs-content`,className:e.cn(`min-h-0 flex-1`,r),...i})}exports.NavTab=o,exports.NavTabBadge=s,exports.Tabs=c,exports.TabsContent=d,exports.TabsList=l,exports.TabsTrigger=u,exports.tabBadgeVariants=a,exports.tabVariants=i;
|
|
2
2
|
//# sourceMappingURL=Tabs.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.cjs","names":["cva","Slot","cn","TabsPrimitive"],"sources":["../../../src/components/Tabs.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\nimport { cn } from '../lib/cn
|
|
1
|
+
{"version":3,"file":"Tabs.cjs","names":["cva","Slot","cn","TabsPrimitive"],"sources":["../../../src/components/Tabs.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/**\n * The look a tab wears, whether Radix drives it or a router link does. It is\n * exported because the cockpit's own tabs navigate routes rather than swap\n * panels, and a link that looks like a tab must not be a second implementation.\n */\nexport const tabVariants = cva(\n 'flex cursor-pointer items-center gap-1.5 rounded px-2 py-1 text-xs transition-colors outline-none',\n {\n variants: {\n active: {\n true: 'bg-doom-tint-blue font-bold text-doom-blue',\n false: 'text-doom-dim hover:bg-doom-panel hover:text-doom-hi',\n },\n },\n defaultVariants: { active: false },\n },\n);\n\n/** The count a tab carries; it inverts on the active tab so it stays readable on the tint. */\nexport const tabBadgeVariants = cva(\n 'flex h-[15px] min-w-[15px] items-center justify-center rounded-full px-1 text-2xs font-bold',\n {\n variants: {\n active: { true: 'bg-doom-blue text-doom-rail', false: 'bg-doom-panel text-doom-dim' },\n },\n defaultVariants: { active: false },\n },\n);\n\nexport interface NavTabProps extends ComponentProps<'a'>, VariantProps<typeof tabVariants> {\n /** Render the child element instead of an <a>, so a router Link can be the tab. */\n asChild?: boolean;\n}\n\n/**\n * A tab that navigates. Radix Tabs owns panels and roving focus over content\n * it renders; a route-driven tab strip has neither, so it gets the styling and\n * leaves the semantics to the router.\n */\nexport function NavTab({ className, active, asChild = false, ...props }: NavTabProps) {\n const Component = asChild ? Slot.Root : 'a';\n return (\n <Component\n data-slot=\"nav-tab\"\n data-active={active ?? false}\n className={cn(tabVariants({ active }), className)}\n {...props}\n />\n );\n}\n\n/** The count beside a tab's label. */\nexport function NavTabBadge({\n className,\n active,\n ...props\n}: ComponentProps<'span'> & VariantProps<typeof tabBadgeVariants>) {\n return <span data-slot=\"nav-tab-badge\" className={cn(tabBadgeVariants({ active }), className)} {...props} />;\n}\n\n/** Radix Tabs, for a surface that swaps panels in place rather than navigating. */\nexport function Tabs(props: ComponentProps<typeof TabsPrimitive.Root>) {\n return <TabsPrimitive.Root data-slot=\"tabs\" {...props} />;\n}\n\nexport function TabsList({ className, ...props }: ComponentProps<typeof TabsPrimitive.List>) {\n return <TabsPrimitive.List data-slot=\"tabs-list\" className={cn('flex items-center gap-1', className)} {...props} />;\n}\n\nexport function TabsTrigger({ className, ...props }: ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n tabVariants({ active: false }),\n 'data-[state=active]:bg-doom-tint-blue data-[state=active]:font-bold data-[state=active]:text-doom-blue',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function TabsContent({ className, ...props }: ComponentProps<typeof TabsPrimitive.Content>) {\n return <TabsPrimitive.Content data-slot=\"tabs-content\" className={cn('min-h-0 flex-1', className)} {...props} />;\n}\n"],"mappings":"gIAYA,MAAa,GAAA,EAAcA,EAAAA,IAAAA,CACzB,oGACA,CACE,SAAU,CACR,OAAQ,CACN,KAAM,6CACN,MAAO,sDACT,CACF,EACA,gBAAiB,CAAE,OAAQ,EAAM,CACnC,CACF,EAGa,GAAA,EAAmBA,EAAAA,IAAAA,CAC9B,8FACA,CACE,SAAU,CACR,OAAQ,CAAE,KAAM,8BAA+B,MAAO,6BAA8B,CACtF,EACA,gBAAiB,CAAE,OAAQ,EAAM,CACnC,CACF,EAYA,SAAgB,EAAO,CAAE,YAAW,SAAQ,UAAU,GAAO,GAAG,GAAsB,CACpF,IAAM,EAAY,EAAUC,EAAAA,KAAK,KAAO,IACxC,MACE,iBAAA,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,YAAU,UACV,cAAa,GAAU,GACvB,UAAWC,EAAAA,GAAG,EAAY,CAAE,QAAO,CAAC,EAAG,CAAS,EAChD,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAY,CAC1B,YACA,SACA,GAAG,GAC8D,CACjE,MAAO,iBAAA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,YAAU,gBAAgB,UAAWA,EAAAA,GAAG,EAAiB,CAAE,QAAO,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CAC7G,CAGA,SAAgB,EAAK,EAAkD,CACrE,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,KAAc,KAAf,CAAoB,YAAU,OAAO,GAAI,CAAQ,CAAA,CAC1D,CAEA,SAAgB,EAAS,CAAE,YAAW,GAAG,GAAoD,CAC3F,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,KAAc,KAAf,CAAoB,YAAU,YAAY,UAAWD,EAAAA,GAAG,0BAA2B,CAAS,EAAG,GAAI,CAAQ,CAAA,CACpH,CAEA,SAAgB,EAAY,CAAE,YAAW,GAAG,GAAuD,CACjG,MACE,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,KAAc,QAAf,CACE,YAAU,eACV,UAAWD,EAAAA,GACT,EAAY,CAAE,OAAQ,EAAM,CAAC,EAC7B,yGACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAY,CAAE,YAAW,GAAG,GAAuD,CACjG,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,KAAc,QAAf,CAAuB,YAAU,eAAe,UAAWD,EAAAA,GAAG,iBAAkB,CAAS,EAAG,GAAI,CAAQ,CAAA,CACjH"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Tabs } from "radix-ui";
|
|
2
|
-
import { VariantProps } from "class-variance-authority";
|
|
3
2
|
import { ComponentProps } from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
//#region src/components/Tabs.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* The look a tab wears, whether Radix drives it or a router link does. It is
|
|
7
7
|
* exported because the cockpit's own tabs navigate routes rather than swap
|
|
8
8
|
* panels, and a link that looks like a tab must not be a second implementation.
|
|
9
9
|
*/
|
|
10
|
-
declare const tabVariants: (props?: ({
|
|
10
|
+
export declare const tabVariants: (props?: ({
|
|
11
11
|
active?: boolean | null | undefined;
|
|
12
12
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
13
|
/** The count a tab carries; it inverts on the active tab so it stays readable on the tint. */
|
|
14
|
-
declare const tabBadgeVariants: (props?: ({
|
|
14
|
+
export declare const tabBadgeVariants: (props?: ({
|
|
15
15
|
active?: boolean | null | undefined;
|
|
16
16
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
17
|
-
interface NavTabProps extends ComponentProps<'a'>, VariantProps<typeof tabVariants> {
|
|
17
|
+
export interface NavTabProps extends ComponentProps<'a'>, VariantProps<typeof tabVariants> {
|
|
18
18
|
/** Render the child element instead of an <a>, so a router Link can be the tab. */
|
|
19
19
|
asChild?: boolean;
|
|
20
20
|
}
|
|
@@ -23,14 +23,14 @@ interface NavTabProps extends ComponentProps<'a'>, VariantProps<typeof tabVarian
|
|
|
23
23
|
* it renders; a route-driven tab strip has neither, so it gets the styling and
|
|
24
24
|
* leaves the semantics to the router.
|
|
25
25
|
*/
|
|
26
|
-
declare function NavTab({ className, active, asChild, ...props }: NavTabProps): import("react
|
|
26
|
+
export declare function NavTab({ className, active, asChild, ...props }: NavTabProps): import("react").JSX.Element;
|
|
27
27
|
/** The count beside a tab's label. */
|
|
28
|
-
declare function NavTabBadge({ className, active, ...props }: ComponentProps<'span'> & VariantProps<typeof tabBadgeVariants>): import("react
|
|
28
|
+
export declare function NavTabBadge({ className, active, ...props }: ComponentProps<'span'> & VariantProps<typeof tabBadgeVariants>): import("react").JSX.Element;
|
|
29
29
|
/** Radix Tabs, for a surface that swaps panels in place rather than navigating. */
|
|
30
|
-
declare function Tabs$1(props: ComponentProps<typeof Tabs.Root>): import("react
|
|
31
|
-
declare function TabsList({ className, ...props }: ComponentProps<typeof Tabs.List>): import("react
|
|
32
|
-
declare function TabsTrigger({ className, ...props }: ComponentProps<typeof Tabs.Trigger>): import("react
|
|
33
|
-
declare function TabsContent({ className, ...props }: ComponentProps<typeof Tabs.Content>): import("react
|
|
30
|
+
declare function Tabs$1(props: ComponentProps<typeof Tabs.Root>): import("react").JSX.Element;
|
|
31
|
+
export declare function TabsList({ className, ...props }: ComponentProps<typeof Tabs.List>): import("react").JSX.Element;
|
|
32
|
+
export declare function TabsTrigger({ className, ...props }: ComponentProps<typeof Tabs.Trigger>): import("react").JSX.Element;
|
|
33
|
+
export declare function TabsContent({ className, ...props }: ComponentProps<typeof Tabs.Content>): import("react").JSX.Element;
|
|
34
34
|
//#endregion
|
|
35
|
-
export {
|
|
35
|
+
export { Tabs$1 as Tabs };
|
|
36
36
|
//# sourceMappingURL=Tabs.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.mts","names":[],"sources":["../../../src/components/Tabs.tsx"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Tabs.d.mts","names":[],"sources":["../../../src/components/Tabs.tsx"],"mappings":";;;;;;;;;qBAYa,cAAW;;6CAWvB;;qBAGY,mBAAgB;;6CAQ5B;iBAEgB,oBAAoB,qBAAqB,oBAAoB;;EAE5E;;;;;;;wBAQc,SAAS,WAAW,QAAQ,YAAoB,SAAS,8BAAW,IAAA;;wBAapE,cACd,WACA,WACG,SACF,yBAAyB,oBAAoB,oCAAiB,IAAA;;iBAKjD,OAAK,OAAO,sBAAsB,KAAc,wBAAK,IAAA;wBAIrD,WAAW,cAAc,SAAS,sBAAsB,KAAc,wBAAK,IAAA;wBAI3E,cAAc,cAAc,SAAS,sBAAsB,KAAc,2BAAQ,IAAA;wBAcjF,cAAc,cAAc,SAAS,sBAAsB,KAAc,2BAAQ,IAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as e}from"../lib/cn.mjs";import{Slot as t,Tabs as n}from"radix-ui";import{jsx as r}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";const a=i(`flex cursor-pointer items-center gap-1.5 rounded px-2 py-1 text-
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{Slot as t,Tabs as n}from"radix-ui";import{jsx as r}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";const a=i(`flex cursor-pointer items-center gap-1.5 rounded px-2 py-1 text-xs transition-colors outline-none`,{variants:{active:{true:`bg-doom-tint-blue font-bold text-doom-blue`,false:`text-doom-dim hover:bg-doom-panel hover:text-doom-hi`}},defaultVariants:{active:!1}}),o=i(`flex h-[15px] min-w-[15px] items-center justify-center rounded-full px-1 text-2xs font-bold`,{variants:{active:{true:`bg-doom-blue text-doom-rail`,false:`bg-doom-panel text-doom-dim`}},defaultVariants:{active:!1}});function s({className:n,active:i,asChild:o=!1,...s}){let c=o?t.Root:`a`;return/* @__PURE__ */ r(c,{"data-slot":`nav-tab`,"data-active":i??!1,className:e(a({active:i}),n),...s})}function c({className:t,active:n,...i}){return/* @__PURE__ */ r(`span`,{"data-slot":`nav-tab-badge`,className:e(o({active:n}),t),...i})}function l(e){return/* @__PURE__ */ r(n.Root,{"data-slot":`tabs`,...e})}function u({className:t,...i}){return/* @__PURE__ */ r(n.List,{"data-slot":`tabs-list`,className:e(`flex items-center gap-1`,t),...i})}function d({className:t,...i}){return/* @__PURE__ */ r(n.Trigger,{"data-slot":`tabs-trigger`,className:e(a({active:!1}),`data-[state=active]:bg-doom-tint-blue data-[state=active]:font-bold data-[state=active]:text-doom-blue`,t),...i})}function f({className:t,...i}){return/* @__PURE__ */ r(n.Content,{"data-slot":`tabs-content`,className:e(`min-h-0 flex-1`,t),...i})}export{s as NavTab,c as NavTabBadge,l as Tabs,f as TabsContent,u as TabsList,d as TabsTrigger,o as tabBadgeVariants,a as tabVariants};
|
|
2
2
|
//# sourceMappingURL=Tabs.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.mjs","names":["Tabs","TabsPrimitive"],"sources":["../../../src/components/Tabs.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\nimport { cn } from '../lib/cn
|
|
1
|
+
{"version":3,"file":"Tabs.mjs","names":["Tabs","TabsPrimitive"],"sources":["../../../src/components/Tabs.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/**\n * The look a tab wears, whether Radix drives it or a router link does. It is\n * exported because the cockpit's own tabs navigate routes rather than swap\n * panels, and a link that looks like a tab must not be a second implementation.\n */\nexport const tabVariants = cva(\n 'flex cursor-pointer items-center gap-1.5 rounded px-2 py-1 text-xs transition-colors outline-none',\n {\n variants: {\n active: {\n true: 'bg-doom-tint-blue font-bold text-doom-blue',\n false: 'text-doom-dim hover:bg-doom-panel hover:text-doom-hi',\n },\n },\n defaultVariants: { active: false },\n },\n);\n\n/** The count a tab carries; it inverts on the active tab so it stays readable on the tint. */\nexport const tabBadgeVariants = cva(\n 'flex h-[15px] min-w-[15px] items-center justify-center rounded-full px-1 text-2xs font-bold',\n {\n variants: {\n active: { true: 'bg-doom-blue text-doom-rail', false: 'bg-doom-panel text-doom-dim' },\n },\n defaultVariants: { active: false },\n },\n);\n\nexport interface NavTabProps extends ComponentProps<'a'>, VariantProps<typeof tabVariants> {\n /** Render the child element instead of an <a>, so a router Link can be the tab. */\n asChild?: boolean;\n}\n\n/**\n * A tab that navigates. Radix Tabs owns panels and roving focus over content\n * it renders; a route-driven tab strip has neither, so it gets the styling and\n * leaves the semantics to the router.\n */\nexport function NavTab({ className, active, asChild = false, ...props }: NavTabProps) {\n const Component = asChild ? Slot.Root : 'a';\n return (\n <Component\n data-slot=\"nav-tab\"\n data-active={active ?? false}\n className={cn(tabVariants({ active }), className)}\n {...props}\n />\n );\n}\n\n/** The count beside a tab's label. */\nexport function NavTabBadge({\n className,\n active,\n ...props\n}: ComponentProps<'span'> & VariantProps<typeof tabBadgeVariants>) {\n return <span data-slot=\"nav-tab-badge\" className={cn(tabBadgeVariants({ active }), className)} {...props} />;\n}\n\n/** Radix Tabs, for a surface that swaps panels in place rather than navigating. */\nexport function Tabs(props: ComponentProps<typeof TabsPrimitive.Root>) {\n return <TabsPrimitive.Root data-slot=\"tabs\" {...props} />;\n}\n\nexport function TabsList({ className, ...props }: ComponentProps<typeof TabsPrimitive.List>) {\n return <TabsPrimitive.List data-slot=\"tabs-list\" className={cn('flex items-center gap-1', className)} {...props} />;\n}\n\nexport function TabsTrigger({ className, ...props }: ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n tabVariants({ active: false }),\n 'data-[state=active]:bg-doom-tint-blue data-[state=active]:font-bold data-[state=active]:text-doom-blue',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function TabsContent({ className, ...props }: ComponentProps<typeof TabsPrimitive.Content>) {\n return <TabsPrimitive.Content data-slot=\"tabs-content\" className={cn('min-h-0 flex-1', className)} {...props} />;\n}\n"],"mappings":"oKAYA,MAAa,EAAc,EACzB,oGACA,CACE,SAAU,CACR,OAAQ,CACN,KAAM,6CACN,MAAO,sDACT,CACF,EACA,gBAAiB,CAAE,OAAQ,EAAM,CACnC,CACF,EAGa,EAAmB,EAC9B,8FACA,CACE,SAAU,CACR,OAAQ,CAAE,KAAM,8BAA+B,MAAO,6BAA8B,CACtF,EACA,gBAAiB,CAAE,OAAQ,EAAM,CACnC,CACF,EAYA,SAAgB,EAAO,CAAE,YAAW,SAAQ,UAAU,GAAO,GAAG,GAAsB,CACpF,IAAM,EAAY,EAAU,EAAK,KAAO,IACxC,MACE,kBAAC,EAAD,CACE,YAAU,UACV,cAAa,GAAU,GACvB,UAAW,EAAG,EAAY,CAAE,QAAO,CAAC,EAAG,CAAS,EAChD,GAAI,CACL,CAAA,CAEL,CAGA,SAAgB,EAAY,CAC1B,YACA,SACA,GAAG,GAC8D,CACjE,MAAO,kBAAC,OAAD,CAAM,YAAU,gBAAgB,UAAW,EAAG,EAAiB,CAAE,QAAO,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CAC7G,CAGA,SAAgBA,EAAK,EAAkD,CACrE,MAAO,kBAACC,EAAc,KAAf,CAAoB,YAAU,OAAO,GAAI,CAAQ,CAAA,CAC1D,CAEA,SAAgB,EAAS,CAAE,YAAW,GAAG,GAAoD,CAC3F,MAAO,kBAACA,EAAc,KAAf,CAAoB,YAAU,YAAY,UAAW,EAAG,0BAA2B,CAAS,EAAG,GAAI,CAAQ,CAAA,CACpH,CAEA,SAAgB,EAAY,CAAE,YAAW,GAAG,GAAuD,CACjG,MACE,kBAACA,EAAc,QAAf,CACE,YAAU,eACV,UAAW,EACT,EAAY,CAAE,OAAQ,EAAM,CAAC,EAC7B,yGACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAY,CAAE,YAAW,GAAG,GAAuD,CACjG,MAAO,kBAACA,EAAc,QAAf,CAAuB,YAAU,eAAe,UAAW,EAAG,iBAAkB,CAAS,EAAG,GAAI,CAAQ,CAAA,CACjH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../lib/cn.cjs"),t=require("../types/theme.cjs");let n=require("react/jsx-runtime"),r=require("react");function i(e,n){return getComputedStyle(e).getPropertyValue(t.themeVariable(n)).trim()}function a({onData:t,onReady:a,ref:o,fontSize:s=11,className:c,...l}){let u=(0,r.useRef)(null),d=(0,r.useRef)(void 0),f=(0,r.useRef)(t),[p,m]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{f.current=t}),(0,r.useImperativeHandle)(o,()=>({write:e=>d.current?.write(e),reset:()=>d.current?.reset()})),(0,r.useEffect)(()=>{let e=u.current;if(e===null)return;let t=!1,n=()=>void 0;return(async()=>{let[{Terminal:r}]=await Promise.all([import(`@xterm/xterm`),import(`@xterm/xterm/css/xterm.css`)]);if(t)return;let o=new r({cursorBlink:!0,fontFamily:`ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:s,allowTransparency:!0,theme:{background:i(e,`deep`),foreground:i(e,`dim`),cursor:i(e,`hi`),selectionBackground:i(e,`selected`)}});o.open(e),o.onData(e=>f.current?.(e)),d.current={write:e=>o.write(e),reset:()=>o.reset()},m(!0),a?.(),n=()=>{d.current=void 0,o.dispose()}})(),()=>{t=!0,n()}},[]),/* @__PURE__ */ (0,n.jsx)(`div`,{ref:u,"data-slot":`terminal-view`,"data-ready":p,className:e.cn(`h-full w-full`,c),...l})}exports.TerminalView=a;
|
|
2
|
+
//# sourceMappingURL=TerminalView.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerminalView.cjs","names":["themeVariable","useRef","useState","cn"],"sources":["../../../src/components/TerminalView.tsx"],"sourcesContent":["import { type ComponentProps, useEffect, useImperativeHandle, useRef, useState } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { themeVariable } from '../types/theme';\n\n/**\n * A terminal emulator, for output that is a screen rather than a document.\n *\n * `AnsiText` beside it renders colour in text that happens to carry escapes.\n * This is the other thing: a full VT emulator that keeps a cursor, a grid and\n * an alternate screen, so a prompt, a progress bar or a full-screen program\n * behaves the way it would in a shell. Give it the bytes a pty produced and it\n * draws them; take its `onData` and you have what the reader typed.\n *\n * The emulator is loaded on mount rather than with the bundle. It is not a\n * small dependency, and most surfaces never show a terminal.\n */\n\nexport interface TerminalHandle {\n /** Writes pane bytes, escapes and all. */\n write(data: Uint8Array | string): void;\n /** Clears the screen and scrollback, for a stream that restarted. */\n reset(): void;\n}\n\nexport interface TerminalViewProps extends Omit<ComponentProps<'div'>, 'children' | 'onData' | 'ref'> {\n /** What the reader typed, already encoded the way a terminal sends it. */\n onData?: (text: string) => void;\n /** Called once the emulator is live, so a caller can start feeding it. */\n onReady?: () => void;\n ref?: React.Ref<TerminalHandle>;\n fontSize?: number;\n}\n\nconst DEFAULT_FONT_SIZE = 11;\nconst FONT_STACK = 'ui-monospace, SFMono-Regular, Menlo, monospace';\n\n/** Reads a theme token from the document, so the terminal follows the active theme. */\nfunction tokenColour(root: HTMLElement, token: Parameters<typeof themeVariable>[0]): string {\n return getComputedStyle(root).getPropertyValue(themeVariable(token)).trim();\n}\n\nexport function TerminalView({\n onData,\n onReady,\n ref,\n fontSize = DEFAULT_FONT_SIZE,\n className,\n ...props\n}: TerminalViewProps) {\n const mount = useRef<HTMLDivElement | null>(null);\n const handle = useRef<TerminalHandle | undefined>(undefined);\n const dataRef = useRef<((text: string) => void) | undefined>(onData);\n const [ready, setReady] = useState(false);\n\n useEffect(() => {\n dataRef.current = onData;\n });\n\n useImperativeHandle(ref, () => ({\n write: (data) => handle.current?.write(data),\n reset: () => handle.current?.reset(),\n }));\n\n useEffect(() => {\n const element = mount.current;\n if (element === null) return;\n let disposed = false;\n let dispose = (): void => undefined;\n\n void (async () => {\n const [{ Terminal }] = await Promise.all([import('@xterm/xterm'), import('@xterm/xterm/css/xterm.css')]);\n if (disposed) return;\n const terminal = new Terminal({\n cursorBlink: true,\n fontFamily: FONT_STACK,\n fontSize,\n allowTransparency: true,\n // Taken from the document's own custom properties rather than written\n // here, so a theme switch is the only place a colour is ever decided.\n theme: {\n background: tokenColour(element, 'deep'),\n foreground: tokenColour(element, 'dim'),\n cursor: tokenColour(element, 'hi'),\n selectionBackground: tokenColour(element, 'selected'),\n },\n });\n terminal.open(element);\n terminal.onData((text) => dataRef.current?.(text));\n handle.current = {\n write: (data) => terminal.write(data),\n reset: () => terminal.reset(),\n };\n setReady(true);\n onReady?.();\n\n dispose = () => {\n handle.current = undefined;\n terminal.dispose();\n };\n })();\n\n return () => {\n disposed = true;\n dispose();\n };\n // The emulator is built once for the life of the surface; later prop\n // changes reach it through the refs above rather than rebuilding it.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <div\n ref={mount}\n data-slot=\"terminal-view\"\n data-ready={ready}\n className={cn('h-full w-full', className)}\n {...props}\n />\n );\n}\n"],"mappings":"uHAsCA,SAAS,EAAY,EAAmB,EAAoD,CAC1F,OAAO,iBAAiB,CAAI,CAAC,CAAC,iBAAiBA,EAAAA,cAAc,CAAK,CAAC,CAAC,CAAC,KAAK,CAC5E,CAEA,SAAgB,EAAa,CAC3B,SACA,UACA,MACA,WAAW,GACX,YACA,GAAG,GACiB,CACpB,IAAM,GAAA,EAAQC,EAAAA,OAAAA,CAA8B,IAAI,EAC1C,GAAA,EAASA,EAAAA,OAAAA,CAAmC,IAAA,EAAS,EACrD,GAAA,EAAUA,EAAAA,OAAAA,CAA6C,CAAM,EAC7D,CAAC,EAAO,IAAA,EAAYC,EAAAA,SAAAA,CAAS,EAAK,EA0DxC,OAxDA,EAAA,EAAA,UAAA,KAAgB,CACd,EAAQ,QAAU,CACpB,CAAC,GAED,EAAA,EAAA,oBAAA,CAAoB,OAAY,CAC9B,MAAQ,GAAS,EAAO,SAAS,MAAM,CAAI,EAC3C,UAAa,EAAO,SAAS,MAAM,CACrC,EAAE,GAEF,EAAA,EAAA,UAAA,KAAgB,CACd,IAAM,EAAU,EAAM,QACtB,GAAI,IAAY,KAAM,OACtB,IAAI,EAAW,GACX,MAAsB,IAAA,GAkC1B,OAhCM,SAAY,CAChB,GAAM,CAAC,CAAE,aAAc,MAAM,QAAQ,IAAI,CAAC,OAAO,gBAAiB,OAAO,6BAA6B,CAAC,EACvG,GAAI,EAAU,OACd,IAAM,EAAW,IAAI,EAAS,CAC5B,YAAa,GACb,WAAY,iDACZ,WACA,kBAAmB,GAGnB,MAAO,CACL,WAAY,EAAY,EAAS,MAAM,EACvC,WAAY,EAAY,EAAS,KAAK,EACtC,OAAQ,EAAY,EAAS,IAAI,EACjC,oBAAqB,EAAY,EAAS,UAAU,CACtD,CACF,CAAC,EACD,EAAS,KAAK,CAAO,EACrB,EAAS,OAAQ,GAAS,EAAQ,UAAU,CAAI,CAAC,EACjD,EAAO,QAAU,CACf,MAAQ,GAAS,EAAS,MAAM,CAAI,EACpC,UAAa,EAAS,MAAM,CAC9B,EACA,EAAS,EAAI,EACb,IAAU,EAEV,MAAgB,CACd,EAAO,QAAU,IAAA,GACjB,EAAS,QAAQ,CACnB,CACF,EAAA,CAAG,MAEU,CACX,EAAW,GACX,EAAQ,CACV,CAIF,EAAG,CAAC,CAAC,EAGH,iBAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CACE,IAAK,EACL,YAAU,gBACV,aAAY,EACZ,UAAWC,EAAAA,GAAG,gBAAiB,CAAS,EACxC,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
//#region src/components/TerminalView.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* A terminal emulator, for output that is a screen rather than a document.
|
|
5
|
+
*
|
|
6
|
+
* `AnsiText` beside it renders colour in text that happens to carry escapes.
|
|
7
|
+
* This is the other thing: a full VT emulator that keeps a cursor, a grid and
|
|
8
|
+
* an alternate screen, so a prompt, a progress bar or a full-screen program
|
|
9
|
+
* behaves the way it would in a shell. Give it the bytes a pty produced and it
|
|
10
|
+
* draws them; take its `onData` and you have what the reader typed.
|
|
11
|
+
*
|
|
12
|
+
* The emulator is loaded on mount rather than with the bundle. It is not a
|
|
13
|
+
* small dependency, and most surfaces never show a terminal.
|
|
14
|
+
*/
|
|
15
|
+
export interface TerminalHandle {
|
|
16
|
+
/** Writes pane bytes, escapes and all. */
|
|
17
|
+
write(data: Uint8Array | string): void;
|
|
18
|
+
/** Clears the screen and scrollback, for a stream that restarted. */
|
|
19
|
+
reset(): void;
|
|
20
|
+
}
|
|
21
|
+
export interface TerminalViewProps extends Omit<ComponentProps<'div'>, 'children' | 'onData' | 'ref'> {
|
|
22
|
+
/** What the reader typed, already encoded the way a terminal sends it. */
|
|
23
|
+
onData?: (text: string) => void;
|
|
24
|
+
/** Called once the emulator is live, so a caller can start feeding it. */
|
|
25
|
+
onReady?: () => void;
|
|
26
|
+
ref?: React.Ref<TerminalHandle>;
|
|
27
|
+
fontSize?: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function TerminalView({ onData, onReady, ref, fontSize, className, ...props }: TerminalViewProps): import("react").JSX.Element;
|
|
30
|
+
//#endregion
|
|
31
|
+
//# sourceMappingURL=TerminalView.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerminalView.d.mts","names":[],"sources":["../../../src/components/TerminalView.tsx"],"mappings":";;;;;;;;;;;;;;iBAkBiB;;EAEf,MAAM,MAAM;;EAEZ;;iBAGe,0BAA0B,KAAK;;EAE9C,UAAU;;EAEV;EACA,MAAM,MAAM,IAAI;EAChB;;wBAWc,eACd,QACA,SACA,KACA,UACA,cACG,SACF,oCAAiB,IAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{themeVariable as t}from"../types/theme.mjs";import{jsx as n}from"react/jsx-runtime";import{useEffect as r,useImperativeHandle as i,useRef as a,useState as o}from"react";function s(e,n){return getComputedStyle(e).getPropertyValue(t(n)).trim()}function c({onData:t,onReady:c,ref:l,fontSize:u=11,className:d,...f}){let p=a(null),m=a(void 0),h=a(t),[g,_]=o(!1);return r(()=>{h.current=t}),i(l,()=>({write:e=>m.current?.write(e),reset:()=>m.current?.reset()})),r(()=>{let e=p.current;if(e===null)return;let t=!1,n=()=>void 0;return(async()=>{let[{Terminal:r}]=await Promise.all([import(`@xterm/xterm`),import(`@xterm/xterm/css/xterm.css`)]);if(t)return;let i=new r({cursorBlink:!0,fontFamily:`ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:u,allowTransparency:!0,theme:{background:s(e,`deep`),foreground:s(e,`dim`),cursor:s(e,`hi`),selectionBackground:s(e,`selected`)}});i.open(e),i.onData(e=>h.current?.(e)),m.current={write:e=>i.write(e),reset:()=>i.reset()},_(!0),c?.(),n=()=>{m.current=void 0,i.dispose()}})(),()=>{t=!0,n()}},[]),/* @__PURE__ */ n(`div`,{ref:p,"data-slot":`terminal-view`,"data-ready":g,className:e(`h-full w-full`,d),...f})}export{c as TerminalView};
|
|
2
|
+
//# sourceMappingURL=TerminalView.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerminalView.mjs","names":[],"sources":["../../../src/components/TerminalView.tsx"],"sourcesContent":["import { type ComponentProps, useEffect, useImperativeHandle, useRef, useState } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { themeVariable } from '../types/theme';\n\n/**\n * A terminal emulator, for output that is a screen rather than a document.\n *\n * `AnsiText` beside it renders colour in text that happens to carry escapes.\n * This is the other thing: a full VT emulator that keeps a cursor, a grid and\n * an alternate screen, so a prompt, a progress bar or a full-screen program\n * behaves the way it would in a shell. Give it the bytes a pty produced and it\n * draws them; take its `onData` and you have what the reader typed.\n *\n * The emulator is loaded on mount rather than with the bundle. It is not a\n * small dependency, and most surfaces never show a terminal.\n */\n\nexport interface TerminalHandle {\n /** Writes pane bytes, escapes and all. */\n write(data: Uint8Array | string): void;\n /** Clears the screen and scrollback, for a stream that restarted. */\n reset(): void;\n}\n\nexport interface TerminalViewProps extends Omit<ComponentProps<'div'>, 'children' | 'onData' | 'ref'> {\n /** What the reader typed, already encoded the way a terminal sends it. */\n onData?: (text: string) => void;\n /** Called once the emulator is live, so a caller can start feeding it. */\n onReady?: () => void;\n ref?: React.Ref<TerminalHandle>;\n fontSize?: number;\n}\n\nconst DEFAULT_FONT_SIZE = 11;\nconst FONT_STACK = 'ui-monospace, SFMono-Regular, Menlo, monospace';\n\n/** Reads a theme token from the document, so the terminal follows the active theme. */\nfunction tokenColour(root: HTMLElement, token: Parameters<typeof themeVariable>[0]): string {\n return getComputedStyle(root).getPropertyValue(themeVariable(token)).trim();\n}\n\nexport function TerminalView({\n onData,\n onReady,\n ref,\n fontSize = DEFAULT_FONT_SIZE,\n className,\n ...props\n}: TerminalViewProps) {\n const mount = useRef<HTMLDivElement | null>(null);\n const handle = useRef<TerminalHandle | undefined>(undefined);\n const dataRef = useRef<((text: string) => void) | undefined>(onData);\n const [ready, setReady] = useState(false);\n\n useEffect(() => {\n dataRef.current = onData;\n });\n\n useImperativeHandle(ref, () => ({\n write: (data) => handle.current?.write(data),\n reset: () => handle.current?.reset(),\n }));\n\n useEffect(() => {\n const element = mount.current;\n if (element === null) return;\n let disposed = false;\n let dispose = (): void => undefined;\n\n void (async () => {\n const [{ Terminal }] = await Promise.all([import('@xterm/xterm'), import('@xterm/xterm/css/xterm.css')]);\n if (disposed) return;\n const terminal = new Terminal({\n cursorBlink: true,\n fontFamily: FONT_STACK,\n fontSize,\n allowTransparency: true,\n // Taken from the document's own custom properties rather than written\n // here, so a theme switch is the only place a colour is ever decided.\n theme: {\n background: tokenColour(element, 'deep'),\n foreground: tokenColour(element, 'dim'),\n cursor: tokenColour(element, 'hi'),\n selectionBackground: tokenColour(element, 'selected'),\n },\n });\n terminal.open(element);\n terminal.onData((text) => dataRef.current?.(text));\n handle.current = {\n write: (data) => terminal.write(data),\n reset: () => terminal.reset(),\n };\n setReady(true);\n onReady?.();\n\n dispose = () => {\n handle.current = undefined;\n terminal.dispose();\n };\n })();\n\n return () => {\n disposed = true;\n dispose();\n };\n // The emulator is built once for the life of the surface; later prop\n // changes reach it through the refs above rather than rebuilding it.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <div\n ref={mount}\n data-slot=\"terminal-view\"\n data-ready={ready}\n className={cn('h-full w-full', className)}\n {...props}\n />\n );\n}\n"],"mappings":"mNAsCA,SAAS,EAAY,EAAmB,EAAoD,CAC1F,OAAO,iBAAiB,CAAI,CAAC,CAAC,iBAAiB,EAAc,CAAK,CAAC,CAAC,CAAC,KAAK,CAC5E,CAEA,SAAgB,EAAa,CAC3B,SACA,UACA,MACA,WAAW,GACX,YACA,GAAG,GACiB,CACpB,IAAM,EAAQ,EAA8B,IAAI,EAC1C,EAAS,EAAmC,IAAA,EAAS,EACrD,EAAU,EAA6C,CAAM,EAC7D,CAAC,EAAO,GAAY,EAAS,EAAK,EA0DxC,OAxDA,MAAgB,CACd,EAAQ,QAAU,CACpB,CAAC,EAED,EAAoB,OAAY,CAC9B,MAAQ,GAAS,EAAO,SAAS,MAAM,CAAI,EAC3C,UAAa,EAAO,SAAS,MAAM,CACrC,EAAE,EAEF,MAAgB,CACd,IAAM,EAAU,EAAM,QACtB,GAAI,IAAY,KAAM,OACtB,IAAI,EAAW,GACX,MAAsB,IAAA,GAkC1B,OAhCM,SAAY,CAChB,GAAM,CAAC,CAAE,aAAc,MAAM,QAAQ,IAAI,CAAC,OAAO,gBAAiB,OAAO,6BAA6B,CAAC,EACvG,GAAI,EAAU,OACd,IAAM,EAAW,IAAI,EAAS,CAC5B,YAAa,GACb,WAAY,iDACZ,WACA,kBAAmB,GAGnB,MAAO,CACL,WAAY,EAAY,EAAS,MAAM,EACvC,WAAY,EAAY,EAAS,KAAK,EACtC,OAAQ,EAAY,EAAS,IAAI,EACjC,oBAAqB,EAAY,EAAS,UAAU,CACtD,CACF,CAAC,EACD,EAAS,KAAK,CAAO,EACrB,EAAS,OAAQ,GAAS,EAAQ,UAAU,CAAI,CAAC,EACjD,EAAO,QAAU,CACf,MAAQ,GAAS,EAAS,MAAM,CAAI,EACpC,UAAa,EAAS,MAAM,CAC9B,EACA,EAAS,EAAI,EACb,IAAU,EAEV,MAAgB,CACd,EAAO,QAAU,IAAA,GACjB,EAAS,QAAQ,CACnB,CACF,EAAA,CAAG,MAEU,CACX,EAAW,GACX,EAAQ,CACV,CAIF,EAAG,CAAC,CAAC,EAGH,kBAAC,MAAD,CACE,IAAK,EACL,YAAU,gBACV,aAAY,EACZ,UAAW,EAAG,gBAAiB,CAAS,EACxC,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../lib/cn.cjs"),t=require("./Input.cjs");let n=require("react/jsx-runtime");function r({className:r,variant:i,size:a,...o}){return(0,n.jsx)(`textarea`,{"data-slot":`textarea`,className:e.cn(`resize-none`,t.fieldVariants({variant:i,size:a}),r),...o})}exports.Textarea=r;
|
|
1
|
+
const e=require("../lib/cn.cjs"),t=require("./Input.cjs");let n=require("react/jsx-runtime");function r({className:r,variant:i,size:a,...o}){return/* @__PURE__ */ (0,n.jsx)(`textarea`,{"data-slot":`textarea`,className:e.cn(`resize-none`,t.fieldVariants({variant:i,size:a}),r),...o})}exports.Textarea=r;
|
|
2
2
|
//# sourceMappingURL=Textarea.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.cjs","names":["cn","fieldVariants"],"sources":["../../../src/components/Textarea.tsx"],"sourcesContent":["import type { VariantProps } from 'class-variance-authority';\nimport type { ComponentProps } from 'react';\nimport { cn } from '../lib/cn
|
|
1
|
+
{"version":3,"file":"Textarea.cjs","names":["cn","fieldVariants"],"sources":["../../../src/components/Textarea.tsx"],"sourcesContent":["import type { VariantProps } from 'class-variance-authority';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { fieldVariants } from './Input';\n\nexport interface TextareaProps extends Omit<ComponentProps<'textarea'>, 'size'>, VariantProps<typeof fieldVariants> {}\n\n/** The multi-line field, styled as the Input; `bare` drops the well for a composer that draws its own. */\nexport function Textarea({ className, variant, size, ...props }: TextareaProps) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn('resize-none', fieldVariants({ variant, size }), className)}\n {...props}\n />\n );\n}\n"],"mappings":"6FASA,SAAgB,EAAS,CAAE,YAAW,UAAS,OAAM,GAAG,GAAwB,CAC9E,MACE,iBAAA,EAAA,EAAA,IAAA,CAAC,WAAD,CACE,YAAU,WACV,UAAWA,EAAAA,GAAG,cAAeC,EAAAA,cAAc,CAAE,UAAS,MAAK,CAAC,EAAG,CAAS,EACxE,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { fieldVariants } from "./Input.mjs";
|
|
2
|
-
import { VariantProps } from "class-variance-authority";
|
|
3
2
|
import { ComponentProps } from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
//#region src/components/Textarea.d.ts
|
|
5
|
-
interface TextareaProps extends Omit<ComponentProps<'textarea'>, 'size'>, VariantProps<typeof fieldVariants> {}
|
|
5
|
+
export interface TextareaProps extends Omit<ComponentProps<'textarea'>, 'size'>, VariantProps<typeof fieldVariants> {}
|
|
6
6
|
/** The multi-line field, styled as the Input; `bare` drops the well for a composer that draws its own. */
|
|
7
|
-
declare function Textarea({ className, variant, size, ...props }: TextareaProps): import("react
|
|
7
|
+
export declare function Textarea({ className, variant, size, ...props }: TextareaProps): import("react").JSX.Element;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { Textarea, TextareaProps };
|
|
10
9
|
//# sourceMappingURL=Textarea.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.d.mts","names":[],"sources":["../../../src/components/Textarea.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"Textarea.d.mts","names":[],"sources":["../../../src/components/Textarea.tsx"],"mappings":";;;;iBAMiB,sBAAsB,KAAK,qCAAqC,oBAAoB;;wBAGrF,WAAW,WAAW,SAAS,SAAS,SAAS,gCAAa,IAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as e}from"../lib/cn.mjs";import{fieldVariants as t}from"./Input.mjs";import{jsx as n}from"react/jsx-runtime";function r({className:r,variant:i,size:a,...o}){return n(`textarea`,{"data-slot":`textarea`,className:e(`resize-none`,t({variant:i,size:a}),r),...o})}export{r as Textarea};
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{fieldVariants as t}from"./Input.mjs";import{jsx as n}from"react/jsx-runtime";function r({className:r,variant:i,size:a,...o}){return/* @__PURE__ */ n(`textarea`,{"data-slot":`textarea`,className:e(`resize-none`,t({variant:i,size:a}),r),...o})}export{r as Textarea};
|
|
2
2
|
//# sourceMappingURL=Textarea.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.mjs","names":[],"sources":["../../../src/components/Textarea.tsx"],"sourcesContent":["import type { VariantProps } from 'class-variance-authority';\nimport type { ComponentProps } from 'react';\nimport { cn } from '../lib/cn
|
|
1
|
+
{"version":3,"file":"Textarea.mjs","names":[],"sources":["../../../src/components/Textarea.tsx"],"sourcesContent":["import type { VariantProps } from 'class-variance-authority';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { fieldVariants } from './Input';\n\nexport interface TextareaProps extends Omit<ComponentProps<'textarea'>, 'size'>, VariantProps<typeof fieldVariants> {}\n\n/** The multi-line field, styled as the Input; `bare` drops the well for a composer that draws its own. */\nexport function Textarea({ className, variant, size, ...props }: TextareaProps) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn('resize-none', fieldVariants({ variant, size }), className)}\n {...props}\n />\n );\n}\n"],"mappings":"uHASA,SAAgB,EAAS,CAAE,YAAW,UAAS,OAAM,GAAG,GAAwB,CAC9E,MACE,kBAAC,WAAD,CACE,YAAU,WACV,UAAW,EAAG,cAAe,EAAc,CAAE,UAAS,MAAK,CAAC,EAAG,CAAS,EACxE,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../icons/icons.cjs");const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime"),r=require("class-variance-authority"),i=require("lucide-react");function a(e){return(0,n.jsx)(t.Toast.Provider,{...e})}function o({className:r,...i}){return(0,n.jsx)(t.Toast.Viewport,{"data-slot":`toast-viewport`,className:e.cn(`fixed right-4 bottom-4 z-50 flex w-[360px] max-w-full flex-col gap-2 outline-none`,r),...i})}const s=(0,r.cva)(`flex items-start gap-3 rounded-md border bg-doom-panel px-3 py-2.5 font-mono shadow-2xl data-[state=open]:animate-doom-rise`,{variants:{tone:{neutral:`border-doom-border`,running:`border-doom-edge-yellow`,ok:`border-doom-edge-green`,error:`border-doom-edge-red`,info:`border-doom-edge-blue`,accent:`border-doom-edge-magenta`}},defaultVariants:{tone:`neutral`}});function c({className:r,tone:i,...a}){return(0,n.jsx)(t.Toast.Root,{"data-slot":`toast`,className:e.cn(s({tone:i}),r),...a})}function l({className:r,...i}){return(0,n.jsx)(t.Toast.Title,{"data-slot":`toast-title`,className:e.cn(`text-
|
|
1
|
+
require("../icons/icons.cjs");const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime"),r=require("class-variance-authority"),i=require("lucide-react");function a(e){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Provider,{...e})}function o({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Viewport,{"data-slot":`toast-viewport`,className:e.cn(`fixed right-4 bottom-4 z-50 flex w-[360px] max-w-full flex-col gap-2 outline-none`,r),...i})}const s=(0,r.cva)(`flex items-start gap-3 rounded-md border bg-doom-panel px-3 py-2.5 font-mono shadow-2xl data-[state=open]:animate-doom-rise`,{variants:{tone:{neutral:`border-doom-border`,running:`border-doom-edge-yellow`,ok:`border-doom-edge-green`,error:`border-doom-edge-red`,info:`border-doom-edge-blue`,accent:`border-doom-edge-magenta`}},defaultVariants:{tone:`neutral`}});function c({className:r,tone:i,...a}){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Root,{"data-slot":`toast`,className:e.cn(s({tone:i}),r),...a})}function l({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Title,{"data-slot":`toast-title`,className:e.cn(`text-sm font-bold text-doom-hi`,r),...i})}function u({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Description,{"data-slot":`toast-description`,className:e.cn(`text-sm leading-relaxed text-doom-dim`,r),...i})}function d(e){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Action,{"data-slot":`toast-action`,...e})}function f({className:r,...a}){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Close,{"data-slot":`toast-close`,"aria-label":`dismiss`,className:e.cn(`shrink-0 cursor-pointer text-doom-faint transition-colors hover:text-doom-hi`,r),...a,children:/* @__PURE__ */ (0,n.jsx)(i.X,{className:`h-3 w-3`})})}exports.Toast=c,exports.ToastAction=d,exports.ToastClose=f,exports.ToastDescription=u,exports.ToastProvider=a,exports.ToastTitle=l,exports.ToastViewport=o,exports.toastVariants=s;
|
|
2
2
|
//# sourceMappingURL=Toast.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.cjs","names":["ToastPrimitive","cn","cva","CloseIcon"],"sources":["../../../src/components/Toast.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Toast as ToastPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\nimport { CloseIcon } from '../icons/icons
|
|
1
|
+
{"version":3,"file":"Toast.cjs","names":["ToastPrimitive","cn","cva","CloseIcon"],"sources":["../../../src/components/Toast.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Toast as ToastPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { CloseIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport type { StatusTone } from '../types/tone';\n\n/**\n * A transient notice. Radix owns the part that is easy to get wrong: it\n * announces through a live region, pauses its timer on hover and on window\n * blur, and restores focus when it leaves. Mount one ToastProvider and one\n * ToastViewport per page.\n */\nexport function ToastProvider(props: ComponentProps<typeof ToastPrimitive.Provider>) {\n return <ToastPrimitive.Provider {...props} />;\n}\n\nexport function ToastViewport({ className, ...props }: ComponentProps<typeof ToastPrimitive.Viewport>) {\n return (\n <ToastPrimitive.Viewport\n data-slot=\"toast-viewport\"\n className={cn('fixed right-4 bottom-4 z-50 flex w-[360px] max-w-full flex-col gap-2 outline-none', className)}\n {...props}\n />\n );\n}\n\nexport const toastVariants = cva(\n 'flex items-start gap-3 rounded-md border bg-doom-panel px-3 py-2.5 font-mono shadow-2xl data-[state=open]:animate-doom-rise',\n {\n variants: {\n tone: {\n neutral: 'border-doom-border',\n running: 'border-doom-edge-yellow',\n ok: 'border-doom-edge-green',\n error: 'border-doom-edge-red',\n info: 'border-doom-edge-blue',\n accent: 'border-doom-edge-magenta',\n } satisfies Record<StatusTone, string>,\n },\n defaultVariants: { tone: 'neutral' },\n },\n);\n\nexport interface ToastProps extends ComponentProps<typeof ToastPrimitive.Root>, VariantProps<typeof toastVariants> {}\n\nexport function Toast({ className, tone, ...props }: ToastProps) {\n return <ToastPrimitive.Root data-slot=\"toast\" className={cn(toastVariants({ tone }), className)} {...props} />;\n}\n\nexport function ToastTitle({ className, ...props }: ComponentProps<typeof ToastPrimitive.Title>) {\n return (\n <ToastPrimitive.Title\n data-slot=\"toast-title\"\n className={cn('text-sm font-bold text-doom-hi', className)}\n {...props}\n />\n );\n}\n\nexport function ToastDescription({ className, ...props }: ComponentProps<typeof ToastPrimitive.Description>) {\n return (\n <ToastPrimitive.Description\n data-slot=\"toast-description\"\n className={cn('text-sm leading-relaxed text-doom-dim', className)}\n {...props}\n />\n );\n}\n\nexport function ToastAction(props: ComponentProps<typeof ToastPrimitive.Action>) {\n return <ToastPrimitive.Action data-slot=\"toast-action\" {...props} />;\n}\n\nexport function ToastClose({ className, ...props }: ComponentProps<typeof ToastPrimitive.Close>) {\n return (\n <ToastPrimitive.Close\n data-slot=\"toast-close\"\n aria-label=\"dismiss\"\n className={cn('shrink-0 cursor-pointer text-doom-faint transition-colors hover:text-doom-hi', className)}\n {...props}\n >\n <CloseIcon className=\"h-3 w-3\" />\n </ToastPrimitive.Close>\n );\n}\n"],"mappings":"wLAcA,SAAgB,EAAc,EAAuD,CACnF,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,MAAe,SAAhB,CAAyB,GAAI,CAAQ,CAAA,CAC9C,CAEA,SAAgB,EAAc,CAAE,YAAW,GAAG,GAAyD,CACrG,MACE,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,MAAe,SAAhB,CACE,YAAU,iBACV,UAAWC,EAAAA,GAAG,oFAAqF,CAAS,EAC5G,GAAI,CACL,CAAA,CAEL,CAEA,MAAa,GAAA,EAAgBC,EAAAA,IAAAA,CAC3B,8HACA,CACE,SAAU,CACR,KAAM,CACJ,QAAS,qBACT,QAAS,0BACT,GAAI,yBACJ,MAAO,uBACP,KAAM,wBACN,OAAQ,0BACV,CACF,EACA,gBAAiB,CAAE,KAAM,SAAU,CACrC,CACF,EAIA,SAAgB,EAAM,CAAE,YAAW,OAAM,GAAG,GAAqB,CAC/D,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACF,EAAAA,MAAe,KAAhB,CAAqB,YAAU,QAAQ,UAAWC,EAAAA,GAAG,EAAc,CAAE,MAAK,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CAC/G,CAEA,SAAgB,EAAW,CAAE,YAAW,GAAG,GAAsD,CAC/F,MACE,iBAAA,EAAA,EAAA,IAAA,CAACD,EAAAA,MAAe,MAAhB,CACE,YAAU,cACV,UAAWC,EAAAA,GAAG,iCAAkC,CAAS,EACzD,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAiB,CAAE,YAAW,GAAG,GAA4D,CAC3G,MACE,iBAAA,EAAA,EAAA,IAAA,CAACD,EAAAA,MAAe,YAAhB,CACE,YAAU,oBACV,UAAWC,EAAAA,GAAG,wCAAyC,CAAS,EAChE,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAY,EAAqD,CAC/E,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACD,EAAAA,MAAe,OAAhB,CAAuB,YAAU,eAAe,GAAI,CAAQ,CAAA,CACrE,CAEA,SAAgB,EAAW,CAAE,YAAW,GAAG,GAAsD,CAC/F,MACE,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,MAAe,MAAhB,CACE,YAAU,cACV,aAAW,UACX,UAAWC,EAAAA,GAAG,+EAAgF,CAAS,EACvG,GAAI,EAEJ,SAAA,iBAAA,EAAA,EAAA,IAAA,CAACE,EAAAA,EAAD,CAAW,UAAU,SAAW,CAAA,CACZ,CAAA,CAE1B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Toast } from "radix-ui";
|
|
2
|
-
import { VariantProps } from "class-variance-authority";
|
|
3
2
|
import { ComponentProps } from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
//#region src/components/Toast.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* A transient notice. Radix owns the part that is easy to get wrong: it
|
|
@@ -8,17 +8,17 @@ import { ComponentProps } from "react";
|
|
|
8
8
|
* blur, and restores focus when it leaves. Mount one ToastProvider and one
|
|
9
9
|
* ToastViewport per page.
|
|
10
10
|
*/
|
|
11
|
-
declare function ToastProvider(props: ComponentProps<typeof Toast.Provider>): import("react
|
|
12
|
-
declare function ToastViewport({ className, ...props }: ComponentProps<typeof Toast.Viewport>): import("react
|
|
13
|
-
declare const toastVariants: (props?: ({
|
|
11
|
+
export declare function ToastProvider(props: ComponentProps<typeof Toast.Provider>): import("react").JSX.Element;
|
|
12
|
+
export declare function ToastViewport({ className, ...props }: ComponentProps<typeof Toast.Viewport>): import("react").JSX.Element;
|
|
13
|
+
export declare const toastVariants: (props?: ({
|
|
14
14
|
tone?: "accent" | "error" | "info" | "neutral" | "ok" | "running" | null | undefined;
|
|
15
15
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
-
interface ToastProps extends ComponentProps<typeof Toast.Root>, VariantProps<typeof toastVariants> {}
|
|
17
|
-
declare function Toast$1({ className, tone, ...props }: ToastProps): import("react
|
|
18
|
-
declare function ToastTitle({ className, ...props }: ComponentProps<typeof Toast.Title>): import("react
|
|
19
|
-
declare function ToastDescription({ className, ...props }: ComponentProps<typeof Toast.Description>): import("react
|
|
20
|
-
declare function ToastAction(props: ComponentProps<typeof Toast.Action>): import("react
|
|
21
|
-
declare function ToastClose({ className, ...props }: ComponentProps<typeof Toast.Close>): import("react
|
|
16
|
+
export interface ToastProps extends ComponentProps<typeof Toast.Root>, VariantProps<typeof toastVariants> {}
|
|
17
|
+
declare function Toast$1({ className, tone, ...props }: ToastProps): import("react").JSX.Element;
|
|
18
|
+
export declare function ToastTitle({ className, ...props }: ComponentProps<typeof Toast.Title>): import("react").JSX.Element;
|
|
19
|
+
export declare function ToastDescription({ className, ...props }: ComponentProps<typeof Toast.Description>): import("react").JSX.Element;
|
|
20
|
+
export declare function ToastAction(props: ComponentProps<typeof Toast.Action>): import("react").JSX.Element;
|
|
21
|
+
export declare function ToastClose({ className, ...props }: ComponentProps<typeof Toast.Close>): import("react").JSX.Element;
|
|
22
22
|
//#endregion
|
|
23
|
-
export { Toast$1 as Toast
|
|
23
|
+
export { Toast$1 as Toast };
|
|
24
24
|
//# sourceMappingURL=Toast.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.mts","names":[],"sources":["../../../src/components/Toast.tsx"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Toast.d.mts","names":[],"sources":["../../../src/components/Toast.tsx"],"mappings":";;;;;;;;;;wBAcgB,cAAc,OAAO,sBAAsB,MAAe,4BAAS,IAAA;wBAInE,gBAAgB,cAAc,SAAS,sBAAsB,MAAe,4BAAS,IAAA;qBAUxF,gBAAa;;6CAezB;iBAEgB,mBAAmB,sBAAsB,MAAe,OAAO,oBAAoB;iBAEpF,UAAQ,WAAW,SAAS,SAAS,6BAAU,IAAA;wBAI/C,aAAa,cAAc,SAAS,sBAAsB,MAAe,yBAAM,IAAA;wBAU/E,mBAAmB,cAAc,SAAS,sBAAsB,MAAe,+BAAY,IAAA;wBAU3F,YAAY,OAAO,sBAAsB,MAAe,0BAAO,IAAA;wBAI/D,aAAa,cAAc,SAAS,sBAAsB,MAAe,yBAAM,IAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{CloseIcon as e}from"../icons/icons.mjs";import{cn as t}from"../lib/cn.mjs";import{Toast as n}from"radix-ui";import{jsx as r}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";function a(e){return r(n.Provider,{...e})}function o({className:e,...i}){return r(n.Viewport,{"data-slot":`toast-viewport`,className:t(`fixed right-4 bottom-4 z-50 flex w-[360px] max-w-full flex-col gap-2 outline-none`,e),...i})}const s=i(`flex items-start gap-3 rounded-md border bg-doom-panel px-3 py-2.5 font-mono shadow-2xl data-[state=open]:animate-doom-rise`,{variants:{tone:{neutral:`border-doom-border`,running:`border-doom-edge-yellow`,ok:`border-doom-edge-green`,error:`border-doom-edge-red`,info:`border-doom-edge-blue`,accent:`border-doom-edge-magenta`}},defaultVariants:{tone:`neutral`}});function c({className:e,tone:i,...a}){return r(n.Root,{"data-slot":`toast`,className:t(s({tone:i}),e),...a})}function l({className:e,...i}){return r(n.Title,{"data-slot":`toast-title`,className:t(`text-
|
|
1
|
+
import{CloseIcon as e}from"../icons/icons.mjs";import{cn as t}from"../lib/cn.mjs";import{Toast as n}from"radix-ui";import{jsx as r}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";function a(e){return/* @__PURE__ */ r(n.Provider,{...e})}function o({className:e,...i}){return/* @__PURE__ */ r(n.Viewport,{"data-slot":`toast-viewport`,className:t(`fixed right-4 bottom-4 z-50 flex w-[360px] max-w-full flex-col gap-2 outline-none`,e),...i})}const s=i(`flex items-start gap-3 rounded-md border bg-doom-panel px-3 py-2.5 font-mono shadow-2xl data-[state=open]:animate-doom-rise`,{variants:{tone:{neutral:`border-doom-border`,running:`border-doom-edge-yellow`,ok:`border-doom-edge-green`,error:`border-doom-edge-red`,info:`border-doom-edge-blue`,accent:`border-doom-edge-magenta`}},defaultVariants:{tone:`neutral`}});function c({className:e,tone:i,...a}){return/* @__PURE__ */ r(n.Root,{"data-slot":`toast`,className:t(s({tone:i}),e),...a})}function l({className:e,...i}){return/* @__PURE__ */ r(n.Title,{"data-slot":`toast-title`,className:t(`text-sm font-bold text-doom-hi`,e),...i})}function u({className:e,...i}){return/* @__PURE__ */ r(n.Description,{"data-slot":`toast-description`,className:t(`text-sm leading-relaxed text-doom-dim`,e),...i})}function d(e){return/* @__PURE__ */ r(n.Action,{"data-slot":`toast-action`,...e})}function f({className:i,...a}){return/* @__PURE__ */ r(n.Close,{"data-slot":`toast-close`,"aria-label":`dismiss`,className:t(`shrink-0 cursor-pointer text-doom-faint transition-colors hover:text-doom-hi`,i),...a,children:/* @__PURE__ */ r(e,{className:`h-3 w-3`})})}export{c as Toast,d as ToastAction,f as ToastClose,u as ToastDescription,a as ToastProvider,l as ToastTitle,o as ToastViewport,s as toastVariants};
|
|
2
2
|
//# sourceMappingURL=Toast.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.mjs","names":["ToastPrimitive","Toast"],"sources":["../../../src/components/Toast.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Toast as ToastPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\nimport { CloseIcon } from '../icons/icons
|
|
1
|
+
{"version":3,"file":"Toast.mjs","names":["ToastPrimitive","Toast"],"sources":["../../../src/components/Toast.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Toast as ToastPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { CloseIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport type { StatusTone } from '../types/tone';\n\n/**\n * A transient notice. Radix owns the part that is easy to get wrong: it\n * announces through a live region, pauses its timer on hover and on window\n * blur, and restores focus when it leaves. Mount one ToastProvider and one\n * ToastViewport per page.\n */\nexport function ToastProvider(props: ComponentProps<typeof ToastPrimitive.Provider>) {\n return <ToastPrimitive.Provider {...props} />;\n}\n\nexport function ToastViewport({ className, ...props }: ComponentProps<typeof ToastPrimitive.Viewport>) {\n return (\n <ToastPrimitive.Viewport\n data-slot=\"toast-viewport\"\n className={cn('fixed right-4 bottom-4 z-50 flex w-[360px] max-w-full flex-col gap-2 outline-none', className)}\n {...props}\n />\n );\n}\n\nexport const toastVariants = cva(\n 'flex items-start gap-3 rounded-md border bg-doom-panel px-3 py-2.5 font-mono shadow-2xl data-[state=open]:animate-doom-rise',\n {\n variants: {\n tone: {\n neutral: 'border-doom-border',\n running: 'border-doom-edge-yellow',\n ok: 'border-doom-edge-green',\n error: 'border-doom-edge-red',\n info: 'border-doom-edge-blue',\n accent: 'border-doom-edge-magenta',\n } satisfies Record<StatusTone, string>,\n },\n defaultVariants: { tone: 'neutral' },\n },\n);\n\nexport interface ToastProps extends ComponentProps<typeof ToastPrimitive.Root>, VariantProps<typeof toastVariants> {}\n\nexport function Toast({ className, tone, ...props }: ToastProps) {\n return <ToastPrimitive.Root data-slot=\"toast\" className={cn(toastVariants({ tone }), className)} {...props} />;\n}\n\nexport function ToastTitle({ className, ...props }: ComponentProps<typeof ToastPrimitive.Title>) {\n return (\n <ToastPrimitive.Title\n data-slot=\"toast-title\"\n className={cn('text-sm font-bold text-doom-hi', className)}\n {...props}\n />\n );\n}\n\nexport function ToastDescription({ className, ...props }: ComponentProps<typeof ToastPrimitive.Description>) {\n return (\n <ToastPrimitive.Description\n data-slot=\"toast-description\"\n className={cn('text-sm leading-relaxed text-doom-dim', className)}\n {...props}\n />\n );\n}\n\nexport function ToastAction(props: ComponentProps<typeof ToastPrimitive.Action>) {\n return <ToastPrimitive.Action data-slot=\"toast-action\" {...props} />;\n}\n\nexport function ToastClose({ className, ...props }: ComponentProps<typeof ToastPrimitive.Close>) {\n return (\n <ToastPrimitive.Close\n data-slot=\"toast-close\"\n aria-label=\"dismiss\"\n className={cn('shrink-0 cursor-pointer text-doom-faint transition-colors hover:text-doom-hi', className)}\n {...props}\n >\n <CloseIcon className=\"h-3 w-3\" />\n </ToastPrimitive.Close>\n );\n}\n"],"mappings":"0MAcA,SAAgB,EAAc,EAAuD,CACnF,MAAO,kBAACA,EAAe,SAAhB,CAAyB,GAAI,CAAQ,CAAA,CAC9C,CAEA,SAAgB,EAAc,CAAE,YAAW,GAAG,GAAyD,CACrG,MACE,kBAACA,EAAe,SAAhB,CACE,YAAU,iBACV,UAAW,EAAG,oFAAqF,CAAS,EAC5G,GAAI,CACL,CAAA,CAEL,CAEA,MAAa,EAAgB,EAC3B,8HACA,CACE,SAAU,CACR,KAAM,CACJ,QAAS,qBACT,QAAS,0BACT,GAAI,yBACJ,MAAO,uBACP,KAAM,wBACN,OAAQ,0BACV,CACF,EACA,gBAAiB,CAAE,KAAM,SAAU,CACrC,CACF,EAIA,SAAgBC,EAAM,CAAE,YAAW,OAAM,GAAG,GAAqB,CAC/D,MAAO,kBAACD,EAAe,KAAhB,CAAqB,YAAU,QAAQ,UAAW,EAAG,EAAc,CAAE,MAAK,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CAC/G,CAEA,SAAgB,EAAW,CAAE,YAAW,GAAG,GAAsD,CAC/F,MACE,kBAACA,EAAe,MAAhB,CACE,YAAU,cACV,UAAW,EAAG,iCAAkC,CAAS,EACzD,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAiB,CAAE,YAAW,GAAG,GAA4D,CAC3G,MACE,kBAACA,EAAe,YAAhB,CACE,YAAU,oBACV,UAAW,EAAG,wCAAyC,CAAS,EAChE,GAAI,CACL,CAAA,CAEL,CAEA,SAAgB,EAAY,EAAqD,CAC/E,MAAO,kBAACA,EAAe,OAAhB,CAAuB,YAAU,eAAe,GAAI,CAAQ,CAAA,CACrE,CAEA,SAAgB,EAAW,CAAE,YAAW,GAAG,GAAsD,CAC/F,MACE,kBAACA,EAAe,MAAhB,CACE,YAAU,cACV,aAAW,UACX,UAAW,EAAG,+EAAgF,CAAS,EACvG,GAAI,EAEJ,SAAA,kBAAC,EAAD,CAAW,UAAU,SAAW,CAAA,CACZ,CAAA,CAE1B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../lib/cn.cjs");let t=require("react/jsx-runtime");function n({path:n,onOpen:r,className:i,"data-testid":a=`tool-path`,...o}){return r===void 0?/* @__PURE__ */ (0,t.jsx)(`span`,{"data-slot":`tool-path`,"data-testid":a,className:e.cn(`truncate text-doom-text`,i),...o,children:n}):/* @__PURE__ */ (0,t.jsx)(`button`,{type:`button`,"data-slot":`tool-path`,"data-testid":a,title:`open ${n}`,onClick:r,className:e.cn(`cursor-pointer truncate text-left text-doom-text hover:text-doom-blue hover:underline`,i),...o,children:n})}exports.ToolPathLink=n;
|
|
2
|
+
//# sourceMappingURL=ToolPathLink.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolPathLink.cjs","names":["cn"],"sources":["../../../src/components/ToolPathLink.tsx"],"sourcesContent":["import { cn } from '../lib/cn';\n\n/**\n * The file path in a tool call's header, as a link when something can open it.\n *\n * A read, a write and an edit all put a path in the same place, and a reader\n * who wants to see that file should not have to go looking for it in a file\n * list. Whether the path can be opened is not this component's business: the\n * host resolves it against whatever plugin owns files, and hands the answer\n * down as `onOpen`. Without one the path stays exactly what it was, plain\n * text, because a link that opens nothing is worse than no link.\n */\n\nexport interface ToolPathLinkProps {\n path: string;\n /** Opens the file; omitted when nothing installed can show it. */\n onOpen?: () => void;\n className?: string;\n /** Defaults to `tool-path`, which is how a test finds the link inside a call header. */\n 'data-testid'?: string;\n}\n\nexport function ToolPathLink({\n path,\n onOpen,\n className,\n 'data-testid': testId = 'tool-path',\n ...props\n}: ToolPathLinkProps) {\n if (onOpen === undefined) {\n return (\n <span data-slot=\"tool-path\" data-testid={testId} className={cn('truncate text-doom-text', className)} {...props}>\n {path}\n </span>\n );\n }\n return (\n <button\n type=\"button\"\n data-slot=\"tool-path\"\n data-testid={testId}\n title={`open ${path}`}\n onClick={onOpen}\n className={cn('cursor-pointer truncate text-left text-doom-text hover:text-doom-blue hover:underline', className)}\n {...props}\n >\n {path}\n </button>\n );\n}\n"],"mappings":"oEAsBA,SAAgB,EAAa,CAC3B,OACA,SACA,YACA,cAAe,EAAS,YACxB,GAAG,GACiB,CAQpB,OAPI,IAAW,IAAA,GAEX,iBAAA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,YAAU,YAAY,cAAa,EAAQ,UAAWA,EAAAA,GAAG,0BAA2B,CAAS,EAAG,GAAI,EACvG,SAAA,CACG,CAAA,EAIR,iBAAA,EAAA,EAAA,IAAA,CAAC,SAAD,CACE,KAAK,SACL,YAAU,YACV,cAAa,EACb,MAAO,QAAQ,IACf,QAAS,EACT,UAAWA,EAAAA,GAAG,wFAAyF,CAAS,EAChH,GAAI,EAEH,SAAA,CACK,CAAA,CAEZ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/components/ToolPathLink.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The file path in a tool call's header, as a link when something can open it.
|
|
4
|
+
*
|
|
5
|
+
* A read, a write and an edit all put a path in the same place, and a reader
|
|
6
|
+
* who wants to see that file should not have to go looking for it in a file
|
|
7
|
+
* list. Whether the path can be opened is not this component's business: the
|
|
8
|
+
* host resolves it against whatever plugin owns files, and hands the answer
|
|
9
|
+
* down as `onOpen`. Without one the path stays exactly what it was, plain
|
|
10
|
+
* text, because a link that opens nothing is worse than no link.
|
|
11
|
+
*/
|
|
12
|
+
export interface ToolPathLinkProps {
|
|
13
|
+
path: string;
|
|
14
|
+
/** Opens the file; omitted when nothing installed can show it. */
|
|
15
|
+
onOpen?: () => void;
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Defaults to `tool-path`, which is how a test finds the link inside a call header. */
|
|
18
|
+
'data-testid'?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function ToolPathLink({ path, onOpen, className, 'data-testid': testId, ...props }: ToolPathLinkProps): import("react").JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
//# sourceMappingURL=ToolPathLink.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolPathLink.d.mts","names":[],"sources":["../../../src/components/ToolPathLink.tsx"],"mappings":";;;;;;;;;;;iBAaiB;EACf;;EAEA;EACA;;EAEA;;wBAGc,eACd,MACA,QACA,0BACe,WACZ,SACF,oCAAiB,IAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{jsx as t}from"react/jsx-runtime";function n({path:n,onOpen:r,className:i,"data-testid":a=`tool-path`,...o}){return r===void 0?/* @__PURE__ */ t(`span`,{"data-slot":`tool-path`,"data-testid":a,className:e(`truncate text-doom-text`,i),...o,children:n}):/* @__PURE__ */ t(`button`,{type:`button`,"data-slot":`tool-path`,"data-testid":a,title:`open ${n}`,onClick:r,className:e(`cursor-pointer truncate text-left text-doom-text hover:text-doom-blue hover:underline`,i),...o,children:n})}export{n as ToolPathLink};
|
|
2
|
+
//# sourceMappingURL=ToolPathLink.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolPathLink.mjs","names":[],"sources":["../../../src/components/ToolPathLink.tsx"],"sourcesContent":["import { cn } from '../lib/cn';\n\n/**\n * The file path in a tool call's header, as a link when something can open it.\n *\n * A read, a write and an edit all put a path in the same place, and a reader\n * who wants to see that file should not have to go looking for it in a file\n * list. Whether the path can be opened is not this component's business: the\n * host resolves it against whatever plugin owns files, and hands the answer\n * down as `onOpen`. Without one the path stays exactly what it was, plain\n * text, because a link that opens nothing is worse than no link.\n */\n\nexport interface ToolPathLinkProps {\n path: string;\n /** Opens the file; omitted when nothing installed can show it. */\n onOpen?: () => void;\n className?: string;\n /** Defaults to `tool-path`, which is how a test finds the link inside a call header. */\n 'data-testid'?: string;\n}\n\nexport function ToolPathLink({\n path,\n onOpen,\n className,\n 'data-testid': testId = 'tool-path',\n ...props\n}: ToolPathLinkProps) {\n if (onOpen === undefined) {\n return (\n <span data-slot=\"tool-path\" data-testid={testId} className={cn('truncate text-doom-text', className)} {...props}>\n {path}\n </span>\n );\n }\n return (\n <button\n type=\"button\"\n data-slot=\"tool-path\"\n data-testid={testId}\n title={`open ${path}`}\n onClick={onOpen}\n className={cn('cursor-pointer truncate text-left text-doom-text hover:text-doom-blue hover:underline', className)}\n {...props}\n >\n {path}\n </button>\n );\n}\n"],"mappings":"2EAsBA,SAAgB,EAAa,CAC3B,OACA,SACA,YACA,cAAe,EAAS,YACxB,GAAG,GACiB,CAQpB,OAPI,IAAW,IAAA,GAEX,kBAAC,OAAD,CAAM,YAAU,YAAY,cAAa,EAAQ,UAAW,EAAG,0BAA2B,CAAS,EAAG,GAAI,EACvG,SAAA,CACG,CAAA,EAIR,kBAAC,SAAD,CACE,KAAK,SACL,YAAU,YACV,cAAa,EACb,MAAO,QAAQ,IACf,QAAS,EACT,UAAW,EAAG,wFAAyF,CAAS,EAChH,GAAI,EAEH,SAAA,CACK,CAAA,CAEZ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime");function r({delayDuration:e=300,...r}){return(0,n.jsx)(t.Tooltip.Provider,{"data-slot":`tooltip-provider`,delayDuration:e,...r})}function i(e){return(0,n.jsx)(t.Tooltip.Root,{"data-slot":`tooltip`,...e})}function a(e){return(0,n.jsx)(t.Tooltip.Trigger,{"data-slot":`tooltip-trigger`,...e})}function o({className:r,sideOffset:i=4,children:a,...o}){return(0,n.jsx)(t.Tooltip.Portal,{children
|
|
1
|
+
const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime");function r({delayDuration:e=300,...r}){return/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Provider,{"data-slot":`tooltip-provider`,delayDuration:e,...r})}function i(e){return/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Root,{"data-slot":`tooltip`,...e})}function a(e){return/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Trigger,{"data-slot":`tooltip-trigger`,...e})}function o({className:r,sideOffset:i=4,children:a,...o}){return/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Portal,{children:/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Content,{"data-slot":`tooltip-content`,sideOffset:i,className:e.cn(`z-50 rounded border border-doom-border bg-doom-deep px-2 py-1 font-mono text-xs text-doom-text shadow-lg data-[state=delayed-open]:animate-doom-fade`,r),...o,children:a})})}exports.Tooltip=i,exports.TooltipContent=o,exports.TooltipProvider=r,exports.TooltipTrigger=a;
|
|
2
2
|
//# sourceMappingURL=Tooltip.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.cjs","names":["TooltipPrimitive","cn"],"sources":["../../../src/components/Tooltip.tsx"],"sourcesContent":["import { Tooltip as TooltipPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\nimport { cn } from '../lib/cn
|
|
1
|
+
{"version":3,"file":"Tooltip.cjs","names":["TooltipPrimitive","cn"],"sources":["../../../src/components/Tooltip.tsx"],"sourcesContent":["import { Tooltip as TooltipPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** Mount once near the root; every Tooltip below shares its delay. */\nexport function TooltipProvider({ delayDuration = 300, ...props }: ComponentProps<typeof TooltipPrimitive.Provider>) {\n return <TooltipPrimitive.Provider data-slot=\"tooltip-provider\" delayDuration={delayDuration} {...props} />;\n}\n\nexport function Tooltip(props: ComponentProps<typeof TooltipPrimitive.Root>) {\n return <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />;\n}\n\nexport function TooltipTrigger(props: ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nexport function TooltipContent({\n className,\n sideOffset = 4,\n children,\n ...props\n}: ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n 'z-50 rounded border border-doom-border bg-doom-deep px-2 py-1 font-mono text-xs text-doom-text shadow-lg data-[state=delayed-open]:animate-doom-fade',\n className,\n )}\n {...props}\n >\n {children}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n"],"mappings":"0FAMA,SAAgB,EAAgB,CAAE,gBAAgB,IAAK,GAAG,GAA2D,CACnH,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,QAAiB,SAAlB,CAA2B,YAAU,mBAAkC,gBAAe,GAAI,CAAQ,CAAA,CAC3G,CAEA,SAAgB,EAAQ,EAAqD,CAC3E,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,QAAiB,KAAlB,CAAuB,YAAU,UAAU,GAAI,CAAQ,CAAA,CAChE,CAEA,SAAgB,EAAe,EAAwD,CACrF,MAAO,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,QAAiB,QAAlB,CAA0B,YAAU,kBAAkB,GAAI,CAAQ,CAAA,CAC3E,CAEA,SAAgB,EAAe,CAC7B,YACA,aAAa,EACb,WACA,GAAG,GAC+C,CAClD,MACE,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,QAAiB,OAAlB,CAAA,SACE,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,QAAiB,QAAlB,CACE,YAAU,kBACE,aACZ,UAAWC,EAAAA,GACT,uJACA,CACF,EACA,GAAI,EAEH,UACuB,CAAA,CACH,CAAA,CAE7B"}
|
|
@@ -2,10 +2,10 @@ import { Tooltip } from "radix-ui";
|
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
//#region src/components/Tooltip.d.ts
|
|
4
4
|
/** Mount once near the root; every Tooltip below shares its delay. */
|
|
5
|
-
declare function TooltipProvider({ delayDuration, ...props }: ComponentProps<typeof Tooltip.Provider>): import("react
|
|
6
|
-
declare function Tooltip$1(props: ComponentProps<typeof Tooltip.Root>): import("react
|
|
7
|
-
declare function TooltipTrigger(props: ComponentProps<typeof Tooltip.Trigger>): import("react
|
|
8
|
-
declare function TooltipContent({ className, sideOffset, children, ...props }: ComponentProps<typeof Tooltip.Content>): import("react
|
|
5
|
+
export declare function TooltipProvider({ delayDuration, ...props }: ComponentProps<typeof Tooltip.Provider>): import("react").JSX.Element;
|
|
6
|
+
declare function Tooltip$1(props: ComponentProps<typeof Tooltip.Root>): import("react").JSX.Element;
|
|
7
|
+
export declare function TooltipTrigger(props: ComponentProps<typeof Tooltip.Trigger>): import("react").JSX.Element;
|
|
8
|
+
export declare function TooltipContent({ className, sideOffset, children, ...props }: ComponentProps<typeof Tooltip.Content>): import("react").JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { Tooltip$1 as Tooltip
|
|
10
|
+
export { Tooltip$1 as Tooltip };
|
|
11
11
|
//# sourceMappingURL=Tooltip.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.mts","names":[],"sources":["../../../src/components/Tooltip.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"Tooltip.d.mts","names":[],"sources":["../../../src/components/Tooltip.tsx"],"mappings":";;;;wBAMgB,kBAAkB,kBAAwB,SAAS,sBAAsB,QAAiB,4BAAS,IAAA;iBAInG,UAAQ,OAAO,sBAAsB,QAAiB,wBAAK,IAAA;wBAI3D,eAAe,OAAO,sBAAsB,QAAiB,2BAAQ,IAAA;wBAIrE,iBACd,WACA,YACA,aACG,SACF,sBAAsB,QAAiB,2BAAQ,IAAA"}
|