mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
Design System: Fix Select does not show its invalid state correctly (#50859)
## Problem `Select` does not show its invalid state correctly. Change anything in [the production form example](https://supabase.com/design-system/docs/ui-patterns/forms) and submit; <img width="982" height="401" alt="image" src="https://github.com/user-attachments/assets/3b0382e2-b77a-4f79-a9c6-3fa2d7c671a3" /> ## Solution Apply the same styles as for the other inputs: <img width="887" height="354" alt="image" src="https://github.com/user-attachments/assets/d05e12e1-171e-4e5c-8b49-2ea54ab79ce3" /> ## Review instructions Change anything in [the staging form example](https://design-system-ah0n5wasc-supabase.vercel.app/design-system/docs/ui-patterns/forms) and submit <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Select triggers now display destructive error styling when marked as invalid, including updated background and border colors. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
1 parent
3990fb4207
commit
202ca5c7a4
1 file changed
+5
-1
@@ -3,9 +3,13 @@
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
|
||||
import { SIZE_VARIANTS, SIZE_VARIANTS_DEFAULT } from '../../../lib/constants'
|
||||
import { cn } from '../../../lib/utils'
|
||||
|
||||
export const selectTriggerVariants = cva(
|
||||
'flex w-full cursor-pointer items-center justify-between rounded-md border border-strong hover:border-control-hover bg-control-raised text-xs data-[placeholder]:text-foreground-lighter ring-border-control focus-ring disabled:cursor-not-allowed disabled:opacity-50 transition-colors duration-200 data-[state=open]:border-control-hover gap-2 [&>span]:truncate text-left',
|
||||
cn(
|
||||
'flex w-full cursor-pointer items-center justify-between rounded-md border border-strong hover:border-control-hover bg-control-raised text-xs data-[placeholder]:text-foreground-lighter ring-border-control focus-ring disabled:cursor-not-allowed disabled:opacity-50 transition-colors duration-200 data-[state=open]:border-control-hover gap-2 [&>span]:truncate text-left',
|
||||
'aria-[invalid=true]:bg-destructive-200 aria-[invalid=true]:border-destructive-400 aria-[invalid=true]:hover:border-destructive aria-[invalid=true]:focus:border-destructive aria-[invalid=true]:focus-visible:border-destructive'
|
||||
),
|
||||
{
|
||||
variants: {
|
||||
size: {
|
||||
|
||||
Reference in new issue
Block a user