UNPKG

@snowball-tech/fractal

Version:

Fractal's (Snowball's design system) React component library based on RadixUI and PandaCSS

59 lines (56 loc) 1.89 kB
import { SelectContentProps } from '@radix-ui/react-select'; import { AllHTMLAttributes, ReactNode } from 'react'; type CombinedRefs = { container: HTMLDivElement | null; dropdown: HTMLDivElement | null; trigger: HTMLButtonElement | null; }; interface SelectProps extends Omit<AllHTMLAttributes<HTMLSelectElement>, 'label' | 'onSelect'> { autoFocus?: boolean; children?: ReactNode; defaultValue?: string; description?: ReactNode; disabled?: boolean; displayedValue?: ReactNode; dropdown?: Partial<{ className?: string; } & Omit<SelectContentProps, 'asChild'>>; fullWidth?: boolean; id?: string; label?: ReactNode; labelElement?: keyof HTMLElementTagNameMap; name?: string; open?: boolean; placeholder?: string; portalled?: boolean; rainbow?: boolean; readOnly?: boolean; required?: boolean; value?: string; onClose?: () => void; onOpen?: () => void; onSelect?: (newValue: string) => void; } interface SelectEmptyProps extends Omit<AllHTMLAttributes<HTMLDivElement>, 'label'> { children?: ReactNode; label?: ReactNode; labelElement?: keyof HTMLElementTagNameMap; value?: string; } interface SelectItemProps extends Omit<AllHTMLAttributes<HTMLDivElement>, 'label'> { value: string; children?: ReactNode; disabled?: boolean; label?: ReactNode; labelElement?: keyof HTMLElementTagNameMap; rainbow?: boolean; } interface SelectItemGroupProps extends Omit<AllHTMLAttributes<HTMLDivElement>, 'label'> { children: ReactNode; label: ReactNode; disabled?: boolean; labelElement?: keyof HTMLElementTagNameMap; rainbow?: boolean; } type SelectItemSeparatorProps = AllHTMLAttributes<HTMLDivElement>; export type { CombinedRefs, SelectEmptyProps, SelectItemGroupProps, SelectItemProps, SelectItemSeparatorProps, SelectProps };