diff --git a/lib/components/Button/index.tsx b/lib/components/Button/index.tsx index 100c5df..6cad4fa 100644 --- a/lib/components/Button/index.tsx +++ b/lib/components/Button/index.tsx @@ -17,7 +17,7 @@ const buttonVariants = cva( 'transition-colors', 'focus-visible:outline-none', 'focus-visible:ring-2', - 'focus-visible:ring-ring', + 'focus-visible:ring-carmine-500', 'focus-visible:ring-offset-2', 'disabled:pointer-events-none', 'disabled:opacity-50', diff --git a/lib/components/Checkbox/index.tsx b/lib/components/Checkbox/index.tsx index fb471d4..1839e91 100644 --- a/lib/components/Checkbox/index.tsx +++ b/lib/components/Checkbox/index.tsx @@ -19,7 +19,7 @@ const Checkbox = forwardRef< ( = { + title: 'Components/Select', + component: Select, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], +} + +export default meta + +type Story = StoryObj + +export const Default: Story = { + args: {}, + render: (args) => ( + + ), +} diff --git a/lib/components/Select/index.tsx b/lib/components/Select/index.tsx new file mode 100644 index 0000000..a2a541e --- /dev/null +++ b/lib/components/Select/index.tsx @@ -0,0 +1,160 @@ +'use client' + +import * as SelectPrimitive from '@radix-ui/react-select' +import { Check, ChevronDown, ChevronUp } from 'lucide-react' +import * as React from 'react' + +import { cn } from '@/utils' + +const Select = SelectPrimitive.Root + +const SelectGroup = SelectPrimitive.Group + +const SelectValue = SelectPrimitive.Value + +const SelectTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + span]:line-clamp-1', + className + )} + {...props} + > + {children} + + + + +)) +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 +>(({ className, children, position = 'popper', ...props }, ref) => ( + + + + + {children} + + + + +)) +SelectContent.displayName = SelectPrimitive.Content.displayName + +const SelectLabel = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +SelectLabel.displayName = SelectPrimitive.Label.displayName + +const SelectItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + + + + + + {children} + +)) +SelectItem.displayName = SelectPrimitive.Item.displayName + +const SelectSeparator = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +SelectSeparator.displayName = SelectPrimitive.Separator.displayName + +export { + Select, + SelectGroup, + SelectValue, + SelectTrigger, + SelectContent, + SelectLabel, + SelectItem, + SelectSeparator, + SelectScrollUpButton, + SelectScrollDownButton, +} diff --git a/lib/components/Switch/index.tsx b/lib/components/Switch/index.tsx index 856325f..4a77a28 100644 --- a/lib/components/Switch/index.tsx +++ b/lib/components/Switch/index.tsx @@ -11,7 +11,7 @@ export const Switch = React.forwardRef< >(({ className, ...props }, ref) => ( ( )}