Files
supabase/apps/studio/components/ui/BannerStack/BannerCard.tsx
Ivan Vasilov 56de26fe22 chore: Migrate the monorepo to use Tailwind v4 (#45318)
This PR migrates the whole monorepo to use Tailwind v4:
- Removed `@tailwindcss/container-queries` plugin since it's included by
default in v4,
- Bump all instances of Tailwind to v4. Made minimal changes to the
shared config to remove non-supported features (`alpha` mentions),
- Migrate all apps to be compatible with v4 configs,
- Fix the `typography.css` import in 3 apps,
- Add missing rules which were included by default in v3,
- Run `pnpm dlx @tailwindcss/upgrade` on all apps, which renames a lot
of classes
- Rename all misnamed classes according to
https://tailwindcss.com/docs/upgrade-guide#renamed-utilities in all
apps.

---------

Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-04-30 10:53:24 +00:00

51 lines
1.6 KiB
TypeScript

import { X } from 'lucide-react'
import { Button, Card, CardContent, cn } from 'ui'
import { BASE_PATH } from '@/lib/constants'
interface BannerCardProps {
onDismiss?: () => void
children: React.ReactNode
className?: string
}
export const BannerCard = ({ onDismiss, children, className }: BannerCardProps) => {
return (
<Card className={cn('relative overflow-hidden shadow-lg rounded-2xl', className)}>
<div className="absolute -inset-16 z-0 opacity-100 pointer-events-none">
<img
src={`${BASE_PATH}/img/reports/bg-grafana-dark.svg`}
alt="Background pattern"
className="w-full h-full object-cover object-right hidden dark:block"
/>
<img
src={`${BASE_PATH}/img/reports/bg-grafana-light.svg`}
alt="Background pattern"
className="w-full h-full object-cover object-right dark:hidden"
/>
<div className="absolute inset-0 bg-linear-to-r from-background-alternative to-transparent" />
</div>
<CardContent className="relative z-10 p-6">
{onDismiss && (
<div className="absolute top-4 right-4 z-20">
<Button
type="text"
size="tiny"
htmlType="button"
icon={<X size={16} strokeWidth={1.5} />}
onClick={(e) => {
e.preventDefault()
onDismiss()
}}
className="opacity-75 hover:opacity-100 px-1"
aria-label="Close banner"
/>
</div>
)}
{children}
</CardContent>
</Card>
)
}