Skip to content
Draft
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
8 changes: 3 additions & 5 deletions apps/docs/src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ export interface ButtonProps
asChild?: boolean;
}

const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
function Button({ ref, className, variant, size, asChild = false, ...props }: ButtonProps & { ref?: React.Ref<HTMLButtonElement> }) {
const Comp = asChild ? Slot : 'button';
return (
<Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
);
}
);
}

Button.displayName = 'Button';

export { Button, buttonVariants };
4 changes: 2 additions & 2 deletions apps/expo-nativewind/app/(components)/navigation-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,6 @@ const ListItem = React.forwardRef<
</Text>
</NavigationMenuLink>
</View>
);
});
}

ListItem.displayName = 'ListItem';
14 changes: 6 additions & 8 deletions apps/expo-nativewind/components/ui/accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const Accordion = React.forwardRef<
<Animated.View layout={LinearTransition.duration(200)}>{children}</Animated.View>
</AccordionPrimitive.Root>
</LayoutAnimationConfig>
);
});
}

Accordion.displayName = AccordionPrimitive.Root.displayName;

Expand All @@ -44,8 +43,8 @@ const AccordionItem = React.forwardRef<
{...props}
/>
</Animated.View>
);
});
}

AccordionItem.displayName = AccordionPrimitive.Item.displayName;

const Trigger = Platform.OS === 'web' ? View : Pressable;
Expand Down Expand Up @@ -82,8 +81,8 @@ const AccordionTrigger = React.forwardRef<
</AccordionPrimitive.Trigger>
</AccordionPrimitive.Header>
</TextClassContext.Provider>
);
});
}

AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;

const AccordionContent = React.forwardRef<
Expand Down Expand Up @@ -119,8 +118,7 @@ function InnerContent({ children, className }: { children: React.ReactNode; clas
>
{children}
</Animated.View>
);
}
}

AccordionContent.displayName = AccordionPrimitive.Content.displayName;

Expand Down
10 changes: 4 additions & 6 deletions apps/expo-nativewind/components/ui/alert-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ const AlertDialogOverlayWeb = React.forwardRef<
{...props}
ref={ref}
/>
);
});
}

AlertDialogOverlayWeb.displayName = 'AlertDialogOverlayWeb';

Expand All @@ -48,8 +47,7 @@ const AlertDialogOverlayNative = React.forwardRef<
{children}
</Animated.View>
</AlertDialogPrimitive.Overlay>
);
});
}

AlertDialogOverlayNative.displayName = 'AlertDialogOverlayNative';

Expand Down Expand Up @@ -80,8 +78,8 @@ const AlertDialogContent = React.forwardRef<
/>
</AlertDialogOverlay>
</AlertDialogPortal>
);
});
}

AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;

const AlertDialogHeader = ({
Expand Down
5 changes: 2 additions & 3 deletions apps/expo-nativewind/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ const Button = React.forwardRef<React.ElementRef<typeof Pressable>, ButtonProps>
{...props}
/>
</TextClassContext.Provider>
);
}
);
}

Button.displayName = 'Button';

export { Button, buttonTextVariants, buttonVariants };
Expand Down
4 changes: 2 additions & 2 deletions apps/expo-nativewind/components/ui/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const Checkbox = React.forwardRef<
/>
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
);
});
}

Checkbox.displayName = CheckboxPrimitive.Root.displayName;

export { Checkbox };
12 changes: 6 additions & 6 deletions apps/expo-nativewind/components/ui/context-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const ContextMenuSubTrigger = React.forwardRef<
<Icon size={18} className='ml-auto text-foreground' />
</ContextMenuPrimitive.SubTrigger>
</TextClassContext.Provider>
);
});
}

ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;

const ContextMenuSubContent = React.forwardRef<
Expand All @@ -64,8 +64,8 @@ const ContextMenuSubContent = React.forwardRef<
)}
{...props}
/>
);
});
}

ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;

const ContextMenuContent = React.forwardRef<
Expand Down Expand Up @@ -105,8 +105,8 @@ const ContextMenuContent = React.forwardRef<
/>
</ContextMenuPrimitive.Overlay>
</ContextMenuPrimitive.Portal>
);
});
}

ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;

const ContextMenuItem = React.forwardRef<
Expand Down
10 changes: 4 additions & 6 deletions apps/expo-nativewind/components/ui/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ const DialogOverlayWeb = React.forwardRef<
{...props}
ref={ref}
/>
);
});
}

DialogOverlayWeb.displayName = 'DialogOverlayWeb';

Expand All @@ -48,8 +47,7 @@ const DialogOverlayNative = React.forwardRef<
<>{children}</>
</Animated.View>
</DialogPrimitive.Overlay>
);
});
}

DialogOverlayNative.displayName = 'DialogOverlayNative';

Expand Down Expand Up @@ -91,8 +89,8 @@ const DialogContent = React.forwardRef<
</DialogPrimitive.Content>
</DialogOverlay>
</DialogPortal>
);
});
}

DialogContent.displayName = DialogPrimitive.Content.displayName;

const DialogHeader = ({ className, ...props }: React.ComponentPropsWithoutRef<typeof View>) => (
Expand Down
12 changes: 6 additions & 6 deletions apps/expo-nativewind/components/ui/dropdown-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const DropdownMenuSubTrigger = React.forwardRef<
<Icon size={18} className='ml-auto text-foreground' />
</DropdownMenuPrimitive.SubTrigger>
</TextClassContext.Provider>
);
});
}

DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;

const DropdownMenuSubContent = React.forwardRef<
Expand All @@ -70,8 +70,8 @@ const DropdownMenuSubContent = React.forwardRef<
)}
{...props}
/>
);
});
}

DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;

const DropdownMenuContent = React.forwardRef<
Expand Down Expand Up @@ -111,8 +111,8 @@ const DropdownMenuContent = React.forwardRef<
/>
</DropdownMenuPrimitive.Overlay>
</DropdownMenuPrimitive.Portal>
);
});
}

DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;

const DropdownMenuItem = React.forwardRef<
Expand Down
4 changes: 2 additions & 2 deletions apps/expo-nativewind/components/ui/hover-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ const HoverCardContent = React.forwardRef<
</Animated.View>
</HoverCardPrimitive.Overlay>
</HoverCardPrimitive.Portal>
);
});
}

HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;

export { HoverCard, HoverCardContent, HoverCardTrigger };
3 changes: 1 addition & 2 deletions apps/expo-nativewind/components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const Input = React.forwardRef<
placeholderClassName={cn('text-muted-foreground', placeholderClassName)}
{...props}
/>
);
});
}

Input.displayName = 'Input';

Expand Down
16 changes: 8 additions & 8 deletions apps/expo-nativewind/components/ui/menubar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ const MenubarTrigger = React.forwardRef<
)}
{...props}
/>
);
});
}

MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;

const MenubarSubTrigger = React.forwardRef<
Expand Down Expand Up @@ -83,8 +83,8 @@ const MenubarSubTrigger = React.forwardRef<
<Icon size={18} className='ml-auto text-foreground' />
</MenubarPrimitive.SubTrigger>
</TextClassContext.Provider>
);
});
}

MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;

const MenubarSubContent = React.forwardRef<
Expand All @@ -104,8 +104,8 @@ const MenubarSubContent = React.forwardRef<
)}
{...props}
/>
);
});
}

MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;

const MenubarContent = React.forwardRef<
Expand All @@ -128,8 +128,8 @@ const MenubarContent = React.forwardRef<
{...props}
/>
</MenubarPrimitive.Portal>
);
});
}

MenubarContent.displayName = MenubarPrimitive.Content.displayName;

const MenubarItem = React.forwardRef<
Expand Down
16 changes: 8 additions & 8 deletions apps/expo-nativewind/components/ui/navigation-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ const NavigationMenuTrigger = React.forwardRef<
/>
</Animated.View>
</NavigationMenuPrimitive.Trigger>
);
});
}

NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;

const NavigationMenuContent = React.forwardRef<
Expand Down Expand Up @@ -118,8 +118,8 @@ const NavigationMenuContent = React.forwardRef<
</Animated.View>
</NavigationMenuPrimitive.Content>
</NavigationMenuPrimitive.Portal>
);
});
}

NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;

const NavigationMenuLink = NavigationMenuPrimitive.Link;
Expand All @@ -141,8 +141,8 @@ const NavigationMenuViewport = React.forwardRef<
<NavigationMenuPrimitive.Viewport />
</View>
</View>
);
});
}

NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;

const NavigationMenuIndicator = React.forwardRef<
Expand All @@ -164,8 +164,8 @@ const NavigationMenuIndicator = React.forwardRef<
>
<View className='relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md shadow-foreground/5' />
</NavigationMenuPrimitive.Indicator>
);
});
}

NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;

export {
Expand Down
4 changes: 2 additions & 2 deletions apps/expo-nativewind/components/ui/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const PopoverContent = React.forwardRef<
</Animated.View>
</PopoverPrimitive.Overlay>
</PopoverPrimitive.Portal>
);
});
}

PopoverContent.displayName = PopoverPrimitive.Content.displayName;

export { Popover, PopoverContent, PopoverTrigger };
4 changes: 2 additions & 2 deletions apps/expo-nativewind/components/ui/progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const Progress = React.forwardRef<
>
<Indicator value={value} className={indicatorClassName} />
</ProgressPrimitive.Root>
);
});
}

Progress.displayName = ProgressPrimitive.Root.displayName;

export { Progress };
Expand Down
8 changes: 4 additions & 4 deletions apps/expo-nativewind/components/ui/radio-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const RadioGroup = React.forwardRef<
>(({ className, ...props }, ref) => {
return (
<RadioGroupPrimitive.Root className={cn('web:grid gap-2', className)} {...props} ref={ref} />
);
});
}

RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;

const RadioGroupItem = React.forwardRef<
Expand All @@ -31,8 +31,8 @@ const RadioGroupItem = React.forwardRef<
<View className='aspect-square h-[9px] w-[9px] native:h-[10] native:w-[10] bg-primary rounded-full' />
</RadioGroupPrimitive.Indicator>
</RadioGroupPrimitive.Item>
);
});
}

RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;

export { RadioGroup, RadioGroupItem };
4 changes: 2 additions & 2 deletions apps/expo-nativewind/components/ui/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ const SelectContent = React.forwardRef<
</Animated.View>
</SelectPrimitive.Overlay>
</SelectPrimitive.Portal>
);
});
}

SelectContent.displayName = SelectPrimitive.Content.displayName;

const SelectLabel = React.forwardRef<
Expand Down
4 changes: 2 additions & 2 deletions apps/expo-nativewind/components/ui/switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ const SwitchNative = React.forwardRef<
</Animated.View>
</SwitchPrimitives.Root>
</Animated.View>
);
});
}

SwitchNative.displayName = 'SwitchNative';

const Switch = Platform.select({
Expand Down
Loading