|
| 1 | +import { tv } from 'tailwind-variants'; |
| 2 | + |
| 3 | +import { dialogVariants } from '../dialog/dialog-variants'; |
| 4 | + |
| 5 | +export const drawerVariants = tv({ |
| 6 | + defaultVariants: { |
| 7 | + size: 'md' |
| 8 | + }, |
| 9 | + slots: { |
| 10 | + ...dialogVariants.slots, |
| 11 | + content: `fixed inset-x-0 bottom-0 z-50 border bg-background`, |
| 12 | + contentBody: `flex h-auto flex-col`, |
| 13 | + knob: `mx-auto shrink-0 cursor-grab active:cursor-grabbing rounded-full bg-muted` |
| 14 | + }, |
| 15 | + variants: { |
| 16 | + size: { |
| 17 | + '2xl': { |
| 18 | + content: `mt-30 rounded-t-[16px]`, |
| 19 | + contentBody: `gap-y-6 max-w-3xl px-7 py-6 text-xl`, |
| 20 | + knob: 'mt-7 h-3.5 w-40' |
| 21 | + }, |
| 22 | + lg: { |
| 23 | + content: `mt-26 rounded-t-[12px]`, |
| 24 | + contentBody: `gap-y-4 max-w-xl px-5 py-4 text-base`, |
| 25 | + knob: 'mt-5 h-2.5 w-30' |
| 26 | + }, |
| 27 | + md: { |
| 28 | + content: `mt-24 rounded-t-[10px]`, |
| 29 | + contentBody: `gap-y-3 max-w-lg px-4 py-3 text-sm`, |
| 30 | + knob: 'mt-4 h-2 w-25' |
| 31 | + }, |
| 32 | + sm: { |
| 33 | + content: `mt-22 rounded-t-[8px]`, |
| 34 | + contentBody: `gap-y-2 max-w-md px-3 py-2 text-xs`, |
| 35 | + knob: 'mt-3.5 h-1.75 w-22' |
| 36 | + }, |
| 37 | + xl: { |
| 38 | + content: `mt-28 rounded-t-[14px]`, |
| 39 | + contentBody: `gap-y-5 max-w-2xl px-6 py-5 text-lg`, |
| 40 | + knob: 'mt-6 h-3 w-35' |
| 41 | + }, |
| 42 | + xs: { |
| 43 | + content: `mt-20 rounded-t-[6px]`, |
| 44 | + contentBody: `gap-y-1.5 max-w-md px-2 py-1.5 text-2xs`, |
| 45 | + knob: 'mt-3 h-1.5 w-20' |
| 46 | + } |
| 47 | + } |
| 48 | + } |
| 49 | +}); |
| 50 | + |
| 51 | +export type DrawerSlots = keyof typeof drawerVariants.slots; |
0 commit comments