chore(ui): general updates and fixes to TSDocs and types (#10753)

This commit is contained in:
Shahed Nasser
2025-01-06 14:22:27 +02:00
committed by GitHub
parent c440068d49
commit 3253e19b36
5 changed files with 162 additions and 27 deletions
@@ -82,6 +82,7 @@ const triggerVariants = cva({
/**
* The trigger that toggles the select.
* It's based on [Radix UI Select Trigger](https://www.radix-ui.com/primitives/docs/components/select#trigger).
*/
const Trigger = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Trigger>,
@@ -104,19 +105,35 @@ const Trigger = React.forwardRef<
})
Trigger.displayName = "Select.Trigger"
interface SelectContentProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> {
}
/**
* The content that appears when the select is open.
* It's based on [Radix UI Select Content](https://www.radix-ui.com/primitives/docs/components/select#content).
*/
const Content = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
SelectContentProps
>(
(
{
className,
children,
/**
* Whether to show the select items below (`popper`) or over (`item-aligned`) the select input.
*/
position = "popper",
/**
* The distance of the content pop-up in pixels from the select input. Only available when position is set to popper.
*/
sideOffset = 8,
/**
* The distance in pixels from the boundary edges where collision detection should occur. Only available when position is set to popper.
*/
collisionPadding = 24,
...props
},
}: SelectContentProps,
ref
) => (
<SelectPrimitive.Portal>
@@ -155,6 +172,7 @@ Content.displayName = "Select.Content"
/**
* Used to label a group of items.
* It's based on [Radix UI Select Label](https://www.radix-ui.com/primitives/docs/components/select#label).
*/
const Label = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Label>,