@agimon-ai/doompi-web-components 0.0.1-alpha.37 → 0.0.1-alpha.39
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/dist/index.cjs +1 -1
- package/dist/index.d.mts +2 -1
- 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.mjs +1 -1
- package/dist/src/components/Accordion.mjs.map +1 -1
- package/dist/src/components/AnsiText.cjs +3 -3
- package/dist/src/components/AnsiText.cjs.map +1 -1
- package/dist/src/components/AnsiText.mjs +3 -3
- package/dist/src/components/AnsiText.mjs.map +1 -1
- package/dist/src/components/Avatar.cjs +1 -1
- package/dist/src/components/Avatar.cjs.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.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.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.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.mjs +1 -1
- package/dist/src/components/Checkbox.mjs.map +1 -1
- package/dist/src/components/CodeBlock.cjs +1 -1
- package/dist/src/components/CodeBlock.cjs.map +1 -1
- package/dist/src/components/CodeBlock.mjs +1 -1
- package/dist/src/components/CodeBlock.mjs.map +1 -1
- package/dist/src/components/CodeEditor.cjs +1 -1
- package/dist/src/components/CodeEditor.cjs.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.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.mjs +1 -1
- package/dist/src/components/Command.mjs.map +1 -1
- package/dist/src/components/CopyButton.cjs +1 -1
- package/dist/src/components/CopyButton.cjs.map +1 -1
- package/dist/src/components/CopyButton.mjs +1 -1
- package/dist/src/components/CopyButton.mjs.map +1 -1
- package/dist/src/components/Dialog.cjs +1 -1
- package/dist/src/components/Dialog.cjs.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.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.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.mjs +1 -1
- package/dist/src/components/EmptyState.mjs.map +1 -1
- package/dist/src/components/HashlineLines.cjs +1 -1
- package/dist/src/components/HashlineLines.cjs.map +1 -1
- package/dist/src/components/HashlineLines.mjs +1 -1
- package/dist/src/components/HashlineLines.mjs.map +1 -1
- package/dist/src/components/Input.cjs +1 -1
- package/dist/src/components/Input.cjs.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.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.mjs +1 -1
- package/dist/src/components/Label.mjs.map +1 -1
- package/dist/src/components/Markdown.cjs +1 -1
- package/dist/src/components/Markdown.cjs.map +1 -1
- package/dist/src/components/Markdown.mjs +1 -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.mjs +1 -1
- package/dist/src/components/MediaPreview.mjs.map +1 -1
- package/dist/src/components/MermaidDiagram.cjs +1 -1
- package/dist/src/components/MermaidDiagram.cjs.map +1 -1
- package/dist/src/components/MermaidDiagram.mjs +1 -1
- package/dist/src/components/MermaidDiagram.mjs.map +1 -1
- package/dist/src/components/MessageItem.cjs +1 -1
- package/dist/src/components/MessageItem.cjs.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.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.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.mjs +1 -1
- package/dist/src/components/Panel.mjs.map +1 -1
- package/dist/src/components/PdfPreview.cjs +1 -1
- package/dist/src/components/PdfPreview.cjs.map +1 -1
- package/dist/src/components/PdfPreview.mjs +1 -1
- package/dist/src/components/PdfPreview.mjs.map +1 -1
- package/dist/src/components/Popover.cjs +1 -1
- package/dist/src/components/Popover.cjs.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.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.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.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.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.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.mjs +1 -1
- package/dist/src/components/Separator.mjs.map +1 -1
- package/dist/src/components/Sheet.cjs +1 -1
- package/dist/src/components/Sheet.cjs.map +1 -1
- package/dist/src/components/Sheet.mjs +1 -1
- package/dist/src/components/Sheet.mjs.map +1 -1
- package/dist/src/components/Skeleton.cjs +1 -1
- package/dist/src/components/Skeleton.cjs.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.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.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.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.mjs +1 -1
- package/dist/src/components/Switch.mjs.map +1 -1
- package/dist/src/components/SyntaxText.cjs +3 -3
- package/dist/src/components/SyntaxText.cjs.map +1 -1
- package/dist/src/components/SyntaxText.mjs +3 -3
- package/dist/src/components/SyntaxText.mjs.map +1 -1
- package/dist/src/components/Tabs.cjs +1 -1
- package/dist/src/components/Tabs.cjs.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 +1 -1
- package/dist/src/components/TerminalView.cjs.map +1 -1
- package/dist/src/components/TerminalView.mjs +1 -1
- package/dist/src/components/TerminalView.mjs.map +1 -1
- package/dist/src/components/Textarea.cjs +1 -1
- package/dist/src/components/Textarea.cjs.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.mjs +1 -1
- package/dist/src/components/Toast.mjs.map +1 -1
- package/dist/src/components/ToolPathLink.cjs +1 -1
- package/dist/src/components/ToolPathLink.cjs.map +1 -1
- package/dist/src/components/ToolPathLink.mjs +1 -1
- package/dist/src/components/ToolPathLink.mjs.map +1 -1
- package/dist/src/components/Tooltip.cjs +1 -1
- package/dist/src/components/Tooltip.cjs.map +1 -1
- package/dist/src/components/Tooltip.mjs +1 -1
- package/dist/src/components/Tooltip.mjs.map +1 -1
- package/package.json +11 -11
- package/dist/components/Accordion.d.cts +0 -11
- package/dist/components/Accordion.d.cts.map +0 -1
- package/dist/components/AnsiText.d.cts +0 -16
- package/dist/components/AnsiText.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 -17
- package/dist/components/Badge.d.cts.map +0 -1
- package/dist/components/Breadcrumb.d.cts +0 -36
- package/dist/components/Breadcrumb.d.cts.map +0 -1
- package/dist/components/Button.d.cts +0 -24
- 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 -5
- 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 -41
- 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 -15
- 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 -17
- package/dist/components/EmptyState.d.cts.map +0 -1
- package/dist/components/HashlineLines.d.cts +0 -23
- package/dist/components/HashlineLines.d.cts.map +0 -1
- package/dist/components/Input.d.cts +0 -19
- package/dist/components/Input.d.cts.map +0 -1
- package/dist/components/Kbd.d.cts +0 -6
- 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 -17
- package/dist/components/Markdown.d.cts.map +0 -1
- package/dist/components/MediaPreview.d.cts +0 -61
- package/dist/components/MediaPreview.d.cts.map +0 -1
- package/dist/components/MessageItem.d.cts +0 -102
- package/dist/components/MessageItem.d.cts.map +0 -1
- package/dist/components/MessageLines.d.cts +0 -23
- package/dist/components/MessageLines.d.cts.map +0 -1
- package/dist/components/OptionList.d.cts +0 -49
- package/dist/components/OptionList.d.cts.map +0 -1
- package/dist/components/Panel.d.cts +0 -14
- package/dist/components/Panel.d.cts.map +0 -1
- package/dist/components/PdfPreview.d.cts +0 -52
- package/dist/components/PdfPreview.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 -6
- 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/Sheet.d.cts +0 -35
- package/dist/components/Sheet.d.cts.map +0 -1
- package/dist/components/Skeleton.d.cts +0 -10
- package/dist/components/Skeleton.d.cts.map +0 -1
- package/dist/components/Spinner.d.cts +0 -14
- package/dist/components/Spinner.d.cts.map +0 -1
- package/dist/components/StatusBadge.d.cts +0 -23
- package/dist/components/StatusBadge.d.cts.map +0 -1
- package/dist/components/StreamCursor.d.cts +0 -6
- 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/SyntaxText.d.cts +0 -50
- package/dist/components/SyntaxText.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/TerminalView.d.cts +0 -31
- package/dist/components/TerminalView.d.cts.map +0 -1
- package/dist/components/Textarea.d.cts +0 -9
- 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/ToolPathLink.d.cts +0 -22
- package/dist/components/ToolPathLink.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 -59
- package/dist/lib/ansiSpans.d.cts +0 -42
- package/dist/lib/ansiSpans.d.cts.map +0 -1
- package/dist/lib/cn.d.cts +0 -6
- package/dist/lib/cn.d.cts.map +0 -1
- package/dist/lib/collapse.d.cts +0 -14
- package/dist/lib/collapse.d.cts.map +0 -1
- package/dist/lib/editorLanguage.d.cts +0 -21
- package/dist/lib/editorLanguage.d.cts.map +0 -1
- package/dist/lib/editorTheme.d.cts +0 -76
- package/dist/lib/editorTheme.d.cts.map +0 -1
- package/dist/lib/hashlineHighlight.d.cts +0 -30
- package/dist/lib/hashlineHighlight.d.cts.map +0 -1
- package/dist/lib/hashlineView.d.cts +0 -60
- package/dist/lib/hashlineView.d.cts.map +0 -1
- package/dist/lib/media.d.cts +0 -11
- package/dist/lib/media.d.cts.map +0 -1
- package/dist/lib/optionList.d.cts +0 -21
- package/dist/lib/optionList.d.cts.map +0 -1
- package/dist/lib/syntaxHighlight.d.cts +0 -54
- package/dist/lib/syntaxHighlight.d.cts.map +0 -1
- package/dist/lib/tone.d.cts +0 -25
- package/dist/lib/tone.d.cts.map +0 -1
- package/dist/theme/apply.d.cts +0 -25
- package/dist/theme/apply.d.cts.map +0 -1
- package/dist/theme/builtinThemes.d.cts +0 -11
- package/dist/theme/builtinThemes.d.cts.map +0 -1
- package/dist/theme/derive.d.cts +0 -14
- package/dist/theme/derive.d.cts.map +0 -1
- package/dist/theme/parse.d.cts +0 -10
- package/dist/theme/parse.d.cts.map +0 -1
- package/dist/theme/piTheme.d.cts +0 -19
- package/dist/theme/piTheme.d.cts.map +0 -1
- package/dist/theme/preference.d.cts +0 -15
- package/dist/theme/preference.d.cts.map +0 -1
- package/dist/theme.d.cts +0 -8
- package/dist/types/editor.d.cts +0 -78
- package/dist/types/editor.d.cts.map +0 -1
- package/dist/types/theme.d.cts +0 -38
- package/dist/types/theme.d.cts.map +0 -1
- package/dist/types/tone.d.cts +0 -28
- package/dist/types/tone.d.cts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.cjs","names":["cva","Slot","cn"],"sources":["../../../src/components/StatusBadge.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\nimport type { StatusTone as Tone } from '../types/tone';\n\nexport const statusBadgeVariants = cva(\n 'inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-sm font-mono font-bold uppercase',\n {\n variants: {\n tone: {\n neutral: 'bg-doom-panel text-doom-faint',\n running: 'bg-doom-tint-yellow text-doom-yellow',\n ok: 'bg-doom-tint-green text-doom-green',\n error: 'bg-doom-tint-red text-doom-red',\n info: 'bg-doom-tint-blue text-doom-blue',\n accent: 'bg-doom-tint-magenta text-doom-magenta',\n } satisfies Record<Tone, string>,\n size: {\n xs: 'px-1.5 py-0.5 text-2xs',\n sm: 'px-[7px] py-[3px] text-xs',\n md: 'h-[21px] px-2 text-sm normal-case',\n lg: 'h-6 px-2.5 text-base normal-case',\n },\n },\n defaultVariants: { tone: 'neutral', size: 'sm' },\n },\n);\n\nexport type StatusTone = Tone;\n\n/**\n * The border a card wears for a status, the same tint family as the badge.\n * MessageItem builds its frame variants from this table, so a tone's edge is\n * named once and a card and its badge can never disagree about it.\n */\nexport const STATUS_EDGE: Readonly<Record<StatusTone, string>> = {\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};\n\nexport interface StatusBadgeProps extends ComponentProps<'span'>, VariantProps<typeof statusBadgeVariants> {\n /** Render the child element instead of a <span>, so a link can look like a pill. */\n asChild?: boolean;\n}\n\n/** The tinted outcome pill: RUNNING, OK, ERROR and their kin, as every run card draws it. */\nexport function StatusBadge({ className, tone, size, asChild = false, ...props }: StatusBadgeProps) {\n const Component = asChild ? Slot.Root : 'span';\n return (\n <Component data-slot=\"status-badge\" className={cn(statusBadgeVariants({ tone, size }), className)} {...props} />\n );\n}\n"],"mappings":"0FAOA,MAAa,GAAA,oCAAsBA,CAAAA,CAAAA,IAAAA,CACjC,uGACA,CACE,SAAU,CACR,KAAM,CACJ,QAAS,gCACT,QAAS,uCACT,GAAI,qCACJ,MAAO,iCACP,KAAM,mCACN,OAAQ,wCACV,EACA,KAAM,CACJ,GAAI,yBACJ,GAAI,4BACJ,GAAI,oCACJ,GAAI,kCACN,CACF,EACA,gBAAiB,CAAE,KAAM,UAAW,KAAM,IAAK,CACjD,CACF,EASa,EAAoD,CAC/D,QAAS,qBACT,QAAS,0BACT,GAAI,yBACJ,MAAO,uBACP,KAAM,wBACN,OAAQ,0BACV,EAQA,SAAgB,EAAY,CAAE,YAAW,OAAM,OAAM,UAAU,GAAO,GAAG,GAA2B,CAClG,IAAM,EAAY,EAAUC,EAAAA,KAAK,KAAO,OACxC,
|
|
1
|
+
{"version":3,"file":"StatusBadge.cjs","names":["cva","Slot","cn"],"sources":["../../../src/components/StatusBadge.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\nimport type { StatusTone as Tone } from '../types/tone';\n\nexport const statusBadgeVariants = cva(\n 'inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-sm font-mono font-bold uppercase',\n {\n variants: {\n tone: {\n neutral: 'bg-doom-panel text-doom-faint',\n running: 'bg-doom-tint-yellow text-doom-yellow',\n ok: 'bg-doom-tint-green text-doom-green',\n error: 'bg-doom-tint-red text-doom-red',\n info: 'bg-doom-tint-blue text-doom-blue',\n accent: 'bg-doom-tint-magenta text-doom-magenta',\n } satisfies Record<Tone, string>,\n size: {\n xs: 'px-1.5 py-0.5 text-2xs',\n sm: 'px-[7px] py-[3px] text-xs',\n md: 'h-[21px] px-2 text-sm normal-case',\n lg: 'h-6 px-2.5 text-base normal-case',\n },\n },\n defaultVariants: { tone: 'neutral', size: 'sm' },\n },\n);\n\nexport type StatusTone = Tone;\n\n/**\n * The border a card wears for a status, the same tint family as the badge.\n * MessageItem builds its frame variants from this table, so a tone's edge is\n * named once and a card and its badge can never disagree about it.\n */\nexport const STATUS_EDGE: Readonly<Record<StatusTone, string>> = {\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};\n\nexport interface StatusBadgeProps extends ComponentProps<'span'>, VariantProps<typeof statusBadgeVariants> {\n /** Render the child element instead of a <span>, so a link can look like a pill. */\n asChild?: boolean;\n}\n\n/** The tinted outcome pill: RUNNING, OK, ERROR and their kin, as every run card draws it. */\nexport function StatusBadge({ className, tone, size, asChild = false, ...props }: StatusBadgeProps) {\n const Component = asChild ? Slot.Root : 'span';\n return (\n <Component data-slot=\"status-badge\" className={cn(statusBadgeVariants({ tone, size }), className)} {...props} />\n );\n}\n"],"mappings":"0FAOA,MAAa,GAAA,oCAAsBA,CAAAA,CAAAA,IAAAA,CACjC,uGACA,CACE,SAAU,CACR,KAAM,CACJ,QAAS,gCACT,QAAS,uCACT,GAAI,qCACJ,MAAO,iCACP,KAAM,mCACN,OAAQ,wCACV,EACA,KAAM,CACJ,GAAI,yBACJ,GAAI,4BACJ,GAAI,oCACJ,GAAI,kCACN,CACF,EACA,gBAAiB,CAAE,KAAM,UAAW,KAAM,IAAK,CACjD,CACF,EASa,EAAoD,CAC/D,QAAS,qBACT,QAAS,0BACT,GAAI,yBACJ,MAAO,uBACP,KAAM,wBACN,OAAQ,0BACV,EAQA,SAAgB,EAAY,CAAE,YAAW,OAAM,OAAM,UAAU,GAAO,GAAG,GAA2B,CAClG,IAAM,EAAY,EAAUC,EAAAA,KAAK,KAAO,OACxC,MACE,iBAAA,EAAA,EAAA,IAAA,CAAC,EAAD,CAAW,YAAU,eAAe,UAAWC,EAAAA,GAAG,EAAoB,CAAE,OAAM,MAAK,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CAEnH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as e}from"../lib/cn.mjs";import{Slot as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";const i=r(`inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-sm font-mono font-bold uppercase`,{variants:{tone:{neutral:`bg-doom-panel text-doom-faint`,running:`bg-doom-tint-yellow text-doom-yellow`,ok:`bg-doom-tint-green text-doom-green`,error:`bg-doom-tint-red text-doom-red`,info:`bg-doom-tint-blue text-doom-blue`,accent:`bg-doom-tint-magenta text-doom-magenta`},size:{xs:`px-1.5 py-0.5 text-2xs`,sm:`px-[7px] py-[3px] text-xs`,md:`h-[21px] px-2 text-sm normal-case`,lg:`h-6 px-2.5 text-base normal-case`}},defaultVariants:{tone:`neutral`,size:`sm`}}),a={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`};function o({className:r,tone:a,size:o,asChild:s=!1,...c}){let l=s?t.Root:`span`;return n(l,{"data-slot":`status-badge`,className:e(i({tone:a,size:o}),r),...c})}export{a as STATUS_EDGE,o as StatusBadge,i as statusBadgeVariants};
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{Slot as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";const i=r(`inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-sm font-mono font-bold uppercase`,{variants:{tone:{neutral:`bg-doom-panel text-doom-faint`,running:`bg-doom-tint-yellow text-doom-yellow`,ok:`bg-doom-tint-green text-doom-green`,error:`bg-doom-tint-red text-doom-red`,info:`bg-doom-tint-blue text-doom-blue`,accent:`bg-doom-tint-magenta text-doom-magenta`},size:{xs:`px-1.5 py-0.5 text-2xs`,sm:`px-[7px] py-[3px] text-xs`,md:`h-[21px] px-2 text-sm normal-case`,lg:`h-6 px-2.5 text-base normal-case`}},defaultVariants:{tone:`neutral`,size:`sm`}}),a={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`};function o({className:r,tone:a,size:o,asChild:s=!1,...c}){let l=s?t.Root:`span`;return/* @__PURE__ */ n(l,{"data-slot":`status-badge`,className:e(i({tone:a,size:o}),r),...c})}export{a as STATUS_EDGE,o as StatusBadge,i as statusBadgeVariants};
|
|
2
2
|
//# sourceMappingURL=StatusBadge.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.mjs","names":[],"sources":["../../../src/components/StatusBadge.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\nimport type { StatusTone as Tone } from '../types/tone';\n\nexport const statusBadgeVariants = cva(\n 'inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-sm font-mono font-bold uppercase',\n {\n variants: {\n tone: {\n neutral: 'bg-doom-panel text-doom-faint',\n running: 'bg-doom-tint-yellow text-doom-yellow',\n ok: 'bg-doom-tint-green text-doom-green',\n error: 'bg-doom-tint-red text-doom-red',\n info: 'bg-doom-tint-blue text-doom-blue',\n accent: 'bg-doom-tint-magenta text-doom-magenta',\n } satisfies Record<Tone, string>,\n size: {\n xs: 'px-1.5 py-0.5 text-2xs',\n sm: 'px-[7px] py-[3px] text-xs',\n md: 'h-[21px] px-2 text-sm normal-case',\n lg: 'h-6 px-2.5 text-base normal-case',\n },\n },\n defaultVariants: { tone: 'neutral', size: 'sm' },\n },\n);\n\nexport type StatusTone = Tone;\n\n/**\n * The border a card wears for a status, the same tint family as the badge.\n * MessageItem builds its frame variants from this table, so a tone's edge is\n * named once and a card and its badge can never disagree about it.\n */\nexport const STATUS_EDGE: Readonly<Record<StatusTone, string>> = {\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};\n\nexport interface StatusBadgeProps extends ComponentProps<'span'>, VariantProps<typeof statusBadgeVariants> {\n /** Render the child element instead of a <span>, so a link can look like a pill. */\n asChild?: boolean;\n}\n\n/** The tinted outcome pill: RUNNING, OK, ERROR and their kin, as every run card draws it. */\nexport function StatusBadge({ className, tone, size, asChild = false, ...props }: StatusBadgeProps) {\n const Component = asChild ? Slot.Root : 'span';\n return (\n <Component data-slot=\"status-badge\" className={cn(statusBadgeVariants({ tone, size }), className)} {...props} />\n );\n}\n"],"mappings":"0JAOA,MAAa,EAAsB,EACjC,uGACA,CACE,SAAU,CACR,KAAM,CACJ,QAAS,gCACT,QAAS,uCACT,GAAI,qCACJ,MAAO,iCACP,KAAM,mCACN,OAAQ,wCACV,EACA,KAAM,CACJ,GAAI,yBACJ,GAAI,4BACJ,GAAI,oCACJ,GAAI,kCACN,CACF,EACA,gBAAiB,CAAE,KAAM,UAAW,KAAM,IAAK,CACjD,CACF,EASa,EAAoD,CAC/D,QAAS,qBACT,QAAS,0BACT,GAAI,yBACJ,MAAO,uBACP,KAAM,wBACN,OAAQ,0BACV,EAQA,SAAgB,EAAY,CAAE,YAAW,OAAM,OAAM,UAAU,GAAO,GAAG,GAA2B,CAClG,IAAM,EAAY,EAAU,EAAK,KAAO,OACxC,
|
|
1
|
+
{"version":3,"file":"StatusBadge.mjs","names":[],"sources":["../../../src/components/StatusBadge.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\nimport type { StatusTone as Tone } from '../types/tone';\n\nexport const statusBadgeVariants = cva(\n 'inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-sm font-mono font-bold uppercase',\n {\n variants: {\n tone: {\n neutral: 'bg-doom-panel text-doom-faint',\n running: 'bg-doom-tint-yellow text-doom-yellow',\n ok: 'bg-doom-tint-green text-doom-green',\n error: 'bg-doom-tint-red text-doom-red',\n info: 'bg-doom-tint-blue text-doom-blue',\n accent: 'bg-doom-tint-magenta text-doom-magenta',\n } satisfies Record<Tone, string>,\n size: {\n xs: 'px-1.5 py-0.5 text-2xs',\n sm: 'px-[7px] py-[3px] text-xs',\n md: 'h-[21px] px-2 text-sm normal-case',\n lg: 'h-6 px-2.5 text-base normal-case',\n },\n },\n defaultVariants: { tone: 'neutral', size: 'sm' },\n },\n);\n\nexport type StatusTone = Tone;\n\n/**\n * The border a card wears for a status, the same tint family as the badge.\n * MessageItem builds its frame variants from this table, so a tone's edge is\n * named once and a card and its badge can never disagree about it.\n */\nexport const STATUS_EDGE: Readonly<Record<StatusTone, string>> = {\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};\n\nexport interface StatusBadgeProps extends ComponentProps<'span'>, VariantProps<typeof statusBadgeVariants> {\n /** Render the child element instead of a <span>, so a link can look like a pill. */\n asChild?: boolean;\n}\n\n/** The tinted outcome pill: RUNNING, OK, ERROR and their kin, as every run card draws it. */\nexport function StatusBadge({ className, tone, size, asChild = false, ...props }: StatusBadgeProps) {\n const Component = asChild ? Slot.Root : 'span';\n return (\n <Component data-slot=\"status-badge\" className={cn(statusBadgeVariants({ tone, size }), className)} {...props} />\n );\n}\n"],"mappings":"0JAOA,MAAa,EAAsB,EACjC,uGACA,CACE,SAAU,CACR,KAAM,CACJ,QAAS,gCACT,QAAS,uCACT,GAAI,qCACJ,MAAO,iCACP,KAAM,mCACN,OAAQ,wCACV,EACA,KAAM,CACJ,GAAI,yBACJ,GAAI,4BACJ,GAAI,oCACJ,GAAI,kCACN,CACF,EACA,gBAAiB,CAAE,KAAM,UAAW,KAAM,IAAK,CACjD,CACF,EASa,EAAoD,CAC/D,QAAS,qBACT,QAAS,0BACT,GAAI,yBACJ,MAAO,uBACP,KAAM,wBACN,OAAQ,0BACV,EAQA,SAAgB,EAAY,CAAE,YAAW,OAAM,OAAM,UAAU,GAAO,GAAG,GAA2B,CAClG,IAAM,EAAY,EAAU,EAAK,KAAO,OACxC,MACE,kBAAC,EAAD,CAAW,YAAU,eAAe,UAAW,EAAG,EAAoB,CAAE,OAAM,MAAK,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CAEnH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../lib/cn.cjs");let t=require("react/jsx-runtime");function n({className:n,...r}){return(0,t.jsx)(`span`,{"data-slot":`stream-cursor`,"aria-hidden":!0,className:e.cn(`ml-0.5 inline-block h-3.5 w-2 translate-y-0.5 animate-doom-blink bg-doom-blue`,n),...r})}exports.StreamCursor=n;
|
|
1
|
+
const e=require("../lib/cn.cjs");let t=require("react/jsx-runtime");function n({className:n,...r}){return/* @__PURE__ */ (0,t.jsx)(`span`,{"data-slot":`stream-cursor`,"aria-hidden":!0,className:e.cn(`ml-0.5 inline-block h-3.5 w-2 translate-y-0.5 animate-doom-blink bg-doom-blue`,n),...r})}exports.StreamCursor=n;
|
|
2
2
|
//# sourceMappingURL=StreamCursor.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StreamCursor.cjs","names":["cn"],"sources":["../../../src/components/StreamCursor.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** The blinking block that marks text still arriving. */\nexport function StreamCursor({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"stream-cursor\"\n aria-hidden\n className={cn('ml-0.5 inline-block h-3.5 w-2 translate-y-0.5 animate-doom-blink bg-doom-blue', className)}\n {...props}\n />\n );\n}\n"],"mappings":"oEAKA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAiC,CAC5E,
|
|
1
|
+
{"version":3,"file":"StreamCursor.cjs","names":["cn"],"sources":["../../../src/components/StreamCursor.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** The blinking block that marks text still arriving. */\nexport function StreamCursor({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"stream-cursor\"\n aria-hidden\n className={cn('ml-0.5 inline-block h-3.5 w-2 translate-y-0.5 animate-doom-blink bg-doom-blue', className)}\n {...props}\n />\n );\n}\n"],"mappings":"oEAKA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAiC,CAC5E,MACE,iBAAA,EAAA,EAAA,IAAA,CAAC,OAAD,CACE,YAAU,gBACV,cAAA,GACA,UAAWA,EAAAA,GAAG,gFAAiF,CAAS,EACxG,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as e}from"../lib/cn.mjs";import{jsx as t}from"react/jsx-runtime";function n({className:n,...r}){return t(`span`,{"data-slot":`stream-cursor`,"aria-hidden":!0,className:e(`ml-0.5 inline-block h-3.5 w-2 translate-y-0.5 animate-doom-blink bg-doom-blue`,n),...r})}export{n as StreamCursor};
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{jsx as t}from"react/jsx-runtime";function n({className:n,...r}){return/* @__PURE__ */ t(`span`,{"data-slot":`stream-cursor`,"aria-hidden":!0,className:e(`ml-0.5 inline-block h-3.5 w-2 translate-y-0.5 animate-doom-blink bg-doom-blue`,n),...r})}export{n as StreamCursor};
|
|
2
2
|
//# sourceMappingURL=StreamCursor.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StreamCursor.mjs","names":[],"sources":["../../../src/components/StreamCursor.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** The blinking block that marks text still arriving. */\nexport function StreamCursor({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"stream-cursor\"\n aria-hidden\n className={cn('ml-0.5 inline-block h-3.5 w-2 translate-y-0.5 animate-doom-blink bg-doom-blue', className)}\n {...props}\n />\n );\n}\n"],"mappings":"2EAKA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAiC,CAC5E,
|
|
1
|
+
{"version":3,"file":"StreamCursor.mjs","names":[],"sources":["../../../src/components/StreamCursor.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** The blinking block that marks text still arriving. */\nexport function StreamCursor({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"stream-cursor\"\n aria-hidden\n className={cn('ml-0.5 inline-block h-3.5 w-2 translate-y-0.5 animate-doom-blink bg-doom-blue', className)}\n {...props}\n />\n );\n}\n"],"mappings":"2EAKA,SAAgB,EAAa,CAAE,YAAW,GAAG,GAAiC,CAC5E,MACE,kBAAC,OAAD,CACE,YAAU,gBACV,cAAA,GACA,UAAW,EAAG,gFAAiF,CAAS,EACxG,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime");function r({className:r,...i}){return(0,n.jsx)(t.Switch.Root,{"data-slot":`switch`,className:e.cn(`inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border border-doom-border bg-doom-deep p-px outline-none transition-colors focus-visible:ring-2 focus-visible:ring-doom-blue/50 disabled:pointer-events-none disabled:opacity-40 data-[state=checked]:border-doom-blue data-[state=checked]:bg-doom-tint-blue`,r),...i,children
|
|
1
|
+
const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime");function r({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Switch.Root,{"data-slot":`switch`,className:e.cn(`inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border border-doom-border bg-doom-deep p-px outline-none transition-colors focus-visible:ring-2 focus-visible:ring-doom-blue/50 disabled:pointer-events-none disabled:opacity-40 data-[state=checked]:border-doom-blue data-[state=checked]:bg-doom-tint-blue`,r),...i,children:/* @__PURE__ */ (0,n.jsx)(t.Switch.Thumb,{"data-slot":`switch-thumb`,className:`block h-3 w-3 rounded-full bg-doom-faint transition-transform data-[state=checked]:translate-x-3 data-[state=checked]:bg-doom-blue`})})}exports.Switch=r;
|
|
2
2
|
//# sourceMappingURL=Switch.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.cjs","names":["SwitchPrimitive","cn"],"sources":["../../../src/components/Switch.tsx"],"sourcesContent":["import { Switch as SwitchPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** An on/off track; use it where the change takes effect immediately, a checkbox where it needs a save. */\nexport function Switch({ className, ...props }: ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n 'inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border border-doom-border bg-doom-deep p-px outline-none transition-colors focus-visible:ring-2 focus-visible:ring-doom-blue/50 disabled:pointer-events-none disabled:opacity-40 data-[state=checked]:border-doom-blue data-[state=checked]:bg-doom-tint-blue',\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"block h-3 w-3 rounded-full bg-doom-faint transition-transform data-[state=checked]:translate-x-3 data-[state=checked]:bg-doom-blue\"\n />\n </SwitchPrimitive.Root>\n );\n}\n"],"mappings":"0FAMA,SAAgB,EAAO,CAAE,YAAW,GAAG,GAAsD,CAC3F,
|
|
1
|
+
{"version":3,"file":"Switch.cjs","names":["SwitchPrimitive","cn"],"sources":["../../../src/components/Switch.tsx"],"sourcesContent":["import { Switch as SwitchPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** An on/off track; use it where the change takes effect immediately, a checkbox where it needs a save. */\nexport function Switch({ className, ...props }: ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n 'inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border border-doom-border bg-doom-deep p-px outline-none transition-colors focus-visible:ring-2 focus-visible:ring-doom-blue/50 disabled:pointer-events-none disabled:opacity-40 data-[state=checked]:border-doom-blue data-[state=checked]:bg-doom-tint-blue',\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"block h-3 w-3 rounded-full bg-doom-faint transition-transform data-[state=checked]:translate-x-3 data-[state=checked]:bg-doom-blue\"\n />\n </SwitchPrimitive.Root>\n );\n}\n"],"mappings":"0FAMA,SAAgB,EAAO,CAAE,YAAW,GAAG,GAAsD,CAC3F,MACE,iBAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAgB,KAAjB,CACE,YAAU,SACV,UAAWC,EAAAA,GACT,sUACA,CACF,EACA,GAAI,EAEJ,SAAA,iBAAA,EAAA,EAAA,IAAA,CAACD,EAAAA,OAAgB,MAAjB,CACE,YAAU,eACV,UAAU,oIACX,CAAA,CACmB,CAAA,CAE1B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as e}from"../lib/cn.mjs";import{Switch as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function r({className:r,...i}){return n(t.Root,{"data-slot":`switch`,className:e(`inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border border-doom-border bg-doom-deep p-px outline-none transition-colors focus-visible:ring-2 focus-visible:ring-doom-blue/50 disabled:pointer-events-none disabled:opacity-40 data-[state=checked]:border-doom-blue data-[state=checked]:bg-doom-tint-blue`,r),...i,children
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{Switch as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function r({className:r,...i}){return/* @__PURE__ */ n(t.Root,{"data-slot":`switch`,className:e(`inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border border-doom-border bg-doom-deep p-px outline-none transition-colors focus-visible:ring-2 focus-visible:ring-doom-blue/50 disabled:pointer-events-none disabled:opacity-40 data-[state=checked]:border-doom-blue data-[state=checked]:bg-doom-tint-blue`,r),...i,children:/* @__PURE__ */ n(t.Thumb,{"data-slot":`switch-thumb`,className:`block h-3 w-3 rounded-full bg-doom-faint transition-transform data-[state=checked]:translate-x-3 data-[state=checked]:bg-doom-blue`})})}export{r as Switch};
|
|
2
2
|
//# sourceMappingURL=Switch.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.mjs","names":["Switch","SwitchPrimitive"],"sources":["../../../src/components/Switch.tsx"],"sourcesContent":["import { Switch as SwitchPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** An on/off track; use it where the change takes effect immediately, a checkbox where it needs a save. */\nexport function Switch({ className, ...props }: ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n 'inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border border-doom-border bg-doom-deep p-px outline-none transition-colors focus-visible:ring-2 focus-visible:ring-doom-blue/50 disabled:pointer-events-none disabled:opacity-40 data-[state=checked]:border-doom-blue data-[state=checked]:bg-doom-tint-blue',\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"block h-3 w-3 rounded-full bg-doom-faint transition-transform data-[state=checked]:translate-x-3 data-[state=checked]:bg-doom-blue\"\n />\n </SwitchPrimitive.Root>\n );\n}\n"],"mappings":"6GAMA,SAAgBA,EAAO,CAAE,YAAW,GAAG,GAAsD,CAC3F,
|
|
1
|
+
{"version":3,"file":"Switch.mjs","names":["Switch","SwitchPrimitive"],"sources":["../../../src/components/Switch.tsx"],"sourcesContent":["import { Switch as SwitchPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** An on/off track; use it where the change takes effect immediately, a checkbox where it needs a save. */\nexport function Switch({ className, ...props }: ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n 'inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border border-doom-border bg-doom-deep p-px outline-none transition-colors focus-visible:ring-2 focus-visible:ring-doom-blue/50 disabled:pointer-events-none disabled:opacity-40 data-[state=checked]:border-doom-blue data-[state=checked]:bg-doom-tint-blue',\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"block h-3 w-3 rounded-full bg-doom-faint transition-transform data-[state=checked]:translate-x-3 data-[state=checked]:bg-doom-blue\"\n />\n </SwitchPrimitive.Root>\n );\n}\n"],"mappings":"6GAMA,SAAgBA,EAAO,CAAE,YAAW,GAAG,GAAsD,CAC3F,MACE,kBAACC,EAAgB,KAAjB,CACE,YAAU,SACV,UAAW,EACT,sUACA,CACF,EACA,GAAI,EAEJ,SAAA,kBAACA,EAAgB,MAAjB,CACE,YAAU,eACV,UAAU,oIACX,CAAA,CACmB,CAAA,CAE1B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("../lib/cn.cjs"),t=require("../lib/syntaxHighlight.cjs");let n=require("react/jsx-runtime"),r=require("react");function i(e,n={}){let{path:i,grammar:a}=n,o=a??t.detectGrammar({path:i,text:e}),s=`${o??``}\u0000${e}`,[c,l]=(0,r.useState)(void 0);return(0,r.useEffect)(()=>{if(o===void 0)return;let n=!0;return t.highlightToLines(e,o).then(e=>{n&&e!==void 0&&l({signature:s,lines:e})},()=>void 0),()=>{n=!1}},[e,o,s]),c?.signature===s?c.lines:void 0}function a({spans:e,text:r,...i}){return e===void 0
|
|
2
|
-
`);return(0,n.jsx)(`pre`,{"data-slot":`syntax-text`,"data-highlighted":u!==void 0,className:e.cn(`whitespace-pre-wrap break-words [overflow-wrap:anywhere] font-mono`,t),...l,children:(u??d).map((e,t)
|
|
3
|
-
`:null
|
|
1
|
+
const e=require("../lib/cn.cjs"),t=require("../lib/syntaxHighlight.cjs");let n=require("react/jsx-runtime"),r=require("react");function i(e,n={}){let{path:i,grammar:a}=n,o=a??t.detectGrammar({path:i,text:e}),s=`${o??``}\u0000${e}`,[c,l]=(0,r.useState)(void 0);return(0,r.useEffect)(()=>{if(o===void 0)return;let n=!0;return t.highlightToLines(e,o).then(e=>{n&&e!==void 0&&l({signature:s,lines:e})},()=>void 0),()=>{n=!1}},[e,o,s]),c?.signature===s?c.lines:void 0}function a({spans:e,text:r,...i}){return e===void 0?/* @__PURE__ */ (0,n.jsx)(`span`,{...i,children:r}):/* @__PURE__ */ (0,n.jsx)(`span`,{...i,children:e.map((e,r)=>/* @__PURE__ */ (0,n.jsx)(`span`,{style:t.syntaxStyleOf(e.token),children:e.text},r))})}function o({className:t,text:o,path:s,grammar:c,...l}){let u=i(o,{path:s,grammar:c}),d=o.split(`
|
|
2
|
+
`);return/* @__PURE__ */ (0,n.jsx)(`pre`,{"data-slot":`syntax-text`,"data-highlighted":u!==void 0,className:e.cn(`whitespace-pre-wrap break-words [overflow-wrap:anywhere] font-mono`,t),...l,children:(u??d).map((e,t)=>/* @__PURE__ */ (0,n.jsxs)(r.Fragment,{children:[t>0?`
|
|
3
|
+
`:null,/* @__PURE__ */ (0,n.jsx)(a,{spans:typeof e==`string`?void 0:e,text:typeof e==`string`?e:``})]},t))})}exports.SyntaxLine=a,exports.SyntaxText=o,exports.useSyntaxLines=i;
|
|
4
4
|
//# sourceMappingURL=SyntaxText.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyntaxText.cjs","names":["detectGrammar","useState","highlightToLines","syntaxStyleOf","cn","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":"+HA6CA,SAAgB,EAAe,EAAc,EAAqB,CAAC,EAA4B,CAC7F,GAAM,CAAE,OAAM,WAAY,EACpB,EAAM,GAAWA,EAAAA,cAAc,CAAE,OAAM,MAAK,CAAC,EAC7C,EAAY,GAAG,GAAO,GAAG,QAAQ,IACjC,CAAC,EAAM,IAAA,EAAWC,EAAAA,SAAAA,CAAgE,IAAA,EAAS,EAkBjG,OAhBA,EAAA,EAAA,UAAA,KAAgB,CACd,GAAI,IAAQ,IAAA,GAAW,OACvB,IAAI,EAAO,GASX,OARA,EAAKC,iBAAiB,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,
|
|
1
|
+
{"version":3,"file":"SyntaxText.cjs","names":["detectGrammar","useState","highlightToLines","syntaxStyleOf","cn","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":"+HA6CA,SAAgB,EAAe,EAAc,EAAqB,CAAC,EAA4B,CAC7F,GAAM,CAAE,OAAM,WAAY,EACpB,EAAM,GAAWA,EAAAA,cAAc,CAAE,OAAM,MAAK,CAAC,EAC7C,EAAY,GAAG,GAAO,GAAG,QAAQ,IACjC,CAAC,EAAM,IAAA,EAAWC,EAAAA,SAAAA,CAAgE,IAAA,EAAS,EAkBjG,OAhBA,EAAA,EAAA,UAAA,KAAgB,CACd,GAAI,IAAQ,IAAA,GAAW,OACvB,IAAI,EAAO,GASX,OARA,EAAKC,iBAAiB,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,iBAAA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,GAAI,EAAQ,SAAA,CAAW,CAAA,EAE3D,iBAAA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,GAAI,EACP,SAAA,EAAM,KAAK,EAAM,IAChB,iBAAA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAkB,MAAOC,EAAAA,cAAc,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,iBAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CACE,YAAU,cACV,mBAAkB,IAAU,IAAA,GAC5B,UAAWC,EAAAA,GAAG,qEAAsE,CAAS,EAC7F,GAAI,EAEF,UAAA,GAAS,EAAA,CAAO,KAAK,EAAO,IAC5B,iBAAA,EAAA,EAAA,KAAA,CAACC,EAAAA,SAAD,CAAA,SAAA,CACG,EAAQ,EAAI;EAAO,KACpB,iBAAA,EAAA,EAAA,IAAA,CAAC,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,4 +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
|
|
2
|
-
`);return 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)
|
|
3
|
-
`:null
|
|
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
4
|
//# sourceMappingURL=SyntaxText.mjs.map
|
|
@@ -1 +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,
|
|
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-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(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(0,n.jsx)(`span`,{"data-slot":`nav-tab-badge`,className:e.cn(a({active:r}),t),...i})}function c(e){return(0,n.jsx)(t.Tabs.Root,{"data-slot":`tabs`,...e})}function l({className:r,...i}){return(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(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(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;
|
|
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';\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,
|
|
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,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-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 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 r(`span`,{"data-slot":`nav-tab-badge`,className:e(o({active:n}),t),...i})}function l(e){return r(n.Root,{"data-slot":`tabs`,...e})}function u({className:t,...i}){return r(n.List,{"data-slot":`tabs-list`,className:e(`flex items-center gap-1`,t),...i})}function d({className:t,...i}){return 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 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};
|
|
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';\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,
|
|
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"}
|
|
@@ -1,2 +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()}},[])
|
|
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
2
|
//# sourceMappingURL=TerminalView.cjs.map
|
|
@@ -1 +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,
|
|
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"}
|
|
@@ -1,2 +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()}},[])
|
|
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
2
|
//# sourceMappingURL=TerminalView.mjs.map
|
|
@@ -1 +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,
|
|
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';\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,
|
|
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,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';\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,
|
|
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-sm font-bold text-doom-hi`,r),...i})}function u({className:r,...i}){return(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(0,n.jsx)(t.Toast.Action,{"data-slot":`toast-action`,...e})}function f({className:r,...a}){return(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
|
|
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';\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,
|
|
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,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-sm font-bold text-doom-hi`,e),...i})}function u({className:e,...i}){return r(n.Description,{"data-slot":`toast-description`,className:t(`text-sm leading-relaxed text-doom-dim`,e),...i})}function d(e){return r(n.Action,{"data-slot":`toast-action`,...e})}function f({className:i,...a}){return 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
|
|
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';\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,
|
|
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"}
|
|
@@ -1,2 +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
|
|
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
2
|
//# sourceMappingURL=ToolPathLink.cjs.map
|
|
@@ -1 +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,
|
|
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"}
|
|
@@ -1,2 +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
|
|
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
2
|
//# sourceMappingURL=ToolPathLink.mjs.map
|
|
@@ -1 +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,
|
|
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';\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,
|
|
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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as e}from"../lib/cn.mjs";import{Tooltip as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function r({delayDuration:e=300,...r}){return n(t.Provider,{"data-slot":`tooltip-provider`,delayDuration:e,...r})}function i(e){return n(t.Root,{"data-slot":`tooltip`,...e})}function a(e){return n(t.Trigger,{"data-slot":`tooltip-trigger`,...e})}function o({className:r,sideOffset:i=4,children:a,...o}){return n(t.Portal,{children
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{Tooltip as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function r({delayDuration:e=300,...r}){return/* @__PURE__ */ n(t.Provider,{"data-slot":`tooltip-provider`,delayDuration:e,...r})}function i(e){return/* @__PURE__ */ n(t.Root,{"data-slot":`tooltip`,...e})}function a(e){return/* @__PURE__ */ n(t.Trigger,{"data-slot":`tooltip-trigger`,...e})}function o({className:r,sideOffset:i=4,children:a,...o}){return/* @__PURE__ */ n(t.Portal,{children:/* @__PURE__ */ n(t.Content,{"data-slot":`tooltip-content`,sideOffset:i,className:e(`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})})}export{i as Tooltip,o as TooltipContent,r as TooltipProvider,a as TooltipTrigger};
|
|
2
2
|
//# sourceMappingURL=Tooltip.mjs.map
|