Accessibility pass for the website and the apps (WCAG 2.2 AA target) and the accessibility statement: root ACCESSIBILITY.md + docs/i18n/vi/ACCESSIBILITY.md, the accessibility issue form, a default PR template; focus management, the '/' shortcut switch, chart names and data tables, contrast tokens with a CI check, Windows contrast themes; a docs sync of verified mismatches; version 4.6.0 with the two deps sweeps since 4.5.0 (#176, #182). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
1.3 KiB
TypeScript
27 lines
1.3 KiB
TypeScript
import * as PopoverPrimitive from '@radix-ui/react-popover'
|
|
import { forwardRef, type ComponentPropsWithoutRef, type ElementRef } from 'react'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
export const Popover = PopoverPrimitive.Root
|
|
export const PopoverTrigger = PopoverPrimitive.Trigger
|
|
export const PopoverClose = PopoverPrimitive.Close
|
|
|
|
export const PopoverContent = forwardRef<
|
|
ElementRef<typeof PopoverPrimitive.Content>,
|
|
ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
|
|
>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (
|
|
<PopoverPrimitive.Portal>
|
|
<PopoverPrimitive.Content
|
|
ref={ref}
|
|
align={align}
|
|
sideOffset={sideOffset}
|
|
className={cn(
|
|
'z-50 w-72 rounded-xl border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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}
|
|
/>
|
|
</PopoverPrimitive.Portal>
|
|
))
|
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName
|