@@ -45,13 +45,58 @@ export const groupItem = tv({
4545 }
4646} ) ;
4747
48+ const colorVariants = {
49+ primary : {
50+ dot : "bg-primary-200 dark:bg-primary-900" ,
51+ ring : "ring-white dark:ring-gray-900" ,
52+ icon : "text-primary-600 dark:text-primary-400" ,
53+ connector : "border-primary-200 dark:border-primary-700"
54+ } ,
55+ green : {
56+ dot : "bg-green-200 dark:bg-green-900" ,
57+ ring : "ring-white dark:ring-gray-900" ,
58+ icon : "text-green-600 dark:text-green-400" ,
59+ connector : "border-green-200 dark:border-green-700"
60+ } ,
61+ orange : {
62+ dot : "bg-orange-200 dark:bg-orange-900" ,
63+ ring : "ring-white dark:ring-gray-900" ,
64+ icon : "text-orange-600 dark:text-orange-400" ,
65+ connector : "border-orange-200 dark:border-orange-700"
66+ } ,
67+ red : {
68+ dot : "bg-red-200 dark:bg-red-900" ,
69+ ring : "ring-white dark:ring-gray-900" ,
70+ icon : "text-red-600 dark:text-red-400" ,
71+ connector : "border-red-200 dark:border-red-700"
72+ } ,
73+ blue : {
74+ dot : "bg-blue-200 dark:bg-blue-900" ,
75+ ring : "ring-white dark:ring-gray-900" ,
76+ icon : "text-blue-600 dark:text-blue-400" ,
77+ connector : "border-blue-200 dark:border-blue-700"
78+ } ,
79+ purple : {
80+ dot : "bg-purple-200 dark:bg-purple-900" ,
81+ ring : "ring-white dark:ring-gray-900" ,
82+ icon : "text-purple-600 dark:text-purple-400" ,
83+ connector : "border-purple-200 dark:border-purple-700"
84+ } ,
85+ gray : {
86+ dot : "bg-gray-200 dark:bg-gray-700" ,
87+ ring : "ring-white dark:ring-gray-900" ,
88+ icon : "text-gray-600 dark:text-gray-400" ,
89+ connector : "border-gray-200 dark:border-gray-700"
90+ }
91+ } ;
92+
4893export const timeline = tv ( {
4994 variants : {
5095 order : {
5196 group : "p-5 mb-4 bg-gray-50 rounded-lg border border-gray-100 dark:bg-gray-800 dark:border-gray-700" ,
5297 horizontal : "sm:flex" ,
53- activity : "relative border-s border-gray-200 dark:border-gray-700 " ,
54- vertical : "relative border-s border-gray-200 dark:border-gray-700 " ,
98+ activity : "relative" ,
99+ vertical : "relative" ,
55100 default : "relative border-s border-gray-200 dark:border-gray-700"
56101 }
57102 } ,
@@ -62,25 +107,27 @@ export const timeline = tv({
62107
63108export const timelineItem = tv ( {
64109 slots : {
65- base : "" ,
110+ base : "relative " ,
66111 div : "" ,
67112 time : "" ,
68113 h3 : "" ,
69- svg : "w-3 h-3 text-primary-600 dark:text-primary-400"
114+ svg : "w-4 h-4" ,
115+ connector : "absolute top-6 left-3 w-px h-full"
70116 } ,
71117 variants : {
72118 order : {
73119 default : {
74120 base : "mb-10 ms-4" ,
75- div : "absolute w-3 h-3 bg-gray-200 rounded-full mt-1.5 -start -1.5 border border-white dark:border-gray-900 dark:bg-gray-700" ,
121+ div : "absolute w-3 h-3 bg-gray-200 rounded-full mt-1.5 -left -1.5 border border-white dark:border-gray-900 dark:bg-gray-700" ,
76122 time : "mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500" ,
77123 h3 : "text-lg font-semibold text-gray-900 dark:text-white"
78124 } ,
79125 vertical : {
80- base : "mb-10 ms-6" ,
81- div : "flex absolute -start-3 justify-center items-center w-6 h-6 bg-primary-200 rounded-full ring-8 ring-white dark:ring-gray-900 dark:bg-primary-900" ,
82- time : "mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500" ,
83- h3 : "flex items-center mb-1 text-lg font-semibold text-gray-900 dark:text-white"
126+ base : "mb-10 ms-6 relative" ,
127+ div : "flex absolute -left-4 top-1.5 justify-center items-center w-6 h-6 rounded-full ring-8" ,
128+ time : "mb-1 pl-4 text-sm font-normal leading-none text-gray-400 dark:text-gray-500" ,
129+ h3 : "flex ml-4 items-center mb-1 text-lg font-semibold text-gray-900 dark:text-white" ,
130+ connector : "absolute top-7 -left-1.5 w-px h-full"
84131 } ,
85132 horizontal : {
86133 base : "relative mb-6 sm:mb-0" ,
@@ -89,20 +136,166 @@ export const timelineItem = tv({
89136 h3 : "text-lg font-semibold text-gray-900 dark:text-white"
90137 } ,
91138 activity : {
92- base : "mb-10 ms-6" ,
93- div : "flex absolute -start-3 justify-center items-center w-6 h-6 bg-primary-200 rounded-full ring-8 ring-white dark:ring-gray-900 dark:bg-primary-900 " ,
139+ base : "mb-10 ms-6 relative " ,
140+ div : "flex absolute -left-4 top-1.5 justify-center items-center w-6 h-6 rounded-full ring-8" ,
94141 time : "mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500" ,
95- h3 : "text-lg font-semibold text-gray-900 dark:text-white"
142+ h3 : "text-lg font-semibold text-gray-900 dark:text-white" ,
143+ connector : "absolute top-7 -left-4 w-px h-full"
96144 } ,
97145 group : {
98146 base : "" ,
99147 div : "p-5 mb-4 bg-gray-50 rounded-lg border border-gray-100 dark:bg-gray-800 dark:border-gray-700" ,
100148 time : "text-lg font-semibold text-gray-900 dark:text-white" ,
101149 h3 : "text-lg font-semibold text-gray-900 dark:text-white"
102150 }
151+ } ,
152+ color : {
153+ primary : { } ,
154+ green : { } ,
155+ orange : { } ,
156+ red : { } ,
157+ blue : { } ,
158+ purple : { } ,
159+ gray : { }
160+ } ,
161+ isLast : {
162+ true : { } ,
163+ false : { }
103164 }
104165 } ,
166+ compoundVariants : [
167+ // Vertical color variants
168+ {
169+ order : "vertical" ,
170+ color : "primary" ,
171+ class : {
172+ div : colorVariants . primary . dot + " " + colorVariants . primary . ring ,
173+ svg : colorVariants . primary . icon ,
174+ connector : "bg-primary-200 dark:bg-primary-700"
175+ }
176+ } ,
177+ {
178+ order : "vertical" ,
179+ color : "green" ,
180+ class : {
181+ div : colorVariants . green . dot + " " + colorVariants . green . ring ,
182+ svg : colorVariants . green . icon ,
183+ connector : "bg-green-200 dark:bg-green-700"
184+ }
185+ } ,
186+ {
187+ order : "vertical" ,
188+ color : "orange" ,
189+ class : {
190+ div : colorVariants . orange . dot + " " + colorVariants . orange . ring ,
191+ svg : colorVariants . orange . icon ,
192+ connector : "bg-orange-200 dark:bg-orange-700"
193+ }
194+ } ,
195+ {
196+ order : "vertical" ,
197+ color : "red" ,
198+ class : {
199+ div : colorVariants . red . dot + " " + colorVariants . red . ring ,
200+ svg : colorVariants . red . icon ,
201+ connector : "bg-red-200 dark:bg-red-700"
202+ }
203+ } ,
204+ {
205+ order : "vertical" ,
206+ color : "blue" ,
207+ class : {
208+ div : colorVariants . blue . dot + " " + colorVariants . blue . ring ,
209+ svg : colorVariants . blue . icon ,
210+ connector : "bg-blue-200 dark:bg-blue-700"
211+ }
212+ } ,
213+ {
214+ order : "vertical" ,
215+ color : "purple" ,
216+ class : {
217+ div : colorVariants . purple . dot + " " + colorVariants . purple . ring ,
218+ svg : colorVariants . purple . icon ,
219+ connector : "bg-purple-200 dark:bg-purple-700"
220+ }
221+ } ,
222+ {
223+ order : "vertical" ,
224+ color : "gray" ,
225+ class : {
226+ div : colorVariants . gray . dot + " " + colorVariants . gray . ring ,
227+ svg : colorVariants . gray . icon ,
228+ connector : "bg-gray-200 dark:bg-gray-700"
229+ }
230+ } ,
231+ // Horizontal color variants
232+ {
233+ order : "horizontal" ,
234+ color : "primary" ,
235+ class : {
236+ div : colorVariants . primary . dot + " " + colorVariants . primary . ring ,
237+ svg : colorVariants . primary . icon
238+ }
239+ } ,
240+ {
241+ order : "horizontal" ,
242+ color : "green" ,
243+ class : {
244+ div : colorVariants . green . dot + " " + colorVariants . green . ring ,
245+ svg : colorVariants . green . icon
246+ }
247+ } ,
248+ {
249+ order : "horizontal" ,
250+ color : "orange" ,
251+ class : {
252+ div : colorVariants . orange . dot + " " + colorVariants . orange . ring ,
253+ svg : colorVariants . orange . icon
254+ }
255+ } ,
256+ {
257+ order : "horizontal" ,
258+ color : "red" ,
259+ class : {
260+ div : colorVariants . red . dot + " " + colorVariants . red . ring ,
261+ svg : colorVariants . red . icon
262+ }
263+ } ,
264+ {
265+ order : "horizontal" ,
266+ color : "blue" ,
267+ class : {
268+ div : colorVariants . blue . dot + " " + colorVariants . blue . ring ,
269+ svg : colorVariants . blue . icon
270+ }
271+ } ,
272+ {
273+ order : "horizontal" ,
274+ color : "purple" ,
275+ class : {
276+ div : colorVariants . purple . dot + " " + colorVariants . purple . ring ,
277+ svg : colorVariants . purple . icon
278+ }
279+ } ,
280+ {
281+ order : "horizontal" ,
282+ color : "gray" ,
283+ class : {
284+ div : colorVariants . gray . dot + " " + colorVariants . gray . ring ,
285+ svg : colorVariants . gray . icon
286+ }
287+ } ,
288+ // Hide connector on last item
289+ {
290+ isLast : true ,
291+ class : {
292+ connector : "hidden"
293+ }
294+ }
295+ ] ,
105296 defaultVariants : {
106- order : "default"
297+ order : "default" ,
298+ color : "primary" ,
299+ isLast : false
107300 }
108301} ) ;
0 commit comments