mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
refactor(ui): rename HandButton→Button, HandInput→Input + remove deprecated aliases
- Rename HandButton.tsx → Button.tsx, export default function Button - Rename HandInput.tsx → Input.tsx, rename exports: HandInput→Input, HandTextarea→Textarea, HandSelect→Select, HandCheckbox→Checkbox - Rename internal interface names (ButtonProps, InputProps, etc.) - Update all 21 import sites across components/ and pages/ - Remove deprecated `wobbly` and `colors` exports from design.ts
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { ReactNode, ButtonHTMLAttributes } from 'react';
|
||||
import { radius } from '../design';
|
||||
|
||||
interface HandButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
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 (
|
||||
<button
|
||||
className={`
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEffect, type ReactNode } from 'react';
|
||||
import Card from './Card';
|
||||
import HandButton from './HandButton';
|
||||
import Button from './Button';
|
||||
import { radius } from '../design';
|
||||
import { useFocusTrap } from '../hooks/useFocusTrap';
|
||||
|
||||
@@ -70,23 +70,23 @@ export default function ConfirmDialog({
|
||||
</div>
|
||||
<div className="flex gap-3 justify-center">
|
||||
{cancelText && (
|
||||
<HandButton
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={onCancel}
|
||||
disabled={loading}
|
||||
>
|
||||
{cancelText}
|
||||
</HandButton>
|
||||
</Button>
|
||||
)}
|
||||
<HandButton
|
||||
<Button
|
||||
variant={variant === 'danger' ? 'danger' : 'primary'}
|
||||
size="sm"
|
||||
onClick={onConfirm}
|
||||
disabled={loading}
|
||||
>
|
||||
{loading ? 'Working...' : confirmText}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
@@ -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<Props, State> {
|
||||
>
|
||||
{this.state.error?.message || 'An unexpected error occurred.'}
|
||||
</p>
|
||||
<HandButton variant="secondary" onClick={() => window.location.reload()}>
|
||||
<Button variant="secondary" onClick={() => window.location.reload()}>
|
||||
Reload page
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
@@ -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"
|
||||
/>
|
||||
</h3>
|
||||
<HandButton variant="ghost" size="sm" onClick={onClose} className="shrink-0 ml-2">
|
||||
<Button variant="ghost" size="sm" onClick={onClose} className="shrink-0 ml-2">
|
||||
<X size={16} strokeWidth={2.5} />
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* Content */}
|
||||
|
||||
@@ -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({
|
||||
<span className="text-xs text-muted-dark shrink-0 px-1.5">Built-in</span>
|
||||
) : confirmDelete === hub.url ? (
|
||||
<div className="flex items-center gap-1 shrink-0">
|
||||
<HandButton
|
||||
<Button
|
||||
variant="danger"
|
||||
size="sm"
|
||||
onClick={() => handleDelete(hub.url)}
|
||||
>
|
||||
Confirm
|
||||
</HandButton>
|
||||
<HandButton
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setConfirmDelete(null)}
|
||||
>
|
||||
Cancel
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<button
|
||||
@@ -177,13 +177,13 @@ export default function HubManagerModal({
|
||||
Add Hub
|
||||
</p>
|
||||
<div className="space-y-2 mb-2">
|
||||
<HandInput
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="Label (optional)"
|
||||
value={newLabel}
|
||||
onChange={(e) => setNewLabel(e.target.value)}
|
||||
/>
|
||||
<HandInput
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="URL or file path"
|
||||
value={newURL}
|
||||
@@ -201,13 +201,13 @@ export default function HubManagerModal({
|
||||
Enter a URL or local path to a skillshare-hub.json file.
|
||||
</p>
|
||||
<div className="flex justify-between">
|
||||
<HandButton variant="primary" size="sm" onClick={handleAdd}>
|
||||
<Button variant="primary" size="sm" onClick={handleAdd}>
|
||||
<Plus size={14} strokeWidth={2.5} />
|
||||
Add
|
||||
</HandButton>
|
||||
<HandButton variant="ghost" size="sm" onClick={onClose}>
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm" onClick={onClose}>
|
||||
Close
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
@@ -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<HTMLInputElement> {
|
||||
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
||||
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<HTMLTextAreaElement> {
|
||||
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
||||
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<HTMLDivElement>(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 (
|
||||
<label
|
||||
className={`inline-flex items-center gap-2 cursor-pointer select-none ${className}`}
|
||||
@@ -2,9 +2,9 @@ import { useState, useCallback } from 'react';
|
||||
import { Download, Package, ChevronDown, ChevronUp, ShieldAlert, ShieldCheck } from 'lucide-react';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import Card from './Card';
|
||||
import HandButton from './HandButton';
|
||||
import Button from './Button';
|
||||
import Badge from './Badge';
|
||||
import { HandInput, HandCheckbox } from './HandInput';
|
||||
import { Input, Checkbox } from './Input';
|
||||
import SkillPickerModal from './SkillPickerModal';
|
||||
import ConfirmDialog from './ConfirmDialog';
|
||||
import { useToast } from './Toast';
|
||||
@@ -304,9 +304,9 @@ export default function InstallForm({
|
||||
};
|
||||
|
||||
const formContent = (
|
||||
<Card variant="postit" className="animate-fade-in">
|
||||
<Card variant="default" className="animate-fade-in">
|
||||
<div className="space-y-4">
|
||||
<HandInput
|
||||
<Input
|
||||
label="Source (GitHub URL, owner/repo, or local path)"
|
||||
type="text"
|
||||
placeholder="owner/repo or https://github.com/..."
|
||||
@@ -314,14 +314,14 @@ export default function InstallForm({
|
||||
onChange={(e) => setSource(e.target.value)}
|
||||
onKeyDown={(e) => e.key === 'Enter' && handleInstall()}
|
||||
/>
|
||||
<HandInput
|
||||
<Input
|
||||
label="Name override (optional)"
|
||||
type="text"
|
||||
placeholder="custom-name"
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
/>
|
||||
<HandInput
|
||||
<Input
|
||||
label="Into directory (optional)"
|
||||
type="text"
|
||||
placeholder="frontend or frontend/react"
|
||||
@@ -329,23 +329,23 @@ export default function InstallForm({
|
||||
onChange={(e) => setInto(e.target.value)}
|
||||
/>
|
||||
<div className="flex items-center gap-6">
|
||||
<HandCheckbox
|
||||
<Checkbox
|
||||
label="Track (git repo)"
|
||||
checked={track}
|
||||
onChange={setTrack}
|
||||
/>
|
||||
<HandCheckbox
|
||||
<Checkbox
|
||||
label="Force overwrite"
|
||||
checked={force}
|
||||
onChange={setForce}
|
||||
/>
|
||||
<HandCheckbox
|
||||
<Checkbox
|
||||
label="Skip audit"
|
||||
checked={skipAudit}
|
||||
onChange={setSkipAudit}
|
||||
/>
|
||||
</div>
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={handleInstall}
|
||||
disabled={installing || !source.trim()}
|
||||
variant="primary"
|
||||
@@ -353,7 +353,7 @@ export default function InstallForm({
|
||||
>
|
||||
<Download size={14} strokeWidth={2.5} />
|
||||
{installing ? 'Installing...' : 'Install'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useState, useEffect, useRef, useMemo } from 'react';
|
||||
import { Download, Search } from 'lucide-react';
|
||||
import Card from './Card';
|
||||
import HandButton from './HandButton';
|
||||
import { HandCheckbox } from './HandInput';
|
||||
import Button from './Button';
|
||||
import { Checkbox } from './Input';
|
||||
import { radius } from '../design';
|
||||
import { useFocusTrap } from '../hooks/useFocusTrap';
|
||||
import type { DiscoveredSkill } from '../api/client';
|
||||
@@ -137,7 +137,7 @@ export default function SkillPickerModal({
|
||||
|
||||
{/* Select All */}
|
||||
<div className="flex items-center justify-between border-b-2 border-dashed border-muted pb-2 mb-2">
|
||||
<HandCheckbox
|
||||
<Checkbox
|
||||
label={allFilteredSelected ? 'Deselect All' : 'Select All'}
|
||||
checked={allFilteredSelected}
|
||||
onChange={toggleAll}
|
||||
@@ -153,7 +153,7 @@ export default function SkillPickerModal({
|
||||
<div className="overflow-y-auto space-y-1 mb-4" style={{ maxHeight: '16rem' }}>
|
||||
{filtered.map((skill) => (
|
||||
<div key={skill.path} className="flex items-start gap-2 py-1">
|
||||
<HandCheckbox
|
||||
<Checkbox
|
||||
label=""
|
||||
checked={selected.has(skill.path)}
|
||||
onChange={() => toggle(skill.path)}
|
||||
@@ -179,15 +179,15 @@ export default function SkillPickerModal({
|
||||
|
||||
{/* Footer */}
|
||||
<div className="flex gap-3 justify-end">
|
||||
<HandButton
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={onCancel}
|
||||
disabled={installing}
|
||||
>
|
||||
Cancel
|
||||
</HandButton>
|
||||
<HandButton
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
size="sm"
|
||||
onClick={handleInstall}
|
||||
@@ -197,7 +197,7 @@ export default function SkillPickerModal({
|
||||
{installing
|
||||
? 'Installing...'
|
||||
: `Install Selected (${selected.size})`}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
@@ -38,30 +38,3 @@ export const palette = {
|
||||
warning: '#d4870e',
|
||||
danger: '#c0392b',
|
||||
} as const;
|
||||
|
||||
// ── Backward compatibility aliases ──────────────────────
|
||||
// These will be removed after all files are migrated.
|
||||
// DO NOT use in new code.
|
||||
/** @deprecated Use `radius` instead */
|
||||
export const wobbly = {
|
||||
full: radius.full,
|
||||
md: radius.md,
|
||||
sm: radius.sm,
|
||||
btn: radius.btn,
|
||||
} as const;
|
||||
|
||||
/** @deprecated Use `palette` instead */
|
||||
export const colors = {
|
||||
paper: '#f7f6f3',
|
||||
paperWarm: '#ffffff',
|
||||
pencil: '#141312',
|
||||
pencilLight: '#5a5750',
|
||||
muted: '#e2dfd8',
|
||||
mutedDark: '#9e9b94',
|
||||
accent: '#dc4538',
|
||||
blue: '#2d5da1',
|
||||
postit: '#fff9c4',
|
||||
success: '#2e8b57',
|
||||
warning: '#d4870e',
|
||||
danger: '#c0392b',
|
||||
} as const;
|
||||
|
||||
+11
-11
@@ -17,9 +17,9 @@ import {
|
||||
import { api } from '../api/client';
|
||||
import type { AuditAllResponse, AuditResult, AuditFinding } from '../api/client';
|
||||
import Card from '../components/Card';
|
||||
import HandButton from '../components/HandButton';
|
||||
import Button from '../components/Button';
|
||||
import Badge from '../components/Badge';
|
||||
import { HandSelect } from '../components/HandInput';
|
||||
import { Select } from '../components/Input';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
import { PageSkeleton } from '../components/Skeleton';
|
||||
import { useToast } from '../components/Toast';
|
||||
@@ -137,12 +137,12 @@ export default function AuditPage() {
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
<Link to="/audit/rules">
|
||||
<HandButton variant="secondary" size="lg">
|
||||
<Button variant="secondary" size="lg">
|
||||
<FileEdit size={18} strokeWidth={2.5} />
|
||||
Custom Rules
|
||||
</HandButton>
|
||||
</Button>
|
||||
</Link>
|
||||
<HandButton
|
||||
<Button
|
||||
variant="primary"
|
||||
size="lg"
|
||||
onClick={runAudit}
|
||||
@@ -150,7 +150,7 @@ export default function AuditPage() {
|
||||
>
|
||||
<ShieldCheck size={18} strokeWidth={2.5} />
|
||||
{loading ? 'Scanning...' : 'Run Audit'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -162,7 +162,7 @@ export default function AuditPage() {
|
||||
total={progress.total}
|
||||
startTime={startTimeRef.current}
|
||||
icon={ShieldCheck}
|
||||
iconClassName="animate-pulse-gentle"
|
||||
iconClassName="animate-pulse"
|
||||
labelDiscovering="Scanning skills..."
|
||||
labelRunning="Scanning skills..."
|
||||
units="skills"
|
||||
@@ -255,9 +255,9 @@ export default function AuditPage() {
|
||||
title="No audit results yet"
|
||||
description="Click 'Run Audit' to scan your installed skills for security threats"
|
||||
action={
|
||||
<HandButton variant="primary" onClick={runAudit}>
|
||||
<Button variant="primary" onClick={runAudit}>
|
||||
<ShieldCheck size={16} strokeWidth={2.5} /> Run Audit
|
||||
</HandButton>
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
@@ -363,7 +363,7 @@ function StatCard({
|
||||
{/* Pulse dot for non-zero danger/warning */}
|
||||
{!isZero && (variant === 'danger' || variant === 'warning') && (
|
||||
<div className="absolute top-2 right-2">
|
||||
<span className={`block w-2.5 h-2.5 rounded-full ${variant === 'danger' ? 'bg-danger' : 'bg-warning'} animate-pulse-gentle`} />
|
||||
<span className={`block w-2.5 h-2.5 rounded-full ${variant === 'danger' ? 'bg-danger' : 'bg-warning'} animate-pulse`} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -524,7 +524,7 @@ function TriagePanel({
|
||||
{/* Bottom row: filter + help */}
|
||||
<div className="flex flex-col sm:flex-row items-start sm:items-end gap-3 pt-2 border-t border-dashed border-pencil-light/30">
|
||||
<div className="w-full sm:w-56">
|
||||
<HandSelect
|
||||
<Select
|
||||
label="Min Severity"
|
||||
value={minSeverity}
|
||||
onChange={(value) => onSeverityChange(value)}
|
||||
|
||||
@@ -22,10 +22,10 @@ import { yaml } from '@codemirror/lang-yaml';
|
||||
import { EditorView } from '@codemirror/view';
|
||||
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
||||
import Card from '../components/Card';
|
||||
import HandButton from '../components/HandButton';
|
||||
import Button from '../components/Button';
|
||||
import Badge from '../components/Badge';
|
||||
import ConfirmDialog from '../components/ConfirmDialog';
|
||||
import { HandInput } from '../components/HandInput';
|
||||
import { Input } from '../components/Input';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
import { PageSkeleton } from '../components/Skeleton';
|
||||
import { useToast } from '../components/Toast';
|
||||
@@ -313,7 +313,7 @@ export default function AuditRulesPage() {
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => setViewMode(viewMode === 'structured' ? 'yaml' : 'structured')}
|
||||
variant="secondary"
|
||||
size="md"
|
||||
@@ -323,9 +323,9 @@ export default function AuditRulesPage() {
|
||||
) : (
|
||||
<><List size={16} strokeWidth={2.5} /> Rule Browser</>
|
||||
)}
|
||||
</HandButton>
|
||||
</Button>
|
||||
{viewMode === 'structured' && stats.custom > 0 && (
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => setShowResetConfirm(true)}
|
||||
disabled={resetMutation.isPending}
|
||||
variant="danger"
|
||||
@@ -333,7 +333,7 @@ export default function AuditRulesPage() {
|
||||
>
|
||||
<RotateCcw size={16} strokeWidth={2.5} />
|
||||
{resetMutation.isPending ? 'Resetting...' : 'Reset All'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
)}
|
||||
{viewMode === 'yaml' && rawQuery.data?.exists && (
|
||||
<>
|
||||
@@ -345,10 +345,10 @@ export default function AuditRulesPage() {
|
||||
unsaved changes
|
||||
</span>
|
||||
)}
|
||||
<HandButton onClick={handleSave} disabled={saving || !dirty} variant="primary" size="md">
|
||||
<Button onClick={handleSave} disabled={saving || !dirty} variant="primary" size="md">
|
||||
<Save size={16} strokeWidth={2.5} />
|
||||
{saving ? 'Saving...' : 'Save'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
@@ -436,7 +436,7 @@ export default function AuditRulesPage() {
|
||||
strokeWidth={2.5}
|
||||
className="absolute left-3 top-1/2 -translate-y-1/2 text-pencil-light pointer-events-none"
|
||||
/>
|
||||
<HandInput
|
||||
<Input
|
||||
type="text"
|
||||
value={search}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
@@ -500,10 +500,10 @@ export default function AuditRulesPage() {
|
||||
title="No custom rules file"
|
||||
description={`Create ${isProjectMode ? 'a project-level' : 'a global'} audit-rules.yaml to add or override security rules`}
|
||||
action={
|
||||
<HandButton variant="primary" onClick={handleCreate} disabled={creating}>
|
||||
<Button variant="primary" onClick={handleCreate} disabled={creating}>
|
||||
<FilePlus size={16} strokeWidth={2.5} />
|
||||
{creating ? 'Creating...' : 'Create Rules File'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -16,7 +16,7 @@ import { useAppContext } from '../context/AppContext';
|
||||
import { queryKeys, staleTimes } from '../lib/queryKeys';
|
||||
import { formatSize } from '../lib/format';
|
||||
import Card from '../components/Card';
|
||||
import HandButton from '../components/HandButton';
|
||||
import Button from '../components/Button';
|
||||
import Badge from '../components/Badge';
|
||||
import ConfirmDialog from '../components/ConfirmDialog';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
@@ -201,7 +201,7 @@ export default function BackupPage() {
|
||||
)}
|
||||
</div>
|
||||
<div className="flex gap-3">
|
||||
<HandButton
|
||||
<Button
|
||||
variant="primary"
|
||||
size="lg"
|
||||
onClick={handleCreate}
|
||||
@@ -212,15 +212,15 @@ export default function BackupPage() {
|
||||
) : (
|
||||
<><Plus size={18} strokeWidth={2.5} /> Create Backup</>
|
||||
)}
|
||||
</HandButton>
|
||||
</Button>
|
||||
{backups.length > 0 && (
|
||||
<HandButton
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setCleanupOpen(true)}
|
||||
>
|
||||
<Trash2 size={16} strokeWidth={2.5} /> Cleanup
|
||||
</HandButton>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -233,9 +233,9 @@ export default function BackupPage() {
|
||||
title="No backups found"
|
||||
description="Create your first backup to protect your target configurations"
|
||||
action={
|
||||
<HandButton variant="primary" onClick={handleCreate} disabled={creating}>
|
||||
<Button variant="primary" onClick={handleCreate} disabled={creating}>
|
||||
<Archive size={16} strokeWidth={2.5} /> Create First Backup
|
||||
</HandButton>
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
@@ -378,14 +378,14 @@ function BackupCard({
|
||||
{/* Actions */}
|
||||
<div className="border-t border-dashed border-pencil-light/40 pt-3 flex gap-2">
|
||||
{backup.targets.map((t) => (
|
||||
<HandButton
|
||||
<Button
|
||||
key={t}
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={() => onRestore(t)}
|
||||
>
|
||||
<RotateCcw size={14} strokeWidth={2.5} /> Restore {t}
|
||||
</HandButton>
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
} from 'lucide-react';
|
||||
import Card from '../components/Card';
|
||||
import Badge from '../components/Badge';
|
||||
import HandButton from '../components/HandButton';
|
||||
import Button from '../components/Button';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
import ConfirmDialog from '../components/ConfirmDialog';
|
||||
import { PageSkeleton } from '../components/Skeleton';
|
||||
@@ -187,7 +187,7 @@ export default function CollectPage() {
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="flex items-center gap-2 px-4 py-2 bg-postit border-2 border-pencil"
|
||||
className="flex items-center gap-2 px-4 py-2 bg-paper border-2 border-pencil"
|
||||
style={{ borderRadius: radius.sm, boxShadow: shadows.sm }}
|
||||
>
|
||||
<Folder size={18} strokeWidth={2.5} className="text-warning" />
|
||||
@@ -200,7 +200,7 @@ export default function CollectPage() {
|
||||
{/* Scan control area */}
|
||||
<Card className="mb-6 text-center">
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => handleScan(presetTarget)}
|
||||
disabled={phase === 'scanning' || phase === 'collecting'}
|
||||
variant="primary"
|
||||
@@ -218,7 +218,7 @@ export default function CollectPage() {
|
||||
{phase === 'idle' ? 'Scan for Local Skills' : 'Re-scan'}
|
||||
</>
|
||||
)}
|
||||
</HandButton>
|
||||
</Button>
|
||||
|
||||
{presetTarget && (
|
||||
<p className="text-sm text-pencil-light">
|
||||
@@ -266,22 +266,22 @@ export default function CollectPage() {
|
||||
Found {totalCount} local skill{totalCount !== 1 ? 's' : ''}
|
||||
</h3>
|
||||
<div className="flex gap-2">
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => toggleAll(true)}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
disabled={phase === 'collecting'}
|
||||
>
|
||||
Select All
|
||||
</HandButton>
|
||||
<HandButton
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => toggleAll(false)}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
disabled={phase === 'collecting'}
|
||||
>
|
||||
Select None
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -301,7 +301,7 @@ export default function CollectPage() {
|
||||
{/* Collect button */}
|
||||
{phase !== 'done' && (
|
||||
<div className="mt-6 text-center">
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => setConfirming(true)}
|
||||
disabled={selected.size === 0 || phase === 'collecting'}
|
||||
variant="primary"
|
||||
@@ -319,7 +319,7 @@ export default function CollectPage() {
|
||||
Collect {selected.size} Skill{selected.size !== 1 ? 's' : ''}
|
||||
</>
|
||||
)}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -340,10 +340,10 @@ export default function CollectPage() {
|
||||
Skills collected to source! Run Sync to distribute them to all targets.
|
||||
</p>
|
||||
<Link to="/sync">
|
||||
<HandButton variant="primary" size="sm">
|
||||
<Button variant="primary" size="sm">
|
||||
<RefreshCw size={16} strokeWidth={2.5} />
|
||||
Go to Sync
|
||||
</HandButton>
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
@@ -5,7 +5,7 @@ import { yaml } from '@codemirror/lang-yaml';
|
||||
import { EditorView } from '@codemirror/view';
|
||||
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import Card from '../components/Card';
|
||||
import HandButton from '../components/HandButton';
|
||||
import Button from '../components/Button';
|
||||
import { PageSkeleton } from '../components/Skeleton';
|
||||
import { useToast } from '../components/Toast';
|
||||
import { api } from '../api/client';
|
||||
@@ -90,7 +90,7 @@ export default function ConfigPage() {
|
||||
unsaved changes
|
||||
</span>
|
||||
)}
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={handleSave}
|
||||
disabled={saving || !dirty}
|
||||
variant="primary"
|
||||
@@ -98,7 +98,7 @@ export default function ConfigPage() {
|
||||
>
|
||||
<Save size={16} strokeWidth={2.5} />
|
||||
{saving ? 'Saving...' : 'Save'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ export default function DashboardPage() {
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||
<Link to="/sync" className="h-full">
|
||||
<div
|
||||
className="flex items-center gap-3 px-5 py-4 h-full bg-postit border-2 border-pencil transition-all duration-100 hover:translate-x-[2px] hover:translate-y-[2px] cursor-pointer group"
|
||||
className="flex items-center gap-3 px-5 py-4 h-full bg-paper border-2 border-pencil transition-all duration-100 hover:translate-x-[2px] hover:translate-y-[2px] cursor-pointer group"
|
||||
style={{
|
||||
borderRadius: radius.md,
|
||||
boxShadow: shadows.md,
|
||||
@@ -305,7 +305,7 @@ export default function DashboardPage() {
|
||||
<RefreshCw
|
||||
size={22}
|
||||
strokeWidth={2.5}
|
||||
className="text-pencil group-hover:animate-spin-slow"
|
||||
className="text-pencil group-hover:animate-spin"
|
||||
/>
|
||||
<div className="flex-1">
|
||||
<p className="font-medium text-pencil">
|
||||
|
||||
+21
-21
@@ -7,8 +7,8 @@ import { queryKeys, staleTimes } from '../lib/queryKeys';
|
||||
import { useAppContext } from '../context/AppContext';
|
||||
import { useToast } from '../components/Toast';
|
||||
import Card from '../components/Card';
|
||||
import HandButton from '../components/HandButton';
|
||||
import { HandInput, HandSelect } from '../components/HandInput';
|
||||
import Button from '../components/Button';
|
||||
import { Input, Select } from '../components/Input';
|
||||
import Badge from '../components/Badge';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
import ConfirmDialog from '../components/ConfirmDialog';
|
||||
@@ -111,7 +111,7 @@ function AddExtraModal({
|
||||
|
||||
<div className="space-y-4">
|
||||
{/* Name */}
|
||||
<HandInput
|
||||
<Input
|
||||
label="Name"
|
||||
placeholder="e.g. my-scripts"
|
||||
value={name}
|
||||
@@ -130,7 +130,7 @@ function AddExtraModal({
|
||||
{targets.map((t, i) => (
|
||||
<div key={i} className="flex gap-2 items-start">
|
||||
<div className="flex-1">
|
||||
<HandInput
|
||||
<Input
|
||||
placeholder="Target path (e.g. ~/.cursor/scripts)"
|
||||
value={t.path}
|
||||
onChange={(e) => updateTarget(i, 'path', e.target.value)}
|
||||
@@ -138,7 +138,7 @@ function AddExtraModal({
|
||||
/>
|
||||
</div>
|
||||
<div className="w-36 shrink-0">
|
||||
<HandSelect
|
||||
<Select
|
||||
value={t.mode}
|
||||
onChange={(v) => updateTarget(i, 'mode', v)}
|
||||
options={MODE_OPTIONS}
|
||||
@@ -157,7 +157,7 @@ function AddExtraModal({
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<HandButton
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={addTarget}
|
||||
@@ -165,17 +165,17 @@ function AddExtraModal({
|
||||
className="mt-2"
|
||||
>
|
||||
<Plus size={14} strokeWidth={2.5} /> Add Target
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex gap-3 justify-end mt-6">
|
||||
<HandButton variant="ghost" size="sm" onClick={onClose} disabled={saving}>
|
||||
<Button variant="ghost" size="sm" onClick={onClose} disabled={saving}>
|
||||
Cancel
|
||||
</HandButton>
|
||||
<HandButton variant="primary" size="sm" onClick={handleCreate} disabled={saving}>
|
||||
</Button>
|
||||
<Button variant="primary" size="sm" onClick={handleCreate} disabled={saving}>
|
||||
{saving ? 'Creating...' : 'Create'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
@@ -213,12 +213,12 @@ function ExtraCard({
|
||||
)}
|
||||
</div>
|
||||
<div className="flex gap-2 shrink-0">
|
||||
<HandButton variant="secondary" size="sm" onClick={() => onSync(extra.name)}>
|
||||
<Button variant="secondary" size="sm" onClick={() => onSync(extra.name)}>
|
||||
<RefreshCw size={12} strokeWidth={2.5} /> Sync
|
||||
</HandButton>
|
||||
<HandButton variant="danger" size="sm" onClick={() => onRemove(extra.name)}>
|
||||
</Button>
|
||||
<Button variant="danger" size="sm" onClick={() => onRemove(extra.name)}>
|
||||
<Trash2 size={12} strokeWidth={2.5} />
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -346,13 +346,13 @@ export default function ExtrasPage() {
|
||||
</h2>
|
||||
<div className="flex gap-2">
|
||||
{extras.length > 0 && (
|
||||
<HandButton variant="secondary" size="sm" onClick={handleSyncAll}>
|
||||
<Button variant="secondary" size="sm" onClick={handleSyncAll}>
|
||||
<RefreshCw size={14} strokeWidth={2.5} /> Sync All
|
||||
</HandButton>
|
||||
</Button>
|
||||
)}
|
||||
<HandButton variant="primary" size="sm" onClick={() => setShowAdd(true)}>
|
||||
<Button variant="primary" size="sm" onClick={() => setShowAdd(true)}>
|
||||
<Plus size={14} strokeWidth={2.5} /> Add Extra
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<p
|
||||
@@ -381,9 +381,9 @@ export default function ExtrasPage() {
|
||||
title="No extras configured"
|
||||
description="Extras let you sync any directory to your AI tool targets alongside your skills."
|
||||
action={
|
||||
<HandButton variant="primary" size="md" onClick={() => setShowAdd(true)}>
|
||||
<Button variant="primary" size="md" onClick={() => setShowAdd(true)}>
|
||||
<Plus size={16} strokeWidth={2.5} /> Add Extra
|
||||
</HandButton>
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -20,8 +20,8 @@ import { queryKeys, staleTimes } from '../lib/queryKeys';
|
||||
import { useAppContext } from '../context/AppContext';
|
||||
import { shortenHome } from '../lib/paths';
|
||||
import Card from '../components/Card';
|
||||
import HandButton from '../components/HandButton';
|
||||
import { HandInput, HandCheckbox } from '../components/HandInput';
|
||||
import Button from '../components/Button';
|
||||
import { Input, Checkbox } from '../components/Input';
|
||||
import Badge from '../components/Badge';
|
||||
import { PageSkeleton } from '../components/Skeleton';
|
||||
import { useToast } from '../components/Toast';
|
||||
@@ -222,7 +222,7 @@ export default function GitSyncPage() {
|
||||
</h3>
|
||||
|
||||
{/* Commit Message */}
|
||||
<HandInput
|
||||
<Input
|
||||
label="Commit Message"
|
||||
placeholder="Describe your changes..."
|
||||
value={commitMsg}
|
||||
@@ -271,12 +271,12 @@ export default function GitSyncPage() {
|
||||
)}
|
||||
|
||||
<div className="flex items-center justify-between gap-4 pt-2">
|
||||
<HandCheckbox
|
||||
<Checkbox
|
||||
label="Dry Run"
|
||||
checked={pushDryRun}
|
||||
onChange={setPushDryRun}
|
||||
/>
|
||||
<HandButton
|
||||
<Button
|
||||
variant="primary"
|
||||
size="lg"
|
||||
onClick={handlePush}
|
||||
@@ -288,7 +288,7 @@ export default function GitSyncPage() {
|
||||
) : (
|
||||
<><ArrowUpCircle size={18} strokeWidth={2.5} /> Push</>
|
||||
)}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{pushResult && (
|
||||
@@ -322,12 +322,12 @@ export default function GitSyncPage() {
|
||||
)}
|
||||
|
||||
<div className="flex items-center justify-between gap-4 pt-2">
|
||||
<HandCheckbox
|
||||
<Checkbox
|
||||
label="Dry Run"
|
||||
checked={pullDryRun}
|
||||
onChange={setPullDryRun}
|
||||
/>
|
||||
<HandButton
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="lg"
|
||||
onClick={handlePull}
|
||||
@@ -339,7 +339,7 @@ export default function GitSyncPage() {
|
||||
) : (
|
||||
<><ArrowDownCircle size={18} strokeWidth={2.5} /> Pull</>
|
||||
)}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* Pull Results */}
|
||||
|
||||
@@ -5,13 +5,13 @@ import { api } from '../api/client';
|
||||
import type { LogEntry, LogStatsResponse } from '../api/client';
|
||||
import { queryKeys, staleTimes } from '../lib/queryKeys';
|
||||
import Card from '../components/Card';
|
||||
import HandButton from '../components/HandButton';
|
||||
import Button from '../components/Button';
|
||||
import Badge from '../components/Badge';
|
||||
import ConfirmDialog from '../components/ConfirmDialog';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
import { PageSkeleton } from '../components/Skeleton';
|
||||
import { useToast } from '../components/Toast';
|
||||
import { HandSelect } from '../components/HandInput';
|
||||
import { Select } from '../components/Input';
|
||||
import { radius, shadows } from '../design';
|
||||
|
||||
/* ──────────────────────────────────────────────────────────────────────
|
||||
@@ -746,15 +746,15 @@ export default function LogPage() {
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<HandButton onClick={handleRefresh} variant="secondary" size="sm" disabled={loading}>
|
||||
<Button onClick={handleRefresh} variant="secondary" size="sm" disabled={loading}>
|
||||
<RefreshCw size={16} className={loading ? 'animate-spin' : ''} />
|
||||
Refresh
|
||||
</HandButton>
|
||||
</Button>
|
||||
{hasEntries && (
|
||||
<HandButton onClick={() => setConfirmOpen(true)} variant="danger" size="sm" disabled={clearing}>
|
||||
<Button onClick={() => setConfirmOpen(true)} variant="danger" size="sm" disabled={clearing}>
|
||||
<Trash2 size={16} />
|
||||
Clear
|
||||
</HandButton>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -774,7 +774,7 @@ export default function LogPage() {
|
||||
{/* ─── Filters ─── */}
|
||||
<div className="flex flex-wrap items-end gap-3">
|
||||
<div className="w-36">
|
||||
<HandSelect
|
||||
<Select
|
||||
label="Command"
|
||||
value={cmdFilter}
|
||||
onChange={setCmdFilter}
|
||||
@@ -785,7 +785,7 @@ export default function LogPage() {
|
||||
/>
|
||||
</div>
|
||||
<div className="w-32">
|
||||
<HandSelect
|
||||
<Select
|
||||
label="Status"
|
||||
value={statusFilter}
|
||||
onChange={setStatusFilter}
|
||||
|
||||
+20
-20
@@ -3,8 +3,8 @@ import { Search, Star, Download, Globe, Database, Settings } from 'lucide-react'
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import Card from '../components/Card';
|
||||
import Badge from '../components/Badge';
|
||||
import HandButton from '../components/HandButton';
|
||||
import { HandInput, HandSelect } from '../components/HandInput';
|
||||
import Button from '../components/Button';
|
||||
import { Input, Select } from '../components/Input';
|
||||
import SkillPickerModal from '../components/SkillPickerModal';
|
||||
import HubManagerModal, { type SavedHub } from '../components/HubManagerModal';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
@@ -331,22 +331,22 @@ export default function SearchPage() {
|
||||
|
||||
{/* Mode tabs */}
|
||||
<div className="flex gap-2 mb-4">
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => switchMode('github')}
|
||||
variant={mode === 'github' ? 'primary' : 'secondary'}
|
||||
size="sm"
|
||||
>
|
||||
<Globe size={14} strokeWidth={2.5} />
|
||||
GitHub
|
||||
</HandButton>
|
||||
<HandButton
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => switchMode('hub')}
|
||||
variant={mode === 'hub' ? 'primary' : 'secondary'}
|
||||
size="sm"
|
||||
>
|
||||
<Database size={14} strokeWidth={2.5} />
|
||||
Hub
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* Hub selector (only in hub mode) */}
|
||||
@@ -354,13 +354,13 @@ export default function SearchPage() {
|
||||
<Card className="mb-4 !overflow-visible">
|
||||
{savedHubs.length > 0 ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<HandSelect
|
||||
<Select
|
||||
value={selectedHub}
|
||||
onChange={handleSelectHub}
|
||||
options={savedHubs.map((h) => ({ value: h.url, label: h.label }))}
|
||||
className="flex-1"
|
||||
/>
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => setShowHubManager(true)}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
@@ -368,21 +368,21 @@ export default function SearchPage() {
|
||||
>
|
||||
<Settings size={14} strokeWidth={2.5} />
|
||||
Manage
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<div className="text-center py-3">
|
||||
<p className="text-base text-muted-dark mb-3">
|
||||
No hubs configured. Add one to get started.
|
||||
</p>
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => setShowHubManager(true)}
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
>
|
||||
<Settings size={14} strokeWidth={2.5} />
|
||||
Manage Hubs
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
<p className="text-sm text-muted-dark mt-3 flex items-center gap-1.5">
|
||||
@@ -411,7 +411,7 @@ export default function SearchPage() {
|
||||
strokeWidth={2.5}
|
||||
className="absolute left-4 top-1/2 -translate-y-1/2 text-muted-dark pointer-events-none"
|
||||
/>
|
||||
<HandInput
|
||||
<Input
|
||||
type="text"
|
||||
placeholder={mode === 'github' ? 'Search GitHub for skills...' : 'Search hub...'}
|
||||
value={query}
|
||||
@@ -420,7 +420,7 @@ export default function SearchPage() {
|
||||
className="!pl-11"
|
||||
/>
|
||||
</div>
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => handleSearch(query)}
|
||||
disabled={searching}
|
||||
variant="primary"
|
||||
@@ -428,7 +428,7 @@ export default function SearchPage() {
|
||||
>
|
||||
<Search size={16} strokeWidth={2.5} />
|
||||
{searching ? 'Searching...' : 'Search'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
{mode === 'github' && (
|
||||
<p className="text-sm text-muted-dark mt-3 flex items-center gap-1">
|
||||
@@ -451,7 +451,7 @@ export default function SearchPage() {
|
||||
strokeWidth={2.5}
|
||||
className="absolute left-3 top-1/2 -translate-y-1/2 text-muted-dark pointer-events-none"
|
||||
/>
|
||||
<HandInput
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="Filter by name, description, or tag..."
|
||||
value={filter}
|
||||
@@ -498,7 +498,7 @@ export default function SearchPage() {
|
||||
{r.source}
|
||||
</p>
|
||||
</div>
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => handleInstall(r.source, r.skill)}
|
||||
disabled={installing === r.source}
|
||||
variant="secondary"
|
||||
@@ -507,7 +507,7 @@ export default function SearchPage() {
|
||||
>
|
||||
<Download size={14} strokeWidth={2.5} />
|
||||
{installing === r.source ? 'Installing...' : 'Install'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
))}
|
||||
@@ -531,7 +531,7 @@ export default function SearchPage() {
|
||||
{!results && !searching && (
|
||||
<div className="text-center py-12">
|
||||
<div
|
||||
className="inline-flex items-center justify-center w-20 h-20 bg-postit border-2 border-dashed border-pencil-light mb-4"
|
||||
className="inline-flex items-center justify-center w-20 h-20 bg-paper border-2 border-dashed border-pencil-light mb-4"
|
||||
style={{ borderRadius: '50%' }}
|
||||
>
|
||||
<Search size={32} strokeWidth={2} className="text-pencil-light" />
|
||||
@@ -546,14 +546,14 @@ export default function SearchPage() {
|
||||
? 'Type a query above to find skills on GitHub'
|
||||
: 'Type a query above, or search with empty query to browse all'}
|
||||
</p>
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => handleSearch('')}
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
>
|
||||
<Star size={14} strokeWidth={2.5} />
|
||||
{mode === 'github' ? 'Browse Popular Skills' : 'Browse All Skills'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import { queryKeys, staleTimes } from '../lib/queryKeys';
|
||||
import Badge from '../components/Badge';
|
||||
import Card from '../components/Card';
|
||||
import CopyButton from '../components/CopyButton';
|
||||
import HandButton from '../components/HandButton';
|
||||
import Button from '../components/Button';
|
||||
import { PageSkeleton } from '../components/Skeleton';
|
||||
import { useToast } from '../components/Toast';
|
||||
import ConfirmDialog from '../components/ConfirmDialog';
|
||||
@@ -354,7 +354,7 @@ export default function SkillDetailPage() {
|
||||
<Card>
|
||||
{hasManifest && (
|
||||
<div
|
||||
className="mb-4 p-4 border-2 border-dashed border-pencil-light/40 bg-postit/35"
|
||||
className="mb-4 p-4 border-2 border-dashed border-pencil-light/40 bg-surface"
|
||||
style={{ borderRadius: radius.sm }}
|
||||
>
|
||||
<p
|
||||
@@ -458,7 +458,7 @@ export default function SkillDetailPage() {
|
||||
{/* Actions */}
|
||||
<div className="flex gap-2 mt-4 pt-4 border-t-2 border-dashed border-pencil-light/30">
|
||||
{(skill.isInRepo || skill.source) && (
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => handleUpdate()}
|
||||
disabled={updating}
|
||||
variant="secondary"
|
||||
@@ -467,9 +467,9 @@ export default function SkillDetailPage() {
|
||||
>
|
||||
<RefreshCw size={14} strokeWidth={2.5} className={updating ? 'animate-spin' : ''} />
|
||||
{updating ? 'Updating...' : 'Update'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
)}
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => setConfirmDelete(true)}
|
||||
disabled={deleting}
|
||||
variant="danger"
|
||||
@@ -482,7 +482,7 @@ export default function SkillDetailPage() {
|
||||
: skill.isInRepo
|
||||
? 'Uninstall Repo'
|
||||
: 'Uninstall'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import { VirtuosoGrid } from 'react-virtuoso';
|
||||
import type { GridComponents } from 'react-virtuoso';
|
||||
import { queryKeys, staleTimes } from '../lib/queryKeys';
|
||||
import Badge from '../components/Badge';
|
||||
import { HandInput, HandSelect } from '../components/HandInput';
|
||||
import { Input, Select } from '../components/Input';
|
||||
import { PageSkeleton } from '../components/Skeleton';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
import Card from '../components/Card';
|
||||
@@ -341,7 +341,7 @@ export default function SkillsPage() {
|
||||
strokeWidth={2.5}
|
||||
className="absolute left-4 top-1/2 -translate-y-1/2 text-muted-dark pointer-events-none"
|
||||
/>
|
||||
<HandInput
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="Filter skills..."
|
||||
value={search}
|
||||
@@ -351,7 +351,7 @@ export default function SkillsPage() {
|
||||
</div>
|
||||
<div className="flex items-center gap-2 sm:w-52">
|
||||
<ArrowUpDown size={16} strokeWidth={2.5} className="text-pencil-light shrink-0" />
|
||||
<HandSelect
|
||||
<Select
|
||||
value={sortType}
|
||||
onChange={(v) => setSortType(v as SortType)}
|
||||
options={[
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
import { Virtuoso } from 'react-virtuoso';
|
||||
import Card from '../components/Card';
|
||||
import Badge from '../components/Badge';
|
||||
import HandButton from '../components/HandButton';
|
||||
import Button from '../components/Button';
|
||||
import { useToast } from '../components/Toast';
|
||||
import { api, type SyncResult, type DiffTarget } from '../api/client';
|
||||
import { queryKeys } from '../lib/queryKeys';
|
||||
@@ -140,7 +140,7 @@ export default function SyncPage() {
|
||||
{/* Visual Pipeline */}
|
||||
<div className="hidden md:flex items-center justify-center gap-4 mb-8">
|
||||
<div
|
||||
className="flex items-center gap-2 px-4 py-2 bg-postit border-2 border-pencil"
|
||||
className="flex items-center gap-2 px-4 py-2 bg-paper border-2 border-pencil"
|
||||
style={{ borderRadius: radius.sm, boxShadow: shadows.sm }}
|
||||
>
|
||||
<Folder size={18} strokeWidth={2.5} className="text-warning" />
|
||||
@@ -237,7 +237,7 @@ export default function SyncPage() {
|
||||
)}
|
||||
|
||||
{/* Big sync button */}
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={handleSync}
|
||||
disabled={syncing}
|
||||
variant="primary"
|
||||
@@ -250,7 +250,7 @@ export default function SyncPage() {
|
||||
className={syncing ? 'animate-spin' : ''}
|
||||
/>
|
||||
{syncing ? 'Syncing...' : dryRun ? 'Preview Sync' : 'Sync Now'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
|
||||
{/* Advanced options toggle */}
|
||||
<button
|
||||
|
||||
@@ -4,8 +4,8 @@ import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { Trash2, Plus, Target, ArrowDownToLine, Search, CircleDot, PenLine, AlertTriangle, Filter } from 'lucide-react';
|
||||
import Card from '../components/Card';
|
||||
import StatusBadge from '../components/StatusBadge';
|
||||
import HandButton from '../components/HandButton';
|
||||
import { HandInput, HandSelect } from '../components/HandInput';
|
||||
import Button from '../components/Button';
|
||||
import { Input, Select } from '../components/Input';
|
||||
import FilterTagInput from '../components/FilterTagInput';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
import ConfirmDialog from '../components/ConfirmDialog';
|
||||
@@ -119,7 +119,7 @@ export default function TargetsPage() {
|
||||
{targets.length} target{targets.length !== 1 ? 's' : ''} configured
|
||||
</p>
|
||||
</div>
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => {
|
||||
if (adding) {
|
||||
setAdding(false);
|
||||
@@ -135,7 +135,7 @@ export default function TargetsPage() {
|
||||
>
|
||||
<Plus size={16} strokeWidth={2.5} />
|
||||
{adding ? 'Cancel' : 'Add Target'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* Add target form */}
|
||||
@@ -166,16 +166,16 @@ export default function TargetsPage() {
|
||||
{shortenHome(newTarget.path)}
|
||||
</p>
|
||||
</div>
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => setNewTarget({ name: '', path: '' })}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
>
|
||||
Change
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<HandInput
|
||||
<Input
|
||||
label="Path (customize if needed)"
|
||||
type="text"
|
||||
value={newTarget.path}
|
||||
@@ -184,11 +184,11 @@ export default function TargetsPage() {
|
||||
/>
|
||||
|
||||
<div className="flex gap-3">
|
||||
<HandButton onClick={handleAdd} variant="primary" size="sm">
|
||||
<Button onClick={handleAdd} variant="primary" size="sm">
|
||||
<Plus size={16} strokeWidth={2.5} />
|
||||
Add Target
|
||||
</HandButton>
|
||||
<HandButton
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setAdding(false);
|
||||
setNewTarget({ name: '', path: '' });
|
||||
@@ -199,20 +199,20 @@ export default function TargetsPage() {
|
||||
size="sm"
|
||||
>
|
||||
Cancel
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
) : customMode ? (
|
||||
/* Custom target entry mode */
|
||||
<div className="space-y-4 animate-fade-in">
|
||||
<HandInput
|
||||
<Input
|
||||
label="Target Name"
|
||||
type="text"
|
||||
value={newTarget.name}
|
||||
onChange={(e) => setNewTarget({ ...newTarget, name: e.target.value })}
|
||||
placeholder="my-custom-target"
|
||||
/>
|
||||
<HandInput
|
||||
<Input
|
||||
label="Path"
|
||||
type="text"
|
||||
value={newTarget.path}
|
||||
@@ -220,11 +220,11 @@ export default function TargetsPage() {
|
||||
placeholder="/path/to/target/skills"
|
||||
/>
|
||||
<div className="flex gap-3">
|
||||
<HandButton onClick={handleAdd} variant="primary" size="sm">
|
||||
<Button onClick={handleAdd} variant="primary" size="sm">
|
||||
<Plus size={16} strokeWidth={2.5} />
|
||||
Add Target
|
||||
</HandButton>
|
||||
<HandButton
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setCustomMode(false);
|
||||
setNewTarget({ name: '', path: '' });
|
||||
@@ -233,8 +233,8 @@ export default function TargetsPage() {
|
||||
size="sm"
|
||||
>
|
||||
Back to picker
|
||||
</HandButton>
|
||||
<HandButton
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setAdding(false);
|
||||
setNewTarget({ name: '', path: '' });
|
||||
@@ -245,7 +245,7 @@ export default function TargetsPage() {
|
||||
size="sm"
|
||||
>
|
||||
Cancel
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
@@ -342,7 +342,7 @@ export default function TargetsPage() {
|
||||
<PenLine size={14} strokeWidth={2.5} />
|
||||
Enter custom target
|
||||
</button>
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={() => {
|
||||
setAdding(false);
|
||||
setNewTarget({ name: '', path: '' });
|
||||
@@ -353,7 +353,7 @@ export default function TargetsPage() {
|
||||
size="sm"
|
||||
>
|
||||
Cancel
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
@@ -394,7 +394,7 @@ export default function TargetsPage() {
|
||||
<span className="text-sm text-pencil-light">
|
||||
Sync mode:
|
||||
</span>
|
||||
<HandSelect
|
||||
<Select
|
||||
value={target.mode || 'merge'}
|
||||
onChange={async (mode) => {
|
||||
try {
|
||||
@@ -437,7 +437,7 @@ export default function TargetsPage() {
|
||||
)}
|
||||
</div>
|
||||
{editingFilter === target.name && (
|
||||
<div className="mt-3 p-3 bg-postit/40 border-2 border-dashed border-muted-dark animate-fade-in" style={{ borderRadius: radius.md }}>
|
||||
<div className="mt-3 p-3 bg-surface border-2 border-dashed border-muted-dark animate-fade-in" style={{ borderRadius: radius.md }}>
|
||||
<div className="space-y-3">
|
||||
<FilterTagInput
|
||||
label="Include patterns"
|
||||
@@ -452,7 +452,7 @@ export default function TargetsPage() {
|
||||
color="danger"
|
||||
/>
|
||||
<div className="flex gap-2">
|
||||
<HandButton
|
||||
<Button
|
||||
onClick={async () => {
|
||||
setSavingFilter(true);
|
||||
try {
|
||||
@@ -474,14 +474,14 @@ export default function TargetsPage() {
|
||||
disabled={savingFilter}
|
||||
>
|
||||
{savingFilter ? 'Saving...' : 'Save'}
|
||||
</HandButton>
|
||||
<HandButton
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => setEditingFilter(null)}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
>
|
||||
Cancel
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -531,10 +531,10 @@ export default function TargetsPage() {
|
||||
description="Add a target to start syncing your skills."
|
||||
action={
|
||||
!adding ? (
|
||||
<HandButton onClick={() => setAdding(true)} variant="secondary" size="sm">
|
||||
<Button onClick={() => setAdding(true)} variant="secondary" size="sm">
|
||||
<Plus size={16} strokeWidth={2.5} />
|
||||
Add Your First Target
|
||||
</HandButton>
|
||||
</Button>
|
||||
) : undefined
|
||||
}
|
||||
/>
|
||||
@@ -580,7 +580,7 @@ function TargetPickerItem({
|
||||
return (
|
||||
<button
|
||||
onClick={() => onSelect(target)}
|
||||
className="w-full text-left px-3 py-2.5 flex items-center gap-3 border-b border-muted/60 hover:bg-postit/40 transition-colors cursor-pointer group"
|
||||
className="w-full text-left px-3 py-2.5 flex items-center gap-3 border-b border-muted/60 hover:bg-muted/20 transition-colors cursor-pointer group"
|
||||
>
|
||||
{isDetected ? (
|
||||
<span className="w-2.5 h-2.5 rounded-full bg-success shrink-0" />
|
||||
|
||||
@@ -12,7 +12,7 @@ import { queryKeys, staleTimes } from '../lib/queryKeys';
|
||||
import { useAppContext } from '../context/AppContext';
|
||||
import { formatSize } from '../lib/format';
|
||||
import Card from '../components/Card';
|
||||
import HandButton from '../components/HandButton';
|
||||
import Button from '../components/Button';
|
||||
import Badge from '../components/Badge';
|
||||
import ConfirmDialog from '../components/ConfirmDialog';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
@@ -146,13 +146,13 @@ export default function TrashPage() {
|
||||
)}
|
||||
</div>
|
||||
{items.length > 0 && (
|
||||
<HandButton
|
||||
<Button
|
||||
variant="danger"
|
||||
size="lg"
|
||||
onClick={() => setEmptyOpen(true)}
|
||||
>
|
||||
<Trash2 size={18} strokeWidth={2.5} /> Empty Trash
|
||||
</HandButton>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</Card>
|
||||
@@ -277,12 +277,12 @@ function TrashCard({
|
||||
|
||||
{/* Actions */}
|
||||
<div className="border-t border-dashed border-pencil-light/40 pt-3 flex gap-2">
|
||||
<HandButton variant="secondary" size="sm" onClick={onRestore}>
|
||||
<Button variant="secondary" size="sm" onClick={onRestore}>
|
||||
<RotateCcw size={14} strokeWidth={2.5} /> Restore
|
||||
</HandButton>
|
||||
<HandButton variant="ghost" size="sm" onClick={onDelete}>
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm" onClick={onDelete}>
|
||||
<X size={14} strokeWidth={2.5} /> Delete
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
+16
-16
@@ -5,8 +5,8 @@ import {
|
||||
Circle, CheckCircle, XCircle, MinusCircle, ShieldAlert,
|
||||
} from 'lucide-react';
|
||||
import Card from '../components/Card';
|
||||
import HandButton from '../components/HandButton';
|
||||
import { HandCheckbox } from '../components/HandInput';
|
||||
import Button from '../components/Button';
|
||||
import { Checkbox } from '../components/Input';
|
||||
import Badge from '../components/Badge';
|
||||
import { queryKeys } from '../lib/queryKeys';
|
||||
import { useToast } from '../components/Toast';
|
||||
@@ -239,7 +239,7 @@ export default function UpdatePage() {
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
{phase === 'idle' && (
|
||||
<HandButton
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={runCheck}
|
||||
@@ -247,13 +247,13 @@ export default function UpdatePage() {
|
||||
>
|
||||
<RefreshCw size={16} className={checking ? 'animate-spin' : ''} />
|
||||
Check Now
|
||||
</HandButton>
|
||||
</Button>
|
||||
)}
|
||||
{phase === 'idle' && hasUpdates && totalSelected > 0 && (
|
||||
<HandButton onClick={handleUpdate}>
|
||||
<Button onClick={handleUpdate}>
|
||||
<ArrowUpCircle size={16} />
|
||||
Update Selected ({totalSelected})
|
||||
</HandButton>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -281,9 +281,9 @@ export default function UpdatePage() {
|
||||
)}
|
||||
</div>
|
||||
{phase === 'done' && (
|
||||
<HandButton variant="ghost" size="sm" onClick={handleDone}>
|
||||
<Button variant="ghost" size="sm" onClick={handleDone}>
|
||||
Done
|
||||
</HandButton>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</Card>
|
||||
@@ -342,7 +342,7 @@ export default function UpdatePage() {
|
||||
All tracked repositories and skills are at their latest versions.
|
||||
</p>
|
||||
<div className="mt-4">
|
||||
<HandButton
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={runCheck}
|
||||
@@ -350,7 +350,7 @@ export default function UpdatePage() {
|
||||
>
|
||||
<RefreshCw size={16} className={checking ? 'animate-spin' : ''} />
|
||||
Check Again
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
@@ -362,9 +362,9 @@ export default function UpdatePage() {
|
||||
<h2 className="text-lg font-bold text-pencil">
|
||||
Tracked Repositories ({updatableRepos.length})
|
||||
</h2>
|
||||
<HandButton variant="ghost" size="sm" onClick={selectAllRepos}>
|
||||
<Button variant="ghost" size="sm" onClick={selectAllRepos}>
|
||||
{selectedRepos.size === updatableRepos.length ? 'Deselect All' : 'Select All'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
{updatableRepos.map((repo) => (
|
||||
@@ -373,7 +373,7 @@ export default function UpdatePage() {
|
||||
className="flex items-center gap-3 px-3 py-2 border border-pencil/10"
|
||||
style={{ borderRadius: radius.sm }}
|
||||
>
|
||||
<HandCheckbox label="" checked={selectedRepos.has(repo.name)} onChange={() => toggleRepo(repo.name)} />
|
||||
<Checkbox label="" checked={selectedRepos.has(repo.name)} onChange={() => toggleRepo(repo.name)} />
|
||||
<div className="flex-1 min-w-0">
|
||||
<span className="text-pencil font-medium block">
|
||||
{repo.name}
|
||||
@@ -395,9 +395,9 @@ export default function UpdatePage() {
|
||||
<h2 className="text-lg font-bold text-pencil">
|
||||
Skills with Updates ({updatableSkills.length})
|
||||
</h2>
|
||||
<HandButton variant="ghost" size="sm" onClick={selectAllSkills}>
|
||||
<Button variant="ghost" size="sm" onClick={selectAllSkills}>
|
||||
{selectedSkills.size === updatableSkills.length ? 'Deselect All' : 'Select All'}
|
||||
</HandButton>
|
||||
</Button>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
{updatableSkills.map((skill) => (
|
||||
@@ -406,7 +406,7 @@ export default function UpdatePage() {
|
||||
className="flex items-center gap-3 px-3 py-2 border border-pencil/10"
|
||||
style={{ borderRadius: radius.sm }}
|
||||
>
|
||||
<HandCheckbox label="" checked={selectedSkills.has(skill.name)} onChange={() => toggleSkill(skill.name)} />
|
||||
<Checkbox label="" checked={selectedSkills.has(skill.name)} onChange={() => toggleSkill(skill.name)} />
|
||||
<div className="flex-1 min-w-0">
|
||||
<span className="text-pencil font-medium block">
|
||||
{skill.name}
|
||||
|
||||
Reference in New Issue
Block a user