torch-glare 2.1.5 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/lib/components/BadgeField.tsx +131 -12
- package/apps/lib/components/ContextMenu.tsx +524 -0
- package/apps/lib/components/DataViews/DataViewsConfigPanel.tsx +1 -1
- package/apps/lib/components/Drawer.tsx +23 -4
- package/apps/lib/components/DropdownMenu.tsx +254 -102
- package/apps/lib/components/SearchableSelect.tsx +308 -0
- package/apps/lib/components/SearchableTable.tsx +363 -0
- package/apps/lib/components/Table.tsx +6 -6
- package/dist/bin/index.js +2 -1
- package/dist/bin/index.js.map +1 -1
- package/docs/components/context-menu.md +455 -0
- package/docs/components/data-views-layout.md +16 -1
- package/docs/components/drawer.md +527 -668
- package/docs/components/dropdown-menu.md +37 -34
- package/docs/components/searchable-select.md +359 -0
- package/docs/components/searchable-table.md +419 -0
- package/docs/reference/tailwind-plugins.md +21 -1
- package/docs/tutorials/getting-started.md +15 -1
- package/package.json +1 -1
|
@@ -16,21 +16,53 @@ const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
|
16
16
|
|
|
17
17
|
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
18
18
|
|
|
19
|
-
const DropdownMenuGroup =
|
|
19
|
+
const DropdownMenuGroup = React.forwardRef<
|
|
20
|
+
React.ElementRef<typeof DropdownMenuPrimitive.Group>,
|
|
21
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group> &
|
|
22
|
+
VariantProps<typeof menuGroupStyles>
|
|
23
|
+
>(({ className, variant = "Boxed", ...props }, ref) => (
|
|
24
|
+
<DropdownMenuPrimitive.Group
|
|
25
|
+
ref={ref}
|
|
26
|
+
className={cn(menuGroupStyles({ variant }), className)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
));
|
|
30
|
+
DropdownMenuGroup.displayName = DropdownMenuPrimitive.Group.displayName;
|
|
20
31
|
|
|
21
32
|
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
22
33
|
|
|
23
34
|
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
24
35
|
|
|
25
|
-
const DropdownMenuRadioGroup =
|
|
36
|
+
const DropdownMenuRadioGroup = React.forwardRef<
|
|
37
|
+
React.ElementRef<typeof DropdownMenuPrimitive.RadioGroup>,
|
|
38
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup> &
|
|
39
|
+
VariantProps<typeof menuGroupStyles>
|
|
40
|
+
>(({ className, variant = "Boxed", ...props }, ref) => (
|
|
41
|
+
<DropdownMenuPrimitive.RadioGroup
|
|
42
|
+
ref={ref}
|
|
43
|
+
className={cn(menuGroupStyles({ variant }), className)}
|
|
44
|
+
{...props}
|
|
45
|
+
/>
|
|
46
|
+
));
|
|
47
|
+
DropdownMenuRadioGroup.displayName =
|
|
48
|
+
DropdownMenuPrimitive.RadioGroup.displayName;
|
|
26
49
|
|
|
27
50
|
const DropdownMenuContent = React.forwardRef<
|
|
28
51
|
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
|
29
52
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> &
|
|
30
|
-
DropdownMenuProps
|
|
53
|
+
DropdownMenuProps & { autoGroup?: boolean }
|
|
31
54
|
>(
|
|
32
55
|
(
|
|
33
|
-
{
|
|
56
|
+
{
|
|
57
|
+
theme,
|
|
58
|
+
className,
|
|
59
|
+
sideOffset = 4,
|
|
60
|
+
variant = "PresentationStyle",
|
|
61
|
+
autoGroup = true,
|
|
62
|
+
collisionPadding = 8,
|
|
63
|
+
children,
|
|
64
|
+
...props
|
|
65
|
+
},
|
|
34
66
|
ref
|
|
35
67
|
) => (
|
|
36
68
|
<DropdownMenuPrimitive.Portal>
|
|
@@ -38,9 +70,18 @@ const DropdownMenuContent = React.forwardRef<
|
|
|
38
70
|
data-theme={theme}
|
|
39
71
|
ref={ref}
|
|
40
72
|
sideOffset={sideOffset}
|
|
41
|
-
|
|
73
|
+
collisionPadding={collisionPadding}
|
|
74
|
+
className={cn(
|
|
75
|
+
menuContentStyles({ variant }),
|
|
76
|
+
// Cap to the space Radix has after collision handling so a tall menu
|
|
77
|
+
// scrolls instead of overflowing off-screen.
|
|
78
|
+
"max-h-[var(--radix-dropdown-menu-content-available-height)]",
|
|
79
|
+
className
|
|
80
|
+
)}
|
|
42
81
|
{...props}
|
|
43
|
-
|
|
82
|
+
>
|
|
83
|
+
{autoGroup ? autoGroupChildren(children) : children}
|
|
84
|
+
</DropdownMenuPrimitive.Content>
|
|
44
85
|
</DropdownMenuPrimitive.Portal>
|
|
45
86
|
)
|
|
46
87
|
);
|
|
@@ -59,7 +100,6 @@ const DropdownMenuSubTrigger = React.forwardRef<
|
|
|
59
100
|
children,
|
|
60
101
|
variant = "Default",
|
|
61
102
|
size = "M",
|
|
62
|
-
disabled,
|
|
63
103
|
...props
|
|
64
104
|
},
|
|
65
105
|
ref
|
|
@@ -67,14 +107,17 @@ const DropdownMenuSubTrigger = React.forwardRef<
|
|
|
67
107
|
<DropdownMenuPrimitive.SubTrigger
|
|
68
108
|
ref={ref}
|
|
69
109
|
className={cn(
|
|
70
|
-
MenuItemStyles({ variant, size
|
|
110
|
+
MenuItemStyles({ variant, size }),
|
|
71
111
|
"justify-between",
|
|
72
112
|
className
|
|
73
113
|
)}
|
|
74
114
|
{...props}
|
|
75
115
|
>
|
|
76
|
-
|
|
77
|
-
|
|
116
|
+
<div className="justify-between"><div className="flex gap-2">
|
|
117
|
+
{children}
|
|
118
|
+
</div>
|
|
119
|
+
<i className="ri-arrow-right-s-line text-[16px] rtl:rotate-180"></i></div>
|
|
120
|
+
|
|
78
121
|
</DropdownMenuPrimitive.SubTrigger>
|
|
79
122
|
)
|
|
80
123
|
);
|
|
@@ -85,14 +128,30 @@ const DropdownMenuSubContent = React.forwardRef<
|
|
|
85
128
|
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
|
|
86
129
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent> & {
|
|
87
130
|
variant?: "PresentationStyle";
|
|
131
|
+
autoGroup?: boolean;
|
|
88
132
|
}
|
|
89
|
-
>(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
133
|
+
>(
|
|
134
|
+
(
|
|
135
|
+
{
|
|
136
|
+
className,
|
|
137
|
+
variant = "PresentationStyle",
|
|
138
|
+
autoGroup = true,
|
|
139
|
+
children,
|
|
140
|
+
...props
|
|
141
|
+
},
|
|
142
|
+
ref
|
|
143
|
+
) => (
|
|
144
|
+
<DropdownMenuPrimitive.Portal>
|
|
145
|
+
<DropdownMenuPrimitive.SubContent
|
|
146
|
+
ref={ref}
|
|
147
|
+
className={cn(menuContentStyles({ variant }), className)}
|
|
148
|
+
{...props}
|
|
149
|
+
>
|
|
150
|
+
{autoGroup ? autoGroupChildren(children) : children}
|
|
151
|
+
</DropdownMenuPrimitive.SubContent>
|
|
152
|
+
</DropdownMenuPrimitive.Portal>
|
|
153
|
+
)
|
|
154
|
+
);
|
|
96
155
|
DropdownMenuSubContent.displayName =
|
|
97
156
|
DropdownMenuPrimitive.SubContent.displayName;
|
|
98
157
|
|
|
@@ -106,9 +165,9 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
106
165
|
{
|
|
107
166
|
className,
|
|
108
167
|
inset,
|
|
168
|
+
children,
|
|
109
169
|
variant = "Default",
|
|
110
170
|
size = "M",
|
|
111
|
-
disabled,
|
|
112
171
|
active,
|
|
113
172
|
...props
|
|
114
173
|
},
|
|
@@ -118,10 +177,12 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
118
177
|
{...props}
|
|
119
178
|
ref={ref}
|
|
120
179
|
className={cn(
|
|
121
|
-
MenuItemStyles({ variant, size,
|
|
180
|
+
MenuItemStyles({ variant, size, active }),
|
|
122
181
|
className
|
|
123
182
|
)}
|
|
124
|
-
|
|
183
|
+
>
|
|
184
|
+
<div >{children}</div>
|
|
185
|
+
</DropdownMenuPrimitive.Item>
|
|
125
186
|
)
|
|
126
187
|
);
|
|
127
188
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
@@ -138,7 +199,7 @@ const DropdownMenuCheckboxItem = React.forwardRef<
|
|
|
138
199
|
checked,
|
|
139
200
|
variant = "Default",
|
|
140
201
|
size = "M",
|
|
141
|
-
|
|
202
|
+
onSelect,
|
|
142
203
|
...props
|
|
143
204
|
},
|
|
144
205
|
ref
|
|
@@ -146,19 +207,37 @@ const DropdownMenuCheckboxItem = React.forwardRef<
|
|
|
146
207
|
<DropdownMenuPrimitive.CheckboxItem
|
|
147
208
|
ref={ref}
|
|
148
209
|
className={cn(
|
|
149
|
-
MenuItemStyles({ variant, size
|
|
150
|
-
"relative
|
|
210
|
+
MenuItemStyles({ variant, size }),
|
|
211
|
+
"relative",
|
|
151
212
|
className
|
|
152
213
|
)}
|
|
153
214
|
checked={checked}
|
|
215
|
+
// Keep the menu open when toggling; preventDefault stops Radix's auto-close.
|
|
216
|
+
onSelect={(event) => {
|
|
217
|
+
event.preventDefault();
|
|
218
|
+
onSelect?.(event);
|
|
219
|
+
}}
|
|
154
220
|
{...props}
|
|
155
221
|
>
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
222
|
+
|
|
223
|
+
<div className="relative flex items-center">
|
|
224
|
+
<span className="h-full flex items-center justify-center">
|
|
225
|
+
{/* Red dot is the default; hidden once the item is checked. */}
|
|
226
|
+
<div className=" flex justify-center items-center h-full [[data-state=checked]_&]:hidden">
|
|
227
|
+
<div className="w-[16px] h-[16px] rounded-[3px] border border-white-alpha-40 bg-black-alpha-15 group-hover:border-white-700 group-hover:bg-black-alpha-075">
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
{/* Blue dot only renders when the item is checked. */}
|
|
232
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
233
|
+
<div className="bg-blue-sparkle-600 flex justify-center items-center w-[16px] h-[16px] rounded-[3px]">
|
|
234
|
+
|
|
235
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
236
|
+
<path d="M5.8339 8.84977L11.1961 3.48755L12.0211 4.3125L5.8339 10.4997L2.12158 6.7874L2.94654 5.96245L5.8339 8.84977Z" fill="#F9F9F9" />
|
|
237
|
+
</svg>
|
|
238
|
+
</div>
|
|
239
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
240
|
+
</span> {children}</div>
|
|
162
241
|
</DropdownMenuPrimitive.CheckboxItem>
|
|
163
242
|
)
|
|
164
243
|
);
|
|
@@ -176,7 +255,7 @@ const DropdownMenuRadioItem = React.forwardRef<
|
|
|
176
255
|
children,
|
|
177
256
|
variant = "Default",
|
|
178
257
|
size = "M",
|
|
179
|
-
|
|
258
|
+
onSelect,
|
|
180
259
|
...props
|
|
181
260
|
},
|
|
182
261
|
ref
|
|
@@ -184,23 +263,82 @@ const DropdownMenuRadioItem = React.forwardRef<
|
|
|
184
263
|
<DropdownMenuPrimitive.RadioItem
|
|
185
264
|
ref={ref}
|
|
186
265
|
className={cn(
|
|
187
|
-
MenuItemStyles({ variant, size
|
|
188
|
-
"relative
|
|
266
|
+
MenuItemStyles({ variant, size }),
|
|
267
|
+
"relative",
|
|
189
268
|
className
|
|
190
269
|
)}
|
|
270
|
+
// Keep the menu open when selecting; preventDefault stops Radix's auto-close.
|
|
271
|
+
onSelect={(event) => {
|
|
272
|
+
event.preventDefault();
|
|
273
|
+
onSelect?.(event);
|
|
274
|
+
}}
|
|
191
275
|
{...props}
|
|
192
276
|
>
|
|
193
|
-
<
|
|
194
|
-
<
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
277
|
+
<div className="relative flex items-center">
|
|
278
|
+
<span className="h-full left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
279
|
+
{/* Red dot is the default; hidden once the item is checked. */}
|
|
280
|
+
<div className=" flex justify-center items-center h-full [[data-state=checked]_&]:hidden">
|
|
281
|
+
<div className="w-[14px] h-[14px] rounded-[100px] border border-white-alpha-40 bg-black-alpha-15 group-hover:border-white-700 group-hover:bg-black-alpha-075">
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
285
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 14" fill="none">
|
|
286
|
+
<rect width="14" height="14" rx="7" fill="#005ECC" />
|
|
287
|
+
<rect x="5" y="5" width="4" height="4" rx="2" fill="white" />
|
|
288
|
+
</svg> </DropdownMenuPrimitive.ItemIndicator>
|
|
289
|
+
</span>
|
|
290
|
+
{children} </div>
|
|
199
291
|
</DropdownMenuPrimitive.RadioItem>
|
|
200
292
|
)
|
|
201
293
|
);
|
|
202
294
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
203
295
|
|
|
296
|
+
// Item types that should be boxed together when sitting loose in the menu.
|
|
297
|
+
// DropdownMenuSub is included because its trigger renders as an inline row
|
|
298
|
+
// (the SubContent is portaled out), so it belongs in the box with the items.
|
|
299
|
+
const GROUPABLE_TYPES = [
|
|
300
|
+
DropdownMenuItem,
|
|
301
|
+
DropdownMenuCheckboxItem,
|
|
302
|
+
DropdownMenuRadioItem,
|
|
303
|
+
DropdownMenuSub,
|
|
304
|
+
] as const;
|
|
305
|
+
|
|
306
|
+
const isGroupable = (child: React.ReactNode): child is React.ReactElement =>
|
|
307
|
+
React.isValidElement(child) &&
|
|
308
|
+
(GROUPABLE_TYPES as readonly React.ElementType[]).includes(
|
|
309
|
+
child.type as React.ElementType
|
|
310
|
+
);
|
|
311
|
+
|
|
312
|
+
// Wraps consecutive runs of loose items in a Boxed DropdownMenuGroup so items
|
|
313
|
+
// render inside a container even when the consumer doesn't write one. Labels,
|
|
314
|
+
// separators and explicit groups act as boundaries and pass through unchanged.
|
|
315
|
+
function autoGroupChildren(children: React.ReactNode): React.ReactNode {
|
|
316
|
+
const out: React.ReactNode[] = [];
|
|
317
|
+
let run: React.ReactElement[] = [];
|
|
318
|
+
|
|
319
|
+
const flush = (key: string) => {
|
|
320
|
+
if (run.length === 0) return;
|
|
321
|
+
out.push(
|
|
322
|
+
<DropdownMenuGroup key={key} variant="Boxed">
|
|
323
|
+
{run}
|
|
324
|
+
</DropdownMenuGroup>
|
|
325
|
+
);
|
|
326
|
+
run = [];
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
React.Children.toArray(children).forEach((child, index) => {
|
|
330
|
+
if (isGroupable(child)) {
|
|
331
|
+
run.push(child);
|
|
332
|
+
} else {
|
|
333
|
+
flush(`auto-group-${index}`);
|
|
334
|
+
out.push(child);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
flush("auto-group-last");
|
|
338
|
+
|
|
339
|
+
return out;
|
|
340
|
+
}
|
|
341
|
+
|
|
204
342
|
const DropdownMenuLabel = React.forwardRef<
|
|
205
343
|
React.ElementRef<typeof DropdownMenuPrimitive.Label>,
|
|
206
344
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
|
|
@@ -210,7 +348,7 @@ const DropdownMenuLabel = React.forwardRef<
|
|
|
210
348
|
<DropdownMenuPrimitive.Label
|
|
211
349
|
ref={ref}
|
|
212
350
|
className={cn(
|
|
213
|
-
"text-content-presentation-
|
|
351
|
+
"text-content-presentation-global-primary-light typography-body-small-medium px-[12px] pt-1 flex justify-start items-center",
|
|
214
352
|
className
|
|
215
353
|
)}
|
|
216
354
|
{...props}
|
|
@@ -218,28 +356,13 @@ const DropdownMenuLabel = React.forwardRef<
|
|
|
218
356
|
));
|
|
219
357
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
220
358
|
|
|
221
|
-
const DropdownMenuSeparator = React.forwardRef<
|
|
222
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
|
|
223
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
|
|
224
|
-
>(({ className, ...props }, ref) => (
|
|
225
|
-
<DropdownMenuPrimitive.Separator
|
|
226
|
-
ref={ref}
|
|
227
|
-
className={cn(
|
|
228
|
-
"mx-[8px] my-[4px] border-b border-b-border-presentation-action-disabled flex-1",
|
|
229
|
-
className
|
|
230
|
-
)}
|
|
231
|
-
{...props}
|
|
232
|
-
/>
|
|
233
|
-
));
|
|
234
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
235
|
-
|
|
236
359
|
const DropdownMenuShortcut = ({
|
|
237
360
|
className,
|
|
238
361
|
...props
|
|
239
362
|
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
240
363
|
return (
|
|
241
364
|
<span
|
|
242
|
-
className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
|
|
365
|
+
className={cn("ltr:ml-auto rtl:mr-auto rtl:ml-0 text-xs tracking-widest opacity-60", className)}
|
|
243
366
|
{...props}
|
|
244
367
|
/>
|
|
245
368
|
);
|
|
@@ -259,119 +382,134 @@ export {
|
|
|
259
382
|
DropdownMenuCheckboxItem,
|
|
260
383
|
DropdownMenuRadioItem,
|
|
261
384
|
DropdownMenuLabel,
|
|
262
|
-
DropdownMenuSeparator,
|
|
263
385
|
DropdownMenuShortcut,
|
|
264
386
|
DropdownMenuItem,
|
|
265
387
|
};
|
|
266
388
|
|
|
267
|
-
|
|
389
|
+
// Also export the styling under the historical names so existing imports
|
|
390
|
+
// (e.g. `import { dropdownMenuStyles } from "./DropdownMenu"`) keep working.
|
|
391
|
+
export { menuContentStyles as dropdownMenuStyles };
|
|
392
|
+
export { menuGroupStyles as dropdownMenuGroupStyles };
|
|
268
393
|
|
|
269
394
|
export const MenuItemStyles = cva(
|
|
270
395
|
[
|
|
271
|
-
"text-content-presentation-
|
|
396
|
+
"text-content-presentation-global-primary-light typography-body-medium-regular",
|
|
272
397
|
"outline-none",
|
|
273
398
|
"border",
|
|
274
399
|
"border-transparent",
|
|
275
400
|
"flex",
|
|
276
|
-
"gap-[8px]",
|
|
277
401
|
"items-center",
|
|
278
402
|
"justify-start",
|
|
279
403
|
"text-overflow",
|
|
280
404
|
"overflow-hidden",
|
|
281
|
-
"
|
|
282
|
-
"rounded-[4px]",
|
|
405
|
+
"p-[2px]",
|
|
283
406
|
"transition-all",
|
|
407
|
+
"bg-[rgba(184,192,204,0.36)]",
|
|
284
408
|
"ease-in-out",
|
|
285
409
|
"duration-300",
|
|
286
|
-
|
|
410
|
+
"[&>div]:flex",
|
|
411
|
+
"[&>div]:px-[12px]",
|
|
412
|
+
"[&>div]:py-[4px]",
|
|
413
|
+
"[&>div]:gap-2",
|
|
414
|
+
"[&>div]:w-full",
|
|
415
|
+
"[&>div]:rounded-[8px]",
|
|
416
|
+
"[&>div]:items-center ",
|
|
417
|
+
"group",
|
|
287
418
|
],
|
|
288
419
|
{
|
|
289
420
|
variants: {
|
|
290
421
|
variant: {
|
|
291
422
|
Default: [
|
|
292
|
-
"text-content-presentation-
|
|
293
|
-
"bg-
|
|
294
|
-
"hover:
|
|
295
|
-
"
|
|
296
|
-
"
|
|
297
|
-
"
|
|
298
|
-
"disabled:
|
|
299
|
-
|
|
423
|
+
"text-content-presentation-global-primary-light",
|
|
424
|
+
"[&>div]:hover:bg-white-50 [&>div]:hover:shadow-[0_0_16px_0_rgba(0,0,0,0.36)]",
|
|
425
|
+
"[&>div]:hover:text-black-1000",
|
|
426
|
+
"[&[data-highlighted]>div]:bg-white-alpha-75",
|
|
427
|
+
"[&[data-highlighted]>div]:text-black-1000",
|
|
428
|
+
"[&[data-disabled]>div]:text-content-presentation-global-primary-light",
|
|
429
|
+
"[&[data-disabled]>div]:opacity-50",
|
|
430
|
+
// Disabled items are pointer-events:none by default (Radix), so
|
|
431
|
+
// re-enable them to allow hover styling without making them selectable.
|
|
432
|
+
"[&[data-disabled]]:pointer-events-auto",
|
|
433
|
+
"[&[data-disabled]>div]:hover:text-content-presentation-global-primary-light",
|
|
434
|
+
"[&[data-disabled]>div]:hover:bg-transparent",
|
|
435
|
+
"[&[data-disabled]>div]:hover:shadow-none",
|
|
300
436
|
],
|
|
301
|
-
|
|
302
|
-
"text-
|
|
303
|
-
"hover:bg-
|
|
304
|
-
"
|
|
305
|
-
"
|
|
306
|
-
"
|
|
437
|
+
info: [
|
|
438
|
+
"text-blue-sparkle-200",
|
|
439
|
+
"[&>div]:hover:bg-white-50 [&>div]:hover:shadow-[0_0_16px_0_rgba(0,0,0,0.36)]",
|
|
440
|
+
"[&>div]:hover:text-blue-sparkle-700",
|
|
441
|
+
"[&[data-highlighted]>div]:bg-white-alpha-75",
|
|
442
|
+
"[&[data-highlighted]>div]:text-blue-sparkle-700",
|
|
443
|
+
"[&[data-disabled]>div]:text-content-presentation-global-primary-light",
|
|
444
|
+
"[&[data-disabled]>div]:opacity-50",
|
|
445
|
+
"[&[data-disabled]]:pointer-events-auto",
|
|
446
|
+
"[&[data-disabled]>div]:hover:text-content-presentation-global-primary-light",
|
|
447
|
+
"[&[data-disabled]>div]:hover:bg-transparent",
|
|
448
|
+
"[&[data-disabled]>div]:hover:shadow-none",
|
|
307
449
|
],
|
|
308
450
|
Negative: [
|
|
309
|
-
"text-
|
|
310
|
-
"hover:bg-
|
|
311
|
-
"hover:text-
|
|
312
|
-
"
|
|
313
|
-
"
|
|
314
|
-
"
|
|
451
|
+
"text-medium-red-200",
|
|
452
|
+
"[&>div]:hover:bg-white-50 [&>div]:hover:shadow-[0_0_16px_0_rgba(0,0,0,0.36)]",
|
|
453
|
+
"[&>div]:hover:text-medium-red-600",
|
|
454
|
+
"[&[data-highlighted]>div]:bg-white-alpha-75",
|
|
455
|
+
"[&[data-highlighted]>div]:text-medium-red-600",
|
|
456
|
+
"[&[data-disabled]>div]:text-content-presentation-global-primary-light",
|
|
457
|
+
"[&[data-disabled]>div]:opacity-50",
|
|
458
|
+
"[&[data-disabled]]:pointer-events-auto",
|
|
459
|
+
"[&[data-disabled]>div]:hover:text-content-presentation-global-primary-light",
|
|
460
|
+
"[&[data-disabled]>div]:hover:bg-transparent",
|
|
461
|
+
"[&[data-disabled]>div]:hover:shadow-none",
|
|
315
462
|
],
|
|
316
463
|
},
|
|
317
464
|
size: {
|
|
318
465
|
S: ["typography-body-small-regular", "h-[24px]"],
|
|
319
466
|
M: ["typography-body-medium-regular", "h-[32px]"],
|
|
320
467
|
},
|
|
321
|
-
|
|
322
|
-
disabled: {
|
|
323
|
-
true: [
|
|
324
|
-
"text-content-presentation-state-disabled",
|
|
325
|
-
"bg-white-00",
|
|
326
|
-
],
|
|
327
|
-
},
|
|
328
|
-
|
|
329
468
|
active: {
|
|
330
469
|
true: [
|
|
331
470
|
"bg-background-presentation-action-selected",
|
|
332
471
|
"text-content-presentation-action-light-primary",
|
|
333
472
|
],
|
|
334
473
|
},
|
|
335
|
-
|
|
336
474
|
defaultVariants: {
|
|
337
475
|
variant: "Default",
|
|
338
476
|
size: "M",
|
|
339
477
|
active: false,
|
|
340
|
-
disabled: false,
|
|
341
478
|
},
|
|
342
479
|
},
|
|
343
480
|
compoundVariants: [
|
|
344
481
|
{
|
|
345
482
|
active: true,
|
|
346
|
-
variant: "
|
|
483
|
+
variant: "info",
|
|
347
484
|
className: ["text-content-presentation-state-negative"],
|
|
348
485
|
},
|
|
349
486
|
],
|
|
350
487
|
}
|
|
351
488
|
);
|
|
352
|
-
|
|
489
|
+
|
|
490
|
+
export const menuContentStyles = cva(
|
|
353
491
|
[
|
|
354
492
|
"p-1",
|
|
355
|
-
"rounded-[
|
|
356
|
-
"border",
|
|
357
|
-
"max-h-[200px]",
|
|
493
|
+
"rounded-[14px]",
|
|
358
494
|
"min-w-[240px]",
|
|
359
495
|
"outline-none",
|
|
360
496
|
"overflow-scroll",
|
|
497
|
+
// Only animate the OPEN (enter) state. An exit animation on [data-state=closed]
|
|
498
|
+
// holds the old DOM node during close, which breaks the context menu's
|
|
499
|
+
// close/reposition on a second right-click (Radix issue #2572).
|
|
361
500
|
"data-[state=open]:animate-in",
|
|
362
|
-
"data-[state=closed]:animate-out",
|
|
363
|
-
"data-[state=closed]:fade-out-0",
|
|
364
501
|
"data-[state=open]:fade-in-0",
|
|
365
502
|
"overflow-x-hidden",
|
|
366
503
|
"scrollbar-hide",
|
|
504
|
+
"backdrop-blur-[21px]",
|
|
505
|
+
"flex gap-1 flex-col",
|
|
367
506
|
],
|
|
368
507
|
{
|
|
369
508
|
variants: {
|
|
370
509
|
variant: {
|
|
371
510
|
PresentationStyle: [
|
|
372
|
-
"
|
|
373
|
-
"
|
|
374
|
-
"shadow-[0px_0px_10px_0px_rgba(0,0,0,0.4),0px_4px_4px_0px_rgba(0,0,0,0.2)]",
|
|
511
|
+
"bg-[rgba(61,64,69,0.72)]",
|
|
512
|
+
"shadow-[0_0_32px_2px_rgba(0,0,0,0.20),0_0_48px_2px_rgba(0,0,0,0.05)]",
|
|
375
513
|
],
|
|
376
514
|
},
|
|
377
515
|
defaultVariants: {
|
|
@@ -380,3 +518,17 @@ export const dropdownMenuStyles = cva(
|
|
|
380
518
|
},
|
|
381
519
|
}
|
|
382
520
|
);
|
|
521
|
+
|
|
522
|
+
export const menuGroupStyles = cva(["flex", "flex-col"], {
|
|
523
|
+
variants: {
|
|
524
|
+
variant: {
|
|
525
|
+
// Visually contains its items in a bordered card.
|
|
526
|
+
Boxed: ["gap-[1px]", "rounded-[10px]", "bg-bldue-500", "overflow-hidden"],
|
|
527
|
+
// No container — semantic grouping only (Radix default behavior).
|
|
528
|
+
Plain: [],
|
|
529
|
+
},
|
|
530
|
+
},
|
|
531
|
+
defaultVariants: {
|
|
532
|
+
variant: "Boxed",
|
|
533
|
+
},
|
|
534
|
+
});
|