diff --git a/ui/src/components/HandButton.tsx b/ui/src/components/Button.tsx similarity index 90% rename from ui/src/components/HandButton.tsx rename to ui/src/components/Button.tsx index 8bfdd9efa..4a63539bd 100644 --- a/ui/src/components/HandButton.tsx +++ b/ui/src/components/Button.tsx @@ -1,7 +1,7 @@ import type { ReactNode, ButtonHTMLAttributes } from 'react'; import { radius } from '../design'; -interface HandButtonProps extends ButtonHTMLAttributes { +interface ButtonProps extends ButtonHTMLAttributes { children: ReactNode; variant?: 'primary' | 'secondary' | 'danger' | 'ghost'; size?: 'sm' | 'md' | 'lg'; @@ -20,7 +20,7 @@ const sizeClasses = { lg: 'px-8 py-3.5 text-lg', }; -export default function HandButton({ +export default function Button({ children, variant = 'primary', size = 'md', @@ -28,7 +28,7 @@ export default function HandButton({ disabled, style, ...props -}: HandButtonProps) { +}: ButtonProps) { return ( )} - {loading ? 'Working...' : confirmText} - + diff --git a/ui/src/components/ErrorBoundary.tsx b/ui/src/components/ErrorBoundary.tsx index fc883aba3..2c1bf1aa6 100644 --- a/ui/src/components/ErrorBoundary.tsx +++ b/ui/src/components/ErrorBoundary.tsx @@ -1,7 +1,7 @@ import { Component, type ReactNode } from 'react'; import { AlertTriangle } from 'lucide-react'; import Card from './Card'; -import HandButton from './HandButton'; +import Button from './Button'; interface Props { children: ReactNode; @@ -36,9 +36,9 @@ export class ErrorBoundary extends Component { > {this.state.error?.message || 'An unexpected error occurred.'}

- window.location.reload()}> + diff --git a/ui/src/components/FileViewerModal.tsx b/ui/src/components/FileViewerModal.tsx index a2c595e8b..403ea86ae 100644 --- a/ui/src/components/FileViewerModal.tsx +++ b/ui/src/components/FileViewerModal.tsx @@ -10,7 +10,7 @@ import { javascript } from '@codemirror/lang-javascript'; import { EditorView } from '@codemirror/view'; import Card from './Card'; import CopyButton from './CopyButton'; -import HandButton from './HandButton'; +import Button from './Button'; import { api, type SkillFileContent } from '../api/client'; import { handTheme } from '../lib/codemirror-theme'; import { radius } from '../design'; @@ -91,9 +91,9 @@ export default function FileViewerModal({ skillName, filepath, sourcePath, onClo copiedLabelClassName="text-xs font-normal" /> - + {/* Content */} diff --git a/ui/src/components/HubManagerModal.tsx b/ui/src/components/HubManagerModal.tsx index e60c218d1..9476a808b 100644 --- a/ui/src/components/HubManagerModal.tsx +++ b/ui/src/components/HubManagerModal.tsx @@ -1,8 +1,8 @@ import { useState, useEffect } from 'react'; import { Plus, Trash2, Server } from 'lucide-react'; import Card from './Card'; -import HandButton from './HandButton'; -import { HandInput } from './HandInput'; +import Button from './Button'; +import { Input } from './Input'; import { radius } from '../design'; export interface SavedHub { @@ -138,20 +138,20 @@ export default function HubManagerModal({ Built-in ) : confirmDelete === hub.url ? (
- handleDelete(hub.url)} > Confirm - - +
) : ( + diff --git a/ui/src/components/HandInput.tsx b/ui/src/components/Input.tsx similarity index 92% rename from ui/src/components/HandInput.tsx rename to ui/src/components/Input.tsx index 966970ff3..25f95ded3 100644 --- a/ui/src/components/HandInput.tsx +++ b/ui/src/components/Input.tsx @@ -3,11 +3,11 @@ import type { InputHTMLAttributes, TextareaHTMLAttributes } from 'react'; import { Check, ChevronDown } from 'lucide-react'; import { radius, shadows } from '../design'; -interface HandInputProps extends InputHTMLAttributes { +interface InputProps extends InputHTMLAttributes { label?: string; } -export function HandInput({ label, className = '', style, id, ...props }: HandInputProps) { +export function Input({ label, className = '', style, id, ...props }: InputProps) { const autoId = useId(); const inputId = id ?? autoId; @@ -41,11 +41,11 @@ export function HandInput({ label, className = '', style, id, ...props }: HandIn ); } -interface HandTextareaProps extends TextareaHTMLAttributes { +interface TextareaProps extends TextareaHTMLAttributes { label?: string; } -export function HandTextarea({ label, className = '', style, id, ...props }: HandTextareaProps) { +export function Textarea({ label, className = '', style, id, ...props }: TextareaProps) { const autoId = useId(); const inputId = id ?? autoId; @@ -85,7 +85,7 @@ export interface SelectOption { description?: string; } -interface HandSelectProps { +interface SelectProps { label?: string; value: string; onChange: (value: string) => void; @@ -93,7 +93,7 @@ interface HandSelectProps { className?: string; } -export function HandSelect({ label, value, onChange, options, className = '' }: HandSelectProps) { +export function Select({ label, value, onChange, options, className = '' }: SelectProps) { const [open, setOpen] = useState(false); const [focusIdx, setFocusIdx] = useState(-1); const containerRef = useRef(null); @@ -238,14 +238,14 @@ export function HandSelect({ label, value, onChange, options, className = '' }: ); } -interface HandCheckboxProps { +interface CheckboxProps { label: string; checked: boolean; onChange: (checked: boolean) => void; className?: string; } -export function HandCheckbox({ label, checked, onChange, className = '' }: HandCheckboxProps) { +export function Checkbox({ label, checked, onChange, className = '' }: CheckboxProps) { return (