navigation-menu.ts
15.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
const color = [
"primary",
"secondary",
"success",
"info",
"warning",
"error",
"neutral"
] as const
const highlightColor = [
"primary",
"secondary",
"success",
"info",
"warning",
"error",
"neutral"
] as const
const variant = [
"pill",
"link"
] as const
const orientation = [
"horizontal",
"vertical"
] as const
const contentOrientation = [
"horizontal",
"vertical"
] as const
export default {
"slots": {
"root": "relative flex gap-1.5 [&>div]:min-w-0",
"list": "isolate min-w-0",
"label": "w-full flex items-center gap-1.5 font-semibold text-xs/5 text-highlighted px-2.5 py-1.5",
"item": "min-w-0",
"link": "group relative w-full flex items-center gap-1.5 font-medium text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",
"linkLeadingIcon": "shrink-0 size-5",
"linkLeadingAvatar": "shrink-0",
"linkLeadingAvatarSize": "2xs",
"linkLeadingChipSize": "sm",
"linkTrailing": "group ms-auto inline-flex gap-1.5 items-center",
"linkTrailingBadge": "shrink-0",
"linkTrailingBadgeSize": "sm",
"linkTrailingIcon": "size-5 transform shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",
"linkLabel": "truncate",
"linkLabelExternalIcon": "inline-block size-3 align-top text-dimmed",
"childList": "isolate",
"childLabel": "text-xs text-highlighted",
"childItem": "",
"childLink": "group relative size-full flex items-start text-start text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",
"childLinkWrapper": "min-w-0",
"childLinkIcon": "size-5 shrink-0",
"childLinkLabel": "truncate",
"childLinkLabelExternalIcon": "inline-block size-3 align-top text-dimmed",
"childLinkDescription": "text-muted",
"separator": "px-2 h-px bg-border",
"viewportWrapper": "absolute top-full left-0 flex w-full",
"viewport": "relative overflow-hidden bg-default shadow-lg rounded-md ring ring-default h-(--reka-navigation-menu-viewport-height) w-full transition-[width,height,left,right] duration-200 origin-[top_center] data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] z-1",
"content": "",
"indicator": "absolute left-0 data-[state=visible]:animate-[fade-in_100ms_ease-out] data-[state=hidden]:animate-[fade-out_100ms_ease-in] data-[state=hidden]:opacity-0 bottom-0 z-2 w-(--reka-navigation-menu-indicator-size) translate-x-(--reka-navigation-menu-indicator-position) flex h-2.5 items-end justify-center overflow-hidden transition-[translate,width] duration-200",
"arrow": "relative top-[50%] size-2.5 rotate-45 border border-default bg-default z-1 rounded-xs"
},
"variants": {
"color": {
"primary": {
"link": "focus-visible:before:ring-primary",
"childLink": "focus-visible:before:ring-primary"
},
"secondary": {
"link": "focus-visible:before:ring-secondary",
"childLink": "focus-visible:before:ring-secondary"
},
"success": {
"link": "focus-visible:before:ring-success",
"childLink": "focus-visible:before:ring-success"
},
"info": {
"link": "focus-visible:before:ring-info",
"childLink": "focus-visible:before:ring-info"
},
"warning": {
"link": "focus-visible:before:ring-warning",
"childLink": "focus-visible:before:ring-warning"
},
"error": {
"link": "focus-visible:before:ring-error",
"childLink": "focus-visible:before:ring-error"
},
"neutral": {
"link": "focus-visible:before:ring-inverted",
"childLink": "focus-visible:before:ring-inverted"
}
},
"highlightColor": {
"primary": "",
"secondary": "",
"success": "",
"info": "",
"warning": "",
"error": "",
"neutral": ""
},
"variant": {
"pill": "",
"link": ""
},
"orientation": {
"horizontal": {
"root": "items-center justify-between",
"list": "flex items-center",
"item": "py-2",
"link": "px-2.5 py-1.5 before:inset-x-px before:inset-y-0",
"childList": "grid p-2",
"childLink": "px-3 py-2 gap-2 before:inset-x-px before:inset-y-0",
"childLinkLabel": "font-medium",
"content": "absolute top-0 left-0 w-full max-h-[70vh] overflow-y-auto"
},
"vertical": {
"root": "flex-col",
"link": "flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0",
"childLabel": "px-1.5 py-0.5",
"childLink": "p-1.5 gap-1.5 before:inset-y-px before:inset-x-0"
}
},
"contentOrientation": {
"horizontal": {
"viewportWrapper": "justify-center",
"content": "data-[motion=from-start]:animate-[enter-from-left_200ms_ease] data-[motion=from-end]:animate-[enter-from-right_200ms_ease] data-[motion=to-start]:animate-[exit-to-left_200ms_ease] data-[motion=to-end]:animate-[exit-to-right_200ms_ease]"
},
"vertical": {
"viewport": "sm:w-(--reka-navigation-menu-viewport-width) left-(--reka-navigation-menu-viewport-left) rtl:left-auto rtl:right-[calc(100%-var(--reka-navigation-menu-viewport-left)-var(--reka-navigation-menu-viewport-width))]"
}
},
"active": {
"true": {
"childLink": "before:bg-elevated text-highlighted",
"childLinkIcon": "text-default"
},
"false": {
"link": "text-muted",
"linkLeadingIcon": "text-dimmed",
"childLink": [
"hover:before:bg-elevated/50 text-default hover:text-highlighted",
"transition-colors before:transition-colors"
],
"childLinkIcon": [
"text-dimmed group-hover:text-default",
"transition-colors"
]
}
},
"disabled": {
"true": {
"link": "cursor-not-allowed opacity-75"
}
},
"highlight": {
"true": ""
},
"level": {
"true": ""
},
"collapsed": {
"true": ""
}
},
"compoundVariants": [
{
"orientation": "horizontal" as typeof orientation[number],
"contentOrientation": "horizontal" as typeof contentOrientation[number],
"class": {
"childList": "grid-cols-2 gap-2"
}
},
{
"orientation": "horizontal" as typeof orientation[number],
"contentOrientation": "vertical" as typeof contentOrientation[number],
"class": {
"childList": "gap-1",
"content": "w-60"
}
},
{
"orientation": "vertical" as typeof orientation[number],
"collapsed": false,
"class": {
"childList": "ms-5 border-s border-default",
"childItem": "ps-1.5 -ms-px",
"content": "data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden"
}
},
{
"orientation": "vertical" as typeof orientation[number],
"collapsed": true,
"class": {
"link": "px-1.5",
"linkLabel": "hidden",
"linkTrailing": "hidden",
"content": "shadow-sm rounded-sm min-h-6 p-1"
}
},
{
"orientation": "horizontal" as typeof orientation[number],
"highlight": true,
"class": {
"link": [
"after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full",
"after:transition-colors"
]
}
},
{
"orientation": "vertical" as typeof orientation[number],
"highlight": true,
"level": true,
"class": {
"link": [
"after:absolute after:-start-1.5 after:inset-y-0.5 after:block after:w-px after:rounded-full",
"after:transition-colors"
]
}
},
{
"disabled": false,
"active": false,
"variant": "pill" as typeof variant[number],
"class": {
"link": [
"hover:text-highlighted hover:before:bg-elevated/50",
"transition-colors before:transition-colors"
],
"linkLeadingIcon": [
"group-hover:text-default",
"transition-colors"
]
}
},
{
"disabled": false,
"active": false,
"variant": "pill" as typeof variant[number],
"orientation": "horizontal" as typeof orientation[number],
"class": {
"link": "data-[state=open]:text-highlighted",
"linkLeadingIcon": "group-data-[state=open]:text-default"
}
},
{
"disabled": false,
"variant": "pill" as typeof variant[number],
"highlight": true,
"orientation": "horizontal" as typeof orientation[number],
"class": {
"link": "data-[state=open]:before:bg-elevated/50"
}
},
{
"disabled": false,
"variant": "pill" as typeof variant[number],
"highlight": false,
"active": false,
"orientation": "horizontal" as typeof orientation[number],
"class": {
"link": "data-[state=open]:before:bg-elevated/50"
}
},
{
"color": "primary" as typeof color[number],
"variant": "pill" as typeof variant[number],
"active": true,
"class": {
"link": "text-primary",
"linkLeadingIcon": "text-primary group-data-[state=open]:text-primary"
}
},
{
"color": "secondary" as typeof color[number],
"variant": "pill" as typeof variant[number],
"active": true,
"class": {
"link": "text-secondary",
"linkLeadingIcon": "text-secondary group-data-[state=open]:text-secondary"
}
},
{
"color": "success" as typeof color[number],
"variant": "pill" as typeof variant[number],
"active": true,
"class": {
"link": "text-success",
"linkLeadingIcon": "text-success group-data-[state=open]:text-success"
}
},
{
"color": "info" as typeof color[number],
"variant": "pill" as typeof variant[number],
"active": true,
"class": {
"link": "text-info",
"linkLeadingIcon": "text-info group-data-[state=open]:text-info"
}
},
{
"color": "warning" as typeof color[number],
"variant": "pill" as typeof variant[number],
"active": true,
"class": {
"link": "text-warning",
"linkLeadingIcon": "text-warning group-data-[state=open]:text-warning"
}
},
{
"color": "error" as typeof color[number],
"variant": "pill" as typeof variant[number],
"active": true,
"class": {
"link": "text-error",
"linkLeadingIcon": "text-error group-data-[state=open]:text-error"
}
},
{
"color": "neutral" as typeof color[number],
"variant": "pill" as typeof variant[number],
"active": true,
"class": {
"link": "text-highlighted",
"linkLeadingIcon": "text-highlighted group-data-[state=open]:text-highlighted"
}
},
{
"variant": "pill" as typeof variant[number],
"active": true,
"highlight": false,
"class": {
"link": "before:bg-elevated"
}
},
{
"variant": "pill" as typeof variant[number],
"active": true,
"highlight": true,
"disabled": false,
"class": {
"link": [
"hover:before:bg-elevated/50",
"before:transition-colors"
]
}
},
{
"disabled": false,
"active": false,
"variant": "link" as typeof variant[number],
"class": {
"link": [
"hover:text-highlighted",
"transition-colors"
],
"linkLeadingIcon": [
"group-hover:text-default",
"transition-colors"
]
}
},
{
"disabled": false,
"active": false,
"variant": "link" as typeof variant[number],
"orientation": "horizontal" as typeof orientation[number],
"class": {
"link": "data-[state=open]:text-highlighted",
"linkLeadingIcon": "group-data-[state=open]:text-default"
}
},
{
"color": "primary" as typeof color[number],
"variant": "link" as typeof variant[number],
"active": true,
"class": {
"link": "text-primary",
"linkLeadingIcon": "text-primary group-data-[state=open]:text-primary"
}
},
{
"color": "secondary" as typeof color[number],
"variant": "link" as typeof variant[number],
"active": true,
"class": {
"link": "text-secondary",
"linkLeadingIcon": "text-secondary group-data-[state=open]:text-secondary"
}
},
{
"color": "success" as typeof color[number],
"variant": "link" as typeof variant[number],
"active": true,
"class": {
"link": "text-success",
"linkLeadingIcon": "text-success group-data-[state=open]:text-success"
}
},
{
"color": "info" as typeof color[number],
"variant": "link" as typeof variant[number],
"active": true,
"class": {
"link": "text-info",
"linkLeadingIcon": "text-info group-data-[state=open]:text-info"
}
},
{
"color": "warning" as typeof color[number],
"variant": "link" as typeof variant[number],
"active": true,
"class": {
"link": "text-warning",
"linkLeadingIcon": "text-warning group-data-[state=open]:text-warning"
}
},
{
"color": "error" as typeof color[number],
"variant": "link" as typeof variant[number],
"active": true,
"class": {
"link": "text-error",
"linkLeadingIcon": "text-error group-data-[state=open]:text-error"
}
},
{
"color": "neutral" as typeof color[number],
"variant": "link" as typeof variant[number],
"active": true,
"class": {
"link": "text-highlighted",
"linkLeadingIcon": "text-highlighted group-data-[state=open]:text-highlighted"
}
},
{
"highlightColor": "primary" as typeof highlightColor[number],
"highlight": true,
"level": true,
"active": true,
"class": {
"link": "after:bg-primary"
}
},
{
"highlightColor": "secondary" as typeof highlightColor[number],
"highlight": true,
"level": true,
"active": true,
"class": {
"link": "after:bg-secondary"
}
},
{
"highlightColor": "success" as typeof highlightColor[number],
"highlight": true,
"level": true,
"active": true,
"class": {
"link": "after:bg-success"
}
},
{
"highlightColor": "info" as typeof highlightColor[number],
"highlight": true,
"level": true,
"active": true,
"class": {
"link": "after:bg-info"
}
},
{
"highlightColor": "warning" as typeof highlightColor[number],
"highlight": true,
"level": true,
"active": true,
"class": {
"link": "after:bg-warning"
}
},
{
"highlightColor": "error" as typeof highlightColor[number],
"highlight": true,
"level": true,
"active": true,
"class": {
"link": "after:bg-error"
}
},
{
"highlightColor": "neutral" as typeof highlightColor[number],
"highlight": true,
"level": true,
"active": true,
"class": {
"link": "after:bg-inverted"
}
}
],
"defaultVariants": {
"color": "primary" as typeof color[number],
"highlightColor": "primary" as typeof highlightColor[number],
"variant": "pill" as typeof variant[number]
}
}