diff --git a/packages/ui/index.tsx b/packages/ui/index.tsx index bcf64fc3426..75119789ad8 100644 --- a/packages/ui/index.tsx +++ b/packages/ui/index.tsx @@ -173,6 +173,8 @@ export { SelectSeparator as SelectSeparator_Shadcn_, SelectTrigger as SelectTrigger_Shadcn_, SelectValue as SelectValue_Shadcn_, + SelectScrollUpButton as SelectScrollUpButton_Shadcn_, + SelectScrollDownButton as SelectScrollDownButton_Shadcn_, } from './src/components/shadcn/ui/select' export { diff --git a/packages/ui/src/components/shadcn/ui/select.tsx b/packages/ui/src/components/shadcn/ui/select.tsx index 2f873d79d30..db47bfe45f3 100644 --- a/packages/ui/src/components/shadcn/ui/select.tsx +++ b/packages/ui/src/components/shadcn/ui/select.tsx @@ -1,7 +1,7 @@ 'use client' import * as SelectPrimitive from '@radix-ui/react-select' -import { Check, ChevronDown } from 'lucide-react' +import { Check, ChevronDown, ChevronUp } from 'lucide-react' import * as React from 'react' import { cn } from '../../../lib/utils/cn' @@ -47,6 +47,40 @@ const SelectTrigger = React.forwardRef< )) SelectTrigger.displayName = SelectPrimitive.Trigger.displayName +const SelectScrollUpButton = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + +)) +SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName + +const SelectScrollDownButton = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + +)) +SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName + const SelectContent = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef @@ -55,13 +89,15 @@ const SelectContent = React.forwardRef< + {children} + )) @@ -82,7 +119,10 @@ const SelectLabel = React.forwardRef< >(({ className, ...props }, ref) => ( )) @@ -96,7 +136,7 @@ const SelectItem = React.forwardRef< ref={ref} className={cn( 'group', - 'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-xs outline-none focus:bg-overlay-hover text-foreground-lighter focus:text-foreground data-[state=checked]:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', + 'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-xs outline-none focus:bg-overlay-hover text-foreground-light focus:text-foreground data-[state=checked]:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className )} {...props} @@ -133,4 +173,6 @@ export { SelectSeparator, SelectTrigger, SelectValue, + SelectScrollUpButton, + SelectScrollDownButton, }