@toolr/ui-design 0.1.0 → 0.1.2

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.
Files changed (41) hide show
  1. package/components/lib/theme-engine.ts +48 -15
  2. package/components/sections/ai-tools-paths/tools-paths-panel.tsx +11 -11
  3. package/components/sections/captured-issues/captured-issues-panel.tsx +20 -20
  4. package/components/sections/golden-snapshots/file-diff-viewer.tsx +19 -19
  5. package/components/sections/golden-snapshots/golden-sync-panel.tsx +3 -3
  6. package/components/sections/golden-snapshots/snapshot-manager.tsx +15 -15
  7. package/components/sections/golden-snapshots/status-overview.tsx +40 -40
  8. package/components/sections/golden-snapshots/version-manager.tsx +10 -10
  9. package/components/sections/prompt-editor/file-type-tabbed-prompt-editor.tsx +11 -11
  10. package/components/sections/prompt-editor/simulator-prompt-editor.tsx +15 -15
  11. package/components/sections/prompt-editor/tabbed-prompt-editor.tsx +19 -19
  12. package/components/sections/snapshot-browser/snapshot-browser-panel.tsx +10 -10
  13. package/components/sections/snapshot-browser/snapshot-tree.tsx +11 -11
  14. package/components/sections/snippets-editor/snippets-editor.tsx +24 -24
  15. package/components/settings/SettingsHeader.tsx +78 -0
  16. package/components/settings/SettingsPanel.tsx +21 -0
  17. package/components/settings/SettingsTreeNav.tsx +256 -0
  18. package/components/settings/index.ts +7 -0
  19. package/components/settings/settings-tree-utils.ts +120 -0
  20. package/components/ui/breadcrumb.tsx +16 -4
  21. package/components/ui/cookie-consent.tsx +82 -0
  22. package/components/ui/file-tree.tsx +5 -5
  23. package/components/ui/filter-dropdown.tsx +4 -4
  24. package/components/ui/form-actions.tsx +1 -1
  25. package/components/ui/label.tsx +31 -3
  26. package/components/ui/resizable-textarea.tsx +2 -2
  27. package/components/ui/segmented-toggle.tsx +17 -4
  28. package/components/ui/select.tsx +3 -3
  29. package/components/ui/sort-dropdown.tsx +2 -2
  30. package/components/ui/status-card.tsx +1 -1
  31. package/components/ui/tooltip.tsx +2 -2
  32. package/dist/index.d.ts +79 -8
  33. package/dist/index.js +1119 -622
  34. package/dist/tokens/{tokens/primitives.css → primitives.css} +10 -8
  35. package/dist/tokens/{tokens/semantic.css → semantic.css} +5 -0
  36. package/index.ts +13 -0
  37. package/package.json +6 -2
  38. package/tokens/primitives.css +10 -8
  39. package/tokens/semantic.css +5 -0
  40. /package/dist/tokens/{tokens/theme.css → theme.css} +0 -0
  41. /package/dist/tokens/{tokens/tokens.json → tokens.json} +0 -0
package/dist/index.d.ts CHANGED
@@ -7,9 +7,9 @@ import { ClassValue } from 'clsx';
7
7
 
8
8
  type FormColor = 'blue' | 'green' | 'red' | 'orange' | 'cyan' | 'yellow' | 'purple' | 'indigo' | 'emerald' | 'amber' | 'violet' | 'neutral' | 'sky';
9
9
 
10
- declare const SCALE_KEYS: readonly ["black", "950", "900", "800", "700", "600", "500", "400", "300", "200"];
10
+ declare const SCALE_KEYS: readonly ["black", "950", "900", "850", "800", "750", "700", "600", "500", "400", "300", "200"];
11
11
  type ScaleKey = (typeof SCALE_KEYS)[number];
12
- type ThemeId = 'oled' | 'dark' | 'night' | 'soft' | 'bright' | 'paper' | 'muted';
12
+ type ThemeId = 'dark' | 'light';
13
13
  declare const DARK_THEMES: ThemeId[];
14
14
  declare const LIGHT_THEMES: ThemeId[];
15
15
  declare const BASE_THEMES: Record<ThemeId, {
@@ -25,9 +25,13 @@ interface AccentDef {
25
25
  declare const ACCENT_DEFS: AccentDef[];
26
26
  declare function satCurve(l: number): number;
27
27
  declare function hslToHex(h: number, s: number, l: number): string;
28
- declare function generateScale(theme: ThemeId, hue: number | null, maxSat: number): Record<ScaleKey, string>;
28
+ declare const SURFACE_KEYS: readonly ["950", "900", "850", "800", "750"];
29
+ type SurfaceKey = (typeof SURFACE_KEYS)[number];
30
+ declare const DEFAULT_DIMS: Record<SurfaceKey, number>;
31
+ declare const DEFAULT_OUTLINE = 30;
32
+ declare function generateScale(theme: ThemeId, hue: number | null, maxSat: number, dims?: Record<SurfaceKey, number>, outline?: number): Record<ScaleKey, string>;
29
33
  declare function isLightTheme(themeId: ThemeId): boolean;
30
- declare function applyTheme(themeId: ThemeId, accentHue: number | null, root?: HTMLElement): void;
34
+ declare function applyTheme(themeId: ThemeId, accentHue: number | null, dims?: Record<SurfaceKey, number>, outline?: number, root?: HTMLElement): void;
31
35
 
32
36
  type ToolrAppId = 'toolr' | 'configr' | 'reviewr' | 'vibr' | 'learnr' | 'planr' | 'seedr';
33
37
  declare const TOOLR_APPS: Record<ToolrAppId, {
@@ -266,11 +270,13 @@ interface LabelProps {
266
270
  };
267
271
  size?: 'xss' | 'xs' | 'sm' | 'md' | 'lg';
268
272
  textTransform?: 'capitalize' | 'lowercase' | 'uppercase';
273
+ /** Progress fill (0–100). Shows a colored background bar behind the label content. */
274
+ progress?: number;
269
275
  onClick?: () => void;
270
276
  className?: string;
271
277
  testId?: string;
272
278
  }
273
- declare function Label({ text, color, icon, IconComponent: CustomIcon, tooltip, size, textTransform, onClick, className, testId, }: LabelProps): react_jsx_runtime.JSX.Element;
279
+ declare function Label({ text, color, icon, IconComponent: CustomIcon, tooltip, size, textTransform, progress, onClick, className, testId, }: LabelProps): react_jsx_runtime.JSX.Element;
274
280
 
275
281
  /**
276
282
  * Badge - Outline-styled pill badge for displaying counts or short labels
@@ -405,7 +411,8 @@ declare function ScopeBadge({ scope, size }: ScopeBadgeProps): react_jsx_runtime
405
411
 
406
412
  interface SegmentedToggleOption<T extends string> {
407
413
  value: T;
408
- icon: ReactNode;
414
+ icon?: ReactNode;
415
+ label?: string;
409
416
  tooltip: TooltipContent;
410
417
  }
411
418
  interface SegmentedToggleProps<T extends string> {
@@ -2525,9 +2532,11 @@ interface BreadcrumbProps {
2525
2532
  segments: BreadcrumbSegment[];
2526
2533
  separator?: 'chevron' | 'slash' | 'dot';
2527
2534
  size?: 'xss' | 'xs' | 'sm' | 'md' | 'lg';
2535
+ /** 'box' (default) wraps in a bordered container; 'plain' renders inline with no background */
2536
+ variant?: 'box' | 'plain';
2528
2537
  className?: string;
2529
2538
  }
2530
- declare function Breadcrumb({ segments, separator, size, className, }: BreadcrumbProps): react_jsx_runtime.JSX.Element;
2539
+ declare function Breadcrumb({ segments, separator, size, variant, className, }: BreadcrumbProps): react_jsx_runtime.JSX.Element;
2531
2540
 
2532
2541
  interface NavigationBarProps {
2533
2542
  segments: BreadcrumbSegment[];
@@ -2683,6 +2692,21 @@ interface DetailSectionProps {
2683
2692
  }
2684
2693
  declare function DetailSection({ title, icon, rows, className }: DetailSectionProps): react_jsx_runtime.JSX.Element;
2685
2694
 
2695
+ type ConsentChoice = 'accepted' | 'declined' | 'essential';
2696
+ interface CookieConsentProps {
2697
+ /** localStorage key used to persist the choice */
2698
+ storageKey: string;
2699
+ /** Accent color for the "Accept All" button (default: 'cyan') */
2700
+ accentColor?: string;
2701
+ /** Heading text (default: 'We value your privacy') */
2702
+ heading?: string;
2703
+ /** Description text */
2704
+ description?: string;
2705
+ /** Called after the user makes a choice */
2706
+ onConsent?: (choice: ConsentChoice) => void;
2707
+ }
2708
+ declare function CookieConsent({ storageKey, accentColor, heading, description, onConsent, }: CookieConsentProps): react_jsx_runtime.JSX.Element | null;
2709
+
2686
2710
  /**
2687
2711
  * Close a menu/dropdown when clicking outside its ref element.
2688
2712
  * If ref is null, closes on any mousedown event.
@@ -2709,6 +2733,53 @@ interface UseNavigationHistoryReturn {
2709
2733
  }
2710
2734
  declare function useNavigationHistory(initial?: BreadcrumbSegment[], maxEntries?: number): UseNavigationHistoryReturn;
2711
2735
 
2736
+ type SettingsTreeNode = {
2737
+ id: string;
2738
+ label: string;
2739
+ icon: ReactNode;
2740
+ children?: SettingsTreeNode[];
2741
+ };
2742
+ declare function findNodeByPath(tree: SettingsTreeNode[], path: string): SettingsTreeNode | null;
2743
+ declare function getBreadcrumbFromPath(tree: SettingsTreeNode[], path: string): Array<{
2744
+ label: string;
2745
+ icon: ReactNode;
2746
+ path: string;
2747
+ }>;
2748
+ declare function isLeafNode(node: SettingsTreeNode): boolean;
2749
+ declare function getAllLeafPaths(tree: SettingsTreeNode[], parentPath?: string): string[];
2750
+ declare function collectExpandablePaths(nodes: SettingsTreeNode[], parentPath?: string): string[];
2751
+ declare function getParentPaths(path: string): string[];
2752
+ declare function filterTree(nodes: SettingsTreeNode[], query: string, parentPath?: string): SettingsTreeNode[];
2753
+
2754
+ interface SettingsPanelProps {
2755
+ tree: SettingsTreeNode[];
2756
+ selectedPath: string;
2757
+ onSelectPath: (path: string) => void;
2758
+ children: ReactNode;
2759
+ }
2760
+ declare function SettingsPanel({ tree, selectedPath, onSelectPath, children }: SettingsPanelProps): react_jsx_runtime.JSX.Element;
2761
+
2762
+ interface SettingsTreeNavProps {
2763
+ tree: SettingsTreeNode[];
2764
+ selectedPath: string;
2765
+ onSelectPath: (path: string) => void;
2766
+ }
2767
+ declare function SettingsTreeNav({ tree, selectedPath, onSelectPath }: SettingsTreeNavProps): react_jsx_runtime.JSX.Element;
2768
+
2769
+ interface SettingsHeaderProps {
2770
+ description: string;
2771
+ icon?: ReactNode;
2772
+ onReset?: () => void;
2773
+ resetTooltip?: {
2774
+ title: string;
2775
+ description: string;
2776
+ };
2777
+ confirmReset?: boolean;
2778
+ action?: ReactNode;
2779
+ variant?: 'default' | 'info' | 'warning' | 'danger';
2780
+ }
2781
+ declare function SettingsHeader({ description, icon, onReset, resetTooltip, action, variant, }: SettingsHeaderProps): react_jsx_runtime.JSX.Element;
2782
+
2712
2783
  declare function cn(...inputs: ClassValue[]): string;
2713
2784
 
2714
- export { ACCENT_DEFS, AI_TOOL_LOGOS, AI_TOOL_NAMES, type AccentColor, type AccentDef, ActionDialog, type ActionDialogProps, type ActionItem, AiActionButton, type AiActionButtonProps, type AiActionStatus, type AiCompletionResult, AiExecutionActionButtons, type AiExecutionActionButtonsProps, type AiToolConfig, AiToolIcon, type AiToolKey, AlertModal, type AlertModalProps, BASE_THEMES, Badge, type BadgeColor, type BadgeProps, BottomPanelHeader, type BottomPanelHeaderProps, Breadcrumb, type BreadcrumbProps, type BreadcrumbSegment, type CapturedError, type CapturedIssuesApi, CapturedIssuesPanel, type CapturedIssuesPanelProps, type ChangedComponents, Checkbox, type CheckboxColor, type CheckboxProps, type CheckboxSize, type CheckboxVariant, type CodingToolId, type CodingToolPresetConfig, CollapseButton, type CollapseButtonProps, CollapsibleSection, type CollapsibleSectionProps, type ComponentVersion, ConfirmBadge, type ConfirmBadgeColor, type ConfirmBadgeProps, ConfirmModal, type ConfirmModalProps, type CreateSnapshotResult, DARK_THEMES, type DetailRow, DetailSection, type DetailSectionProps, DetailViewWrapper, type DetailViewWrapperProps, type DiffSummary, type DiffTreeNode, type DirectoryStatus, EditorPlaceholderCard, type EditorPlaceholderCardProps, EditorToolbar, type EditorToolbarProps, type ErrorLogger, type ExecutionDetailRow, ExecutionDetailsPanel, type ExecutionDetailsPanelProps, type ExecutionStatus, ExtensionListCard, type ExtensionListCardProps, type ExtensionSource, type FileDiffInfo, type FileDiffStatus, FileDiffViewer, type FileDiffViewerProps, type FileEntry, FileStructureSection, type FileStructureSectionProps, FileTree, type FileTreeNode, type FileTreeProps, type FileTypeOption, FileTypeTabbedPromptEditor, type FileTypeTabbedPromptEditorProps, FilesPanel, type FilesPanelProps, FilterDropdown, type FilterDropdownProps, FormActions, type FormActionsProps, type FormColor, FrontmatterFormHeader, type FrontmatterFormHeaderProps, type GoldenLiveDiff, type GoldenMeta, type GoldenSnapshotsApi, type GoldenStatus, GoldenSyncPanel, type GoldenSyncPanelProps, ISSUE_TYPES, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonStatus, type IconButtonVariant, type IconName, Input, type InputProps, type IssueReport, type IssueReportResult, type IssueType, LIGHT_THEMES, Label, type LabelColor, type LabelProps, type LayoutTab, LayoutTabBar, type LayoutTabBarProps, type ModalKind, type ModalSize, NavCard, type NavCardProps, NavigationBar, type NavigationBarProps, NumberInput, type NumberInputProps, type PanelTab, type PreviewMode, type PromptEditorApi, type PromptPlaceholder, type PromptSnapshot, RegistryBrowser, type RegistryBrowserProps, RegistryCard, type RegistryCardProps, RegistryDetail, type RegistryDetailProps, type RegistryItemType, ReportBugForm, type ReportBugFormProps, type ResetResult, ResizableTextarea, type ResizableTextareaProps, SCALE_KEYS, SNIPPET_NAME_REGEX, type ScaleKey, type ScenarioOption, ScopeBadge, type ScopeType, type Screenshot, type ScreenshotAttachment, ScreenshotUploader, type ScreenshotUploaderProps, type SeedInfo, type SeedrItemStatus, SegmentedToggle, type SegmentedToggleOption, type SegmentedToggleProps, Select, type SelectOption, type SelectProps, type SelectionCardItem, SelectionGrid, type SelectionGridProps, SettingRow, type SettingRowProps, SimulatorPromptEditor, type SimulatorPromptEditorProps, type SnapshotBrowserApi, SnapshotBrowserPanel, type SnapshotBrowserPanelProps, SnapshotCard, type SnapshotCardProps, type SnapshotCategory, type SnapshotEntry, type SnapshotInfo, type SnapshotItem, SnapshotManager, type SnapshotManagerProps, type SnapshotScope, SnapshotTree, type SnapshotTreeProps, type SnapshotsManifest, type Snippet, type SnippetData, SnippetsEditor, type SnippetsEditorApi, type SnippetsEditorProps, SnippetsPanel, type SnippetsPanelProps, SortDropdown, type SortDropdownProps, type SortField, type StatusBanner, StatusCard, type StatusCardProps, type StatusItem, StatusOverview, type StatusOverviewProps, type SubmittedError, type SystemInfo, TOOLR_APPS, type Tab, TabBar, type TabBarProps, TabbedPromptEditor, type TabbedPromptEditorProps, type ThemeId, Toggle, type ToggleColor, type ToggleProps, type ToggleSize, type ToggleVariant, type ToolDetectionResult, type ToolTab, type ToolrAppId, ToolrAppLogo, type ToolsPathsApi, ToolsPathsPanel, type ToolsPathsPanelProps, Tooltip, type TooltipAlign, TooltipButton, type TooltipContent, type TooltipPosition, type TrackedError, type UseCapturedIssuesOptions, type UseCapturedIssuesReturn, type UseGoldenSyncOptions, type UseGoldenSyncReturn, type UseNavigationHistoryReturn, type UsePromptEditorOptions, type UsePromptEditorReturn, type UseReportBugOptions, type UseReportBugReturn, type UseSnapshotBrowserOptions, type UseSnapshotBrowserReturn, type UseSnippetsEditorOptions, type UseSnippetsEditorReturn, type UseToolsPathsOptions, type UseToolsPathsReturn, VersionManager, type VersionManagerProps, applyTheme, cn, collectDirPaths, createErrorLogger, formatBytes, formatCategory, formatDate, generateScale, getLanguage, getLanguageFromPath, hslToHex, iconMap, isLightTheme, satCurve, submitIssueReport, useCapturedIssues, useClickOutside, useDropdownMaxHeight, useGoldenSync, useNavigationHistory, usePromptEditor, useReportBug, useSnapshotBrowser, useSnippetsEditor, useToolsPaths };
2785
+ export { ACCENT_DEFS, AI_TOOL_LOGOS, AI_TOOL_NAMES, type AccentColor, type AccentDef, ActionDialog, type ActionDialogProps, type ActionItem, AiActionButton, type AiActionButtonProps, type AiActionStatus, type AiCompletionResult, AiExecutionActionButtons, type AiExecutionActionButtonsProps, type AiToolConfig, AiToolIcon, type AiToolKey, AlertModal, type AlertModalProps, BASE_THEMES, Badge, type BadgeColor, type BadgeProps, BottomPanelHeader, type BottomPanelHeaderProps, Breadcrumb, type BreadcrumbProps, type BreadcrumbSegment, type CapturedError, type CapturedIssuesApi, CapturedIssuesPanel, type CapturedIssuesPanelProps, type ChangedComponents, Checkbox, type CheckboxColor, type CheckboxProps, type CheckboxSize, type CheckboxVariant, type CodingToolId, type CodingToolPresetConfig, CollapseButton, type CollapseButtonProps, CollapsibleSection, type CollapsibleSectionProps, type ComponentVersion, ConfirmBadge, type ConfirmBadgeColor, type ConfirmBadgeProps, ConfirmModal, type ConfirmModalProps, type ConsentChoice, CookieConsent, type CookieConsentProps, type CreateSnapshotResult, DARK_THEMES, DEFAULT_DIMS, DEFAULT_OUTLINE, type DetailRow, DetailSection, type DetailSectionProps, DetailViewWrapper, type DetailViewWrapperProps, type DiffSummary, type DiffTreeNode, type DirectoryStatus, EditorPlaceholderCard, type EditorPlaceholderCardProps, EditorToolbar, type EditorToolbarProps, type ErrorLogger, type ExecutionDetailRow, ExecutionDetailsPanel, type ExecutionDetailsPanelProps, type ExecutionStatus, ExtensionListCard, type ExtensionListCardProps, type ExtensionSource, type FileDiffInfo, type FileDiffStatus, FileDiffViewer, type FileDiffViewerProps, type FileEntry, FileStructureSection, type FileStructureSectionProps, FileTree, type FileTreeNode, type FileTreeProps, type FileTypeOption, FileTypeTabbedPromptEditor, type FileTypeTabbedPromptEditorProps, FilesPanel, type FilesPanelProps, FilterDropdown, type FilterDropdownProps, FormActions, type FormActionsProps, type FormColor, FrontmatterFormHeader, type FrontmatterFormHeaderProps, type GoldenLiveDiff, type GoldenMeta, type GoldenSnapshotsApi, type GoldenStatus, GoldenSyncPanel, type GoldenSyncPanelProps, ISSUE_TYPES, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonStatus, type IconButtonVariant, type IconName, Input, type InputProps, type IssueReport, type IssueReportResult, type IssueType, LIGHT_THEMES, Label, type LabelColor, type LabelProps, type LayoutTab, LayoutTabBar, type LayoutTabBarProps, type ModalKind, type ModalSize, NavCard, type NavCardProps, NavigationBar, type NavigationBarProps, NumberInput, type NumberInputProps, type PanelTab, type PreviewMode, type PromptEditorApi, type PromptPlaceholder, type PromptSnapshot, RegistryBrowser, type RegistryBrowserProps, RegistryCard, type RegistryCardProps, RegistryDetail, type RegistryDetailProps, type RegistryItemType, ReportBugForm, type ReportBugFormProps, type ResetResult, ResizableTextarea, type ResizableTextareaProps, SCALE_KEYS, SNIPPET_NAME_REGEX, SURFACE_KEYS, type ScaleKey, type ScenarioOption, ScopeBadge, type ScopeType, type Screenshot, type ScreenshotAttachment, ScreenshotUploader, type ScreenshotUploaderProps, type SeedInfo, type SeedrItemStatus, SegmentedToggle, type SegmentedToggleOption, type SegmentedToggleProps, Select, type SelectOption, type SelectProps, type SelectionCardItem, SelectionGrid, type SelectionGridProps, SettingRow, type SettingRowProps, SettingsHeader, type SettingsHeaderProps, SettingsPanel, type SettingsPanelProps, SettingsTreeNav, type SettingsTreeNavProps, type SettingsTreeNode, SimulatorPromptEditor, type SimulatorPromptEditorProps, type SnapshotBrowserApi, SnapshotBrowserPanel, type SnapshotBrowserPanelProps, SnapshotCard, type SnapshotCardProps, type SnapshotCategory, type SnapshotEntry, type SnapshotInfo, type SnapshotItem, SnapshotManager, type SnapshotManagerProps, type SnapshotScope, SnapshotTree, type SnapshotTreeProps, type SnapshotsManifest, type Snippet, type SnippetData, SnippetsEditor, type SnippetsEditorApi, type SnippetsEditorProps, SnippetsPanel, type SnippetsPanelProps, SortDropdown, type SortDropdownProps, type SortField, type StatusBanner, StatusCard, type StatusCardProps, type StatusItem, StatusOverview, type StatusOverviewProps, type SubmittedError, type SurfaceKey, type SystemInfo, TOOLR_APPS, type Tab, TabBar, type TabBarProps, TabbedPromptEditor, type TabbedPromptEditorProps, type ThemeId, Toggle, type ToggleColor, type ToggleProps, type ToggleSize, type ToggleVariant, type ToolDetectionResult, type ToolTab, type ToolrAppId, ToolrAppLogo, type ToolsPathsApi, ToolsPathsPanel, type ToolsPathsPanelProps, Tooltip, type TooltipAlign, TooltipButton, type TooltipContent, type TooltipPosition, type TrackedError, type UseCapturedIssuesOptions, type UseCapturedIssuesReturn, type UseGoldenSyncOptions, type UseGoldenSyncReturn, type UseNavigationHistoryReturn, type UsePromptEditorOptions, type UsePromptEditorReturn, type UseReportBugOptions, type UseReportBugReturn, type UseSnapshotBrowserOptions, type UseSnapshotBrowserReturn, type UseSnippetsEditorOptions, type UseSnippetsEditorReturn, type UseToolsPathsOptions, type UseToolsPathsReturn, VersionManager, type VersionManagerProps, applyTheme, cn, collectDirPaths, collectExpandablePaths, createErrorLogger, filterTree, findNodeByPath, formatBytes, formatCategory, formatDate, generateScale, getAllLeafPaths, getBreadcrumbFromPath, getLanguage, getLanguageFromPath, getParentPaths, hslToHex, iconMap, isLeafNode, isLightTheme, satCurve, submitIssueReport, useCapturedIssues, useClickOutside, useDropdownMaxHeight, useGoldenSync, useNavigationHistory, usePromptEditor, useReportBug, useSnapshotBrowser, useSnippetsEditor, useToolsPaths };