mirror of
https://github.com/ershisan99/DevToysWeb.git
synced 2026-01-03 04:59:25 +00:00
chore: upgrade to react 19 beta and next 14 canary
This commit is contained in:
@@ -1,29 +1,22 @@
|
||||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
import { ComponentProps } from "react";
|
||||
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
||||
|
||||
import { cn } from "@/lib/style";
|
||||
|
||||
const ToggleGroup = React.forwardRef<
|
||||
React.ElementRef<typeof ToggleGroupPrimitive.Root>,
|
||||
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<ToggleGroupPrimitive.Root
|
||||
ref={ref}
|
||||
className={cn("flex items-center gap-2.5", className)}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
const ToggleGroup = ({ className, ...props }: ComponentProps<typeof ToggleGroupPrimitive.Root>) => (
|
||||
<ToggleGroupPrimitive.Root className={cn("flex items-center gap-2.5", className)} {...props} />
|
||||
);
|
||||
|
||||
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
||||
|
||||
const ToggleGroupItem = React.forwardRef<
|
||||
React.ElementRef<typeof ToggleGroupPrimitive.Item>,
|
||||
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item>
|
||||
>(({ className, children, ...props }, ref) => (
|
||||
const ToggleGroupItem = ({
|
||||
className,
|
||||
children,
|
||||
...props
|
||||
}: ComponentProps<typeof ToggleGroupPrimitive.Item>) => (
|
||||
<ToggleGroupPrimitive.Item
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"focus-visible:ring-ring inline-flex h-10 items-center justify-center rounded-md bg-accent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-sky-600 data-[state=on]:text-white",
|
||||
className
|
||||
@@ -32,8 +25,6 @@ const ToggleGroupItem = React.forwardRef<
|
||||
>
|
||||
{children}
|
||||
</ToggleGroupPrimitive.Item>
|
||||
));
|
||||
|
||||
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
||||
);
|
||||
|
||||
export { ToggleGroup, ToggleGroupItem };
|
||||
|
||||
Reference in New Issue
Block a user