From 16c472a5551ccc0f6ba64c3a4512aaf2deff1efc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 Aug 2025 01:23:09 +0000 Subject: [PATCH 1/3] Initial plan From c5811da83869d2dff29e9d5f1b3f5518e73481d0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 Aug 2025 01:33:46 +0000 Subject: [PATCH 2/3] Fix FormError component to make name prop truly optional with default '_form' Co-authored-by: jaruesink <4207065+jaruesink@users.noreply.github.com> --- apps/docs/src/remix-hook-form/password-field.stories.tsx | 6 +++--- package.json | 5 +---- packages/components/package.json | 4 +--- packages/components/src/remix-hook-form/form-error.tsx | 6 ++++-- packages/components/src/ui/calendar.tsx | 4 ++-- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/apps/docs/src/remix-hook-form/password-field.stories.tsx b/apps/docs/src/remix-hook-form/password-field.stories.tsx index 8024e6e2..5d91b126 100644 --- a/apps/docs/src/remix-hook-form/password-field.stories.tsx +++ b/apps/docs/src/remix-hook-form/password-field.stories.tsx @@ -123,7 +123,7 @@ const testDefaultValues = ({ canvas }: StoryContext) => { const testPasswordVisibilityToggle = async ({ canvas }: StoryContext) => { const passwordInput = canvas.getByLabelText('Password'); - + // Find the toggle button within the same form item as the password input const formItem = passwordInput.closest('[class*="FormItem"], .form-item, [data-testid="form-item"]') || @@ -136,7 +136,7 @@ const testPasswordVisibilityToggle = async ({ canvas }: StoryContext) => { // Click toggle to show password await userEvent.click(toggleButton); expect(passwordInput).toHaveAttribute('type', 'text'); - + // Find the hide button for the same field const hideButton = formItem?.querySelector('button[aria-label="Hide password"]') as HTMLElement; expect(hideButton).toBeInTheDocument(); @@ -144,7 +144,7 @@ const testPasswordVisibilityToggle = async ({ canvas }: StoryContext) => { // Click toggle to hide password again await userEvent.click(hideButton); expect(passwordInput).toHaveAttribute('type', 'password'); - + // Verify show button is back const showButtonAgain = formItem?.querySelector('button[aria-label="Show password"]') as HTMLElement; expect(showButtonAgain).toBeInTheDocument(); diff --git a/package.json b/package.json index 1a9afef4..16f2631c 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,7 @@ "name": "forms", "version": "0.2.0", "private": true, - "workspaces": [ - "apps/*", - "packages/*" - ], + "workspaces": ["apps/*", "packages/*"], "scripts": { "start": "yarn dev", "dev": "turbo run dev", diff --git a/packages/components/package.json b/packages/components/package.json index cd1945a4..6f2a5061 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -18,9 +18,7 @@ "import": "./dist/ui/index.js" } }, - "files": [ - "dist" - ], + "files": ["dist"], "scripts": { "prepublishOnly": "yarn run build", "build": "vite build", diff --git a/packages/components/src/remix-hook-form/form-error.tsx b/packages/components/src/remix-hook-form/form-error.tsx index a4a322c6..15c56bdf 100644 --- a/packages/components/src/remix-hook-form/form-error.tsx +++ b/packages/components/src/remix-hook-form/form-error.tsx @@ -1,9 +1,11 @@ import { useRemixFormContext } from 'remix-hook-form'; +import type { FieldComponents } from '../ui/form'; import { FormErrorField } from '../ui/form-error-field'; -import type { FormErrorFieldProps } from '../ui/form-error-field'; -export type FormErrorProps = Omit & { +export type FormErrorProps = { name?: string; + className?: string; + components?: Partial; }; export function FormError({ name = '_form', ...props }: FormErrorProps) { diff --git a/packages/components/src/ui/calendar.tsx b/packages/components/src/ui/calendar.tsx index 928b571a..8feb8baa 100644 --- a/packages/components/src/ui/calendar.tsx +++ b/packages/components/src/ui/calendar.tsx @@ -17,7 +17,6 @@ function Calendar({ }: React.ComponentProps & { buttonVariant?: React.ComponentProps['variant']; }) { - return ( Date: Thu, 7 Aug 2025 04:22:45 +0000 Subject: [PATCH 3/3] Patch components package to v0.19.2 - Fixed FormError component TypeScript error by making name prop truly optional - Resolved type conflict between Omit and intersection types - Enables usage without props: - Maintains backward compatibility with existing code Co-authored-by: Jake Ruesink --- packages/components/package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 6f2a5061..c8eb783b 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@lambdacurry/forms", - "version": "0.19.1", + "version": "0.19.2", "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -18,7 +18,9 @@ "import": "./dist/ui/index.js" } }, - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "prepublishOnly": "yarn run build", "build": "vite build",