From bc0da072ee669f9143f62ccf1fe736f49b7552eb Mon Sep 17 00:00:00 2001 From: Denozordec Date: Fri, 26 Jun 2026 15:57:11 +0700 Subject: [PATCH] =?UTF-8?q?fix(web):=20SelectField=20=D0=B8=D1=81=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5=D1=82=20=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D0=BD=D0=B4=D0=B0=D1=80=D1=82=D0=BD=D1=8B=D0=B5=20shadcn=20Sel?= =?UTF-8?q?ect-=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D1=8B=20=D1=81=20w-full?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SelectField переписан на переиспользование Select/SelectTrigger/ SelectValue/SelectContent/SelectItem из @cfdm/ui (вместо дубля стилей) - triggerClassName по умолчанию w-full — триггер виден в формах (для horizontal field в settings передаётся w-32) - items prop в Select.Root — SelectValue рендерит label выбранного элемента Co-authored-by: Cursor --- apps/web/src/components/select-field.tsx | 98 ++++++------------------ 1 file changed, 24 insertions(+), 74 deletions(-) diff --git a/apps/web/src/components/select-field.tsx b/apps/web/src/components/select-field.tsx index 8c49680..5016589 100644 --- a/apps/web/src/components/select-field.tsx +++ b/apps/web/src/components/select-field.tsx @@ -1,11 +1,14 @@ import * as React from 'react' -import { - Select as SelectPrimitive, - type SelectRootProps, -} from '@base-ui/react/select' +import type { SelectRootProps } from '@base-ui/react/select' +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@cfdm/ui/components/select' import { cn } from '@cfdm/ui/lib/utils' -import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from 'lucide-react' export interface SelectOption { value: string @@ -32,76 +35,23 @@ export function SelectField({ onValueChange, ...props }: SelectFieldProps) { - const items = React.useMemo(() => options.map((o) => ({ value: o.value, label: o.label })), [options]) + const items = React.useMemo( + () => options.map((o) => ({ value: o.value, label: o.label })), + [options], + ) return ( - - - - } - /> - - - - - - - - - {options.map((opt) => ( - - - {opt.label} - - - } - > - - - - ))} - - - - - - - - + ) }