import type React from 'react'; import type { InlineHelpTextProps } from '~/components/InlineHelpText'; export type MaxHeight = 'none' | 'fill-available' | 'fit-content' | 'max-content' | 'min-content'; export type Width = 'auto' | 'fit-content' | '100%' | 'inherit' | 'max-content' | 'min-content'; export interface ItemProps { /** * Whether item is disabled. Will prevent clicking. */ disabled?: boolean; /** * Whether this item is currently highlighted (hover over or keyboard nav) */ isHighlighted?: boolean; /** * Whether this item is currently selected/active */ isSelected?: boolean; /** * The text label to be shown for the item */ label: string; /** * If a url is given, each item will be rendered as an anchor with a href to that url */ url?: string; } export type ItemRenderer = (item: T) => React.ReactNode; export type SelectItemHandler = (selectedItem: T, index: number, e: React.MouseEvent | KeyboardEvent) => void; interface DropdownHandleComponent

{ component: React.ComponentType

; props: P; } export type ContainerElement = HTMLDivElement | null; export type ActivatorElement = HTMLDivElement | HTMLButtonElement | null; export interface DropdownPopperProps { children: (props: InjectedDropdownPopperProps) => JSX.Element; rightAlign?: boolean; autoUpdate?: boolean; fluidDropdownList?: DropdownProps['fluidDropdownList']; } interface InjectedDropdownPopperProps { hostRef: React.Ref; floatingRef: React.Ref; floatingStyles: React.CSSProperties; } export interface DropdownProps> extends React.AriaAttributes { /** * Label describing this dropdown for screen readers to read aloud */ ariaLabel: string; children: React.ReactNode; /** * Whether the dropdown should close when the user clicks outside * or presses the Escape key */ closeOnOutsideClick?: boolean; /** * Whether the dropdown functionality is disabled. * If it is disabled, it cannot be opened. */ disabled?: boolean; /** * When defined renders `Dropdown` with error styles and error text below. */ error?: InlineHelpTextProps['error']; /** * JSX or string of the selected item to render within the dropdown handle * Note: No need to add the Down/Up caret; they're handled by the Dropdown component */ displayValue?: React.ReactNode; /** * React component to render instead of the default dropdown handle. * `displayValue` and `placeholder` values will be rendered inside of this * e.g. a fully bordered Block or a Button */ dropdownHandle?: DropdownHandleComponent; /** * Enables dropdown to stretch to full width of parent container */ fluidWidth?: boolean; /** * Enables dropdown list to stretch to full width of the Dropdown handle. */ fluidDropdownList?: boolean; /** * If you're providing your own button via dropdownHandle, use this to avoid nesting