|
1 | 1 | import type { Autocomplete as _Autocomplete } from '@base-ui/react/autocomplete'; |
2 | 2 | import type { ReactElement } from 'react'; |
3 | 3 | import type { ComponentProps } from '../../../utils/types'; |
| 4 | +import type { ItemPopupWidthProps } from '../../../utils/css/item-popup'; |
4 | 5 |
|
5 | 6 | export type AutocompleteCollectionProps = _Autocomplete.Collection.Props; |
6 | 7 |
|
@@ -61,24 +62,25 @@ export type AutocompleteListBodyProps = ComponentProps< 'div' > & { |
61 | 62 |
|
62 | 63 | export type AutocompletePopupProps = ComponentProps< |
63 | 64 | typeof _Autocomplete.Popup |
64 | | -> & { |
65 | | - children?: React.ReactNode; |
66 | | - /** |
67 | | - * Optional portal element, typically `<Autocomplete.Portal />` with custom |
68 | | - * `container`. When omitted, `Autocomplete.Popup` uses |
69 | | - * `Autocomplete.Portal` with default props. Do not pass `children` on the |
70 | | - * portal element; they would be ignored. |
71 | | - */ |
72 | | - portal?: ReactElement< Omit< PortalProps, 'children' > >; |
73 | | - /** |
74 | | - * Optional positioner element, typically `<Autocomplete.Positioner />` |
75 | | - * with custom positioning props (`side`, `align`, `sideOffset`, collision |
76 | | - * settings, etc.). When omitted, `Autocomplete.Popup` uses |
77 | | - * `Autocomplete.Positioner` with default props. Do not pass `children` on |
78 | | - * the positioner element; they would be ignored. |
79 | | - */ |
80 | | - positioner?: ReactElement< Omit< PositionerProps, 'children' > >; |
81 | | -}; |
| 65 | +> & |
| 66 | + ItemPopupWidthProps & { |
| 67 | + children?: React.ReactNode; |
| 68 | + /** |
| 69 | + * Optional portal element, typically `<Autocomplete.Portal />` with custom |
| 70 | + * `container`. When omitted, `Autocomplete.Popup` uses |
| 71 | + * `Autocomplete.Portal` with default props. Do not pass `children` on the |
| 72 | + * portal element; they would be ignored. |
| 73 | + */ |
| 74 | + portal?: ReactElement< Omit< PortalProps, 'children' > >; |
| 75 | + /** |
| 76 | + * Optional positioner element, typically `<Autocomplete.Positioner />` |
| 77 | + * with custom positioning props (`side`, `align`, `sideOffset`, collision |
| 78 | + * settings, etc.). When omitted, `Autocomplete.Popup` uses |
| 79 | + * `Autocomplete.Positioner` with default props. Do not pass `children` on |
| 80 | + * the positioner element; they would be ignored. |
| 81 | + */ |
| 82 | + positioner?: ReactElement< Omit< PositionerProps, 'children' > >; |
| 83 | + }; |
82 | 84 |
|
83 | 85 | export type AutocompleteRootProps< Value = unknown > = |
84 | 86 | _Autocomplete.Root.Props< Value >; |
|
0 commit comments