diff --git a/.phase42-state.json b/.phase42-state.json index 0baa6f0..0022ee7 100644 --- a/.phase42-state.json +++ b/.phase42-state.json @@ -1,8 +1,9 @@ { "completed_features": [], - "current_feature": "context-menu-component", + "current_feature": "popover-component", "started_at": "2026-05-23T10:28:27.180963", "attempted_features": [ - "button-group-component" + "button-group-component", + "context-menu-component" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 645142c..7da1cc0 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -4387,3 +4387,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' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Type 'Promise' provides no match for the signature '(instance: FastifyInstance, +- `10:29:02` **INFO** Committed feature context-menu-component +- `10:29:02` **INFO** Pushed: rc=0 + +## Phase-3 Feature: popover-component (2026-05-23 10:29:02) + +- `10:29:02` **INFO** Description: Popover (klick-getriggert) +- `10:29:02` **INFO** Generating apps/web/src/components/Popover.tsx (Popover-Component. Props: trigger (ReactNode), content (ReactNode), po…) +- `10:29:22` **INFO** wrote 2117 chars in 19.8s (attempt 1) +- `10:29:22` **INFO** Running tsc --noEmit on api… +- `10:29:24` **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' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, diff --git a/apps/web/src/components/Popover.tsx b/apps/web/src/components/Popover.tsx new file mode 100644 index 0000000..87181d2 --- /dev/null +++ b/apps/web/src/components/Popover.tsx @@ -0,0 +1,58 @@ +import React, { useState, useRef, useEffect } from 'react'; +import type { ReactNode } from 'react'; + +interface PopoverProps { + trigger: ReactNode; + content: ReactNode; + position?: 'top' | 'bottom' | 'left' | 'right'; +} + +export default function Popover({ trigger, content, position = 'bottom' }: PopoverProps) { + const [isOpen, setIsOpen] = useState(false); + const containerRef = useRef(null); + + useEffect(() => { + function handleClickOutside(event: MouseEvent) { + if (containerRef.current && !containerRef.current.contains(event.target as Node)) { + setIsOpen(false); + } + } + if (isOpen) { + document.addEventListener('mousedown', handleClickOutside); + } + return () => document.removeEventListener('mousedown', handleClickOutside); + }, [isOpen]); + + const positionClasses = { + top: 'bottom-full left-1/2 -translate-x-1/2 mb-2', + bottom: 'top-full left-1/2 -translate-x-1/2 mt-2', + left: 'right-full top-1/2 -translate-y-1/2 mr-2', + right: 'left-full top-1/2 -translate-y-1/2 ml-2', + }; + + const arrowClasses = { + top: 'bottom-[-4px] left-1/2 -translate-x-1/2 border-t-gray-200 border-x-transparent border-b-transparent', + bottom: 'top-[-4px] left-1/2 -translate-x-1/2 border-b-gray-200 border-x-transparent border-t-transparent', + left: 'right-[-4px] top-1/2 -translate-y-1/2 border-l-gray-200 border-y-transparent border-r-transparent', + right: 'left-[-4px] top-1/2 -translate-y-1/2 border-r-gray-200 border-y-transparent border-l-transparent', + }; + + return ( +
+
setIsOpen(!isOpen)} className="cursor-pointer"> + {trigger} +
+ + {isOpen && ( +
+ {/* Arrow */} +
+ +
+ {content} +
+
+ )} +
+ ); +} \ No newline at end of file