feat(color-swatch-component): ColorSwatch (single color preview circle) [tsc:fail]
This commit is contained in:
parent
63c191b6f8
commit
4e241a8e05
@ -1,9 +1,10 @@
|
||||
{
|
||||
"completed_features": [],
|
||||
"current_feature": "number-input-component",
|
||||
"current_feature": "color-swatch-component",
|
||||
"started_at": "2026-05-23T10:33:26.504299",
|
||||
"attempted_features": [
|
||||
"date-input-component",
|
||||
"time-input-component"
|
||||
"time-input-component",
|
||||
"number-input-component"
|
||||
]
|
||||
}
|
||||
@ -4484,3 +4484,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.
|
||||
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>,
|
||||
- `10:34:14` **INFO** Committed feature number-input-component
|
||||
- `10:34:15` **INFO** Pushed: rc=0
|
||||
|
||||
## Phase-3 Feature: color-swatch-component (2026-05-23 10:34:15)
|
||||
|
||||
- `10:34:15` **INFO** Description: ColorSwatch (single color preview circle)
|
||||
- `10:34:15` **INFO** Generating apps/web/src/components/ColorSwatch.tsx (ColorSwatch-Component. Props: color (hex), size?: 'sm'|'md'|'lg', sele…)
|
||||
- `10:34:21` **INFO** wrote 767 chars in 6.4s (attempt 1)
|
||||
- `10:34:21` **INFO** Running tsc --noEmit on api…
|
||||
- `10:34:23` **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>,
|
||||
|
||||
38
apps/web/src/components/ColorSwatch.tsx
Normal file
38
apps/web/src/components/ColorSwatch.tsx
Normal file
@ -0,0 +1,38 @@
|
||||
import React from 'react';
|
||||
|
||||
interface ColorSwatchProps {
|
||||
color: string;
|
||||
size?: 'sm' | 'md' | 'lg';
|
||||
selected?: boolean;
|
||||
onClick?: () => void;
|
||||
}
|
||||
|
||||
const sizeMap = {
|
||||
sm: 'w-4 h-4',
|
||||
md: 'w-6 h-6',
|
||||
lg: 'w-8 h-8',
|
||||
};
|
||||
|
||||
const ColorSwatch: React.FC<ColorSwatchProps> = ({
|
||||
color,
|
||||
size = 'md',
|
||||
selected = false,
|
||||
onClick,
|
||||
}) => {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClick}
|
||||
className={`
|
||||
${sizeMap[size]}
|
||||
rounded-full border border-black/10 transition-transform hover:scale-110 active:scale-95
|
||||
${selected ? 'ring-2 ring-offset-2 ring-blue-500' : ''}
|
||||
`}
|
||||
style={{ backgroundColor: color }}
|
||||
title={color}
|
||||
aria-label={`Select color ${color}`}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default ColorSwatch;
|
||||
Loading…
Reference in New Issue
Block a user