Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

updated styles on dropdown

Jonathan Summers-Muir41b6d5afe4a3
diff --git a/package-lock.json b/package-lock.json
index 5d7e33ef8ad..904e00a4ce2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -80354,7 +80354,7 @@
"@radix-ui/react-label": "^2.0.1",
"@radix-ui/react-popover": "^1.0.4",
"@radix-ui/react-portal": "^1.0.1",
- "@radix-ui/react-select": "*",
+ "@radix-ui/react-select": "^1.2.1",
"@radix-ui/react-slot": "^1.0.1",
"@radix-ui/react-tabs": "^1.0.2",
"@storybook/addon-actions": "^7.0.5",
diff --git a/packages/ui/src/components/shadcn/dropdown-menu.tsx b/packages/ui/src/components/shadcn/dropdown-menu.tsx
index 5d6d2d03b87..367f8272719 100644
--- a/packages/ui/src/components/shadcn/dropdown-menu.tsx
+++ b/packages/ui/src/components/shadcn/dropdown-menu.tsx
@@ -1,5 +1,9 @@
'use client'
+/**
+ * started to update classnames with custom ones
+ */
+
import * as React from 'react'
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'
import { Check, ChevronRight, Circle } from 'lucide-react'
@@ -27,6 +31,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
<DropdownMenuPrimitive.SubTrigger
ref={ref}
className={cn(
+ // 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent', // original
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent',
inset && 'pl-8',
className
@@ -46,7 +51,11 @@ const DropdownMenuSubContent = React.forwardRef<
<DropdownMenuPrimitive.SubContent
ref={ref}
className={cn(
- 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1',
+ /**
+ * this is same as DropdownMenuContent styles...
+ */
+ // 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1', // original
+ 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-body-light shadow-md animate-in data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1',
className
)}
{...props}
@@ -63,7 +72,8 @@ const DropdownMenuContent = React.forwardRef<
ref={ref}
sideOffset={sideOffset}
className={cn(
- 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
+ // 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', // original
+ 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-body-light shadow-md animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
className
)}
{...props}
@@ -81,7 +91,8 @@ const DropdownMenuItem = React.forwardRef<
<DropdownMenuPrimitive.Item
ref={ref}
className={cn(
- 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
+ // 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', //original
+ 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-body data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
inset && 'pl-8',
className
)}
@@ -143,7 +154,7 @@ const DropdownMenuLabel = React.forwardRef<
>(({ className, inset, ...props }, ref) => (
<DropdownMenuPrimitive.Label
ref={ref}
- className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}
+ className={cn('px-2 py-1.5 text-sm font-normal', inset && 'pl-8', className)}
{...props}
/>
))
@@ -155,7 +166,7 @@ const DropdownMenuSeparator = React.forwardRef<
>(({ className, ...props }, ref) => (
<DropdownMenuPrimitive.Separator
ref={ref}
- className={cn('-mx-1 my-1 h-px bg-muted', className)}
+ className={cn('-mx-1 my-1 h-px bg-body', className)}
{...props}
/>
))
diff --git a/packages/ui/src/components/shadcn/stories/ComboBox.stories.tsx b/packages/ui/src/components/shadcn/stories/ComboBox.stories.tsx
index 08d04d8dfbe..364ed3ba656 100644
--- a/packages/ui/src/components/shadcn/stories/ComboBox.stories.tsx
+++ b/packages/ui/src/components/shadcn/stories/ComboBox.stories.tsx
@@ -116,7 +116,7 @@ export const Combobox = {
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button>
</PopoverTrigger>
- <PopoverContent className="w-[200px] p-0" align="start" side="right">
+ <PopoverContent className="w-[200px] p-0" side="bottom">
<Command>
<CommandInput placeholder="Search framework..." className="border-none ring-0" />
<CommandEmpty>No framework found.</CommandEmpty>