Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/docs/src/remix-hook-form/password-field.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"]') ||
Expand All @@ -136,15 +136,15 @@ 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();

// 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();
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 4 additions & 2 deletions packages/components/src/remix-hook-form/form-error.tsx
Original file line number Diff line number Diff line change
@@ -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<FormErrorFieldProps, 'control'> & {
export type FormErrorProps = {
name?: string;
className?: string;
components?: Partial<FieldComponents>;
};

export function FormError({ name = '_form', ...props }: FormErrorProps) {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/ui/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ function Calendar({
}: React.ComponentProps<typeof DayPicker> & {
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
}) {

return (
<DayPicker
showOutsideDays={showOutsideDays}
Expand Down Expand Up @@ -47,7 +46,8 @@ function Calendar({
),
month_caption: 'flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)',
dropdowns: 'w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5',
dropdown_root: 'relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md',
dropdown_root:
'relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md',
dropdown: 'absolute inset-0 opacity-0',
caption_label: cn(
'select-none font-medium',
Expand Down