import type { ComponentProps, ReactNode } from 'react' import { Field, FieldDescription, FieldLabel } from '@evobgp/ui/components/field' import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, } from '@evobgp/ui/components/select' import { cn } from '@evobgp/ui/lib/utils' export type SelectMenuItem = { value: T label: ReactNode disabled?: boolean } type SelectRootProps = ComponentProps export interface SelectMenuProps extends Omit { items: ReadonlyArray> value?: T | null defaultValue?: T | null onValueChange?: (value: T | null) => void placeholder?: string id?: string triggerClassName?: string contentClassName?: string size?: 'sm' | 'default' side?: ComponentProps['side'] } /** ReUI c-select-4: `items` на Root, опции в `SelectGroup`. */ export function SelectMenu({ items, placeholder, id, triggerClassName, contentClassName, size = 'default', side, value, defaultValue, onValueChange, ...selectProps }: SelectMenuProps) { return ( ) } export interface SelectFieldProps extends SelectMenuProps { label?: ReactNode description?: ReactNode fieldClassName?: string } export function SelectField({ label, description, fieldClassName, id, ...menuProps }: SelectFieldProps) { return ( {label ? {label} : null} {description ? ( typeof description === 'string' ? ( {description} ) : ( description ) ) : null} ) }