|
| 1 | +import { tv } from 'tailwind-variants'; |
| 2 | + |
| 3 | +export const carouselVariants = tv({ |
| 4 | + compoundVariants: [ |
| 5 | + { |
| 6 | + class: { |
| 7 | + content: '-ml-3', |
| 8 | + item: 'pl-3', |
| 9 | + next: '-right-10', |
| 10 | + previous: '-left-10' |
| 11 | + }, |
| 12 | + orientation: 'horizontal', |
| 13 | + size: 'xs' |
| 14 | + }, |
| 15 | + { |
| 16 | + class: { |
| 17 | + content: '-ml-3.5', |
| 18 | + item: 'pl-3.5', |
| 19 | + next: '-right-11', |
| 20 | + previous: '-left-11' |
| 21 | + }, |
| 22 | + orientation: 'horizontal', |
| 23 | + size: 'sm' |
| 24 | + }, |
| 25 | + { |
| 26 | + class: { |
| 27 | + content: '-ml-4.5', |
| 28 | + item: 'pl-4.5', |
| 29 | + next: '-right-13', |
| 30 | + previous: '-left-13' |
| 31 | + }, |
| 32 | + orientation: 'horizontal', |
| 33 | + size: 'lg' |
| 34 | + }, |
| 35 | + { |
| 36 | + class: { |
| 37 | + content: '-ml-5', |
| 38 | + item: 'pl-5', |
| 39 | + next: '-right-14', |
| 40 | + previous: '-left-14' |
| 41 | + }, |
| 42 | + orientation: 'horizontal', |
| 43 | + size: 'xl' |
| 44 | + }, |
| 45 | + { |
| 46 | + class: { |
| 47 | + content: '-ml-6', |
| 48 | + item: 'pl-6', |
| 49 | + next: '-right-16', |
| 50 | + previous: '-left-16' |
| 51 | + }, |
| 52 | + orientation: 'horizontal', |
| 53 | + size: '2xl' |
| 54 | + }, |
| 55 | + { |
| 56 | + class: { |
| 57 | + content: '-mt-3', |
| 58 | + item: 'pt-3', |
| 59 | + next: '-bottom-10', |
| 60 | + previous: '-top-10' |
| 61 | + }, |
| 62 | + orientation: 'vertical', |
| 63 | + size: 'xs' |
| 64 | + }, |
| 65 | + { |
| 66 | + class: { |
| 67 | + content: '-mt-3.5', |
| 68 | + item: 'pt-3.5', |
| 69 | + next: '-bottom-11', |
| 70 | + previous: '-top-11' |
| 71 | + }, |
| 72 | + orientation: 'vertical', |
| 73 | + size: 'sm' |
| 74 | + }, |
| 75 | + { |
| 76 | + class: { |
| 77 | + content: '-mt-4.5', |
| 78 | + item: 'pt-4.5', |
| 79 | + next: '-bottom-13', |
| 80 | + previous: '-top-13' |
| 81 | + }, |
| 82 | + orientation: 'vertical', |
| 83 | + size: 'lg' |
| 84 | + }, |
| 85 | + { |
| 86 | + class: { |
| 87 | + content: '-mt-5', |
| 88 | + item: 'pt-5', |
| 89 | + next: '-bottom-14', |
| 90 | + previous: '-top-14' |
| 91 | + }, |
| 92 | + orientation: 'vertical', |
| 93 | + size: 'xl' |
| 94 | + }, |
| 95 | + { |
| 96 | + class: { |
| 97 | + content: '-mt-6', |
| 98 | + item: 'pt-6', |
| 99 | + next: '-bottom-16', |
| 100 | + previous: '-top-16' |
| 101 | + }, |
| 102 | + orientation: 'vertical', |
| 103 | + size: '2xl' |
| 104 | + } |
| 105 | + ], |
| 106 | + defaultVariants: { |
| 107 | + orientation: 'horizontal' |
| 108 | + }, |
| 109 | + slots: { |
| 110 | + content: 'flex', |
| 111 | + contentWrapper: 'overflow-hidden', |
| 112 | + item: 'min-w-0 shrink-0 grow-0 basis-full', |
| 113 | + next: 'touch-manipulation absolute', |
| 114 | + previous: 'touch-manipulation absolute', |
| 115 | + root: 'relative' |
| 116 | + }, |
| 117 | + variants: { |
| 118 | + orientation: { |
| 119 | + horizontal: { |
| 120 | + content: '-ml-4', |
| 121 | + item: 'pl-4', |
| 122 | + next: '-right-12 top-1/2 -translate-y-1/2', |
| 123 | + previous: '-left-12 top-1/2 -translate-y-1/2' |
| 124 | + }, |
| 125 | + vertical: { |
| 126 | + content: 'flex-col -mt-4', |
| 127 | + item: 'pt-4', |
| 128 | + next: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90', |
| 129 | + previous: '-top-12 left-1/2 -translate-x-1/2 rotate-90' |
| 130 | + } |
| 131 | + }, |
| 132 | + size: { |
| 133 | + '2xl': { |
| 134 | + root: 'text-xl' |
| 135 | + }, |
| 136 | + lg: { |
| 137 | + root: 'text-base' |
| 138 | + }, |
| 139 | + md: { |
| 140 | + root: 'text-sm' |
| 141 | + }, |
| 142 | + sm: { |
| 143 | + root: 'text-xs' |
| 144 | + }, |
| 145 | + xl: { |
| 146 | + root: 'text-lg' |
| 147 | + }, |
| 148 | + xs: { |
| 149 | + root: 'text-2xs' |
| 150 | + } |
| 151 | + } |
| 152 | + } |
| 153 | +}); |
| 154 | + |
| 155 | +export type CarouselSlots = keyof typeof carouselVariants.slots; |
0 commit comments