@vuer-ai/vuer-uikit 0.0.29 → 0.0.30
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/package.json +1 -1
- package/src/ui/select.tsx +35 -6
package/package.json
CHANGED
package/src/ui/select.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
3
|
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
4
|
-
import React, { type ComponentProps, ReactNode } from "react";
|
|
4
|
+
import React, { type ComponentProps, type ReactNode } from "react";
|
|
5
5
|
|
|
6
6
|
import { cn, createClientOnlyComponent } from "../hooks";
|
|
7
7
|
|
|
@@ -13,8 +13,10 @@ export function SelectFallback({ ...props }: ComponentProps<"div">) {
|
|
|
13
13
|
return <div data-slot="select" {...props} />;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
// @typescript-eslint/no-unused-vars
|
|
17
|
+
export const Select = createClientOnlyComponent(SelectRoot, SelectFallback) as React.ComponentType<
|
|
18
|
+
ComponentProps<typeof SelectPrimitive.Root>
|
|
19
|
+
>;
|
|
18
20
|
|
|
19
21
|
export function SelectGroupRoot({
|
|
20
22
|
className,
|
|
@@ -43,6 +45,7 @@ export function SelectValueFallback({ ...props }: ComponentProps<"span">) {
|
|
|
43
45
|
return <span data-slot="select-value" {...props} />;
|
|
44
46
|
}
|
|
45
47
|
|
|
48
|
+
// @typescript-eslint/no-unused-vars
|
|
46
49
|
export const SelectValue = createClientOnlyComponent(SelectValueRoot, SelectValueFallback);
|
|
47
50
|
|
|
48
51
|
export const selectTriggerVariants = cva(
|
|
@@ -337,8 +340,10 @@ export function SelectItemFallback({
|
|
|
337
340
|
prefix,
|
|
338
341
|
suffix,
|
|
339
342
|
disabled,
|
|
343
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
344
|
+
value,
|
|
340
345
|
...props
|
|
341
|
-
}:
|
|
346
|
+
}: SelectItemProps & ComponentProps<"div">) {
|
|
342
347
|
return (
|
|
343
348
|
<div
|
|
344
349
|
data-slot="select-item"
|
|
@@ -358,18 +363,42 @@ export function SelectItemFallback({
|
|
|
358
363
|
"outline-hidden",
|
|
359
364
|
"select-none",
|
|
360
365
|
"focus:bg-bg-secondary",
|
|
366
|
+
disabled && "text-bg-quaternary pointer-events-none",
|
|
361
367
|
],
|
|
362
368
|
className,
|
|
363
369
|
)}
|
|
364
370
|
{...props}
|
|
365
371
|
>
|
|
366
|
-
<p
|
|
372
|
+
<p
|
|
373
|
+
className={cn([
|
|
374
|
+
"text-text-tertiary",
|
|
375
|
+
"flex",
|
|
376
|
+
"shrink-0",
|
|
377
|
+
"gap-0.5",
|
|
378
|
+
disabled && "text-bg-quaternary",
|
|
379
|
+
])}
|
|
380
|
+
>
|
|
381
|
+
{prefix}
|
|
382
|
+
</p>
|
|
367
383
|
<span>{children}</span>
|
|
368
|
-
<p
|
|
384
|
+
<p
|
|
385
|
+
className={cn(
|
|
386
|
+
"text-text-tertiary",
|
|
387
|
+
"ml-auto",
|
|
388
|
+
"flex",
|
|
389
|
+
"shrink-0",
|
|
390
|
+
"gap-0.5",
|
|
391
|
+
disabled && "text-bg-quaternary",
|
|
392
|
+
)}
|
|
393
|
+
>
|
|
394
|
+
{suffix}
|
|
395
|
+
</p>
|
|
369
396
|
</div>
|
|
370
397
|
);
|
|
371
398
|
}
|
|
372
399
|
|
|
400
|
+
// @typescript-eslint/no-unused-vars
|
|
401
|
+
// @ts-expect-error - SelectItemRoot and SelectItemFallback have different prop requirements by design
|
|
373
402
|
export const SelectItem = createClientOnlyComponent(SelectItemRoot, SelectItemFallback);
|
|
374
403
|
|
|
375
404
|
export function SelectSeparatorRoot({
|