feat(input-component): Input mit Label + Error-State [tsc:fail]

This commit is contained in:
Dennis (via Claude+Gemma) 2026-05-23 09:58:44 +02:00
parent dea538987b
commit f086436ec4
5 changed files with 199 additions and 1 deletions

View File

@ -5,6 +5,7 @@
"attempted_features": [
"dropdown-menu-component",
"checkbox-component",
"switch-toggle-component"
"switch-toggle-component",
"radio-group-component"
]
}

5
.phase36-state.json Normal file
View File

@ -0,0 +1,5 @@
{
"completed_features": [],
"current_feature": "input-component",
"started_at": "2026-05-23T09:58:25.839766"
}

View File

@ -3870,3 +3870,28 @@ src/index.ts(27,25): error TS2769: No overload matches this call.
Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,
- `09:54:27` **INFO** Committed feature radio-group-component
- `09:54:27` **INFO** Pushed: rc=0
## Phase-35 Run beendet (2026-05-23 09:54:27)
- `09:54:27` **INFO** OK: 0, Attempted: 4, Total: 4
## 🚀 Phase-36 Codegen-Run gestartet (2026-05-23 09:58:25)
## Phase-3 Feature: input-component (2026-05-23 09:58:25)
- `09:58:25` **INFO** Description: Input mit Label + Error-State
- `09:58:25` **INFO** Generating apps/web/src/components/Input.tsx (Input-Component. Props: value, onChange, label?, error?, placeholder?,…)
- `09:58:42` **INFO** wrote 1862 chars in 16.7s (attempt 1)
- `09:58:42` **INFO** Running tsc --noEmit on api…
- `09:58:44` **WARN** tsc errors:
src/db/schema.ts(37,14): error TS7022: 'customers' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
src/db/schema.ts(45,59): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
src/db/schema.ts(49,14): error TS7022: 'projects' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
src/db/schema.ts(53,56): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
src/index.ts(27,25): error TS2769: No overload matches this call.
Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,

View File

@ -0,0 +1,70 @@
import React, { InputHTMLAttributes } from 'react';
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
label?: string;
error?: string;
leftIcon?: React.ReactNode;
rightIcon?: React.ReactNode;
}
const Input: React.FC<InputProps> = ({
label,
error,
placeholder,
type = 'text',
leftIcon,
rightIcon,
disabled,
className = '',
...props
}) => {
return (
<div className="flex flex-col gap-1.5 w-full">
{label && (
<label className="text-sm font-medium text-gray-700 dark:text-gray-300">
{label}
</label>
)}
<div className="relative flex items-center">
{leftIcon && (
<div className="absolute left-3 flex items-center pointer-events-none text-gray-400">
{leftIcon}
</div>
)}
<input
type={type}
placeholder={placeholder}
disabled={disabled}
className={`
w-full px-3 py-2 bg-white dark:bg-gray-900 border rounded-md outline-none transition-all
${leftIcon ? 'pl-10' : ''}
${rightIcon ? 'pr-10' : ''}
${error
? 'border-red-500 focus:ring-red-500'
: 'border-gray-300 dark:border-gray-700 focus:ring-2 focus:ring-blue-500 border-transparent focus:border-blue-500'
}
${disabled ? 'opacity-50 cursor-not-allowed bg-gray-100 dark:bg-gray-800' : ''}
${className}
`}
{...props}
/>
{rightIcon && (
<div className="absolute right-3 flex items-center pointer-events-none text-gray-400">
{rightIcon}
</div>
)}
</div>
{error && (
<span className="text-xs text-red-500 font-medium">
{error}
</span>
)}
</div>
);
};
export default Input;

View File

@ -0,0 +1,97 @@
#!/usr/bin/env python3
"""Phase-36: standalone form inputs — Input, Textarea, Select, SearchBox."""
from __future__ import annotations
import asyncio, datetime, json, sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
from phase2_features import Feature, FileGen, ROOT, log, log_section
from phase3_features import run_feature_v2
PHASE_STATE = ROOT / ".phase36-state.json"
FEATURES: list[Feature] = [
Feature(
name="input-component",
description="Input mit Label + Error-State",
files=[FileGen(
path="apps/web/src/components/Input.tsx",
purpose=(
"Input-Component. Props: value, onChange, label?, error?, placeholder?, type?, leftIcon?, rightIcon?, disabled?. "
"Wrapper-div mit Label oben, Input mit optional Icons left/right (absolute positioned + Input padding), "
"Error-Text rot drunter wenn error. focus:ring-2 ring-blue-500, border-red-500 wenn error. Tailwind. Export default."
),
)],
),
Feature(
name="textarea-component",
description="Textarea mit auto-resize + char-count",
files=[FileGen(
path="apps/web/src/components/Textarea.tsx",
purpose=(
"Textarea-Component. Props: value, onChange, label?, error?, placeholder?, rows? (default 4), maxLength?, autoResize?: boolean. "
"Wenn autoResize: useEffect setzt height = scrollHeight. Wenn maxLength: zeigt char-count rechts unten ({value.length}/{maxLength}). "
"Tailwind. Export default."
),
)],
),
Feature(
name="select-component",
description="Select mit custom-styling",
files=[FileGen(
path="apps/web/src/components/Select.tsx",
purpose=(
"Select-Component. Props: value, onChange, options (array {value, label, disabled?}), label?, placeholder?, error?, disabled?. "
"Native <select> styled mit Tailwind appearance-none + custom ChevronDown-Icon rechts (lucide-react). "
"Label oben + error rot drunter. Export default."
),
)],
),
Feature(
name="search-box-component",
description="SearchBox mit clear-button",
files=[FileGen(
path="apps/web/src/components/SearchBox.tsx",
purpose=(
"SearchBox-Component. Props: value, onChange, placeholder? (default 'Suchen...'), onClear?. "
"Input mit Search-Icon (lucide-react) links + X-Button rechts wenn value (klick → onChange('') und onClear?()). "
"Tailwind. Export default."
),
)],
),
]
def load_state():
if PHASE_STATE.exists():
return json.loads(PHASE_STATE.read_text())
return {"completed_features": [], "current_feature": None, "started_at": datetime.datetime.now().isoformat()}
def save_state(state):
PHASE_STATE.write_text(json.dumps(state, indent=2))
async def main():
log_section("🚀 Phase-36 Codegen-Run gestartet")
state = load_state()
for feature in FEATURES:
if feature.name in state.get("completed_features", []):
continue
state["current_feature"] = feature.name; save_state(state)
try:
success = await run_feature_v2(feature)
state.setdefault("completed_features" if success else "attempted_features", []).append(feature.name)
save_state(state)
except Exception as e:
log(f"{feature.name} crashed: {e}", level="ERROR")
state.setdefault("attempted_features", []).append(feature.name); save_state(state)
log_section("Phase-36 Run beendet")
log(f"OK: {len(state.get('completed_features', []))}, Attempted: {len(state.get('attempted_features', []))}, Total: {len(FEATURES)}")
return 0
if __name__ == "__main__":
sys.exit(asyncio.run(main()))