mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
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>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { useSortable } from '@dnd-kit/sortable'
|
|
import { GripVertical } from 'lucide-react'
|
|
import type { CSSProperties, ReactNode } from 'react'
|
|
import { cn } from 'ui'
|
|
|
|
type SortableSectionProps = {
|
|
id: string
|
|
children: ReactNode
|
|
}
|
|
|
|
export const SortableSection = ({ id, children }: SortableSectionProps) => {
|
|
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
|
|
id,
|
|
})
|
|
|
|
const style: CSSProperties = {
|
|
transform: transform
|
|
? `translate3d(${Math.round(transform.x)}px, ${Math.round(transform.y)}px, 0)`
|
|
: undefined,
|
|
transition,
|
|
}
|
|
|
|
return (
|
|
<div ref={setNodeRef} style={style} className="relative will-change-transform">
|
|
<button
|
|
aria-label="Drag to reorder section"
|
|
className="absolute -left-6 top-2 text-foreground-muted hover:text-foreground focus:outline-hidden cursor-grab active:cursor-grabbing"
|
|
{...attributes}
|
|
{...listeners}
|
|
>
|
|
<GripVertical size={14} />
|
|
</button>
|
|
<div className={cn(isDragging && 'opacity-70')}>{children}</div>
|
|
</div>
|
|
)
|
|
}
|