@ash-cloud/ash-ui 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -4,7 +4,7 @@ export { AssistantMessageEntry, CommandRunAction, CommandRunResult, DEFAULT_DISP
4
4
  import { ReactNode, DragEvent, ChangeEvent } from 'react';
5
5
  import { ParsedOption } from './utils.cjs';
6
6
  export { GroupedEntry, ParsedOptionsResult, ToolUseInput, cn, createToolCall, extractTextContent, extractToolCallsFromGroup, formatFileSize, formatTimestamp, formatToolName, generateToolSummary, getActionIcon, getActionLabel, groupEntriesForCompactMode, mapToolToActionType, normalizeToolResult, parseCommandResult, parseMcpToolName, parseOptionsFromContent, truncate, updateToolCallWithResult } from './utils.cjs';
7
- export { AlertCircleIcon, AlertTriangleIcon, BotIcon, BrainIcon, BugIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardListIcon, CodeIcon, CopyIcon, EditIcon, FileIcon, FilePlusIcon, FolderSearchIcon, GlobeIcon, IconProps, InfoIcon, ListChecksIcon, LoaderIcon, MessageSquareIcon, MoonIcon, PaperclipIcon, PlugIcon, SearchIcon, SendIcon, SparklesIcon, StopCircleIcon, SunIcon, TerminalIcon, ToolIcon, UserIcon, XCircleIcon, XIcon } from './icons.cjs';
7
+ export { AlertCircleIcon, AlertTriangleIcon, BotIcon, BrainIcon, BugIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardListIcon, CodeIcon, CopyIcon, EditIcon, ErrorIcon, FileIcon, FilePlusIcon, FolderSearchIcon, GlobeIcon, IconProps, InfoIcon, ListChecksIcon, LoaderIcon, MessageSquareIcon, MoonIcon, PaperclipIcon, PlugIcon, SearchIcon, SendIcon, SparklesIcon, SpinnerIcon, StopCircleIcon, SunIcon, TerminalIcon, ToolIcon, UserIcon, XCircleIcon, XIcon } from './icons.cjs';
8
8
  export { BorderRadius, Colors, Keyframes, Shadows, Spacing, Transitions, Typography, Widget, ZIndex, allKeyframesCss, borderRadius, colors, inlineStyles, keyframes, keyframesCss, shadows, spacing, tokensToCssVariables, transitions, typography, widget, zIndex } from './design-tokens.cjs';
9
9
 
10
10
  interface ToolCallCardProps {
@@ -336,6 +336,118 @@ interface TodoPanelProps {
336
336
  */
337
337
  declare function TodoPanel({ todos, title, compact, showProgress, className, }: TodoPanelProps): react_jsx_runtime.JSX.Element | null;
338
338
 
339
+ interface EnvVarsPanelProps {
340
+ /** Current environment variables */
341
+ envVars: Record<string, string>;
342
+ /** Callback when environment variables change */
343
+ onChange: (envVars: Record<string, string>) => void;
344
+ /** Whether the panel is collapsed initially (default: true) */
345
+ defaultCollapsed?: boolean;
346
+ /** Additional class name */
347
+ className?: string;
348
+ /** Label for the panel header */
349
+ label?: string;
350
+ /** Helper text shown below the input */
351
+ helperText?: string;
352
+ }
353
+ /**
354
+ * EnvVarsPanel - Collapsible panel for managing environment variables
355
+ *
356
+ * Provides a UI for adding, viewing, and removing environment variables.
357
+ * Commonly used to set environment variables for sandbox/agent execution.
358
+ *
359
+ * @example
360
+ * ```tsx
361
+ * function ChatSettings() {
362
+ * const [envVars, setEnvVars] = useState<Record<string, string>>({});
363
+ *
364
+ * return (
365
+ * <EnvVarsPanel
366
+ * envVars={envVars}
367
+ * onChange={setEnvVars}
368
+ * helperText="These variables will be available in the sandbox."
369
+ * />
370
+ * );
371
+ * }
372
+ * ```
373
+ */
374
+ declare function EnvVarsPanel({ envVars, onChange, defaultCollapsed, className, label, helperText, }: EnvVarsPanelProps): react_jsx_runtime.JSX.Element;
375
+
376
+ interface DisplayModeToggleProps {
377
+ /** Additional class name */
378
+ className?: string;
379
+ /** Show label text (default: true) */
380
+ showLabel?: boolean;
381
+ /** Custom labels for modes */
382
+ labels?: {
383
+ inline?: string;
384
+ compact?: string;
385
+ accordion?: string;
386
+ };
387
+ /** Which modes to cycle through (default: all three) */
388
+ modes?: ToolDisplayMode[];
389
+ }
390
+ /**
391
+ * DisplayModeToggle - Button to cycle through display modes
392
+ *
393
+ * Uses the DisplayModeContext to cycle through 'inline', 'compact', and 'accordion' modes.
394
+ * Must be used within a DisplayModeProvider.
395
+ *
396
+ * @example
397
+ * ```tsx
398
+ * function ChatHeader() {
399
+ * return (
400
+ * <header>
401
+ * <h1>Chat</h1>
402
+ * <DisplayModeToggle />
403
+ * </header>
404
+ * );
405
+ * }
406
+ *
407
+ * function App() {
408
+ * return (
409
+ * <DisplayModeProvider>
410
+ * <ChatHeader />
411
+ * <MessageList entries={entries} />
412
+ * </DisplayModeProvider>
413
+ * );
414
+ * }
415
+ * ```
416
+ */
417
+ declare function DisplayModeToggle({ className, showLabel, labels, modes, }: DisplayModeToggleProps): react_jsx_runtime.JSX.Element;
418
+
419
+ type StepStatus = 'pending' | 'running' | 'success' | 'error';
420
+ interface StepAccordionProps {
421
+ /** Tool calls to display as steps */
422
+ toolCalls: NormalizedToolCall[];
423
+ /** Whether the accordion starts expanded */
424
+ defaultExpanded?: boolean;
425
+ /** Controlled expanded state */
426
+ isExpanded?: boolean;
427
+ /** Callback when expanded state changes */
428
+ onToggle?: () => void;
429
+ /** Additional class names */
430
+ className?: string;
431
+ }
432
+ /**
433
+ * StepAccordion - Simpler accordion that shows tool calls as numbered steps
434
+ *
435
+ * Features:
436
+ * - Collapsed header shows current running step or completion status
437
+ * - Expanded view shows all steps as a numbered list
438
+ * - Shows step duration for completed steps
439
+ * - Compact design suitable for embedding in chat
440
+ *
441
+ * @example
442
+ * ```tsx
443
+ * <StepAccordion
444
+ * toolCalls={normalizedToolCalls}
445
+ * defaultExpanded={false}
446
+ * />
447
+ * ```
448
+ */
449
+ declare function StepAccordion({ toolCalls, defaultExpanded, isExpanded: controlledExpanded, onToggle, className, }: StepAccordionProps): react_jsx_runtime.JSX.Element | null;
450
+
339
451
  interface StatusIndicatorProps {
340
452
  status: ToolStatus;
341
453
  size?: 'sm' | 'md' | 'lg';
@@ -763,4 +875,4 @@ interface UseFileUploadReturn {
763
875
  declare function useFileUpload({ maxFileSize, // 100MB
764
876
  maxFiles, onValidationError, }?: UseFileUploadOptions): UseFileUploadReturn;
765
877
 
766
- export { ActionIcon, type ActionIconProps, ActionType, AssistantMessage, type AssistantMessageProps, type FileAttachment as ChatFileAttachment, CodeBlock, type CodeBlockProps, CompactToolStatusLine, type CompactToolStatusLineProps, type DisplayModeContextType, DisplayModeProvider, type DisplayModeProviderProps, ErrorMessage, type ErrorMessageProps, JsonDisplay, type JsonDisplayProps, LoadingIndicator, type LoadingIndicatorProps, LogEntry, LogsPanel, type LogsPanelProps, MessageEntry, type MessageEntryProps, MessageList, type MessageListProps, NormalizedEntry, NormalizedToolCall, OptionCards, type OptionCardsProps, ParsedOption, type QueuedMessage, StatusIndicator, type StatusIndicatorProps, StreamingText, type StreamingTextProps, type Theme, type ThemeContextType, ThemeProvider, type ThemeProviderProps, ThinkingMessage, type ThinkingMessageProps, TodoItem, TodoPanel, type TodoPanelProps, ToolCallCard, type ToolCallCardProps, ToolCallMessage, type ToolCallMessageProps, ToolDisplayConfig, ToolDisplayMode, ToolExecutionGroup, type ToolExecutionGroupProps, ToolStatus, TypewriterText, type TypewriterTextProps, type UseFileUploadOptions, type UseFileUploadReturn, type UseMessageQueueOptions, type UseMessageQueueReturn, type UseStopExecutionOptions, type UseStopExecutionReturn, UserMessage, type UserMessageProps, useDisplayConfig, useDisplayMode, useFileUpload, useMessageQueue, useStopExecution, useTheme };
878
+ export { ActionIcon, type ActionIconProps, ActionType, AssistantMessage, type AssistantMessageProps, type FileAttachment as ChatFileAttachment, CodeBlock, type CodeBlockProps, CompactToolStatusLine, type CompactToolStatusLineProps, type DisplayModeContextType, DisplayModeProvider, type DisplayModeProviderProps, DisplayModeToggle, type DisplayModeToggleProps, EnvVarsPanel, type EnvVarsPanelProps, ErrorMessage, type ErrorMessageProps, JsonDisplay, type JsonDisplayProps, LoadingIndicator, type LoadingIndicatorProps, LogEntry, LogsPanel, type LogsPanelProps, MessageEntry, type MessageEntryProps, MessageList, type MessageListProps, NormalizedEntry, NormalizedToolCall, OptionCards, type OptionCardsProps, ParsedOption, type QueuedMessage, StatusIndicator, type StatusIndicatorProps, StepAccordion, type StepAccordionProps, type StepStatus, StreamingText, type StreamingTextProps, type Theme, type ThemeContextType, ThemeProvider, type ThemeProviderProps, ThinkingMessage, type ThinkingMessageProps, TodoItem, TodoPanel, type TodoPanelProps, ToolCallCard, type ToolCallCardProps, ToolCallMessage, type ToolCallMessageProps, ToolDisplayConfig, ToolDisplayMode, ToolExecutionGroup, type ToolExecutionGroupProps, ToolStatus, TypewriterText, type TypewriterTextProps, type UseFileUploadOptions, type UseFileUploadReturn, type UseMessageQueueOptions, type UseMessageQueueReturn, type UseStopExecutionOptions, type UseStopExecutionReturn, UserMessage, type UserMessageProps, useDisplayConfig, useDisplayMode, useFileUpload, useMessageQueue, useStopExecution, useTheme };
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { AssistantMessageEntry, CommandRunAction, CommandRunResult, DEFAULT_DISP
4
4
  import { ReactNode, DragEvent, ChangeEvent } from 'react';
5
5
  import { ParsedOption } from './utils.js';
6
6
  export { GroupedEntry, ParsedOptionsResult, ToolUseInput, cn, createToolCall, extractTextContent, extractToolCallsFromGroup, formatFileSize, formatTimestamp, formatToolName, generateToolSummary, getActionIcon, getActionLabel, groupEntriesForCompactMode, mapToolToActionType, normalizeToolResult, parseCommandResult, parseMcpToolName, parseOptionsFromContent, truncate, updateToolCallWithResult } from './utils.js';
7
- export { AlertCircleIcon, AlertTriangleIcon, BotIcon, BrainIcon, BugIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardListIcon, CodeIcon, CopyIcon, EditIcon, FileIcon, FilePlusIcon, FolderSearchIcon, GlobeIcon, IconProps, InfoIcon, ListChecksIcon, LoaderIcon, MessageSquareIcon, MoonIcon, PaperclipIcon, PlugIcon, SearchIcon, SendIcon, SparklesIcon, StopCircleIcon, SunIcon, TerminalIcon, ToolIcon, UserIcon, XCircleIcon, XIcon } from './icons.js';
7
+ export { AlertCircleIcon, AlertTriangleIcon, BotIcon, BrainIcon, BugIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardListIcon, CodeIcon, CopyIcon, EditIcon, ErrorIcon, FileIcon, FilePlusIcon, FolderSearchIcon, GlobeIcon, IconProps, InfoIcon, ListChecksIcon, LoaderIcon, MessageSquareIcon, MoonIcon, PaperclipIcon, PlugIcon, SearchIcon, SendIcon, SparklesIcon, SpinnerIcon, StopCircleIcon, SunIcon, TerminalIcon, ToolIcon, UserIcon, XCircleIcon, XIcon } from './icons.js';
8
8
  export { BorderRadius, Colors, Keyframes, Shadows, Spacing, Transitions, Typography, Widget, ZIndex, allKeyframesCss, borderRadius, colors, inlineStyles, keyframes, keyframesCss, shadows, spacing, tokensToCssVariables, transitions, typography, widget, zIndex } from './design-tokens.js';
9
9
 
10
10
  interface ToolCallCardProps {
@@ -336,6 +336,118 @@ interface TodoPanelProps {
336
336
  */
337
337
  declare function TodoPanel({ todos, title, compact, showProgress, className, }: TodoPanelProps): react_jsx_runtime.JSX.Element | null;
338
338
 
339
+ interface EnvVarsPanelProps {
340
+ /** Current environment variables */
341
+ envVars: Record<string, string>;
342
+ /** Callback when environment variables change */
343
+ onChange: (envVars: Record<string, string>) => void;
344
+ /** Whether the panel is collapsed initially (default: true) */
345
+ defaultCollapsed?: boolean;
346
+ /** Additional class name */
347
+ className?: string;
348
+ /** Label for the panel header */
349
+ label?: string;
350
+ /** Helper text shown below the input */
351
+ helperText?: string;
352
+ }
353
+ /**
354
+ * EnvVarsPanel - Collapsible panel for managing environment variables
355
+ *
356
+ * Provides a UI for adding, viewing, and removing environment variables.
357
+ * Commonly used to set environment variables for sandbox/agent execution.
358
+ *
359
+ * @example
360
+ * ```tsx
361
+ * function ChatSettings() {
362
+ * const [envVars, setEnvVars] = useState<Record<string, string>>({});
363
+ *
364
+ * return (
365
+ * <EnvVarsPanel
366
+ * envVars={envVars}
367
+ * onChange={setEnvVars}
368
+ * helperText="These variables will be available in the sandbox."
369
+ * />
370
+ * );
371
+ * }
372
+ * ```
373
+ */
374
+ declare function EnvVarsPanel({ envVars, onChange, defaultCollapsed, className, label, helperText, }: EnvVarsPanelProps): react_jsx_runtime.JSX.Element;
375
+
376
+ interface DisplayModeToggleProps {
377
+ /** Additional class name */
378
+ className?: string;
379
+ /** Show label text (default: true) */
380
+ showLabel?: boolean;
381
+ /** Custom labels for modes */
382
+ labels?: {
383
+ inline?: string;
384
+ compact?: string;
385
+ accordion?: string;
386
+ };
387
+ /** Which modes to cycle through (default: all three) */
388
+ modes?: ToolDisplayMode[];
389
+ }
390
+ /**
391
+ * DisplayModeToggle - Button to cycle through display modes
392
+ *
393
+ * Uses the DisplayModeContext to cycle through 'inline', 'compact', and 'accordion' modes.
394
+ * Must be used within a DisplayModeProvider.
395
+ *
396
+ * @example
397
+ * ```tsx
398
+ * function ChatHeader() {
399
+ * return (
400
+ * <header>
401
+ * <h1>Chat</h1>
402
+ * <DisplayModeToggle />
403
+ * </header>
404
+ * );
405
+ * }
406
+ *
407
+ * function App() {
408
+ * return (
409
+ * <DisplayModeProvider>
410
+ * <ChatHeader />
411
+ * <MessageList entries={entries} />
412
+ * </DisplayModeProvider>
413
+ * );
414
+ * }
415
+ * ```
416
+ */
417
+ declare function DisplayModeToggle({ className, showLabel, labels, modes, }: DisplayModeToggleProps): react_jsx_runtime.JSX.Element;
418
+
419
+ type StepStatus = 'pending' | 'running' | 'success' | 'error';
420
+ interface StepAccordionProps {
421
+ /** Tool calls to display as steps */
422
+ toolCalls: NormalizedToolCall[];
423
+ /** Whether the accordion starts expanded */
424
+ defaultExpanded?: boolean;
425
+ /** Controlled expanded state */
426
+ isExpanded?: boolean;
427
+ /** Callback when expanded state changes */
428
+ onToggle?: () => void;
429
+ /** Additional class names */
430
+ className?: string;
431
+ }
432
+ /**
433
+ * StepAccordion - Simpler accordion that shows tool calls as numbered steps
434
+ *
435
+ * Features:
436
+ * - Collapsed header shows current running step or completion status
437
+ * - Expanded view shows all steps as a numbered list
438
+ * - Shows step duration for completed steps
439
+ * - Compact design suitable for embedding in chat
440
+ *
441
+ * @example
442
+ * ```tsx
443
+ * <StepAccordion
444
+ * toolCalls={normalizedToolCalls}
445
+ * defaultExpanded={false}
446
+ * />
447
+ * ```
448
+ */
449
+ declare function StepAccordion({ toolCalls, defaultExpanded, isExpanded: controlledExpanded, onToggle, className, }: StepAccordionProps): react_jsx_runtime.JSX.Element | null;
450
+
339
451
  interface StatusIndicatorProps {
340
452
  status: ToolStatus;
341
453
  size?: 'sm' | 'md' | 'lg';
@@ -763,4 +875,4 @@ interface UseFileUploadReturn {
763
875
  declare function useFileUpload({ maxFileSize, // 100MB
764
876
  maxFiles, onValidationError, }?: UseFileUploadOptions): UseFileUploadReturn;
765
877
 
766
- export { ActionIcon, type ActionIconProps, ActionType, AssistantMessage, type AssistantMessageProps, type FileAttachment as ChatFileAttachment, CodeBlock, type CodeBlockProps, CompactToolStatusLine, type CompactToolStatusLineProps, type DisplayModeContextType, DisplayModeProvider, type DisplayModeProviderProps, ErrorMessage, type ErrorMessageProps, JsonDisplay, type JsonDisplayProps, LoadingIndicator, type LoadingIndicatorProps, LogEntry, LogsPanel, type LogsPanelProps, MessageEntry, type MessageEntryProps, MessageList, type MessageListProps, NormalizedEntry, NormalizedToolCall, OptionCards, type OptionCardsProps, ParsedOption, type QueuedMessage, StatusIndicator, type StatusIndicatorProps, StreamingText, type StreamingTextProps, type Theme, type ThemeContextType, ThemeProvider, type ThemeProviderProps, ThinkingMessage, type ThinkingMessageProps, TodoItem, TodoPanel, type TodoPanelProps, ToolCallCard, type ToolCallCardProps, ToolCallMessage, type ToolCallMessageProps, ToolDisplayConfig, ToolDisplayMode, ToolExecutionGroup, type ToolExecutionGroupProps, ToolStatus, TypewriterText, type TypewriterTextProps, type UseFileUploadOptions, type UseFileUploadReturn, type UseMessageQueueOptions, type UseMessageQueueReturn, type UseStopExecutionOptions, type UseStopExecutionReturn, UserMessage, type UserMessageProps, useDisplayConfig, useDisplayMode, useFileUpload, useMessageQueue, useStopExecution, useTheme };
878
+ export { ActionIcon, type ActionIconProps, ActionType, AssistantMessage, type AssistantMessageProps, type FileAttachment as ChatFileAttachment, CodeBlock, type CodeBlockProps, CompactToolStatusLine, type CompactToolStatusLineProps, type DisplayModeContextType, DisplayModeProvider, type DisplayModeProviderProps, DisplayModeToggle, type DisplayModeToggleProps, EnvVarsPanel, type EnvVarsPanelProps, ErrorMessage, type ErrorMessageProps, JsonDisplay, type JsonDisplayProps, LoadingIndicator, type LoadingIndicatorProps, LogEntry, LogsPanel, type LogsPanelProps, MessageEntry, type MessageEntryProps, MessageList, type MessageListProps, NormalizedEntry, NormalizedToolCall, OptionCards, type OptionCardsProps, ParsedOption, type QueuedMessage, StatusIndicator, type StatusIndicatorProps, StepAccordion, type StepAccordionProps, type StepStatus, StreamingText, type StreamingTextProps, type Theme, type ThemeContextType, ThemeProvider, type ThemeProviderProps, ThinkingMessage, type ThinkingMessageProps, TodoItem, TodoPanel, type TodoPanelProps, ToolCallCard, type ToolCallCardProps, ToolCallMessage, type ToolCallMessageProps, ToolDisplayConfig, ToolDisplayMode, ToolExecutionGroup, type ToolExecutionGroupProps, ToolStatus, TypewriterText, type TypewriterTextProps, type UseFileUploadOptions, type UseFileUploadReturn, type UseMessageQueueOptions, type UseMessageQueueReturn, type UseStopExecutionOptions, type UseStopExecutionReturn, UserMessage, type UserMessageProps, useDisplayConfig, useDisplayMode, useFileUpload, useMessageQueue, useStopExecution, useTheme };