@vizejs/fresco 0.0.1-alpha.31

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-DtI-O8Cr.js","names":["style: Record<string, unknown>","ALIGN_MAP: Record<string, string>","JUSTIFY_MAP: Record<string, string>","rows: VNode[][]","currentRow: VNode[]","children: VNode[]","headerContent: VNode[]","value: string","text: string","style: Record<string, unknown>","v: string","children: VNode[]","timer: ReturnType<typeof setInterval> | null","v: number","ALERT_CONFIG: Record<AlertType, { icon: string; fg: string; title: string }>","VARIANT_COLORS: Record<BadgeVariant, { fg: string; bg?: string }>","intervalId: ReturnType<typeof setInterval> | null","children: VNode[]","children: VNode[]","value: unknown","width?: number | string","rows: ReturnType<typeof h>[]","node: TreeNode","depth: number","isLast: boolean","prefix: string","nodes: VNode[]","children: VNode[]","children: VNode[]","itemContent: VNode[]","tabItems: VNode[]","index: number","status: StepStatus","children: VNode[]","items: StatusBarItem[]","result: VNode[]","children: VNode[]","STATUS_COLORS: Record<string, string>","STATUS_ICONS: Record<string, string>"],"sources":["../src/components/Box.ts","../src/components/Divider.ts","../src/components/Stack.ts","../src/components/Grid.ts","../src/components/Card.ts","../src/components/Text.ts","../src/components/Code.ts","../src/components/Link.ts","../src/components/TextInput.ts","../src/components/TextArea.ts","../src/components/Select.ts","../src/components/Checkbox.ts","../src/components/RadioGroup.ts","../src/components/Confirm.ts","../src/components/Form.ts","../src/components/Spinner.ts","../src/components/ProgressBar.ts","../src/components/Alert.ts","../src/components/Badge.ts","../src/components/Timer.ts","../src/components/Tooltip.ts","../src/components/List.ts","../src/components/Table.ts","../src/components/Tree.ts","../src/components/Menu.ts","../src/components/Tabs.ts","../src/components/Breadcrumb.ts","../src/components/Stepper.ts","../src/components/Modal.ts","../src/components/StatusBar.ts","../src/components/Header.ts","../src/components/KeyHint.ts","../src/components/Avatar.ts"],"sourcesContent":["/**\n * Box Component - Container with flexbox layout\n */\n\nimport { defineComponent, h, type PropType } from \"@vue/runtime-core\";\n\nexport interface BoxProps {\n /** Flex direction */\n flexDirection?: \"row\" | \"column\" | \"row-reverse\" | \"column-reverse\";\n /** Flex wrap */\n flexWrap?: \"nowrap\" | \"wrap\" | \"wrap-reverse\";\n /** Justify content */\n justifyContent?:\n | \"flex-start\"\n | \"flex-end\"\n | \"center\"\n | \"space-between\"\n | \"space-around\"\n | \"space-evenly\";\n /** Align items */\n alignItems?: \"flex-start\" | \"flex-end\" | \"center\" | \"stretch\" | \"baseline\";\n /** Align self */\n alignSelf?: \"auto\" | \"flex-start\" | \"flex-end\" | \"center\" | \"stretch\" | \"baseline\";\n /** Flex grow */\n flexGrow?: number;\n /** Flex shrink */\n flexShrink?: number;\n /** Width */\n width?: number | string;\n /** Height */\n height?: number | string;\n /** Min width */\n minWidth?: number | string;\n /** Min height */\n minHeight?: number | string;\n /** Max width */\n maxWidth?: number | string;\n /** Max height */\n maxHeight?: number | string;\n /** Padding (all sides) */\n padding?: number;\n /** Padding X (left and right) */\n paddingX?: number;\n /** Padding Y (top and bottom) */\n paddingY?: number;\n /** Padding top */\n paddingTop?: number;\n /** Padding right */\n paddingRight?: number;\n /** Padding bottom */\n paddingBottom?: number;\n /** Padding left */\n paddingLeft?: number;\n /** Margin (all sides) */\n margin?: number;\n /** Margin X (left and right) */\n marginX?: number;\n /** Margin Y (top and bottom) */\n marginY?: number;\n /** Margin top */\n marginTop?: number;\n /** Margin right */\n marginRight?: number;\n /** Margin bottom */\n marginBottom?: number;\n /** Margin left */\n marginLeft?: number;\n /** Gap between children */\n gap?: number;\n /** Border style */\n border?: \"none\" | \"single\" | \"double\" | \"rounded\" | \"heavy\" | \"dashed\";\n /** Foreground color */\n fg?: string;\n /** Background color */\n bg?: string;\n}\n\nexport const Box = defineComponent({\n name: \"Box\",\n props: {\n flexDirection: String as PropType<BoxProps[\"flexDirection\"]>,\n flexWrap: String as PropType<BoxProps[\"flexWrap\"]>,\n justifyContent: String as PropType<BoxProps[\"justifyContent\"]>,\n alignItems: String as PropType<BoxProps[\"alignItems\"]>,\n alignSelf: String as PropType<BoxProps[\"alignSelf\"]>,\n flexGrow: Number,\n flexShrink: Number,\n width: [Number, String] as PropType<number | string>,\n height: [Number, String] as PropType<number | string>,\n minWidth: [Number, String] as PropType<number | string>,\n minHeight: [Number, String] as PropType<number | string>,\n maxWidth: [Number, String] as PropType<number | string>,\n maxHeight: [Number, String] as PropType<number | string>,\n padding: Number,\n paddingX: Number,\n paddingY: Number,\n paddingTop: Number,\n paddingRight: Number,\n paddingBottom: Number,\n paddingLeft: Number,\n margin: Number,\n marginX: Number,\n marginY: Number,\n marginTop: Number,\n marginRight: Number,\n marginBottom: Number,\n marginLeft: Number,\n gap: Number,\n border: String as PropType<BoxProps[\"border\"]>,\n fg: String,\n bg: String,\n },\n setup(props, { slots }) {\n return () => {\n const style: Record<string, unknown> = {};\n\n // Layout props\n if (props.flexDirection) style.flex_direction = props.flexDirection;\n if (props.flexWrap) style.flex_wrap = props.flexWrap;\n if (props.justifyContent) style.justify_content = props.justifyContent;\n if (props.alignItems) style.align_items = props.alignItems;\n if (props.flexGrow !== undefined) style.flex_grow = props.flexGrow;\n if (props.flexShrink !== undefined) style.flex_shrink = props.flexShrink;\n\n // Dimensions\n if (props.width !== undefined) style.width = String(props.width);\n if (props.height !== undefined) style.height = String(props.height);\n if (props.minWidth !== undefined) style.min_width = String(props.minWidth);\n if (props.minHeight !== undefined) style.min_height = String(props.minHeight);\n if (props.maxWidth !== undefined) style.max_width = String(props.maxWidth);\n if (props.maxHeight !== undefined) style.max_height = String(props.maxHeight);\n\n // Padding\n if (props.padding !== undefined) style.padding = props.padding;\n if (props.paddingTop !== undefined || props.paddingY !== undefined) {\n style.padding_top = props.paddingTop ?? props.paddingY ?? props.padding;\n }\n if (props.paddingRight !== undefined || props.paddingX !== undefined) {\n style.padding_right = props.paddingRight ?? props.paddingX ?? props.padding;\n }\n if (props.paddingBottom !== undefined || props.paddingY !== undefined) {\n style.padding_bottom = props.paddingBottom ?? props.paddingY ?? props.padding;\n }\n if (props.paddingLeft !== undefined || props.paddingX !== undefined) {\n style.padding_left = props.paddingLeft ?? props.paddingX ?? props.padding;\n }\n\n // Margin\n if (props.margin !== undefined) style.margin = props.margin;\n if (props.marginTop !== undefined || props.marginY !== undefined) {\n style.margin_top = props.marginTop ?? props.marginY ?? props.margin;\n }\n if (props.marginRight !== undefined || props.marginX !== undefined) {\n style.margin_right = props.marginRight ?? props.marginX ?? props.margin;\n }\n if (props.marginBottom !== undefined || props.marginY !== undefined) {\n style.margin_bottom = props.marginBottom ?? props.marginY ?? props.margin;\n }\n if (props.marginLeft !== undefined || props.marginX !== undefined) {\n style.margin_left = props.marginLeft ?? props.marginX ?? props.margin;\n }\n\n // Gap\n if (props.gap !== undefined) style.gap = props.gap;\n\n return h(\n \"box\",\n {\n style,\n border: props.border,\n fg: props.fg,\n bg: props.bg,\n },\n slots.default?.(),\n );\n };\n },\n});\n","/**\n * Divider Component - Horizontal or vertical divider line\n */\n\nimport { defineComponent, h, type PropType } from \"@vue/runtime-core\";\n\nexport interface DividerProps {\n /** Divider direction */\n direction?: \"horizontal\" | \"vertical\";\n /** Divider character */\n char?: string;\n /** Title in the middle of the divider */\n title?: string;\n /** Foreground color */\n fg?: string;\n /** Title foreground color */\n titleFg?: string;\n}\n\nexport const Divider = defineComponent({\n name: \"Divider\",\n props: {\n direction: {\n type: String as PropType<\"horizontal\" | \"vertical\">,\n default: \"horizontal\",\n },\n char: String,\n title: String,\n fg: {\n type: String,\n default: \"gray\",\n },\n titleFg: String,\n },\n setup(props) {\n return () => {\n const dividerChar = props.char ?? (props.direction === \"horizontal\" ? \"─\" : \"│\");\n\n if (props.direction === \"vertical\") {\n return h(\n \"text\",\n {\n fg: props.fg,\n },\n dividerChar,\n );\n }\n\n // Horizontal divider\n if (props.title) {\n return h(\n \"box\",\n {\n style: { flex_direction: \"row\", align_items: \"center\" },\n },\n [\n h(\"text\", { fg: props.fg }, dividerChar.repeat(3)),\n h(\n \"text\",\n {\n fg: props.titleFg ?? props.fg,\n bold: true,\n },\n ` ${props.title} `,\n ),\n h(\"text\", { fg: props.fg }, dividerChar.repeat(3)),\n ],\n );\n }\n\n // Simple divider - width is handled by parent container\n return h(\n \"text\",\n {\n fg: props.fg,\n },\n dividerChar.repeat(40),\n );\n };\n },\n});\n","/**\n * Stack Component - Horizontal/Vertical stack layout helper\n */\n\nimport { defineComponent, h, type PropType } from \"@vue/runtime-core\";\n\nexport interface StackProps {\n /** Stack direction */\n direction?: \"horizontal\" | \"vertical\";\n /** Gap between children */\n gap?: number;\n /** Align items */\n align?: \"start\" | \"center\" | \"end\" | \"stretch\";\n /** Justify content */\n justify?: \"start\" | \"center\" | \"end\" | \"between\" | \"around\" | \"evenly\";\n /** Wrap children */\n wrap?: boolean;\n}\n\nconst ALIGN_MAP: Record<string, string> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n stretch: \"stretch\",\n};\n\nconst JUSTIFY_MAP: Record<string, string> = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n between: \"space-between\",\n around: \"space-around\",\n evenly: \"space-evenly\",\n};\n\nexport const Stack = defineComponent({\n name: \"Stack\",\n props: {\n direction: {\n type: String as PropType<\"horizontal\" | \"vertical\">,\n default: \"vertical\",\n },\n gap: {\n type: Number,\n default: 0,\n },\n align: {\n type: String as PropType<StackProps[\"align\"]>,\n default: \"stretch\",\n },\n justify: {\n type: String as PropType<StackProps[\"justify\"]>,\n default: \"start\",\n },\n wrap: {\n type: Boolean,\n default: false,\n },\n },\n setup(props, { slots }) {\n return () => {\n return h(\n \"box\",\n {\n style: {\n flex_direction: props.direction === \"horizontal\" ? \"row\" : \"column\",\n gap: props.gap,\n align_items: ALIGN_MAP[props.align ?? \"stretch\"],\n justify_content: JUSTIFY_MAP[props.justify ?? \"start\"],\n flex_wrap: props.wrap ? \"wrap\" : \"nowrap\",\n },\n },\n slots.default?.(),\n );\n };\n },\n});\n\n// Convenience components\nexport const HStack = defineComponent({\n name: \"HStack\",\n props: {\n gap: { type: Number, default: 1 },\n align: String as PropType<StackProps[\"align\"]>,\n justify: String as PropType<StackProps[\"justify\"]>,\n },\n setup(props, { slots }) {\n return () => h(Stack, { direction: \"horizontal\", ...props }, slots.default);\n },\n});\n\nexport const VStack = defineComponent({\n name: \"VStack\",\n props: {\n gap: { type: Number, default: 0 },\n align: String as PropType<StackProps[\"align\"]>,\n justify: String as PropType<StackProps[\"justify\"]>,\n },\n setup(props, { slots }) {\n return () => h(Stack, { direction: \"vertical\", ...props }, slots.default);\n },\n});\n","/**\n * Grid Component - Grid layout helper\n */\n\nimport { defineComponent, h, type VNode } from \"@vue/runtime-core\";\n\nexport interface GridProps {\n /** Number of columns */\n columns?: number;\n /** Gap between cells */\n gap?: number;\n /** Row gap */\n rowGap?: number;\n /** Column gap */\n columnGap?: number;\n}\n\nexport const Grid = defineComponent({\n name: \"Grid\",\n props: {\n columns: {\n type: Number,\n default: 2,\n },\n gap: {\n type: Number,\n default: 1,\n },\n rowGap: Number,\n columnGap: Number,\n },\n setup(props, { slots }) {\n return () => {\n const children = slots.default?.() ?? [];\n const flatChildren = Array.isArray(children) ? children.flat() : [children];\n\n const rows: VNode[][] = [];\n let currentRow: VNode[] = [];\n\n flatChildren.forEach((child, index) => {\n currentRow.push(child);\n if (currentRow.length === props.columns || index === flatChildren.length - 1) {\n rows.push([...currentRow]);\n currentRow = [];\n }\n });\n\n const rowGap = props.rowGap ?? props.gap;\n const columnGap = props.columnGap ?? props.gap;\n\n return h(\n \"box\",\n {\n style: {\n flex_direction: \"column\",\n gap: rowGap,\n },\n },\n rows.map((row, rowIndex) =>\n h(\n \"box\",\n {\n key: `row-${rowIndex}`,\n style: {\n flex_direction: \"row\",\n gap: columnGap,\n },\n },\n row.map((cell, cellIndex) =>\n h(\n \"box\",\n {\n key: `cell-${rowIndex}-${cellIndex}`,\n style: { flex_grow: 1 },\n },\n [cell],\n ),\n ),\n ),\n ),\n );\n };\n },\n});\n","/**\n * Card Component - Container card with optional header and footer\n */\n\nimport { defineComponent, h, type PropType, type VNode } from \"@vue/runtime-core\";\n\nexport interface CardProps {\n /** Card title */\n title?: string;\n /** Card subtitle */\n subtitle?: string;\n /** Footer text */\n footer?: string;\n /** Border style */\n border?: \"single\" | \"double\" | \"rounded\" | \"heavy\" | \"none\";\n /** Padding */\n padding?: number;\n /** Title foreground color */\n titleFg?: string;\n /** Border foreground color */\n borderFg?: string;\n /** Background color */\n bg?: string;\n}\n\nexport const Card = defineComponent({\n name: \"Card\",\n props: {\n title: String,\n subtitle: String,\n footer: String,\n border: {\n type: String as PropType<CardProps[\"border\"]>,\n default: \"rounded\",\n },\n padding: {\n type: Number,\n default: 1,\n },\n titleFg: {\n type: String,\n default: \"white\",\n },\n borderFg: String,\n bg: String,\n },\n setup(props, { slots }) {\n return () => {\n const children: VNode[] = [];\n\n // Header\n if (props.title || props.subtitle) {\n const headerContent: VNode[] = [];\n\n if (props.title) {\n headerContent.push(h(\"text\", { fg: props.titleFg, bold: true }, props.title));\n }\n\n if (props.subtitle) {\n headerContent.push(\n h(\"text\", { dim: true }, props.title ? ` - ${props.subtitle}` : props.subtitle),\n );\n }\n\n children.push(\n h(\n \"box\",\n {\n key: \"header\",\n style: {\n flex_direction: \"row\",\n margin_bottom: 1,\n },\n },\n headerContent,\n ),\n );\n }\n\n // Content\n children.push(\n h(\n \"box\",\n {\n key: \"content\",\n style: { flex_grow: 1 },\n },\n slots.default?.(),\n ),\n );\n\n // Footer\n if (props.footer || slots.footer) {\n children.push(\n h(\n \"box\",\n {\n key: \"footer\",\n style: { margin_top: 1 },\n },\n slots.footer?.() ?? [h(\"text\", { dim: true }, props.footer)],\n ),\n );\n }\n\n return h(\n \"box\",\n {\n border: props.border === \"none\" ? undefined : props.border,\n fg: props.borderFg,\n bg: props.bg,\n style: {\n flex_direction: \"column\",\n padding: props.padding,\n },\n },\n children,\n );\n };\n },\n});\n","/**\n * Text Component - Text display\n */\n\nimport { defineComponent, h } from \"@vue/runtime-core\";\n\nexport interface TextProps {\n /** Text content (alternative to slot) */\n content?: string;\n /** Enable text wrapping */\n wrap?: boolean;\n /** Foreground color */\n fg?: string;\n /** Background color */\n bg?: string;\n /** Bold text */\n bold?: boolean;\n /** Dim text */\n dim?: boolean;\n /** Italic text */\n italic?: boolean;\n /** Underlined text */\n underline?: boolean;\n /** Strikethrough text */\n strikethrough?: boolean;\n}\n\nexport const Text = defineComponent({\n name: \"Text\",\n props: {\n content: String,\n wrap: Boolean,\n fg: String,\n bg: String,\n bold: Boolean,\n dim: Boolean,\n italic: Boolean,\n underline: Boolean,\n strikethrough: Boolean,\n },\n setup(props, { slots }) {\n return () => {\n // Get text from content prop or slot\n const text =\n props.content ??\n slots\n .default?.()\n ?.map((vnode) => {\n if (typeof vnode.children === \"string\") {\n return vnode.children;\n }\n return \"\";\n })\n .join(\"\") ??\n \"\";\n\n return h(\"text\", {\n text,\n wrap: props.wrap,\n fg: props.fg,\n bg: props.bg,\n bold: props.bold,\n dim: props.dim,\n italic: props.italic,\n underline: props.underline,\n strikethrough: props.strikethrough,\n });\n };\n },\n});\n\n/**\n * Convenience components for common text styles\n */\n\nexport const ErrorText = defineComponent({\n name: \"ErrorText\",\n props: {\n content: String,\n },\n setup(props, { slots }) {\n return () => h(Text, { fg: \"red\", ...props }, slots);\n },\n});\n\nexport const WarningText = defineComponent({\n name: \"WarningText\",\n props: {\n content: String,\n },\n setup(props, { slots }) {\n return () => h(Text, { fg: \"yellow\", ...props }, slots);\n },\n});\n\nexport const SuccessText = defineComponent({\n name: \"SuccessText\",\n props: {\n content: String,\n },\n setup(props, { slots }) {\n return () => h(Text, { fg: \"green\", ...props }, slots);\n },\n});\n\nexport const InfoText = defineComponent({\n name: \"InfoText\",\n props: {\n content: String,\n },\n setup(props, { slots }) {\n return () => h(Text, { fg: \"blue\", ...props }, slots);\n },\n});\n\nexport const MutedText = defineComponent({\n name: \"MutedText\",\n props: {\n content: String,\n },\n setup(props, { slots }) {\n return () => h(Text, { dim: true, ...props }, slots);\n },\n});\n","/**\n * Code Component - Code block display\n */\n\nimport { defineComponent, h, type PropType } from \"@vue/runtime-core\";\n\nexport interface CodeProps {\n /** Code content */\n code: string;\n /** Language (for future syntax highlighting) */\n language?: string;\n /** Show line numbers */\n lineNumbers?: boolean;\n /** Starting line number */\n startLine?: number;\n /** Highlight specific lines */\n highlightLines?: number[];\n /** Border style */\n border?: \"single\" | \"double\" | \"rounded\" | \"none\";\n /** Code foreground color */\n fg?: string;\n /** Line number foreground color */\n lineNumberFg?: string;\n /** Highlight line background */\n highlightBg?: string;\n}\n\nexport const Code = defineComponent({\n name: \"Code\",\n props: {\n code: {\n type: String,\n required: true,\n },\n language: String,\n lineNumbers: {\n type: Boolean,\n default: true,\n },\n startLine: {\n type: Number,\n default: 1,\n },\n highlightLines: {\n type: Array as PropType<number[]>,\n default: () => [],\n },\n border: {\n type: String as PropType<CodeProps[\"border\"]>,\n default: \"single\",\n },\n fg: {\n type: String,\n default: \"white\",\n },\n lineNumberFg: {\n type: String,\n default: \"gray\",\n },\n highlightBg: {\n type: String,\n default: \"blue\",\n },\n },\n setup(props) {\n return () => {\n const lines = props.code.split(\"\\n\");\n const maxLineNum = props.startLine + lines.length - 1;\n const lineNumWidth = String(maxLineNum).length;\n\n const children = lines.map((line, index) => {\n const lineNum = props.startLine + index;\n const isHighlighted = props.highlightLines?.includes(lineNum);\n\n const parts = [];\n\n if (props.lineNumbers) {\n parts.push(\n h(\n \"text\",\n {\n key: `ln-${lineNum}`,\n fg: props.lineNumberFg,\n },\n `${String(lineNum).padStart(lineNumWidth)} │ `,\n ),\n );\n }\n\n parts.push(\n h(\n \"text\",\n {\n key: `code-${lineNum}`,\n fg: props.fg,\n bg: isHighlighted ? props.highlightBg : undefined,\n },\n line || \" \",\n ),\n );\n\n return h(\n \"box\",\n {\n key: `line-${lineNum}`,\n style: { flex_direction: \"row\" },\n },\n parts,\n );\n });\n\n // Add language label if provided\n if (props.language) {\n children.unshift(\n h(\n \"text\",\n {\n key: \"lang\",\n dim: true,\n style: { margin_bottom: 1 },\n },\n `// ${props.language}`,\n ),\n );\n }\n\n return h(\n \"box\",\n {\n border: props.border === \"none\" ? undefined : props.border,\n style: {\n flex_direction: \"column\",\n padding: props.border !== \"none\" ? 1 : 0,\n },\n },\n children,\n );\n };\n },\n});\n","/**\n * Link Component - Clickable/styled link\n */\n\nimport { defineComponent, h } from \"@vue/runtime-core\";\n\nexport interface LinkProps {\n /** Link text */\n text: string;\n /** URL (for display, actual navigation not supported in TUI) */\n url?: string;\n /** Foreground color */\n fg?: string;\n /** Show underline */\n underline?: boolean;\n /** Show URL in parentheses */\n showUrl?: boolean;\n}\n\nexport const Link = defineComponent({\n name: \"Link\",\n props: {\n text: {\n type: String,\n required: true,\n },\n url: String,\n fg: {\n type: String,\n default: \"blue\",\n },\n underline: {\n type: Boolean,\n default: true,\n },\n showUrl: {\n type: Boolean,\n default: false,\n },\n },\n emits: [\"click\"],\n setup(props, { emit: _emit }) {\n return () => {\n const parts = [\n h(\n \"text\",\n {\n fg: props.fg,\n underline: props.underline,\n },\n props.text,\n ),\n ];\n\n if (props.showUrl && props.url) {\n parts.push(h(\"text\", { dim: true }, ` (${props.url})`));\n }\n\n return h(\"box\", { style: { flex_direction: \"row\" } }, parts);\n };\n },\n});\n","/**\n * TextInput Component - Text input with builtin cursor management and IME support\n */\n\nimport { defineComponent, h, ref, watch, computed, type PropType } from \"@vue/runtime-core\";\nimport { useInput } from \"../composables/useInput.js\";\n\nexport interface TextInputProps {\n /** Input value (v-model) */\n modelValue?: string;\n /** Placeholder text */\n placeholder?: string;\n /** Whether input is focused */\n focus?: boolean;\n /** Password mode (mask input) */\n mask?: boolean;\n /** Mask character */\n maskChar?: string;\n /** Input width */\n width?: number | string;\n /** Foreground color */\n fg?: string;\n /** Background color */\n bg?: string;\n /** Called when value changes */\n \"onUpdate:modelValue\"?: (value: string) => void;\n /** Called when submitted (Enter) */\n onSubmit?: (value: string) => void;\n /** Called when escape is pressed */\n onCancel?: () => void;\n}\n\nexport const TextInput = defineComponent({\n name: \"TextInput\",\n props: {\n modelValue: {\n type: String,\n default: \"\",\n },\n placeholder: {\n type: String,\n default: \"\",\n },\n focus: {\n type: Boolean,\n default: false,\n },\n mask: {\n type: Boolean,\n default: false,\n },\n maskChar: {\n type: String,\n default: \"*\",\n },\n width: [Number, String] as PropType<number | string>,\n fg: String,\n bg: String,\n },\n emits: [\"update:modelValue\", \"submit\", \"cancel\"],\n setup(props, { emit }) {\n const internalValue = ref(props.modelValue);\n const cursorPos = ref(props.modelValue.length);\n\n // Sync with v-model\n watch(\n () => props.modelValue,\n (newValue) => {\n internalValue.value = newValue;\n // Keep cursor at end if value changes externally\n if (cursorPos.value > newValue.length) {\n cursorPos.value = newValue.length;\n }\n },\n );\n\n // Update value and emit\n const updateValue = (value: string) => {\n internalValue.value = value;\n emit(\"update:modelValue\", value);\n };\n\n // Insert text at cursor position\n const insertText = (text: string) => {\n const before = internalValue.value.slice(0, cursorPos.value);\n const after = internalValue.value.slice(cursorPos.value);\n updateValue(before + text + after);\n cursorPos.value += text.length;\n };\n\n // Delete character before cursor (Backspace)\n const deleteBack = () => {\n if (cursorPos.value > 0) {\n const before = internalValue.value.slice(0, cursorPos.value - 1);\n const after = internalValue.value.slice(cursorPos.value);\n updateValue(before + after);\n cursorPos.value--;\n }\n };\n\n // Delete character at cursor (Delete)\n const deleteForward = () => {\n if (cursorPos.value < internalValue.value.length) {\n const before = internalValue.value.slice(0, cursorPos.value);\n const after = internalValue.value.slice(cursorPos.value + 1);\n updateValue(before + after);\n }\n };\n\n // Move cursor left\n const moveLeft = () => {\n if (cursorPos.value > 0) {\n cursorPos.value--;\n }\n };\n\n // Move cursor right\n const moveRight = () => {\n if (cursorPos.value < internalValue.value.length) {\n cursorPos.value++;\n }\n };\n\n // Move cursor to start\n const moveToStart = () => {\n cursorPos.value = 0;\n };\n\n // Move cursor to end\n const moveToEnd = () => {\n cursorPos.value = internalValue.value.length;\n };\n\n // Use focus prop to control input handling\n const isActive = computed(() => props.focus);\n\n // Handle keyboard input when focused\n useInput({\n isActive,\n onChar: (char) => {\n insertText(char);\n },\n onArrow: (direction) => {\n if (direction === \"left\") moveLeft();\n if (direction === \"right\") moveRight();\n },\n onKey: (key, modifiers) => {\n if (key === \"backspace\") {\n deleteBack();\n } else if (key === \"delete\") {\n deleteForward();\n } else if (key === \"home\") {\n moveToStart();\n } else if (key === \"end\") {\n moveToEnd();\n } else if (key === \"a\" && modifiers.ctrl) {\n // Ctrl+A - select all (move to end for now)\n moveToEnd();\n }\n },\n onSubmit: () => {\n emit(\"submit\", internalValue.value);\n },\n onEscape: () => {\n emit(\"cancel\");\n },\n });\n\n return () => {\n const style: Record<string, unknown> = {};\n if (props.width !== undefined) {\n style.width = String(props.width);\n }\n\n return h(\"input\", {\n value: internalValue.value,\n placeholder: props.placeholder,\n focused: props.focus,\n cursor: cursorPos.value,\n mask: props.mask,\n \"mask-char\": props.maskChar,\n style,\n fg: props.fg,\n bg: props.bg,\n });\n };\n },\n});\n\n/**\n * Password input variant\n */\nexport const PasswordInput = defineComponent({\n name: \"PasswordInput\",\n props: {\n modelValue: {\n type: String,\n default: \"\",\n },\n placeholder: {\n type: String,\n default: \"Enter password...\",\n },\n focus: Boolean,\n width: [Number, String] as PropType<number | string>,\n fg: String,\n bg: String,\n },\n emits: [\"update:modelValue\", \"submit\", \"cancel\"],\n setup(props, { emit }) {\n return () =>\n h(TextInput, {\n ...props,\n mask: true,\n \"onUpdate:modelValue\": (v: string) => emit(\"update:modelValue\", v),\n onSubmit: (v: string) => emit(\"submit\", v),\n onCancel: () => emit(\"cancel\"),\n });\n },\n});\n","/**\n * TextArea Component - Multiline text input\n */\n\nimport { defineComponent, h, type PropType, computed } from \"@vue/runtime-core\";\n\nexport interface TextAreaProps {\n /** Text value */\n modelValue?: string;\n /** Placeholder text */\n placeholder?: string;\n /** Number of visible rows */\n rows?: number;\n /** Whether the textarea is focused */\n focused?: boolean;\n /** Whether the textarea is disabled */\n disabled?: boolean;\n /** Show line numbers */\n lineNumbers?: boolean;\n /** Border style */\n border?: \"single\" | \"double\" | \"rounded\" | \"none\";\n /** Foreground color */\n fg?: string;\n /** Placeholder foreground color */\n placeholderFg?: string;\n /** Line number foreground color */\n lineNumberFg?: string;\n /** Cursor line */\n cursorLine?: number;\n /** Cursor column */\n cursorColumn?: number;\n}\n\nexport const TextArea = defineComponent({\n name: \"TextArea\",\n props: {\n modelValue: {\n type: String,\n default: \"\",\n },\n placeholder: String,\n rows: {\n type: Number,\n default: 5,\n },\n focused: {\n type: Boolean,\n default: false,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n lineNumbers: {\n type: Boolean,\n default: false,\n },\n border: {\n type: String as PropType<TextAreaProps[\"border\"]>,\n default: \"single\",\n },\n fg: String,\n placeholderFg: {\n type: String,\n default: \"gray\",\n },\n lineNumberFg: {\n type: String,\n default: \"gray\",\n },\n cursorLine: {\n type: Number,\n default: 0,\n },\n cursorColumn: {\n type: Number,\n default: 0,\n },\n },\n emits: [\"update:modelValue\"],\n setup(props) {\n const lines = computed(() => {\n const text = props.modelValue || \"\";\n const textLines = text.split(\"\\n\");\n\n // Pad to minimum rows\n while (textLines.length < props.rows) {\n textLines.push(\"\");\n }\n\n return textLines.slice(0, props.rows);\n });\n\n const showPlaceholder = computed(\n () => !props.modelValue && props.placeholder && !props.focused,\n );\n\n return () => {\n const lineNumWidth = String(lines.value.length).length;\n\n const children = lines.value.map((line, index) => {\n const isCursorLine = props.focused && index === props.cursorLine;\n const parts = [];\n\n // Line number\n if (props.lineNumbers) {\n parts.push(\n h(\n \"text\",\n {\n key: `ln-${index}`,\n fg: props.lineNumberFg,\n dim: !isCursorLine,\n },\n `${String(index + 1).padStart(lineNumWidth)} │ `,\n ),\n );\n }\n\n // Line content\n let content = line || (showPlaceholder.value && index === 0 ? props.placeholder : \" \");\n\n parts.push(\n h(\n \"text\",\n {\n key: `content-${index}`,\n fg: showPlaceholder.value && index === 0 ? props.placeholderFg : props.fg,\n dim: props.disabled,\n bold: isCursorLine,\n },\n content,\n ),\n );\n\n return h(\n \"box\",\n {\n key: `line-${index}`,\n style: { flex_direction: \"row\" },\n bg: isCursorLine ? \"gray\" : undefined,\n },\n parts,\n );\n });\n\n return h(\n \"box\",\n {\n border: props.border === \"none\" ? undefined : props.border,\n style: {\n flex_direction: \"column\",\n padding: props.border !== \"none\" ? 1 : 0,\n height: String(props.rows + (props.border !== \"none\" ? 2 : 0)),\n },\n },\n children,\n );\n };\n },\n});\n","/**\n * Select Component - Dropdown/menu selection\n */\n\nimport { defineComponent, h, ref, type PropType, watch } from \"@vue/runtime-core\";\n\nexport interface SelectOption {\n label: string;\n value: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps {\n /** Options to display */\n options: SelectOption[];\n /** Currently selected value */\n modelValue?: string;\n /** Placeholder text */\n placeholder?: string;\n /** Whether the select is focused */\n focused?: boolean;\n /** Indicator for selected item */\n indicator?: string;\n /** Indicator for unselected item */\n indicatorEmpty?: string;\n /** Foreground color */\n fg?: string;\n /** Background color */\n bg?: string;\n /** Selected item foreground color */\n selectedFg?: string;\n /** Selected item background color */\n selectedBg?: string;\n}\n\nexport const Select = defineComponent({\n name: \"Select\",\n props: {\n options: {\n type: Array as PropType<SelectOption[]>,\n required: true,\n },\n modelValue: String,\n placeholder: {\n type: String,\n default: \"Select an option\",\n },\n focused: {\n type: Boolean,\n default: false,\n },\n indicator: {\n type: String,\n default: \"> \",\n },\n indicatorEmpty: {\n type: String,\n default: \" \",\n },\n fg: String,\n bg: String,\n selectedFg: {\n type: String,\n default: \"cyan\",\n },\n selectedBg: String,\n },\n emits: [\"update:modelValue\", \"select\"],\n setup(props, { emit: _emit }) {\n const highlightedIndex = ref(0);\n\n // Find initial index based on modelValue\n watch(\n () => props.modelValue,\n (value) => {\n if (value) {\n const index = props.options.findIndex((opt) => opt.value === value);\n if (index !== -1) {\n highlightedIndex.value = index;\n }\n }\n },\n { immediate: true },\n );\n\n // Note: selectOption, moveUp, moveDown are designed for keyboard event handlers\n // They are currently not wired up but kept for future use\n\n return () => {\n const children = props.options.map((option, index) => {\n const isHighlighted = index === highlightedIndex.value;\n const isSelected = option.value === props.modelValue;\n const indicator = isHighlighted ? props.indicator : props.indicatorEmpty;\n\n return h(\n \"box\",\n {\n key: option.value,\n style: { flex_direction: \"row\" },\n },\n [\n h(\n \"text\",\n {\n fg: isHighlighted ? props.selectedFg : props.fg,\n bg: isHighlighted ? props.selectedBg : props.bg,\n dim: option.disabled,\n },\n `${indicator}${option.label}${isSelected ? \" (selected)\" : \"\"}`,\n ),\n ],\n );\n });\n\n return h(\n \"box\",\n {\n style: { flex_direction: \"column\" },\n fg: props.fg,\n bg: props.bg,\n },\n children,\n );\n };\n },\n});\n","/**\n * Checkbox Component - Toggle checkbox\n */\n\nimport { defineComponent, h } from \"@vue/runtime-core\";\n\nexport interface CheckboxProps {\n /** Whether the checkbox is checked */\n modelValue?: boolean;\n /** Label text */\n label?: string;\n /** Whether the checkbox is focused */\n focused?: boolean;\n /** Whether the checkbox is disabled */\n disabled?: boolean;\n /** Checked indicator */\n checked?: string;\n /** Unchecked indicator */\n unchecked?: string;\n /** Foreground color */\n fg?: string;\n /** Checked foreground color */\n checkedFg?: string;\n}\n\nexport const Checkbox = defineComponent({\n name: \"Checkbox\",\n props: {\n modelValue: {\n type: Boolean,\n default: false,\n },\n label: String,\n focused: {\n type: Boolean,\n default: false,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n checked: {\n type: String,\n default: \"[x]\",\n },\n unchecked: {\n type: String,\n default: \"[ ]\",\n },\n fg: String,\n checkedFg: {\n type: String,\n default: \"green\",\n },\n },\n emits: [\"update:modelValue\", \"change\"],\n setup(props, { emit: _emit }) {\n // Note: toggle is designed for keyboard event handlers\n // It is currently not wired up but kept for future use\n\n return () => {\n const indicator = props.modelValue ? props.checked : props.unchecked;\n const color = props.modelValue ? props.checkedFg : props.fg;\n\n return h(\n \"box\",\n {\n style: { flex_direction: \"row\" },\n },\n [\n h(\n \"text\",\n {\n fg: color,\n dim: props.disabled,\n bold: props.focused,\n },\n `${indicator} ${props.label ?? \"\"}`,\n ),\n ],\n );\n };\n },\n});\n","/**\n * RadioGroup Component - Radio button group selection\n */\n\nimport { defineComponent, h, type PropType } from \"@vue/runtime-core\";\n\nexport interface RadioOption {\n label: string;\n value: string;\n disabled?: boolean;\n}\n\nexport interface RadioGroupProps {\n /** Radio options */\n options: RadioOption[];\n /** Currently selected value */\n modelValue?: string;\n /** Layout direction */\n direction?: \"horizontal\" | \"vertical\";\n /** Focused option index */\n focusedIndex?: number;\n /** Selected indicator */\n selected?: string;\n /** Unselected indicator */\n unselected?: string;\n /** Foreground color */\n fg?: string;\n /** Selected foreground color */\n selectedFg?: string;\n}\n\nexport const RadioGroup = defineComponent({\n name: \"RadioGroup\",\n props: {\n options: {\n type: Array as PropType<RadioOption[]>,\n required: true,\n },\n modelValue: String,\n direction: {\n type: String as PropType<\"horizontal\" | \"vertical\">,\n default: \"vertical\",\n },\n focusedIndex: Number,\n selected: {\n type: String,\n default: \"◉\",\n },\n unselected: {\n type: String,\n default: \"○\",\n },\n fg: String,\n selectedFg: {\n type: String,\n default: \"green\",\n },\n },\n emits: [\"update:modelValue\", \"change\"],\n setup(props, { emit: _emit }) {\n return () => {\n const children = props.options.map((option, index) => {\n const isSelected = option.value === props.modelValue;\n const isFocused = index === props.focusedIndex;\n const indicator = isSelected ? props.selected : props.unselected;\n\n return h(\n \"text\",\n {\n key: option.value,\n fg: isSelected ? props.selectedFg : props.fg,\n bold: isFocused,\n dim: option.disabled,\n },\n `${indicator} ${option.label}`,\n );\n });\n\n return h(\n \"box\",\n {\n style: {\n flex_direction: props.direction === \"horizontal\" ? \"row\" : \"column\",\n gap: props.direction === \"horizontal\" ? 2 : 0,\n },\n },\n children,\n );\n };\n },\n});\n","/**\n * Confirm Component - Confirmation dialog\n */\n\nimport { defineComponent, h, ref } from \"@vue/runtime-core\";\n\nexport interface ConfirmProps {\n /** Confirmation message */\n message: string;\n /** Confirm button text */\n confirmText?: string;\n /** Cancel button text */\n cancelText?: string;\n /** Whether confirm is initially selected */\n defaultConfirm?: boolean;\n /** Confirm button foreground color */\n confirmFg?: string;\n /** Cancel button foreground color */\n cancelFg?: string;\n /** Selected button foreground color */\n selectedFg?: string;\n}\n\nexport const Confirm = defineComponent({\n name: \"Confirm\",\n props: {\n message: {\n type: String,\n required: true,\n },\n confirmText: {\n type: String,\n default: \"Yes\",\n },\n cancelText: {\n type: String,\n default: \"No\",\n },\n defaultConfirm: {\n type: Boolean,\n default: true,\n },\n confirmFg: {\n type: String,\n default: \"green\",\n },\n cancelFg: {\n type: String,\n default: \"red\",\n },\n selectedFg: {\n type: String,\n default: \"cyan\",\n },\n },\n emits: [\"confirm\", \"cancel\", \"select\"],\n setup(props, { emit: _emit }) {\n const isConfirmSelected = ref(props.defaultConfirm);\n\n // Note: toggle and confirm are designed for keyboard event handlers\n // They are currently not wired up but kept for future use\n // const toggle = () => { isConfirmSelected.value = !isConfirmSelected.value; };\n // const confirm = () => { ... };\n\n return () => {\n return h(\n \"box\",\n {\n style: { flex_direction: \"column\" },\n },\n [\n // Message\n h(\"text\", { key: \"message\" }, props.message),\n // Buttons\n h(\n \"box\",\n {\n key: \"buttons\",\n style: {\n flex_direction: \"row\",\n gap: 2,\n margin_top: 1,\n },\n },\n [\n h(\n \"text\",\n {\n key: \"confirm\",\n fg: isConfirmSelected.value ? props.selectedFg : props.confirmFg,\n bold: isConfirmSelected.value,\n },\n `[${props.confirmText}]`,\n ),\n h(\n \"text\",\n {\n key: \"cancel\",\n fg: !isConfirmSelected.value ? props.selectedFg : props.cancelFg,\n bold: !isConfirmSelected.value,\n },\n `[${props.cancelText}]`,\n ),\n ],\n ),\n ],\n );\n };\n },\n});\n","/**\n * Form Component - Form container with labels\n */\n\nimport { defineComponent, h, type PropType, type VNode } from \"@vue/runtime-core\";\n\nexport interface FormField {\n key: string;\n label: string;\n required?: boolean;\n hint?: string;\n}\n\nexport interface FormProps {\n /** Form fields metadata */\n fields?: FormField[];\n /** Label width */\n labelWidth?: number;\n /** Gap between fields */\n gap?: number;\n /** Label position */\n labelPosition?: \"left\" | \"top\";\n /** Label foreground color */\n labelFg?: string;\n /** Required indicator */\n requiredIndicator?: string;\n /** Hint foreground color */\n hintFg?: string;\n}\n\nexport const Form = defineComponent({\n name: \"Form\",\n props: {\n fields: {\n type: Array as PropType<FormField[]>,\n default: () => [],\n },\n labelWidth: {\n type: Number,\n default: 15,\n },\n gap: {\n type: Number,\n default: 1,\n },\n labelPosition: {\n type: String as PropType<\"left\" | \"top\">,\n default: \"left\",\n },\n labelFg: String,\n requiredIndicator: {\n type: String,\n default: \"*\",\n },\n hintFg: {\n type: String,\n default: \"gray\",\n },\n },\n setup(props, { slots }) {\n return () => {\n const children: VNode[] = [];\n\n props.fields.forEach((field, _index) => {\n const labelContent = [\n h(\n \"text\",\n {\n fg: props.labelFg,\n },\n field.label.padEnd(props.labelWidth),\n ),\n ];\n\n if (field.required) {\n labelContent.push(h(\"text\", { fg: \"red\" }, props.requiredIndicator));\n }\n\n const fieldSlot = slots[field.key]?.();\n\n if (props.labelPosition === \"top\") {\n children.push(\n h(\n \"box\",\n {\n key: field.key,\n style: { flex_direction: \"column\", margin_bottom: props.gap },\n },\n [\n h(\"box\", { style: { flex_direction: \"row\" } }, labelContent),\n fieldSlot ? h(\"box\", { style: { margin_top: 0.5 } }, fieldSlot) : null,\n field.hint ? h(\"text\", { fg: props.hintFg, dim: true }, field.hint) : null,\n ].filter(Boolean),\n ),\n );\n } else {\n children.push(\n h(\n \"box\",\n {\n key: field.key,\n style: {\n flex_direction: \"row\",\n align_items: \"center\",\n margin_bottom: props.gap,\n },\n },\n [\n h(\n \"box\",\n { style: { width: String(props.labelWidth), flex_direction: \"row\" } },\n labelContent,\n ),\n h(\"box\", { style: { flex_grow: 1 } }, fieldSlot),\n ],\n ),\n );\n\n if (field.hint) {\n children.push(\n h(\n \"text\",\n {\n key: `hint-${field.key}`,\n fg: props.hintFg,\n dim: true,\n style: { margin_left: props.labelWidth, margin_bottom: props.gap },\n },\n field.hint,\n ),\n );\n }\n }\n });\n\n return h(\"box\", { style: { flex_direction: \"column\" } }, children);\n };\n },\n});\n","/**\n * Spinner Component - Loading indicator\n */\n\nimport { defineComponent, h, ref, onMounted, onUnmounted, type PropType } from \"@vue/runtime-core\";\nimport { Text } from \"./Text.js\";\n\n/**\n * Spinner frame sets\n */\nexport const spinnerTypes = {\n dots: [\"⠋\", \"⠙\", \"⠹\", \"⠸\", \"⠼\", \"⠴\", \"⠦\", \"⠧\", \"⠇\", \"⠏\"],\n dots2: [\"⣾\", \"⣽\", \"⣻\", \"⢿\", \"⡿\", \"⣟\", \"⣯\", \"⣷\"],\n line: [\"-\", \"\\\\\", \"|\", \"/\"],\n arc: [\"◜\", \"◠\", \"◝\", \"◞\", \"◡\", \"◟\"],\n circle: [\"◐\", \"◓\", \"◑\", \"◒\"],\n bounce: [\"⠁\", \"⠂\", \"⠄\", \"⡀\", \"⢀\", \"⠠\", \"⠐\", \"⠈\"],\n box: [\"▖\", \"▘\", \"▝\", \"▗\"],\n arrow: [\"←\", \"↖\", \"↑\", \"↗\", \"→\", \"↘\", \"↓\", \"↙\"],\n clock: [\"🕛\", \"🕐\", \"🕑\", \"🕒\", \"🕓\", \"🕔\", \"🕕\", \"🕖\", \"🕗\", \"🕘\", \"🕙\", \"🕚\"],\n moon: [\"🌑\", \"🌒\", \"🌓\", \"🌔\", \"🌕\", \"🌖\", \"🌗\", \"🌘\"],\n earth: [\"🌍\", \"🌎\", \"🌏\"],\n} as const;\n\nexport type SpinnerType = keyof typeof spinnerTypes;\n\nexport interface SpinnerProps {\n /** Spinner type */\n type?: SpinnerType;\n /** Custom frames */\n frames?: string[];\n /** Animation interval in ms */\n interval?: number;\n /** Label text */\n label?: string;\n /** Foreground color */\n fg?: string;\n}\n\nexport const Spinner = defineComponent({\n name: \"Spinner\",\n props: {\n type: {\n type: String as PropType<SpinnerType>,\n default: \"dots\",\n },\n frames: Array as PropType<string[]>,\n interval: {\n type: Number,\n default: 80,\n },\n label: String,\n fg: String,\n },\n setup(props) {\n const frameIndex = ref(0);\n let timer: ReturnType<typeof setInterval> | null = null;\n\n const frames = props.frames ?? spinnerTypes[props.type] ?? spinnerTypes.dots;\n\n onMounted(() => {\n timer = setInterval(() => {\n frameIndex.value = (frameIndex.value + 1) % frames.length;\n }, props.interval);\n });\n\n onUnmounted(() => {\n if (timer) {\n clearInterval(timer);\n }\n });\n\n return () => {\n const frame = frames[frameIndex.value];\n const content = props.label ? `${frame} ${props.label}` : frame;\n\n return h(Text, { fg: props.fg }, () => content);\n };\n },\n});\n","/**\n * ProgressBar Component - Progress indicator\n */\n\nimport { defineComponent, h, computed, type PropType } from \"@vue/runtime-core\";\nimport { Box } from \"./Box.js\";\nimport { Text } from \"./Text.js\";\n\nexport interface ProgressBarProps {\n /** Progress value (0-100) */\n value: number;\n /** Total width in characters */\n width?: number;\n /** Show percentage label */\n showLabel?: boolean;\n /** Label position */\n labelPosition?: \"left\" | \"right\" | \"inside\";\n /** Filled character */\n filledChar?: string;\n /** Empty character */\n emptyChar?: string;\n /** Left border character */\n leftBorder?: string;\n /** Right border character */\n rightBorder?: string;\n /** Filled color */\n filledFg?: string;\n /** Empty color */\n emptyFg?: string;\n}\n\nexport const ProgressBar = defineComponent({\n name: \"ProgressBar\",\n props: {\n value: {\n type: Number,\n required: true,\n validator: (v: number) => v >= 0 && v <= 100,\n },\n width: {\n type: Number,\n default: 20,\n },\n showLabel: {\n type: Boolean,\n default: true,\n },\n labelPosition: {\n type: String as PropType<\"left\" | \"right\" | \"inside\">,\n default: \"right\",\n },\n filledChar: {\n type: String,\n default: \"█\",\n },\n emptyChar: {\n type: String,\n default: \"░\",\n },\n leftBorder: {\n type: String,\n default: \"\",\n },\n rightBorder: {\n type: String,\n default: \"\",\n },\n filledFg: {\n type: String,\n default: \"green\",\n },\n emptyFg: {\n type: String,\n default: \"gray\",\n },\n },\n setup(props) {\n const normalizedValue = computed(() => Math.max(0, Math.min(100, props.value)));\n\n const filledWidth = computed(() => Math.round((normalizedValue.value / 100) * props.width));\n\n const emptyWidth = computed(() => props.width - filledWidth.value);\n\n const label = computed(() => `${Math.round(normalizedValue.value)}%`);\n\n return () => {\n const filled = props.filledChar.repeat(filledWidth.value);\n const empty = props.emptyChar.repeat(emptyWidth.value);\n\n const barContent = [\n props.leftBorder && h(Text, {}, () => props.leftBorder),\n h(Text, { fg: props.filledFg }, () => filled),\n h(Text, { fg: props.emptyFg }, () => empty),\n props.rightBorder && h(Text, {}, () => props.rightBorder),\n ].filter(Boolean);\n\n if (!props.showLabel) {\n return h(Box, { flexDirection: \"row\" }, () => barContent);\n }\n\n const labelElement = h(Text, { dim: true }, () => label.value);\n\n switch (props.labelPosition) {\n case \"left\":\n return h(Box, { flexDirection: \"row\", gap: 1 }, () => [labelElement, ...barContent]);\n case \"inside\":\n // For inside, we'd need more complex rendering\n // For now, show on right\n return h(Box, { flexDirection: \"row\", gap: 1 }, () => [...barContent, labelElement]);\n case \"right\":\n default:\n return h(Box, { flexDirection: \"row\", gap: 1 }, () => [...barContent, labelElement]);\n }\n };\n },\n});\n\n/**\n * Indeterminate progress bar (animated)\n */\nexport const IndeterminateProgressBar = defineComponent({\n name: \"IndeterminateProgressBar\",\n props: {\n width: {\n type: Number,\n default: 20,\n },\n fg: {\n type: String,\n default: \"cyan\",\n },\n },\n setup(props) {\n // This would need animation support\n // For now, show a static pattern\n return () => {\n const pattern = \"▓▒░░░░░░░░░░░░░░░░░░\";\n const display = pattern.slice(0, props.width);\n\n return h(Text, { fg: props.fg }, () => display);\n };\n },\n});\n","/**\n * Alert Component - Alert/notification box\n */\n\nimport { defineComponent, h, type PropType } from \"@vue/runtime-core\";\n\nexport type AlertType = \"info\" | \"success\" | \"warning\" | \"error\";\n\nexport interface AlertProps {\n /** Alert message */\n message: string;\n /** Alert type */\n type?: AlertType;\n /** Alert title */\n title?: string;\n /** Show icon */\n showIcon?: boolean;\n /** Border style */\n border?: \"single\" | \"double\" | \"rounded\" | \"none\";\n}\n\nconst ALERT_CONFIG: Record<AlertType, { icon: string; fg: string; title: string }> = {\n info: { icon: \"ℹ\", fg: \"cyan\", title: \"Info\" },\n success: { icon: \"✓\", fg: \"green\", title: \"Success\" },\n warning: { icon: \"⚠\", fg: \"yellow\", title: \"Warning\" },\n error: { icon: \"✗\", fg: \"red\", title: \"Error\" },\n};\n\nexport const Alert = defineComponent({\n name: \"Alert\",\n props: {\n message: {\n type: String,\n required: true,\n },\n type: {\n type: String as PropType<AlertType>,\n default: \"info\",\n },\n title: String,\n showIcon: {\n type: Boolean,\n default: true,\n },\n border: {\n type: String as PropType<AlertProps[\"border\"]>,\n default: \"rounded\",\n },\n },\n setup(props) {\n return () => {\n const config = ALERT_CONFIG[props.type];\n const title = props.title ?? config.title;\n\n const children = [];\n\n // Header with icon and title\n const headerParts = [];\n if (props.showIcon) {\n headerParts.push(h(\"text\", { fg: config.fg }, `${config.icon} `));\n }\n headerParts.push(h(\"text\", { fg: config.fg, bold: true }, title));\n\n children.push(h(\"box\", { key: \"header\", style: { flex_direction: \"row\" } }, headerParts));\n\n // Message\n children.push(h(\"text\", { key: \"message\", style: { margin_top: 1 } }, props.message));\n\n return h(\n \"box\",\n {\n border: props.border === \"none\" ? undefined : props.border,\n fg: config.fg,\n style: {\n flex_direction: \"column\",\n padding: 1,\n },\n },\n children,\n );\n };\n },\n});\n","/**\n * Badge Component - Status badge/tag\n */\n\nimport { defineComponent, h, type PropType } from \"@vue/runtime-core\";\n\nexport type BadgeVariant = \"default\" | \"success\" | \"warning\" | \"error\" | \"info\";\n\nexport interface BadgeProps {\n /** Badge text */\n label: string;\n /** Badge variant */\n variant?: BadgeVariant;\n /** Custom foreground color (overrides variant) */\n fg?: string;\n /** Custom background color (overrides variant) */\n bg?: string;\n /** Show border */\n border?: boolean;\n}\n\nconst VARIANT_COLORS: Record<BadgeVariant, { fg: string; bg?: string }> = {\n default: { fg: \"white\" },\n success: { fg: \"green\" },\n warning: { fg: \"yellow\" },\n error: { fg: \"red\" },\n info: { fg: \"cyan\" },\n};\n\nexport const Badge = defineComponent({\n name: \"Badge\",\n props: {\n label: {\n type: String,\n required: true,\n },\n variant: {\n type: String as PropType<BadgeVariant>,\n default: \"default\",\n },\n fg: String,\n bg: String,\n border: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n return () => {\n const colors = VARIANT_COLORS[props.variant];\n const fg = props.fg ?? colors.fg;\n const bg = props.bg ?? colors.bg;\n\n if (props.border) {\n return h(\n \"box\",\n {\n border: \"single\",\n fg,\n bg,\n style: { padding_left: 1, padding_right: 1 },\n },\n [h(\"text\", { fg, bg }, props.label)],\n );\n }\n\n return h(\n \"text\",\n {\n fg,\n bg,\n bold: true,\n },\n `[${props.label}]`,\n );\n };\n },\n});\n","/**\n * Timer Component - Countdown/stopwatch timer\n */\n\nimport {\n defineComponent,\n h,\n ref,\n onMounted,\n onUnmounted,\n type PropType,\n computed,\n} from \"@vue/runtime-core\";\n\nexport type TimerMode = \"countdown\" | \"stopwatch\";\n\nexport interface TimerProps {\n /** Timer mode */\n mode?: TimerMode;\n /** Initial seconds (for countdown) */\n initialSeconds?: number;\n /** Auto start */\n autoStart?: boolean;\n /** Show hours */\n showHours?: boolean;\n /** Show milliseconds */\n showMilliseconds?: boolean;\n /** Foreground color */\n fg?: string;\n /** Warning color (when < 10 seconds in countdown) */\n warningFg?: string;\n /** Danger color (when < 5 seconds in countdown) */\n dangerFg?: string;\n}\n\nexport const Timer = defineComponent({\n name: \"Timer\",\n props: {\n mode: {\n type: String as PropType<TimerMode>,\n default: \"stopwatch\",\n },\n initialSeconds: {\n type: Number,\n default: 0,\n },\n autoStart: {\n type: Boolean,\n default: true,\n },\n showHours: {\n type: Boolean,\n default: false,\n },\n showMilliseconds: {\n type: Boolean,\n default: false,\n },\n fg: {\n type: String,\n default: \"white\",\n },\n warningFg: {\n type: String,\n default: \"yellow\",\n },\n dangerFg: {\n type: String,\n default: \"red\",\n },\n },\n emits: [\"tick\", \"complete\"],\n setup(props, { emit, expose }) {\n const elapsed = ref(0); // milliseconds\n const isRunning = ref(false);\n let intervalId: ReturnType<typeof setInterval> | null = null;\n\n const totalMs = computed(() => {\n if (props.mode === \"countdown\") {\n return Math.max(0, props.initialSeconds * 1000 - elapsed.value);\n }\n return elapsed.value;\n });\n\n const formatted = computed(() => {\n const ms = totalMs.value;\n const totalSeconds = Math.floor(ms / 1000);\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor((totalSeconds % 3600) / 60);\n const seconds = totalSeconds % 60;\n const milliseconds = Math.floor((ms % 1000) / 10);\n\n let result = \"\";\n if (props.showHours || hours > 0) {\n result += `${String(hours).padStart(2, \"0\")}:`;\n }\n result += `${String(minutes).padStart(2, \"0\")}:${String(seconds).padStart(2, \"0\")}`;\n if (props.showMilliseconds) {\n result += `.${String(milliseconds).padStart(2, \"0\")}`;\n }\n return result;\n });\n\n const color = computed(() => {\n if (props.mode === \"countdown\") {\n const seconds = totalMs.value / 1000;\n if (seconds <= 5) return props.dangerFg;\n if (seconds <= 10) return props.warningFg;\n }\n return props.fg;\n });\n\n const start = () => {\n if (isRunning.value) return;\n isRunning.value = true;\n intervalId = setInterval(() => {\n elapsed.value += 100;\n emit(\"tick\", totalMs.value);\n\n if (props.mode === \"countdown\" && totalMs.value <= 0) {\n stop();\n emit(\"complete\");\n }\n }, 100);\n };\n\n const stop = () => {\n isRunning.value = false;\n if (intervalId) {\n clearInterval(intervalId);\n intervalId = null;\n }\n };\n\n const reset = () => {\n elapsed.value = 0;\n };\n\n const toggle = () => {\n if (isRunning.value) {\n stop();\n } else {\n start();\n }\n };\n\n expose({ start, stop, reset, toggle, isRunning });\n\n onMounted(() => {\n if (props.autoStart) {\n start();\n }\n });\n\n onUnmounted(() => {\n stop();\n });\n\n return () => {\n return h(\n \"text\",\n {\n fg: color.value,\n bold: true,\n },\n formatted.value,\n );\n };\n },\n});\n","/**\n * Tooltip Component - Tooltip overlay\n */\n\nimport { defineComponent, h, type PropType, type VNode } from \"@vue/runtime-core\";\n\nexport type TooltipPosition = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport interface TooltipProps {\n /** Tooltip text */\n text: string;\n /** Whether tooltip is visible */\n visible?: boolean;\n /** Tooltip position */\n position?: TooltipPosition;\n /** Border style */\n border?: \"single\" | \"rounded\" | \"none\";\n /** Background color */\n bg?: string;\n /** Foreground color */\n fg?: string;\n}\n\nexport const Tooltip = defineComponent({\n name: \"Tooltip\",\n props: {\n text: {\n type: String,\n required: true,\n },\n visible: {\n type: Boolean,\n default: true,\n },\n position: {\n type: String as PropType<TooltipPosition>,\n default: \"top\",\n },\n border: {\n type: String as PropType<TooltipProps[\"border\"]>,\n default: \"rounded\",\n },\n bg: {\n type: String,\n default: \"white\",\n },\n fg: {\n type: String,\n default: \"black\",\n },\n },\n setup(props, { slots }) {\n return () => {\n const content = slots.default?.();\n\n if (!props.visible) {\n return h(\"box\", {}, content);\n }\n\n const tooltip = h(\n \"box\",\n {\n key: \"tooltip\",\n border: props.border === \"none\" ? undefined : props.border,\n bg: props.bg,\n fg: props.fg,\n style: {\n padding_left: 1,\n padding_right: 1,\n },\n },\n [h(\"text\", { fg: props.fg, bg: props.bg }, props.text)],\n );\n\n const children: VNode[] = [];\n\n switch (props.position) {\n case \"top\":\n children.push(tooltip);\n children.push(h(\"box\", { key: \"content\" }, content));\n break;\n case \"bottom\":\n children.push(h(\"box\", { key: \"content\" }, content));\n children.push(tooltip);\n break;\n case \"left\":\n return h(\"box\", { style: { flex_direction: \"row\" } }, [\n tooltip,\n h(\"box\", { key: \"content\" }, content),\n ]);\n case \"right\":\n return h(\"box\", { style: { flex_direction: \"row\" } }, [\n h(\"box\", { key: \"content\" }, content),\n tooltip,\n ]);\n }\n\n return h(\"box\", { style: { flex_direction: \"column\" } }, children);\n };\n },\n});\n","/**\n * List Component - Scrollable list of items\n */\n\nimport { defineComponent, h, ref, computed, type PropType, type VNode } from \"@vue/runtime-core\";\n\nexport interface ListItem {\n key: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface ListProps {\n /** List items */\n items: ListItem[];\n /** Currently selected key */\n modelValue?: string;\n /** Maximum visible items (enables scrolling) */\n maxHeight?: number;\n /** Whether the list is focused */\n focused?: boolean;\n /** Item indicator */\n indicator?: string;\n /** Empty indicator */\n indicatorEmpty?: string;\n /** Foreground color */\n fg?: string;\n /** Selected foreground color */\n selectedFg?: string;\n /** Selected background color */\n selectedBg?: string;\n}\n\nexport const List = defineComponent({\n name: \"List\",\n props: {\n items: {\n type: Array as PropType<ListItem[]>,\n required: true,\n },\n modelValue: String,\n maxHeight: Number,\n focused: {\n type: Boolean,\n default: false,\n },\n indicator: {\n type: String,\n default: \"> \",\n },\n indicatorEmpty: {\n type: String,\n default: \" \",\n },\n fg: String,\n selectedFg: {\n type: String,\n default: \"cyan\",\n },\n selectedBg: String,\n },\n emits: [\"update:modelValue\", \"select\"],\n setup(props, { emit: _emit }) {\n const scrollOffset = ref(0);\n const highlightedIndex = ref(0);\n\n const visibleItems = computed(() => {\n if (!props.maxHeight) {\n return props.items;\n }\n const start = scrollOffset.value;\n const end = start + props.maxHeight;\n return props.items.slice(start, end);\n });\n\n const scrollIndicator = computed(() => {\n if (!props.maxHeight || props.items.length <= props.maxHeight) {\n return { showUp: false, showDown: false };\n }\n return {\n showUp: scrollOffset.value > 0,\n showDown: scrollOffset.value + props.maxHeight < props.items.length,\n };\n });\n\n return () => {\n const children: VNode[] = [];\n\n // Scroll up indicator\n if (scrollIndicator.value.showUp) {\n children.push(h(\"text\", { key: \"scroll-up\", dim: true }, \" ...\"));\n }\n\n // Visible items\n visibleItems.value.forEach((item, visibleIndex) => {\n const actualIndex = scrollOffset.value + visibleIndex;\n const isHighlighted = actualIndex === highlightedIndex.value;\n const isSelected = item.key === props.modelValue;\n const indicator = isHighlighted ? props.indicator : props.indicatorEmpty;\n\n children.push(\n h(\n \"text\",\n {\n key: item.key,\n fg: isHighlighted ? props.selectedFg : props.fg,\n bg: isHighlighted ? props.selectedBg : undefined,\n dim: item.disabled,\n bold: isSelected,\n },\n `${indicator}${item.label}`,\n ),\n );\n });\n\n // Scroll down indicator\n if (scrollIndicator.value.showDown) {\n children.push(h(\"text\", { key: \"scroll-down\", dim: true }, \" ...\"));\n }\n\n return h(\n \"box\",\n {\n style: { flex_direction: \"column\" },\n fg: props.fg,\n },\n children,\n );\n };\n },\n});\n","/**\n * Table Component - Display tabular data\n */\n\nimport { defineComponent, h, type PropType } from \"@vue/runtime-core\";\n\nexport interface TableColumn {\n /** Column key (maps to data property) */\n key: string;\n /** Column header text */\n header: string;\n /** Column width */\n width?: number | string;\n /** Text alignment */\n align?: \"left\" | \"center\" | \"right\";\n}\n\nexport interface TableProps {\n /** Column definitions */\n columns: TableColumn[];\n /** Table data */\n data: Record<string, unknown>[];\n /** Show header row */\n showHeader?: boolean;\n /** Border style */\n border?: \"none\" | \"single\" | \"double\" | \"rounded\";\n /** Header foreground color */\n headerFg?: string;\n /** Header background color */\n headerBg?: string;\n /** Row foreground color */\n rowFg?: string;\n /** Alternate row background color */\n stripedBg?: string;\n /** Cell padding */\n cellPadding?: number;\n}\n\nexport const Table = defineComponent({\n name: \"Table\",\n props: {\n columns: {\n type: Array as PropType<TableColumn[]>,\n required: true,\n },\n data: {\n type: Array as PropType<Record<string, unknown>[]>,\n required: true,\n },\n showHeader: {\n type: Boolean,\n default: true,\n },\n border: {\n type: String as PropType<TableProps[\"border\"]>,\n default: \"single\",\n },\n headerFg: {\n type: String,\n default: \"white\",\n },\n headerBg: String,\n rowFg: String,\n stripedBg: String,\n cellPadding: {\n type: Number,\n default: 1,\n },\n },\n setup(props) {\n const formatCell = (value: unknown, width?: number | string): string => {\n const str =\n typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\"\n ? String(value)\n : value == null\n ? \"\"\n : JSON.stringify(value);\n if (typeof width === \"number\" && str.length < width) {\n return str.padEnd(width);\n }\n return str;\n };\n\n return () => {\n const rows: ReturnType<typeof h>[] = [];\n\n // Header row\n if (props.showHeader) {\n const headerCells = props.columns.map((col) =>\n h(\n \"text\",\n {\n key: col.key,\n bold: true,\n fg: props.headerFg,\n bg: props.headerBg,\n },\n formatCell(col.header, col.width),\n ),\n );\n\n rows.push(\n h(\n \"box\",\n {\n key: \"header\",\n style: {\n flex_direction: \"row\",\n gap: props.cellPadding,\n },\n },\n headerCells,\n ),\n );\n\n // Separator\n if (props.border !== \"none\") {\n const sepChar = props.border === \"double\" ? \"=\" : \"-\";\n const totalWidth = props.columns.reduce((acc, col) => {\n const w = typeof col.width === \"number\" ? col.width : 10;\n return acc + w + (props.cellPadding ?? 1);\n }, 0);\n\n rows.push(\n h(\n \"text\",\n {\n key: \"separator\",\n dim: true,\n },\n sepChar.repeat(totalWidth),\n ),\n );\n }\n }\n\n // Data rows\n props.data.forEach((row, rowIndex) => {\n const cells = props.columns.map((col) =>\n h(\n \"text\",\n {\n key: col.key,\n fg: props.rowFg,\n bg: rowIndex % 2 === 1 ? props.stripedBg : undefined,\n },\n formatCell(row[col.key], col.width),\n ),\n );\n\n rows.push(\n h(\n \"box\",\n {\n key: `row-${rowIndex}`,\n style: {\n flex_direction: \"row\",\n gap: props.cellPadding,\n },\n },\n cells,\n ),\n );\n });\n\n return h(\n \"box\",\n {\n style: { flex_direction: \"column\" },\n border: props.border,\n },\n rows,\n );\n };\n },\n});\n","/**\n * Tree Component - Tree view for hierarchical data\n */\n\nimport { defineComponent, h, type PropType, type VNode } from \"@vue/runtime-core\";\n\nexport interface TreeNode {\n key: string;\n label: string;\n children?: TreeNode[];\n icon?: string;\n disabled?: boolean;\n}\n\nexport interface TreeProps {\n /** Tree data */\n data: TreeNode[];\n /** Expanded node keys */\n expanded?: string[];\n /** Selected node key */\n selected?: string;\n /** Show lines */\n showLines?: boolean;\n /** Indent size */\n indent?: number;\n /** Expanded icon */\n expandedIcon?: string;\n /** Collapsed icon */\n collapsedIcon?: string;\n /** Leaf icon */\n leafIcon?: string;\n /** Foreground color */\n fg?: string;\n /** Selected foreground color */\n selectedFg?: string;\n}\n\nexport const Tree = defineComponent({\n name: \"Tree\",\n props: {\n data: {\n type: Array as PropType<TreeNode[]>,\n required: true,\n },\n expanded: {\n type: Array as PropType<string[]>,\n default: () => [],\n },\n selected: String,\n showLines: {\n type: Boolean,\n default: true,\n },\n indent: {\n type: Number,\n default: 2,\n },\n expandedIcon: {\n type: String,\n default: \"▼\",\n },\n collapsedIcon: {\n type: String,\n default: \"▶\",\n },\n leafIcon: {\n type: String,\n default: \"•\",\n },\n fg: String,\n selectedFg: {\n type: String,\n default: \"cyan\",\n },\n },\n emits: [\"select\", \"toggle\"],\n setup(props, { emit: _emit }) {\n const renderNode = (\n node: TreeNode,\n depth: number,\n isLast: boolean,\n prefix: string,\n ): VNode[] => {\n const nodes: VNode[] = [];\n const hasChildren = node.children && node.children.length > 0;\n const isExpanded = props.expanded?.includes(node.key);\n const isSelected = node.key === props.selected;\n\n // Build line prefix\n let linePrefix = prefix;\n if (props.showLines && depth > 0) {\n linePrefix += isLast ? \"└─\" : \"├─\";\n }\n\n // Icon\n let icon = props.leafIcon;\n if (hasChildren) {\n icon = isExpanded ? props.expandedIcon : props.collapsedIcon;\n }\n if (node.icon) {\n icon = node.icon;\n }\n\n // Node line\n nodes.push(\n h(\n \"text\",\n {\n key: node.key,\n fg: isSelected ? props.selectedFg : props.fg,\n bold: isSelected,\n dim: node.disabled,\n },\n `${linePrefix}${icon} ${node.label}`,\n ),\n );\n\n // Children\n if (hasChildren && isExpanded) {\n const childPrefix = prefix + (props.showLines && depth > 0 ? (isLast ? \" \" : \"│ \") : \"\");\n node.children!.forEach((child, index) => {\n const childIsLast = index === node.children!.length - 1;\n nodes.push(\n ...renderNode(child, depth + 1, childIsLast, childPrefix + \" \".repeat(props.indent)),\n );\n });\n }\n\n return nodes;\n };\n\n return () => {\n const children: VNode[] = [];\n\n props.data.forEach((node, index) => {\n const isLast = index === props.data.length - 1;\n children.push(...renderNode(node, 0, isLast, \"\"));\n });\n\n return h(\"box\", { style: { flex_direction: \"column\" } }, children);\n };\n },\n});\n","/**\n * Menu Component - Command menu/palette\n */\n\nimport { defineComponent, h, type PropType, type VNode } from \"@vue/runtime-core\";\n\nexport interface MenuItem {\n key: string;\n label: string;\n shortcut?: string;\n icon?: string;\n disabled?: boolean;\n separator?: boolean;\n}\n\nexport interface MenuProps {\n /** Menu items */\n items: MenuItem[];\n /** Focused item index */\n focusedIndex?: number;\n /** Show border */\n border?: \"single\" | \"double\" | \"rounded\" | \"none\";\n /** Width */\n width?: number;\n /** Foreground color */\n fg?: string;\n /** Focused foreground color */\n focusedFg?: string;\n /** Focused background color */\n focusedBg?: string;\n /** Shortcut foreground color */\n shortcutFg?: string;\n}\n\nexport const Menu = defineComponent({\n name: \"Menu\",\n props: {\n items: {\n type: Array as PropType<MenuItem[]>,\n required: true,\n },\n focusedIndex: {\n type: Number,\n default: 0,\n },\n border: {\n type: String as PropType<MenuProps[\"border\"]>,\n default: \"single\",\n },\n width: Number,\n fg: String,\n focusedFg: {\n type: String,\n default: \"black\",\n },\n focusedBg: {\n type: String,\n default: \"cyan\",\n },\n shortcutFg: {\n type: String,\n default: \"gray\",\n },\n },\n emits: [\"select\"],\n setup(props, { emit: _emit }) {\n return () => {\n const children: VNode[] = [];\n\n props.items.forEach((item, index) => {\n if (item.separator) {\n children.push(\n h(\"text\", { key: `sep-${index}`, dim: true }, \"─\".repeat(props.width ?? 20)),\n );\n return;\n }\n\n const isFocused = index === props.focusedIndex;\n const itemContent: VNode[] = [];\n\n // Icon\n if (item.icon) {\n itemContent.push(h(\"text\", { key: \"icon\" }, `${item.icon} `));\n }\n\n // Label\n itemContent.push(\n h(\n \"text\",\n {\n key: \"label\",\n fg: isFocused ? props.focusedFg : props.fg,\n bg: isFocused ? props.focusedBg : undefined,\n dim: item.disabled,\n style: { flex_grow: 1 },\n },\n item.label,\n ),\n );\n\n // Shortcut\n if (item.shortcut) {\n itemContent.push(\n h(\n \"text\",\n {\n key: \"shortcut\",\n fg: props.shortcutFg,\n dim: true,\n },\n ` ${item.shortcut}`,\n ),\n );\n }\n\n children.push(\n h(\n \"box\",\n {\n key: item.key,\n style: {\n flex_direction: \"row\",\n padding_left: 1,\n padding_right: 1,\n },\n bg: isFocused ? props.focusedBg : undefined,\n },\n itemContent,\n ),\n );\n });\n\n return h(\n \"box\",\n {\n border: props.border === \"none\" ? undefined : props.border,\n style: {\n flex_direction: \"column\",\n width: props.width ? String(props.width) : undefined,\n },\n },\n children,\n );\n };\n },\n});\n","/**\n * Tabs Component - Tab navigation\n */\n\nimport { defineComponent, h, type PropType, type VNode } from \"@vue/runtime-core\";\n\nexport interface Tab {\n key: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface TabsProps {\n /** Tab definitions */\n tabs: Tab[];\n /** Currently active tab key */\n modelValue?: string;\n /** Tab bar position */\n position?: \"top\" | \"bottom\";\n /** Separator between tabs */\n separator?: string;\n /** Active tab foreground color */\n activeFg?: string;\n /** Active tab background color */\n activeBg?: string;\n /** Inactive tab foreground color */\n inactiveFg?: string;\n /** Show underline for active tab */\n underline?: boolean;\n}\n\nexport const Tabs = defineComponent({\n name: \"Tabs\",\n props: {\n tabs: {\n type: Array as PropType<Tab[]>,\n required: true,\n },\n modelValue: String,\n position: {\n type: String as PropType<\"top\" | \"bottom\">,\n default: \"top\",\n },\n separator: {\n type: String,\n default: \" | \",\n },\n activeFg: {\n type: String,\n default: \"cyan\",\n },\n activeBg: String,\n inactiveFg: String,\n underline: {\n type: Boolean,\n default: true,\n },\n },\n emits: [\"update:modelValue\", \"change\"],\n setup(props, { slots, emit: _emit }) {\n // Note: selectTab is designed for keyboard event handlers\n // It is currently not wired up but kept for future use\n\n return () => {\n // Tab bar\n const tabItems: VNode[] = [];\n\n props.tabs.forEach((tab, index) => {\n if (index > 0) {\n tabItems.push(h(\"text\", { key: `sep-${index}`, dim: true }, props.separator));\n }\n\n const isActive = tab.key === props.modelValue;\n\n tabItems.push(\n h(\n \"text\",\n {\n key: tab.key,\n fg: isActive ? props.activeFg : props.inactiveFg,\n bg: isActive ? props.activeBg : undefined,\n bold: isActive,\n underline: isActive && props.underline,\n dim: tab.disabled,\n },\n tab.label,\n ),\n );\n });\n\n const tabBar = h(\n \"box\",\n {\n key: \"tab-bar\",\n style: {\n flex_direction: \"row\",\n padding_bottom: props.position === \"top\" ? 1 : 0,\n padding_top: props.position === \"bottom\" ? 1 : 0,\n },\n },\n tabItems,\n );\n\n // Content area\n const content = h(\n \"box\",\n {\n key: \"content\",\n style: { flex_grow: 1 },\n },\n slots.default?.(),\n );\n\n // Arrange based on position\n const children = props.position === \"top\" ? [tabBar, content] : [content, tabBar];\n\n return h(\n \"box\",\n {\n style: { flex_direction: \"column\", flex_grow: 1 },\n },\n children,\n );\n };\n },\n});\n","/**\n * Breadcrumb Component - Navigation breadcrumb\n */\n\nimport { defineComponent, h, type PropType } from \"@vue/runtime-core\";\n\nexport interface BreadcrumbItem {\n key: string;\n label: string;\n icon?: string;\n}\n\nexport interface BreadcrumbProps {\n /** Breadcrumb items */\n items: BreadcrumbItem[];\n /** Separator */\n separator?: string;\n /** Foreground color */\n fg?: string;\n /** Active (last item) foreground color */\n activeFg?: string;\n /** Separator foreground color */\n separatorFg?: string;\n}\n\nexport const Breadcrumb = defineComponent({\n name: \"Breadcrumb\",\n props: {\n items: {\n type: Array as PropType<BreadcrumbItem[]>,\n required: true,\n },\n separator: {\n type: String,\n default: \" > \",\n },\n fg: {\n type: String,\n default: \"gray\",\n },\n activeFg: {\n type: String,\n default: \"white\",\n },\n separatorFg: {\n type: String,\n default: \"gray\",\n },\n },\n emits: [\"select\"],\n setup(props, { emit: _emit }) {\n return () => {\n const children = props.items.flatMap((item, index) => {\n const isLast = index === props.items.length - 1;\n const result = [];\n\n // Icon\n if (item.icon) {\n result.push(\n h(\n \"text\",\n {\n key: `icon-${item.key}`,\n fg: isLast ? props.activeFg : props.fg,\n },\n `${item.icon} `,\n ),\n );\n }\n\n // Label\n result.push(\n h(\n \"text\",\n {\n key: item.key,\n fg: isLast ? props.activeFg : props.fg,\n bold: isLast,\n underline: !isLast,\n },\n item.label,\n ),\n );\n\n // Separator\n if (!isLast) {\n result.push(\n h(\n \"text\",\n {\n key: `sep-${item.key}`,\n fg: props.separatorFg,\n },\n props.separator,\n ),\n );\n }\n\n return result;\n });\n\n return h(\"box\", { style: { flex_direction: \"row\" } }, children);\n };\n },\n});\n","/**\n * Stepper Component - Step indicator for wizards\n */\n\nimport { defineComponent, h, type PropType } from \"@vue/runtime-core\";\n\nexport interface Step {\n key: string;\n label: string;\n description?: string;\n}\n\nexport type StepStatus = \"pending\" | \"current\" | \"completed\" | \"error\";\n\nexport interface StepperProps {\n /** Steps */\n steps: Step[];\n /** Current step index */\n current?: number;\n /** Completed steps (indices) */\n completed?: number[];\n /** Error steps (indices) */\n errors?: number[];\n /** Direction */\n direction?: \"horizontal\" | \"vertical\";\n /** Show step numbers */\n showNumbers?: boolean;\n /** Completed icon */\n completedIcon?: string;\n /** Error icon */\n errorIcon?: string;\n /** Current icon */\n currentIcon?: string;\n /** Pending icon */\n pendingIcon?: string;\n}\n\nexport const Stepper = defineComponent({\n name: \"Stepper\",\n props: {\n steps: {\n type: Array as PropType<Step[]>,\n required: true,\n },\n current: {\n type: Number,\n default: 0,\n },\n completed: {\n type: Array as PropType<number[]>,\n default: () => [],\n },\n errors: {\n type: Array as PropType<number[]>,\n default: () => [],\n },\n direction: {\n type: String as PropType<\"horizontal\" | \"vertical\">,\n default: \"horizontal\",\n },\n showNumbers: {\n type: Boolean,\n default: true,\n },\n completedIcon: {\n type: String,\n default: \"✓\",\n },\n errorIcon: {\n type: String,\n default: \"✗\",\n },\n currentIcon: {\n type: String,\n default: \"●\",\n },\n pendingIcon: {\n type: String,\n default: \"○\",\n },\n },\n setup(props) {\n const getStatus = (index: number): StepStatus => {\n if (props.errors?.includes(index)) return \"error\";\n if (props.completed?.includes(index)) return \"completed\";\n if (index === props.current) return \"current\";\n return \"pending\";\n };\n\n const getIcon = (index: number, status: StepStatus): string => {\n if (props.showNumbers && status === \"pending\") {\n return String(index + 1);\n }\n switch (status) {\n case \"completed\":\n return props.completedIcon;\n case \"error\":\n return props.errorIcon;\n case \"current\":\n return props.currentIcon;\n default:\n return props.pendingIcon;\n }\n };\n\n const getColor = (status: StepStatus): string => {\n switch (status) {\n case \"completed\":\n return \"green\";\n case \"error\":\n return \"red\";\n case \"current\":\n return \"cyan\";\n default:\n return \"gray\";\n }\n };\n\n return () => {\n const isHorizontal = props.direction === \"horizontal\";\n const connector = isHorizontal ? \"───\" : \"│\";\n\n const children = props.steps.flatMap((step, index) => {\n const status = getStatus(index);\n const icon = getIcon(index, status);\n const color = getColor(status);\n const isLast = index === props.steps.length - 1;\n\n const stepContent = [\n h(\n \"box\",\n {\n key: `step-${step.key}`,\n style: {\n flex_direction: isHorizontal ? \"column\" : \"row\",\n align_items: \"center\",\n },\n },\n [\n h(\n \"text\",\n {\n fg: color,\n bold: status === \"current\",\n },\n `[${icon}]`,\n ),\n h(\n \"text\",\n {\n fg: status === \"current\" ? \"white\" : \"gray\",\n bold: status === \"current\",\n style: isHorizontal ? { margin_top: 0.5 } : { margin_left: 1 },\n },\n step.label,\n ),\n ],\n ),\n ];\n\n if (!isLast) {\n stepContent.push(\n h(\n \"text\",\n {\n key: `connector-${index}`,\n dim: true,\n style: isHorizontal\n ? { margin_left: 1, margin_right: 1 }\n : { margin_top: 0.5, margin_bottom: 0.5, margin_left: 1 },\n },\n connector,\n ),\n );\n }\n\n return stepContent;\n });\n\n return h(\n \"box\",\n {\n style: {\n flex_direction: isHorizontal ? \"row\" : \"column\",\n align_items: isHorizontal ? \"flex-start\" : \"stretch\",\n },\n },\n children,\n );\n };\n },\n});\n","/**\n * Modal Component - Overlay dialog\n */\n\nimport { defineComponent, h, type PropType, type VNode } from \"@vue/runtime-core\";\n\nexport interface ModalProps {\n /** Whether the modal is visible */\n visible?: boolean;\n /** Modal title */\n title?: string;\n /** Modal width */\n width?: number | string;\n /** Modal height */\n height?: number | string;\n /** Border style */\n border?: \"single\" | \"double\" | \"rounded\" | \"heavy\";\n /** Title foreground color */\n titleFg?: string;\n /** Border foreground color */\n borderFg?: string;\n /** Background color */\n bg?: string;\n}\n\nexport const Modal = defineComponent({\n name: \"Modal\",\n props: {\n visible: {\n type: Boolean,\n default: true,\n },\n title: String,\n width: {\n type: [Number, String] as PropType<number | string>,\n default: \"50%\",\n },\n height: {\n type: [Number, String] as PropType<number | string>,\n default: \"auto\",\n },\n border: {\n type: String as PropType<ModalProps[\"border\"]>,\n default: \"rounded\",\n },\n titleFg: {\n type: String,\n default: \"white\",\n },\n borderFg: String,\n bg: String,\n },\n emits: [\"close\"],\n setup(props, { slots, emit: _emit }) {\n return () => {\n if (!props.visible) {\n return null;\n }\n\n const children: VNode[] = [];\n\n // Title bar\n if (props.title) {\n children.push(\n h(\n \"box\",\n {\n key: \"title\",\n style: {\n flex_direction: \"row\",\n justify_content: \"center\",\n padding_bottom: 1,\n },\n },\n [\n h(\n \"text\",\n {\n bold: true,\n fg: props.titleFg,\n },\n props.title,\n ),\n ],\n ),\n );\n }\n\n // Content\n children.push(\n h(\n \"box\",\n {\n key: \"content\",\n style: { flex_grow: 1 },\n },\n slots.default?.(),\n ),\n );\n\n // Modal container with centering\n return h(\n \"box\",\n {\n style: {\n justify_content: \"center\",\n align_items: \"center\",\n width: \"100%\",\n height: \"100%\",\n },\n },\n [\n h(\n \"box\",\n {\n style: {\n flex_direction: \"column\",\n width: String(props.width),\n height: String(props.height),\n padding: 1,\n },\n border: props.border,\n fg: props.borderFg,\n bg: props.bg,\n },\n children,\n ),\n ],\n );\n };\n },\n});\n","/**\n * StatusBar Component - Status bar (typically at bottom of screen)\n */\n\nimport { defineComponent, h, type PropType, type VNode } from \"@vue/runtime-core\";\n\nexport interface StatusBarItem {\n key: string;\n content: string;\n fg?: string;\n bg?: string;\n bold?: boolean;\n align?: \"left\" | \"right\";\n}\n\nexport interface StatusBarProps {\n /** Status bar items */\n items: StatusBarItem[];\n /** Background color */\n bg?: string;\n /** Foreground color */\n fg?: string;\n /** Separator between items */\n separator?: string;\n}\n\nexport const StatusBar = defineComponent({\n name: \"StatusBar\",\n props: {\n items: {\n type: Array as PropType<StatusBarItem[]>,\n required: true,\n },\n bg: {\n type: String,\n default: \"blue\",\n },\n fg: {\n type: String,\n default: \"white\",\n },\n separator: {\n type: String,\n default: \" │ \",\n },\n },\n setup(props) {\n return () => {\n const leftItems = props.items.filter((item) => item.align !== \"right\");\n const rightItems = props.items.filter((item) => item.align === \"right\");\n\n const renderItems = (items: StatusBarItem[]): VNode[] => {\n const result: VNode[] = [];\n items.forEach((item, index) => {\n if (index > 0) {\n result.push(\n h(\n \"text\",\n { key: `sep-${item.key}`, fg: props.fg, bg: props.bg, dim: true },\n props.separator,\n ),\n );\n }\n result.push(\n h(\n \"text\",\n {\n key: item.key,\n fg: item.fg ?? props.fg,\n bg: item.bg ?? props.bg,\n bold: item.bold,\n },\n item.content,\n ),\n );\n });\n return result;\n };\n\n return h(\n \"box\",\n {\n bg: props.bg,\n style: {\n flex_direction: \"row\",\n justify_content: \"space-between\",\n width: \"100%\",\n padding_left: 1,\n padding_right: 1,\n },\n },\n [\n h(\"box\", { key: \"left\", style: { flex_direction: \"row\" } }, renderItems(leftItems)),\n h(\"box\", { key: \"right\", style: { flex_direction: \"row\" } }, renderItems(rightItems)),\n ],\n );\n };\n },\n});\n","/**\n * Header Component - Application header\n */\n\nimport { defineComponent, h, type VNode } from \"@vue/runtime-core\";\n\nexport interface HeaderProps {\n /** Header title */\n title: string;\n /** Subtitle */\n subtitle?: string;\n /** Left content */\n left?: string;\n /** Right content */\n right?: string;\n /** Background color */\n bg?: string;\n /** Title foreground color */\n titleFg?: string;\n /** Subtitle foreground color */\n subtitleFg?: string;\n /** Border bottom */\n borderBottom?: boolean;\n}\n\nexport const Header = defineComponent({\n name: \"Header\",\n props: {\n title: {\n type: String,\n required: true,\n },\n subtitle: String,\n left: String,\n right: String,\n bg: String,\n titleFg: {\n type: String,\n default: \"white\",\n },\n subtitleFg: {\n type: String,\n default: \"gray\",\n },\n borderBottom: {\n type: Boolean,\n default: false,\n },\n },\n setup(props, { slots }) {\n return () => {\n const leftContent = slots.left?.() ?? (props.left ? [h(\"text\", {}, props.left)] : []);\n const rightContent = slots.right?.() ?? (props.right ? [h(\"text\", {}, props.right)] : []);\n\n const centerContent = [\n h(\n \"text\",\n {\n fg: props.titleFg,\n bold: true,\n },\n props.title,\n ),\n ];\n\n if (props.subtitle) {\n centerContent.push(\n h(\n \"text\",\n {\n fg: props.subtitleFg,\n dim: true,\n },\n ` - ${props.subtitle}`,\n ),\n );\n }\n\n const children: VNode[] = [\n h(\n \"box\",\n {\n key: \"header-content\",\n bg: props.bg,\n style: {\n flex_direction: \"row\",\n justify_content: \"space-between\",\n align_items: \"center\",\n width: \"100%\",\n padding: 1,\n },\n },\n [\n h(\"box\", { key: \"left\", style: { flex_direction: \"row\" } }, leftContent),\n h(\"box\", { key: \"center\", style: { flex_direction: \"row\" } }, centerContent),\n h(\"box\", { key: \"right\", style: { flex_direction: \"row\" } }, rightContent),\n ],\n ),\n ];\n\n if (props.borderBottom) {\n children.push(h(\"text\", { key: \"border\", dim: true }, \"─\".repeat(80)));\n }\n\n return h(\"box\", { style: { flex_direction: \"column\" } }, children);\n };\n },\n});\n","/**\n * KeyHint Component - Display keyboard shortcut hints\n */\n\nimport { defineComponent, h, type PropType } from \"@vue/runtime-core\";\n\nexport interface KeyBinding {\n keys: string[];\n description: string;\n}\n\nexport interface KeyHintProps {\n /** Key bindings to display */\n bindings: KeyBinding[];\n /** Layout direction */\n direction?: \"horizontal\" | \"vertical\";\n /** Key foreground color */\n keyFg?: string;\n /** Key background color */\n keyBg?: string;\n /** Description foreground color */\n descFg?: string;\n /** Separator between key and description */\n separator?: string;\n}\n\nexport const KeyHint = defineComponent({\n name: \"KeyHint\",\n props: {\n bindings: {\n type: Array as PropType<KeyBinding[]>,\n required: true,\n },\n direction: {\n type: String as PropType<\"horizontal\" | \"vertical\">,\n default: \"horizontal\",\n },\n keyFg: {\n type: String,\n default: \"black\",\n },\n keyBg: {\n type: String,\n default: \"white\",\n },\n descFg: {\n type: String,\n default: \"gray\",\n },\n separator: {\n type: String,\n default: \" \",\n },\n },\n setup(props) {\n return () => {\n const children = props.bindings.map((binding, index) => {\n const keyParts = binding.keys\n .map((key, keyIndex) => [\n h(\n \"text\",\n {\n key: `key-${keyIndex}`,\n fg: props.keyFg,\n bg: props.keyBg,\n bold: true,\n },\n ` ${key} `,\n ),\n keyIndex < binding.keys.length - 1 ? h(\"text\", { key: `plus-${keyIndex}` }, \"+\") : null,\n ])\n .flat()\n .filter(Boolean);\n\n return h(\n \"box\",\n {\n key: `binding-${index}`,\n style: {\n flex_direction: \"row\",\n margin_right: props.direction === \"horizontal\" ? 2 : 0,\n },\n },\n [\n ...keyParts,\n h(\"text\", {}, props.separator),\n h(\"text\", { fg: props.descFg }, binding.description),\n ],\n );\n });\n\n return h(\n \"box\",\n {\n style: {\n flex_direction: props.direction === \"horizontal\" ? \"row\" : \"column\",\n flex_wrap: \"wrap\",\n },\n },\n children,\n );\n };\n },\n});\n","/**\n * Avatar Component - User avatar display\n */\n\nimport { defineComponent, h, type PropType } from \"@vue/runtime-core\";\n\nexport interface AvatarProps {\n /** User name (used to generate initials) */\n name?: string;\n /** Custom initials */\n initials?: string;\n /** Avatar size */\n size?: \"sm\" | \"md\" | \"lg\";\n /** Background color */\n bg?: string;\n /** Foreground color */\n fg?: string;\n /** Show border */\n border?: boolean;\n /** Status indicator */\n status?: \"online\" | \"offline\" | \"away\" | \"busy\";\n}\n\nconst STATUS_COLORS: Record<string, string> = {\n online: \"green\",\n offline: \"gray\",\n away: \"yellow\",\n busy: \"red\",\n};\n\nconst STATUS_ICONS: Record<string, string> = {\n online: \"●\",\n offline: \"○\",\n away: \"◐\",\n busy: \"⊘\",\n};\n\nexport const Avatar = defineComponent({\n name: \"Avatar\",\n props: {\n name: String,\n initials: String,\n size: {\n type: String as PropType<\"sm\" | \"md\" | \"lg\">,\n default: \"md\",\n },\n bg: {\n type: String,\n default: \"blue\",\n },\n fg: {\n type: String,\n default: \"white\",\n },\n border: {\n type: Boolean,\n default: true,\n },\n status: {\n type: String as PropType<AvatarProps[\"status\"]>,\n },\n },\n setup(props) {\n return () => {\n // Generate initials from name\n let displayInitials = props.initials;\n if (!displayInitials && props.name) {\n const parts = props.name.split(\" \").filter(Boolean);\n if (parts.length >= 2) {\n displayInitials = `${parts[0][0]}${parts[1][0]}`.toUpperCase();\n } else if (parts.length === 1) {\n displayInitials = parts[0].slice(0, 2).toUpperCase();\n }\n }\n displayInitials = displayInitials || \"??\";\n\n // Size-based padding\n const padding = props.size === \"sm\" ? 0 : props.size === \"lg\" ? 1 : 0;\n\n const children = [\n h(\n \"text\",\n {\n fg: props.fg,\n bg: props.bg,\n bold: true,\n },\n displayInitials,\n ),\n ];\n\n // Status indicator\n if (props.status) {\n children.push(\n h(\n \"text\",\n {\n fg: STATUS_COLORS[props.status],\n },\n STATUS_ICONS[props.status],\n ),\n );\n }\n\n if (props.border) {\n return h(\n \"box\",\n {\n border: \"rounded\",\n bg: props.bg,\n style: {\n flex_direction: \"row\",\n padding_left: padding,\n padding_right: padding,\n },\n },\n children,\n );\n }\n\n return h(\n \"box\",\n {\n bg: props.bg,\n style: {\n flex_direction: \"row\",\n padding_left: padding,\n padding_right: padding,\n },\n },\n children,\n );\n };\n },\n});\n"],"mappings":";;;;AA6EA,MAAa,MAAM,gBAAgB;CACjC,MAAM;CACN,OAAO;EACL,eAAe;EACf,UAAU;EACV,gBAAgB;EAChB,YAAY;EACZ,WAAW;EACX,UAAU;EACV,YAAY;EACZ,OAAO,CAAC,QAAQ,MAAO;EACvB,QAAQ,CAAC,QAAQ,MAAO;EACxB,UAAU,CAAC,QAAQ,MAAO;EAC1B,WAAW,CAAC,QAAQ,MAAO;EA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a;GAEvD;AACD,qBAAkB,mBAAmB;GAGrC,MAAM,UAAU,MAAM,SAAS,OAAO,IAAI,MAAM,SAAS,OAAO,IAAI;GAEpE,MAAM,WAAW,CACf,EACE,QACA;IACE,IAAI,MAAM;IACV,IAAI,MAAM;IACV,MAAM;GACP,GACD,gBACD,AACF;AAGD,OAAI,MAAM,OACR,UAAS,KACP,EACE,QACA,EACE,IAAI,cAAc,MAAM,QACzB,GACD,aAAa,MAAM,QACpB,CACF;AAGH,OAAI,MAAM,OACR,QAAO,EACL,OACA;IACE,QAAQ;IACR,IAAI,MAAM;IACV,OAAO;KACL,gBAAgB;KAChB,cAAc;KACd,eAAe;IAChB;GACF,GACD,SACD;AAGH,UAAO,EACL,OACA;IACE,IAAI,MAAM;IACV,OAAO;KACL,gBAAgB;KAChB,cAAc;KACd,eAAe;IAChB;GACF,GACD,SACD;EACF;CACF;AACF,EAAC"}
@@ -0,0 +1,2 @@
1
+ import { FocusManager, ImeManager, KeyHandler, UseAppReturn, UseFocusOptions, UseImeOptions, UseInputOptions, useApp$1 as useApp, useFocus$1 as useFocus, useIme$1 as useIme, useInput } from "../index-z9cQDuri.js";
2
+ export { FocusManager, ImeManager, KeyHandler, UseAppReturn, UseFocusOptions, UseImeOptions, UseInputOptions, useApp, useFocus, useIme, useInput };
@@ -0,0 +1,4 @@
1
+ import { useInput$1 as useInput } from "../useInput-CvEslk0z.js";
2
+ import { useApp, useFocus, useIme } from "../composables-CLuPs-N5.js";
3
+
4
+ export { useApp, useFocus, useIme, useInput };
@@ -0,0 +1,187 @@
1
+ import { computed, inject, ref } from "@vue/runtime-core";
2
+
3
+ //#region src/composables/useFocus.ts
4
+ const FOCUS_KEY = Symbol("fresco-focus");
5
+ /**
6
+ * Use focus management
7
+ */
8
+ function useFocus(options = {}) {
9
+ const { autoFocus = false, id = `focus-${Math.random().toString(36).slice(2)}` } = options;
10
+ const manager = inject(FOCUS_KEY, null);
11
+ const localFocused = ref(autoFocus);
12
+ const isFocused = computed(() => {
13
+ if (manager) return manager.focusedId.value === id;
14
+ return localFocused.value;
15
+ });
16
+ const focus = () => {
17
+ if (manager) manager.focus(id);
18
+ else localFocused.value = true;
19
+ };
20
+ const blur = () => {
21
+ if (manager) {
22
+ if (manager.focusedId.value === id) manager.focusedId.value = null;
23
+ } else localFocused.value = false;
24
+ };
25
+ if (manager) {
26
+ manager.register(id);
27
+ if (autoFocus && !manager.focusedId.value) manager.focus(id);
28
+ }
29
+ return {
30
+ id,
31
+ isFocused,
32
+ focus,
33
+ blur
34
+ };
35
+ }
36
+
37
+ //#endregion
38
+ //#region src/composables/useApp.ts
39
+ const APP_KEY = Symbol("fresco-app");
40
+ /**
41
+ * Use app context
42
+ */
43
+ function useApp() {
44
+ const context = inject(APP_KEY);
45
+ if (!context) return {
46
+ width: ref(80),
47
+ height: ref(24),
48
+ isRunning: ref(false),
49
+ exit: () => {},
50
+ render: () => {},
51
+ clear: () => {}
52
+ };
53
+ return context;
54
+ }
55
+
56
+ //#endregion
57
+ //#region src/composables/useIme.ts
58
+ const MODE_DISPLAY = {
59
+ direct: "A",
60
+ hiragana: "あ",
61
+ katakana: "ア",
62
+ "half-katakana": "ア",
63
+ "full-alpha": "A",
64
+ pinyin: "拼",
65
+ hangul: "한"
66
+ };
67
+ function useIme(options = {}) {
68
+ const { mode: initialMode = "direct", onModeChange, onCompositionUpdate, onCommit } = options;
69
+ const isActive = ref(false);
70
+ const mode = ref(initialMode);
71
+ const isComposing = ref(false);
72
+ const preedit = ref("");
73
+ const preeditCursor = ref(0);
74
+ const candidates = ref([]);
75
+ const selectedCandidate = ref(0);
76
+ const modeDisplay = computed(() => MODE_DISPLAY[mode.value] ?? "A");
77
+ const enable = () => {
78
+ isActive.value = true;
79
+ };
80
+ const disable = () => {
81
+ isActive.value = false;
82
+ cancel();
83
+ };
84
+ const setMode = (newMode) => {
85
+ if (mode.value !== newMode) {
86
+ cancel();
87
+ mode.value = newMode;
88
+ onModeChange?.(newMode);
89
+ }
90
+ };
91
+ const handleKey = (key, modifiers) => {
92
+ if (!isActive.value || mode.value === "direct") return false;
93
+ if (modifiers.ctrl && key === " ") {
94
+ setMode("direct");
95
+ return true;
96
+ }
97
+ if (isComposing.value) {
98
+ switch (key) {
99
+ case "enter":
100
+ commit();
101
+ return true;
102
+ case "escape":
103
+ cancel();
104
+ return true;
105
+ case "backspace":
106
+ if (preedit.value.length > 0) {
107
+ preedit.value = preedit.value.slice(0, -1);
108
+ preeditCursor.value = Math.min(preeditCursor.value, preedit.value.length);
109
+ onCompositionUpdate?.(preedit.value, preeditCursor.value);
110
+ return true;
111
+ }
112
+ break;
113
+ case "space":
114
+ if (candidates.value.length > 0) {
115
+ nextCandidate();
116
+ return true;
117
+ }
118
+ break;
119
+ }
120
+ if (/^[1-9]$/.test(key)) {
121
+ selectCandidate(parseInt(key, 10));
122
+ return true;
123
+ }
124
+ }
125
+ if (key.length === 1 && !modifiers.ctrl && !modifiers.alt) {
126
+ if (!isComposing.value) isComposing.value = true;
127
+ preedit.value += key;
128
+ preeditCursor.value = preedit.value.length;
129
+ onCompositionUpdate?.(preedit.value, preeditCursor.value);
130
+ return true;
131
+ }
132
+ return false;
133
+ };
134
+ const commit = () => {
135
+ if (preedit.value) {
136
+ const text = candidates.value[selectedCandidate.value] ?? preedit.value;
137
+ onCommit?.(text);
138
+ }
139
+ preedit.value = "";
140
+ preeditCursor.value = 0;
141
+ candidates.value = [];
142
+ selectedCandidate.value = 0;
143
+ isComposing.value = false;
144
+ };
145
+ const cancel = () => {
146
+ preedit.value = "";
147
+ preeditCursor.value = 0;
148
+ candidates.value = [];
149
+ selectedCandidate.value = 0;
150
+ isComposing.value = false;
151
+ };
152
+ const nextCandidate = () => {
153
+ if (candidates.value.length > 0) selectedCandidate.value = (selectedCandidate.value + 1) % candidates.value.length;
154
+ };
155
+ const prevCandidate = () => {
156
+ if (candidates.value.length > 0) selectedCandidate.value = (selectedCandidate.value - 1 + candidates.value.length) % candidates.value.length;
157
+ };
158
+ const selectCandidate = (num) => {
159
+ if (num >= 1 && num <= candidates.value.length) {
160
+ selectedCandidate.value = num - 1;
161
+ commit();
162
+ }
163
+ };
164
+ return {
165
+ isActive,
166
+ mode,
167
+ isComposing,
168
+ preedit,
169
+ preeditCursor,
170
+ candidates,
171
+ selectedCandidate,
172
+ modeDisplay,
173
+ enable,
174
+ disable,
175
+ setMode,
176
+ handleKey,
177
+ commit,
178
+ cancel,
179
+ nextCandidate,
180
+ prevCandidate,
181
+ selectCandidate
182
+ };
183
+ }
184
+
185
+ //#endregion
186
+ export { useApp, useFocus, useIme };
187
+ //# sourceMappingURL=composables-CLuPs-N5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composables-CLuPs-N5.js","names":["FOCUS_KEY: InjectionKey<FocusManager>","options: UseFocusOptions","APP_KEY: InjectionKey<UseAppReturn>","MODE_DISPLAY: Record<ImeMode, string>","options: UseImeOptions","newMode: ImeMode","key: string","modifiers: { ctrl: boolean; alt: boolean }","num: number"],"sources":["../src/composables/useFocus.ts","../src/composables/useApp.ts","../src/composables/useIme.ts"],"sourcesContent":["/**\n * useFocus - Focus management composable\n */\n\nimport { ref, computed, provide, inject, type InjectionKey, type Ref } from \"@vue/runtime-core\";\n\nconst FOCUS_KEY: InjectionKey<FocusManager> = Symbol(\"fresco-focus\");\n\nexport interface UseFocusOptions {\n /** Whether this element starts focused */\n autoFocus?: boolean;\n /** Focus ID for this element */\n id?: string;\n}\n\nexport interface FocusManager {\n /** Currently focused element ID */\n focusedId: Ref<string | null>;\n /** All focusable element IDs */\n focusableIds: Ref<string[]>;\n /** Focus a specific element */\n focus: (id: string) => void;\n /** Focus next element */\n focusNext: () => void;\n /** Focus previous element */\n focusPrevious: () => void;\n /** Register a focusable element */\n register: (id: string) => void;\n /** Unregister a focusable element */\n unregister: (id: string) => void;\n}\n\n/**\n * Create a focus manager (use at app root)\n */\nexport function createFocusManager(): FocusManager {\n const focusedId = ref<string | null>(null);\n const focusableIds = ref<string[]>([]);\n\n const focus = (id: string) => {\n if (focusableIds.value.includes(id)) {\n focusedId.value = id;\n }\n };\n\n const focusNext = () => {\n if (focusableIds.value.length === 0) return;\n\n const currentIndex = focusedId.value ? focusableIds.value.indexOf(focusedId.value) : -1;\n const nextIndex = (currentIndex + 1) % focusableIds.value.length;\n focusedId.value = focusableIds.value[nextIndex];\n };\n\n const focusPrevious = () => {\n if (focusableIds.value.length === 0) return;\n\n const currentIndex = focusedId.value\n ? focusableIds.value.indexOf(focusedId.value)\n : focusableIds.value.length;\n const prevIndex = (currentIndex - 1 + focusableIds.value.length) % focusableIds.value.length;\n focusedId.value = focusableIds.value[prevIndex];\n };\n\n const register = (id: string) => {\n if (!focusableIds.value.includes(id)) {\n focusableIds.value.push(id);\n }\n };\n\n const unregister = (id: string) => {\n const index = focusableIds.value.indexOf(id);\n if (index !== -1) {\n focusableIds.value.splice(index, 1);\n if (focusedId.value === id) {\n focusedId.value = focusableIds.value[0] ?? null;\n }\n }\n };\n\n return {\n focusedId,\n focusableIds,\n focus,\n focusNext,\n focusPrevious,\n register,\n unregister,\n };\n}\n\n/**\n * Provide focus manager to descendants\n */\nexport function provideFocusManager(manager: FocusManager) {\n provide(FOCUS_KEY, manager);\n}\n\n/**\n * Use focus management\n */\nexport function useFocus(options: UseFocusOptions = {}) {\n const { autoFocus = false, id = `focus-${Math.random().toString(36).slice(2)}` } = options;\n\n const manager = inject(FOCUS_KEY, null);\n const localFocused = ref(autoFocus);\n\n const isFocused = computed(() => {\n if (manager) {\n return manager.focusedId.value === id;\n }\n return localFocused.value;\n });\n\n const focus = () => {\n if (manager) {\n manager.focus(id);\n } else {\n localFocused.value = true;\n }\n };\n\n const blur = () => {\n if (manager) {\n if (manager.focusedId.value === id) {\n manager.focusedId.value = null;\n }\n } else {\n localFocused.value = false;\n }\n };\n\n // Register with manager\n if (manager) {\n manager.register(id);\n\n if (autoFocus && !manager.focusedId.value) {\n manager.focus(id);\n }\n }\n\n return {\n id,\n isFocused,\n focus,\n blur,\n };\n}\n","/**\n * useApp - App context composable\n */\n\nimport { ref, provide, inject, type InjectionKey, type Ref } from \"@vue/runtime-core\";\n\nconst APP_KEY: InjectionKey<UseAppReturn> = Symbol(\"fresco-app\");\n\nexport interface UseAppReturn {\n /** Terminal width */\n width: Ref<number>;\n /** Terminal height */\n height: Ref<number>;\n /** Whether app is running */\n isRunning: Ref<boolean>;\n /** Exit the app */\n exit: (code?: number) => void;\n /** Force re-render */\n render: () => void;\n /** Clear the screen */\n clear: () => void;\n}\n\n/**\n * Create app context (use at app root)\n */\nexport function createAppContext(): UseAppReturn {\n const width = ref(80);\n const height = ref(24);\n const isRunning = ref(true);\n\n // These would be connected to actual app instance\n const exit = (_code = 0) => {\n isRunning.value = false;\n // In real implementation, trigger app exit\n };\n\n const render = () => {\n // In real implementation, trigger re-render\n };\n\n const clear = () => {\n // In real implementation, clear screen\n };\n\n // Try to get terminal size\n if (typeof process !== \"undefined\" && process.stdout) {\n width.value = process.stdout.columns ?? 80;\n height.value = process.stdout.rows ?? 24;\n\n process.stdout.on?.(\"resize\", () => {\n width.value = process.stdout.columns ?? 80;\n height.value = process.stdout.rows ?? 24;\n });\n }\n\n return {\n width,\n height,\n isRunning,\n exit,\n render,\n clear,\n };\n}\n\n/**\n * Provide app context to descendants\n */\nexport function provideApp(context: UseAppReturn) {\n provide(APP_KEY, context);\n}\n\n/**\n * Use app context\n */\nexport function useApp(): UseAppReturn {\n const context = inject(APP_KEY);\n\n if (!context) {\n // Return defaults if not in app context\n return {\n width: ref(80),\n height: ref(24),\n isRunning: ref(false),\n exit: () => {},\n render: () => {},\n clear: () => {},\n };\n }\n\n return context;\n}\n\n/**\n * Use terminal dimensions\n */\nexport function useTerminalSize() {\n const { width, height } = useApp();\n return { width, height };\n}\n\n/**\n * Exit handler\n */\nexport function useExit() {\n const { exit } = useApp();\n return exit;\n}\n","/**\n * useIme - IME (Input Method Editor) composable\n */\n\nimport { ref, computed, type Ref } from \"@vue/runtime-core\";\n\nexport interface UseImeOptions {\n /** Initial IME mode */\n mode?: ImeMode;\n /** Called when IME mode changes */\n onModeChange?: (mode: ImeMode) => void;\n /** Called when composition updates */\n onCompositionUpdate?: (text: string, cursor: number) => void;\n /** Called when text is committed */\n onCommit?: (text: string) => void;\n}\n\nexport type ImeMode =\n | \"direct\"\n | \"hiragana\"\n | \"katakana\"\n | \"half-katakana\"\n | \"full-alpha\"\n | \"pinyin\"\n | \"hangul\";\n\nexport interface ImeManager {\n /** Whether IME is active */\n isActive: Ref<boolean>;\n /** Current input mode */\n mode: Ref<ImeMode>;\n /** Whether currently composing */\n isComposing: Ref<boolean>;\n /** Preedit text */\n preedit: Ref<string>;\n /** Cursor position in preedit */\n preeditCursor: Ref<number>;\n /** Candidate list */\n candidates: Ref<string[]>;\n /** Selected candidate index */\n selectedCandidate: Ref<number>;\n /** Mode display name */\n modeDisplay: Ref<string>;\n /** Enable IME */\n enable: () => void;\n /** Disable IME */\n disable: () => void;\n /** Set input mode */\n setMode: (mode: ImeMode) => void;\n /** Handle key event for IME */\n handleKey: (key: string, modifiers: { ctrl: boolean; alt: boolean }) => boolean;\n /** Commit current composition */\n commit: () => void;\n /** Cancel current composition */\n cancel: () => void;\n /** Select next candidate */\n nextCandidate: () => void;\n /** Select previous candidate */\n prevCandidate: () => void;\n /** Select candidate by number (1-9) */\n selectCandidate: (num: number) => void;\n}\n\nconst MODE_DISPLAY: Record<ImeMode, string> = {\n direct: \"A\",\n hiragana: \"あ\",\n katakana: \"ア\",\n \"half-katakana\": \"ア\",\n \"full-alpha\": \"A\",\n pinyin: \"拼\",\n hangul: \"한\",\n};\n\nexport function useIme(options: UseImeOptions = {}): ImeManager {\n const { mode: initialMode = \"direct\", onModeChange, onCompositionUpdate, onCommit } = options;\n\n const isActive = ref(false);\n const mode = ref<ImeMode>(initialMode);\n const isComposing = ref(false);\n const preedit = ref(\"\");\n const preeditCursor = ref(0);\n const candidates = ref<string[]>([]);\n const selectedCandidate = ref(0);\n\n const modeDisplay = computed(() => MODE_DISPLAY[mode.value] ?? \"A\");\n\n const enable = () => {\n isActive.value = true;\n };\n\n const disable = () => {\n isActive.value = false;\n cancel();\n };\n\n const setMode = (newMode: ImeMode) => {\n if (mode.value !== newMode) {\n cancel();\n mode.value = newMode;\n onModeChange?.(newMode);\n }\n };\n\n const handleKey = (key: string, modifiers: { ctrl: boolean; alt: boolean }): boolean => {\n if (!isActive.value || mode.value === \"direct\") {\n return false;\n }\n\n // IME mode toggle (usually Ctrl+Space or similar)\n // If we're here, mode is not 'direct' (filtered above), so toggle to 'direct'\n if (modifiers.ctrl && key === \" \") {\n setMode(\"direct\");\n return true;\n }\n\n // Handle composition\n if (isComposing.value) {\n switch (key) {\n case \"enter\":\n commit();\n return true;\n case \"escape\":\n cancel();\n return true;\n case \"backspace\":\n if (preedit.value.length > 0) {\n preedit.value = preedit.value.slice(0, -1);\n preeditCursor.value = Math.min(preeditCursor.value, preedit.value.length);\n onCompositionUpdate?.(preedit.value, preeditCursor.value);\n return true;\n }\n break;\n case \"space\":\n // Convert / select candidate\n if (candidates.value.length > 0) {\n nextCandidate();\n return true;\n }\n break;\n }\n\n // Number for candidate selection\n if (/^[1-9]$/.test(key)) {\n selectCandidate(parseInt(key, 10));\n return true;\n }\n }\n\n // Start/continue composition for printable characters\n if (key.length === 1 && !modifiers.ctrl && !modifiers.alt) {\n if (!isComposing.value) {\n isComposing.value = true;\n }\n preedit.value += key;\n preeditCursor.value = preedit.value.length;\n onCompositionUpdate?.(preedit.value, preeditCursor.value);\n return true;\n }\n\n return false;\n };\n\n const commit = () => {\n if (preedit.value) {\n const text = candidates.value[selectedCandidate.value] ?? preedit.value;\n onCommit?.(text);\n }\n preedit.value = \"\";\n preeditCursor.value = 0;\n candidates.value = [];\n selectedCandidate.value = 0;\n isComposing.value = false;\n };\n\n const cancel = () => {\n preedit.value = \"\";\n preeditCursor.value = 0;\n candidates.value = [];\n selectedCandidate.value = 0;\n isComposing.value = false;\n };\n\n const nextCandidate = () => {\n if (candidates.value.length > 0) {\n selectedCandidate.value = (selectedCandidate.value + 1) % candidates.value.length;\n }\n };\n\n const prevCandidate = () => {\n if (candidates.value.length > 0) {\n selectedCandidate.value =\n (selectedCandidate.value - 1 + candidates.value.length) % candidates.value.length;\n }\n };\n\n const selectCandidate = (num: number) => {\n if (num >= 1 && num <= candidates.value.length) {\n selectedCandidate.value = num - 1;\n commit();\n }\n };\n\n return {\n isActive,\n mode,\n isComposing,\n preedit,\n preeditCursor,\n candidates,\n selectedCandidate,\n modeDisplay,\n enable,\n disable,\n setMode,\n handleKey,\n commit,\n cancel,\n nextCandidate,\n prevCandidate,\n selectCandidate,\n };\n}\n"],"mappings":";;;AAMA,MAAMA,YAAwC,OAAO,eAAe;;;;AA8FpE,SAAgB,SAASC,UAA2B,CAAE,GAAE;CACtD,MAAM,EAAE,YAAY,OAAO,MAAM,QAAQ,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG;CAEnF,MAAM,UAAU,OAAO,WAAW,KAAK;CACvC,MAAM,eAAe,IAAI,UAAU;CAEnC,MAAM,YAAY,SAAS,MAAM;AAC/B,MAAI,QACF,QAAO,QAAQ,UAAU,UAAU;AAErC,SAAO,aAAa;CACrB,EAAC;CAEF,MAAM,QAAQ,MAAM;AAClB,MAAI,QACF,SAAQ,MAAM,GAAG;MAEjB,cAAa,QAAQ;CAExB;CAED,MAAM,OAAO,MAAM;AACjB,MAAI,SACF;OAAI,QAAQ,UAAU,UAAU,GAC9B,SAAQ,UAAU,QAAQ;EAC3B,MAED,cAAa,QAAQ;CAExB;AAGD,KAAI,SAAS;AACX,UAAQ,SAAS,GAAG;AAEpB,MAAI,cAAc,QAAQ,UAAU,MAClC,SAAQ,MAAM,GAAG;CAEpB;AAED,QAAO;EACL;EACA;EACA;EACA;CACD;AACF;;;;AC5ID,MAAMC,UAAsC,OAAO,aAAa;;;;AAsEhE,SAAgB,SAAuB;CACrC,MAAM,UAAU,OAAO,QAAQ;AAE/B,MAAK,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