dropdown-menu.ts
7.39 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
const color = [
"primary",
"secondary",
"success",
"info",
"warning",
"error",
"neutral"
] as const
const size = [
"xs",
"sm",
"md",
"lg",
"xl"
] as const
export default {
"slots": {
"content": "min-w-32 bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-dropdown-menu-content-transform-origin) flex flex-col",
"input": "border-b border-default",
"empty": "text-center text-muted",
"viewport": "relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1",
"arrow": "fill-bg stroke-default",
"group": "p-1 isolate",
"label": "w-full flex items-center font-semibold text-highlighted",
"separator": "-mx-1 my-1 h-px bg-border",
"item": "group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75",
"itemLeadingIcon": "shrink-0",
"itemLeadingAvatar": "shrink-0",
"itemLeadingAvatarSize": "",
"itemTrailing": "ms-auto inline-flex gap-1.5 items-center",
"itemTrailingIcon": "shrink-0",
"itemTrailingKbds": "hidden lg:inline-flex items-center shrink-0",
"itemTrailingKbdsSize": "",
"itemWrapper": "flex-1 flex flex-col text-start min-w-0",
"itemLabel": "truncate",
"itemDescription": "truncate text-muted",
"itemLabelExternalIcon": "inline-block size-3 align-top text-dimmed"
},
"variants": {
"color": {
"primary": "",
"secondary": "",
"success": "",
"info": "",
"warning": "",
"error": "",
"neutral": ""
},
"active": {
"true": {
"item": "text-highlighted before:bg-elevated",
"itemLeadingIcon": "text-default"
},
"false": {
"item": [
"text-default data-highlighted:text-highlighted data-[state=open]:text-highlighted data-highlighted:before:bg-elevated/50 data-[state=open]:before:bg-elevated/50",
"transition-colors before:transition-colors"
],
"itemLeadingIcon": [
"text-dimmed group-data-highlighted:text-default group-data-[state=open]:text-default",
"transition-colors"
]
}
},
"loading": {
"true": {
"itemLeadingIcon": "animate-spin"
}
},
"size": {
"xs": {
"label": "p-1 text-xs gap-1",
"item": "p-1 text-xs gap-1",
"empty": "p-2 text-xs",
"itemLeadingIcon": "size-4",
"itemLeadingAvatarSize": "3xs",
"itemTrailingIcon": "size-4",
"itemTrailingKbds": "gap-0.5",
"itemTrailingKbdsSize": "sm"
},
"sm": {
"label": "p-1.5 text-xs gap-1.5",
"item": "p-1.5 text-xs gap-1.5",
"empty": "p-2.5 text-xs",
"itemLeadingIcon": "size-4",
"itemLeadingAvatarSize": "3xs",
"itemTrailingIcon": "size-4",
"itemTrailingKbds": "gap-0.5",
"itemTrailingKbdsSize": "sm"
},
"md": {
"label": "p-1.5 text-sm gap-1.5",
"item": "p-1.5 text-sm gap-1.5",
"empty": "p-2.5 text-sm",
"itemLeadingIcon": "size-5",
"itemLeadingAvatarSize": "2xs",
"itemTrailingIcon": "size-5",
"itemTrailingKbds": "gap-0.5",
"itemTrailingKbdsSize": "md"
},
"lg": {
"label": "p-2 text-sm gap-2",
"item": "p-2 text-sm gap-2",
"empty": "p-3 text-sm",
"itemLeadingIcon": "size-5",
"itemLeadingAvatarSize": "2xs",
"itemTrailingIcon": "size-5",
"itemTrailingKbds": "gap-1",
"itemTrailingKbdsSize": "md"
},
"xl": {
"label": "p-2 text-base gap-2",
"item": "p-2 text-base gap-2",
"empty": "p-3 text-base",
"itemLeadingIcon": "size-6",
"itemLeadingAvatarSize": "xs",
"itemTrailingIcon": "size-6",
"itemTrailingKbds": "gap-1",
"itemTrailingKbdsSize": "lg"
}
}
},
"compoundVariants": [
{
"color": "primary" as typeof color[number],
"active": false,
"class": {
"item": "text-primary data-highlighted:text-primary data-highlighted:before:bg-primary/10 data-[state=open]:before:bg-primary/10",
"itemLeadingIcon": "text-primary/75 group-data-highlighted:text-primary group-data-[state=open]:text-primary"
}
},
{
"color": "secondary" as typeof color[number],
"active": false,
"class": {
"item": "text-secondary data-highlighted:text-secondary data-highlighted:before:bg-secondary/10 data-[state=open]:before:bg-secondary/10",
"itemLeadingIcon": "text-secondary/75 group-data-highlighted:text-secondary group-data-[state=open]:text-secondary"
}
},
{
"color": "success" as typeof color[number],
"active": false,
"class": {
"item": "text-success data-highlighted:text-success data-highlighted:before:bg-success/10 data-[state=open]:before:bg-success/10",
"itemLeadingIcon": "text-success/75 group-data-highlighted:text-success group-data-[state=open]:text-success"
}
},
{
"color": "info" as typeof color[number],
"active": false,
"class": {
"item": "text-info data-highlighted:text-info data-highlighted:before:bg-info/10 data-[state=open]:before:bg-info/10",
"itemLeadingIcon": "text-info/75 group-data-highlighted:text-info group-data-[state=open]:text-info"
}
},
{
"color": "warning" as typeof color[number],
"active": false,
"class": {
"item": "text-warning data-highlighted:text-warning data-highlighted:before:bg-warning/10 data-[state=open]:before:bg-warning/10",
"itemLeadingIcon": "text-warning/75 group-data-highlighted:text-warning group-data-[state=open]:text-warning"
}
},
{
"color": "error" as typeof color[number],
"active": false,
"class": {
"item": "text-error data-highlighted:text-error data-highlighted:before:bg-error/10 data-[state=open]:before:bg-error/10",
"itemLeadingIcon": "text-error/75 group-data-highlighted:text-error group-data-[state=open]:text-error"
}
},
{
"color": "primary" as typeof color[number],
"active": true,
"class": {
"item": "text-primary before:bg-primary/10",
"itemLeadingIcon": "text-primary"
}
},
{
"color": "secondary" as typeof color[number],
"active": true,
"class": {
"item": "text-secondary before:bg-secondary/10",
"itemLeadingIcon": "text-secondary"
}
},
{
"color": "success" as typeof color[number],
"active": true,
"class": {
"item": "text-success before:bg-success/10",
"itemLeadingIcon": "text-success"
}
},
{
"color": "info" as typeof color[number],
"active": true,
"class": {
"item": "text-info before:bg-info/10",
"itemLeadingIcon": "text-info"
}
},
{
"color": "warning" as typeof color[number],
"active": true,
"class": {
"item": "text-warning before:bg-warning/10",
"itemLeadingIcon": "text-warning"
}
},
{
"color": "error" as typeof color[number],
"active": true,
"class": {
"item": "text-error before:bg-error/10",
"itemLeadingIcon": "text-error"
}
}
],
"defaultVariants": {
"size": "md" as typeof size[number]
}
}