refactor(ui): seçim bileşeninin görsel etkileşimini modernize et.

This commit is contained in:
2026-01-09 18:26:46 +03:00
parent 8089a816ad
commit 79068c0faa
5 changed files with 48 additions and 9 deletions

View File

@@ -51,7 +51,17 @@ export const Select = SelectPrimitive.Root;
export const SelectGroup = SelectPrimitive.Group;
export const SelectValue = SelectPrimitive.Value;
export const SelectValue = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Value>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>
>(({ className, ...props }, ref) => (
<SelectPrimitive.Value
ref={ref}
className={clsx("block truncate", className)}
{...props}
/>
));
SelectValue.displayName = "SelectValue";
export const SelectLabel = SelectPrimitive.Label;
@@ -62,14 +72,14 @@ export const SelectTrigger = React.forwardRef<
<SelectPrimitive.Trigger
ref={ref}
className={clsx(
"flex h-10 w-full items-center justify-between gap-2 rounded-md border border-slate-200 bg-white px-3 text-sm text-slate-700 shadow-sm transition focus:outline-none focus:ring-2 focus:ring-slate-300 data-[placeholder]:text-slate-400",
"inline-flex h-10 flex-shrink-0 items-center justify-between gap-2 whitespace-nowrap rounded-md border border-slate-200 bg-white px-3 py-2 text-sm text-slate-700 shadow-sm transition focus:outline-none focus:ring-2 focus:ring-slate-300 data-[placeholder]:text-slate-400 disabled:cursor-not-allowed disabled:opacity-50 [&_[data-radix-select-trigger-icon-wrapper]]:shrink-0",
className
)}
{...props}
>
<span className="line-clamp-1">{children}</span>
{children}
<SelectPrimitive.Icon asChild>
<ChevronDown className="h-4 w-4 text-slate-400" />
<ChevronDown className="h-4 w-4 shrink-0 opacity-50" />
</SelectPrimitive.Icon>
</SelectPrimitive.Trigger>
));
@@ -117,7 +127,9 @@ export const SelectContent = React.forwardRef<
<SelectPrimitive.Content
ref={ref}
className={clsx(
"relative z-50 max-h-72 min-w-[8rem] overflow-hidden rounded-md border border-slate-200 bg-white text-slate-700 shadow-md",
"relative z-50 max-h-72 overflow-hidden rounded-md border border-slate-200 bg-white text-slate-700 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
position === "popper" &&
"min-w-[var(--radix-select-trigger-width)] w-[var(--radix-select-trigger-width)] data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
className
)}
position={position}
@@ -129,7 +141,7 @@ export const SelectContent = React.forwardRef<
className={clsx(
"p-1",
position === "popper" &&
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
"h-[var(--radix-select-trigger-height)] w-full"
)}
>
{children}

View File

@@ -352,10 +352,10 @@ export const TimerPage = () => {
}
}}
>
<SelectTrigger className="h-9 w-[180px] text-xs">
<SelectTrigger className="h-9 w-[180px] flex-shrink-0 text-xs">
<SelectValue />
</SelectTrigger>
<SelectContent align="end">
<SelectContent>
{sortOptions.map((option) => (
<SelectItem
key={option.value}