fix: demo build & upgrades (#2848)

This commit is contained in:
KinfeMichael Tariku
2025-05-31 00:22:02 -07:00
committed by GitHub
parent 77c38594bb
commit 06ca627a6a
26 changed files with 10418 additions and 16051 deletions

View File

@@ -1,13 +1,8 @@
"use client";
import * as React from "react";
import {
CaretSortIcon,
CheckIcon,
ChevronDownIcon,
ChevronUpIcon,
} from "@radix-ui/react-icons";
import * as SelectPrimitive from "@radix-ui/react-select";
import { Check, ChevronDown, ChevronUp, ChevronsUpDown } from "lucide-react";
import { cn } from "@/lib/utils";
@@ -17,37 +12,30 @@ const SelectGroup = SelectPrimitive.Group;
const SelectValue = SelectPrimitive.Value;
const SelectTrigger = ({
ref,
className,
children,
...props
}: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> & {
ref: React.RefObject<React.ElementRef<typeof SelectPrimitive.Trigger>>;
}) => (
const SelectTrigger = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
>(({ className, children, ...props }, ref) => (
<SelectPrimitive.Trigger
ref={ref}
className={cn(
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
className,
)}
{...props}
>
{children}
<SelectPrimitive.Icon asChild>
<CaretSortIcon className="h-4 w-4 opacity-50" />
<ChevronsUpDown className="size-4 opacity-50" />
</SelectPrimitive.Icon>
</SelectPrimitive.Trigger>
);
));
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
const SelectScrollUpButton = ({
ref,
className,
...props
}: React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton> & {
ref: React.RefObject<React.ElementRef<typeof SelectPrimitive.ScrollUpButton>>;
}) => (
const SelectScrollUpButton = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
>(({ className, ...props }, ref) => (
<SelectPrimitive.ScrollUpButton
ref={ref}
className={cn(
@@ -56,20 +44,15 @@ const SelectScrollUpButton = ({
)}
{...props}
>
<ChevronUpIcon />
<ChevronUp className="h-4 w-4" />
</SelectPrimitive.ScrollUpButton>
);
));
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
const SelectScrollDownButton = ({
ref,
className,
...props
}: React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton> & {
ref: React.RefObject<
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>
>;
}) => (
const SelectScrollDownButton = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
>(({ className, ...props }, ref) => (
<SelectPrimitive.ScrollDownButton
ref={ref}
className={cn(
@@ -78,21 +61,16 @@ const SelectScrollDownButton = ({
)}
{...props}
>
<ChevronDownIcon />
<ChevronDown className="h-4 w-4" />
</SelectPrimitive.ScrollDownButton>
);
));
SelectScrollDownButton.displayName =
SelectPrimitive.ScrollDownButton.displayName;
const SelectContent = ({
ref,
className,
children,
position = "popper",
...props
}: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & {
ref: React.RefObject<React.ElementRef<typeof SelectPrimitive.Content>>;
}) => (
const SelectContent = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
>(({ className, children, position = "popper", ...props }, ref) => (
<SelectPrimitive.Portal>
<SelectPrimitive.Content
ref={ref}
@@ -118,32 +96,25 @@ const SelectContent = ({
<SelectScrollDownButton />
</SelectPrimitive.Content>
</SelectPrimitive.Portal>
);
));
SelectContent.displayName = SelectPrimitive.Content.displayName;
const SelectLabel = ({
ref,
className,
...props
}: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label> & {
ref: React.RefObject<React.ElementRef<typeof SelectPrimitive.Label>>;
}) => (
const SelectLabel = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Label>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
>(({ className, ...props }, ref) => (
<SelectPrimitive.Label
ref={ref}
className={cn("px-2 py-1.5 text-sm font-semibold", className)}
{...props}
/>
);
));
SelectLabel.displayName = SelectPrimitive.Label.displayName;
const SelectItem = ({
ref,
className,
children,
...props
}: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {
ref: React.RefObject<React.ElementRef<typeof SelectPrimitive.Item>>;
}) => (
const SelectItem = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
>(({ className, children, ...props }, ref) => (
<SelectPrimitive.Item
ref={ref}
className={cn(
@@ -154,27 +125,24 @@ const SelectItem = ({
>
<span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
<SelectPrimitive.ItemIndicator>
<CheckIcon className="h-4 w-4" />
<Check className="h-4 w-4" />
</SelectPrimitive.ItemIndicator>
</span>
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
</SelectPrimitive.Item>
);
));
SelectItem.displayName = SelectPrimitive.Item.displayName;
const SelectSeparator = ({
ref,
className,
...props
}: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator> & {
ref: React.RefObject<React.ElementRef<typeof SelectPrimitive.Separator>>;
}) => (
const SelectSeparator = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Separator>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
>(({ className, ...props }, ref) => (
<SelectPrimitive.Separator
ref={ref}
className={cn("-mx-1 my-1 h-px bg-muted", className)}
{...props}
/>
);
));
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
export {