feat(chip-component): Chip mit dismiss-Button [tsc:fail]

This commit is contained in:
Dennis (via Claude+Gemma) 2026-05-23 10:09:26 +02:00
parent fa9cd8971c
commit ad737de1c3
3 changed files with 101 additions and 2 deletions

View File

@ -1,9 +1,10 @@
{ {
"completed_features": [], "completed_features": [],
"current_feature": "rating-component", "current_feature": "chip-component",
"started_at": "2026-05-23T10:08:26.899213", "started_at": "2026-05-23T10:08:26.899213",
"attempted_features": [ "attempted_features": [
"spinner-component", "spinner-component",
"slider-component" "slider-component",
"rating-component"
] ]
} }

View File

@ -4089,3 +4089,21 @@ 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. 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>'. 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>, Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,
- `10:08:59` **INFO** Committed feature rating-component
- `10:09:00` **INFO** Pushed: rc=0
## Phase-3 Feature: chip-component (2026-05-23 10:09:00)
- `10:09:00` **INFO** Description: Chip mit dismiss-Button
- `10:09:00` **INFO** Generating apps/web/src/components/Chip.tsx (Chip-Component. Props: label, onDismiss?, icon?, variant?: 'default'|'…)
- `10:09:24` **INFO** wrote 2323 chars in 24.5s (attempt 1)
- `10:09:24` **INFO** Running tsc --noEmit on api…
- `10:09:26` **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,80 @@
import React from 'react';
import { LucideIcon } from 'lucide-react';
interface ChipProps {
label: string;
onDismiss?: () => void;
icon?: LucideIcon;
variant?: 'default' | 'outlined' | 'solid';
color?: 'primary' | 'secondary' | 'danger' | 'success' | 'warning';
}
const colorMap = {
primary: {
default: 'bg-blue-100 text-blue-700 border-blue-200',
outlined: 'bg-transparent text-blue-600 border-blue-600',
solid: 'bg-blue-600 text-white border-blue-600',
},
secondary: {
default: 'bg-slate-100 text-slate-700 border-slate-200',
outlined: 'bg-transparent text-slate-600 border-slate-600',
solid: 'bg-slate-600 text-white border-slate-600',
},
danger: {
default: 'bg-red-100 text-red-700 border-red-200',
outlined: 'bg-transparent text-red-600 border-red-600',
solid: 'bg-red-600 text-white border-red-600',
},
success: {
default: 'bg-green-100 text-green-700 border-green-200',
outlined: 'bg-transparent text-green-600 border-green-600',
solid: 'bg-green-600 text-white border-green-600',
},
warning: {
default: 'bg-yellow-100 text-yellow-700 border-yellow-200',
outlined: 'bg-transparent text-yellow-600 border-yellow-600',
solid: 'bg-yellow-600 text-white border-yellow-600',
},
};
export default function Chip({
label,
onDismiss,
icon: Icon,
variant = 'default',
color = 'primary',
}: ChipProps) {
const colorClasses = colorMap[color][variant];
return (
<div
className={`
inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full border text-sm font-medium transition-colors
${colorClasses}
`}
>
{Icon && <Icon className="w-3.5 h-3.5" />}
<span>{label}</span>
{onDismiss && (
<button
onClick={(e) => {
e.stopPropagation();
onDismiss();
}}
className="ml-0.5 p-0.5 rounded-full hover:bg-black/10 transition-colors"
aria-label={`Remove ${label}`}
>
<svg
className="w-3 h-3"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
strokeWidth={2.5}
>
<path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
)}
</div>
);
}