@blips/ui 0.0.1 → 2.0.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/dist/index.cjs +4308 -2010
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +435 -411
- package/dist/index.d.ts +435 -411
- package/dist/index.js +4244 -2008
- package/dist/index.js.map +1 -1
- package/package.json +18 -4
- package/src/components/accordion.tsx +58 -48
- package/src/components/alert-dialog.tsx +170 -112
- package/src/components/alert.tsx +49 -42
- package/src/components/aspect-ratio.tsx +9 -3
- package/src/components/avatar.tsx +109 -50
- package/src/components/badge.tsx +29 -17
- package/src/components/breadcrumb.tsx +81 -87
- package/src/components/button-group.tsx +83 -0
- package/src/components/button.tsx +40 -32
- package/src/components/calendar.tsx +49 -45
- package/src/components/card.tsx +77 -71
- package/src/components/carousel.tsx +150 -168
- package/src/components/chart.tsx +357 -0
- package/src/components/checkbox.tsx +28 -24
- package/src/components/collapsible.tsx +28 -6
- package/src/components/command.tsx +144 -110
- package/src/components/context-menu.tsx +220 -166
- package/src/components/dialog.tsx +131 -95
- package/src/components/drawer.tsx +105 -86
- package/src/components/dropdown-menu.tsx +234 -177
- package/src/components/form.tsx +167 -0
- package/src/components/hover-card.tsx +39 -22
- package/src/components/input-group.tsx +175 -0
- package/src/components/input-otp.tsx +56 -48
- package/src/components/input.tsx +18 -19
- package/src/components/kbd.tsx +28 -0
- package/src/components/label.tsx +20 -22
- package/src/components/menubar.tsx +221 -199
- package/src/components/navigation-menu.tsx +144 -102
- package/src/components/pagination.tsx +102 -91
- package/src/components/popover.tsx +86 -26
- package/src/components/progress.tsx +27 -24
- package/src/components/radio-group.tsx +28 -25
- package/src/components/resizable.tsx +42 -34
- package/src/components/scroll-area.tsx +54 -42
- package/src/components/select.tsx +165 -135
- package/src/components/separator.tsx +16 -17
- package/src/components/sheet.tsx +116 -113
- package/src/components/sidebar.tsx +726 -0
- package/src/components/skeleton.tsx +6 -8
- package/src/components/slider.tsx +60 -23
- package/src/components/sonner.tsx +25 -30
- package/src/components/spinner.tsx +16 -0
- package/src/components/switch.tsx +30 -22
- package/src/components/table.tsx +96 -97
- package/src/components/tabs.tsx +91 -53
- package/src/components/textarea.tsx +8 -12
- package/src/components/toggle-group.tsx +60 -37
- package/src/components/toggle.tsx +28 -24
- package/src/components/tooltip.tsx +50 -23
- package/src/globals.css +230 -68
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/index.ts +105 -6
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress"
|
|
5
5
|
|
|
6
|
-
import { cn } from "../lib/utils"
|
|
6
|
+
import { cn } from "../lib/utils"
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
className
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
))
|
|
26
|
-
|
|
8
|
+
function Progress({
|
|
9
|
+
className,
|
|
10
|
+
value,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof ProgressPrimitive.Root>) {
|
|
13
|
+
return (
|
|
14
|
+
<ProgressPrimitive.Root
|
|
15
|
+
data-slot="progress"
|
|
16
|
+
className={cn(
|
|
17
|
+
"relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
>
|
|
22
|
+
<ProgressPrimitive.Indicator
|
|
23
|
+
data-slot="progress-indicator"
|
|
24
|
+
className="h-full w-full flex-1 bg-primary transition-all"
|
|
25
|
+
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
26
|
+
/>
|
|
27
|
+
</ProgressPrimitive.Root>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
27
30
|
|
|
28
|
-
export { Progress }
|
|
31
|
+
export { Progress }
|
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
import { Circle } from "lucide-react";
|
|
3
|
-
import * as React from "react";
|
|
1
|
+
"use client"
|
|
4
2
|
|
|
5
|
-
import
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Circle } from "@phosphor-icons/react"
|
|
5
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { cn } from "../lib/utils"
|
|
8
|
+
|
|
9
|
+
function RadioGroup({
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
|
|
11
13
|
return (
|
|
12
14
|
<RadioGroupPrimitive.Root
|
|
13
|
-
|
|
15
|
+
data-slot="radio-group"
|
|
16
|
+
className={cn("grid gap-3", className)}
|
|
14
17
|
{...props}
|
|
15
|
-
ref={ref}
|
|
16
18
|
/>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
19
|
+
)
|
|
20
|
+
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
function RadioGroupItem({
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
|
|
25
26
|
return (
|
|
26
27
|
<RadioGroupPrimitive.Item
|
|
27
|
-
|
|
28
|
+
data-slot="radio-group-item"
|
|
28
29
|
className={cn(
|
|
29
|
-
"aspect-square
|
|
30
|
+
"aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
30
31
|
className
|
|
31
32
|
)}
|
|
32
33
|
{...props}
|
|
33
34
|
>
|
|
34
|
-
<RadioGroupPrimitive.Indicator
|
|
35
|
-
|
|
35
|
+
<RadioGroupPrimitive.Indicator
|
|
36
|
+
data-slot="radio-group-indicator"
|
|
37
|
+
className="relative flex items-center justify-center"
|
|
38
|
+
>
|
|
39
|
+
<Circle className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary" />
|
|
36
40
|
</RadioGroupPrimitive.Indicator>
|
|
37
41
|
</RadioGroupPrimitive.Item>
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
42
|
+
)
|
|
43
|
+
}
|
|
41
44
|
|
|
42
|
-
export { RadioGroup, RadioGroupItem }
|
|
45
|
+
export { RadioGroup, RadioGroupItem }
|
|
@@ -1,45 +1,53 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { DotsSixVertical } from "@phosphor-icons/react"
|
|
4
|
+
import * as ResizablePrimitive from "react-resizable-panels"
|
|
5
5
|
|
|
6
|
-
import { cn } from "../lib/utils"
|
|
6
|
+
import { cn } from "../lib/utils"
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
function ResizablePanelGroup({
|
|
9
9
|
className,
|
|
10
10
|
...props
|
|
11
|
-
}:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
className
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
}: ResizablePrimitive.GroupProps) {
|
|
12
|
+
return (
|
|
13
|
+
<ResizablePrimitive.Group
|
|
14
|
+
data-slot="resizable-panel-group"
|
|
15
|
+
className={cn(
|
|
16
|
+
"flex h-full w-full aria-[orientation=vertical]:flex-col",
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps) {
|
|
25
|
+
return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />
|
|
26
|
+
}
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
function ResizableHandle({
|
|
24
29
|
withHandle,
|
|
25
30
|
className,
|
|
26
31
|
...props
|
|
27
|
-
}:
|
|
28
|
-
withHandle?: boolean
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
className
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
)
|
|
32
|
+
}: ResizablePrimitive.SeparatorProps & {
|
|
33
|
+
withHandle?: boolean
|
|
34
|
+
}) {
|
|
35
|
+
return (
|
|
36
|
+
<ResizablePrimitive.Separator
|
|
37
|
+
data-slot="resizable-handle"
|
|
38
|
+
className={cn(
|
|
39
|
+
"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
>
|
|
44
|
+
{withHandle && (
|
|
45
|
+
<div className="z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border">
|
|
46
|
+
<DotsSixVertical className="size-2.5" />
|
|
47
|
+
</div>
|
|
48
|
+
)}
|
|
49
|
+
</ResizablePrimitive.Separator>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
44
52
|
|
|
45
|
-
export {
|
|
53
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup }
|
|
@@ -1,46 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from "react";
|
|
1
|
+
"use client"
|
|
3
2
|
|
|
4
|
-
import
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
|
8
|
-
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
|
9
|
-
>(({ className, children, ...props }, ref) => (
|
|
10
|
-
<ScrollAreaPrimitive.Root
|
|
11
|
-
ref={ref}
|
|
12
|
-
className={cn("relative overflow-hidden", className)}
|
|
13
|
-
{...props}
|
|
14
|
-
>
|
|
15
|
-
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
|
|
16
|
-
{children}
|
|
17
|
-
</ScrollAreaPrimitive.Viewport>
|
|
18
|
-
<ScrollBar />
|
|
19
|
-
<ScrollAreaPrimitive.Corner />
|
|
20
|
-
</ScrollAreaPrimitive.Root>
|
|
21
|
-
));
|
|
22
|
-
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
6
|
+
import { cn } from "../lib/utils"
|
|
23
7
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
8
|
+
function ScrollArea({
|
|
9
|
+
className,
|
|
10
|
+
children,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
|
|
13
|
+
return (
|
|
14
|
+
<ScrollAreaPrimitive.Root
|
|
15
|
+
data-slot="scroll-area"
|
|
16
|
+
className={cn("relative", className)}
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
<ScrollAreaPrimitive.Viewport
|
|
20
|
+
data-slot="scroll-area-viewport"
|
|
21
|
+
className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1"
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</ScrollAreaPrimitive.Viewport>
|
|
25
|
+
<ScrollBar />
|
|
26
|
+
<ScrollAreaPrimitive.Corner />
|
|
27
|
+
</ScrollAreaPrimitive.Root>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
45
30
|
|
|
46
|
-
|
|
31
|
+
function ScrollBar({
|
|
32
|
+
className,
|
|
33
|
+
orientation = "vertical",
|
|
34
|
+
...props
|
|
35
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
|
|
36
|
+
return (
|
|
37
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
38
|
+
data-slot="scroll-area-scrollbar"
|
|
39
|
+
orientation={orientation}
|
|
40
|
+
className={cn(
|
|
41
|
+
"flex touch-none p-px transition-colors select-none",
|
|
42
|
+
orientation === "vertical" &&
|
|
43
|
+
"h-full w-2.5 border-l border-l-transparent",
|
|
44
|
+
orientation === "horizontal" &&
|
|
45
|
+
"h-2.5 flex-col border-t border-t-transparent",
|
|
46
|
+
className
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
>
|
|
50
|
+
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
51
|
+
data-slot="scroll-area-thumb"
|
|
52
|
+
className="relative flex-1 rounded-full bg-border"
|
|
53
|
+
/>
|
|
54
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { ScrollArea, ScrollBar }
|
|
@@ -1,160 +1,190 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import { Check,
|
|
5
|
-
import * as
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Check, CaretDown, CaretUp } from "@phosphor-icons/react"
|
|
5
|
+
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
6
6
|
|
|
7
|
-
import { cn } from "../lib/utils"
|
|
7
|
+
import { cn } from "../lib/utils"
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function Select({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
12
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
13
|
+
}
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
function SelectGroup({
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
18
|
+
return <SelectPrimitive.Group data-slot="select-group" {...props} />
|
|
19
|
+
}
|
|
12
20
|
|
|
13
|
-
|
|
21
|
+
function SelectValue({
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
24
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
25
|
+
}
|
|
14
26
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{children}
|
|
28
|
-
<SelectPrimitive.Icon asChild>
|
|
29
|
-
<ChevronDown className="h-4 w-4 opacity-50" />
|
|
30
|
-
</SelectPrimitive.Icon>
|
|
31
|
-
</SelectPrimitive.Trigger>
|
|
32
|
-
));
|
|
33
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
34
|
-
|
|
35
|
-
const SelectScrollUpButton = React.forwardRef<
|
|
36
|
-
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
37
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
38
|
-
>(({ className, ...props }, ref) => (
|
|
39
|
-
<SelectPrimitive.ScrollUpButton
|
|
40
|
-
ref={ref}
|
|
41
|
-
className={cn(
|
|
42
|
-
"flex cursor-default items-center justify-center py-1",
|
|
43
|
-
className
|
|
44
|
-
)}
|
|
45
|
-
{...props}
|
|
46
|
-
>
|
|
47
|
-
<ChevronUp className="h-4 w-4" />
|
|
48
|
-
</SelectPrimitive.ScrollUpButton>
|
|
49
|
-
));
|
|
50
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
51
|
-
|
|
52
|
-
const SelectScrollDownButton = React.forwardRef<
|
|
53
|
-
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
54
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
55
|
-
>(({ className, ...props }, ref) => (
|
|
56
|
-
<SelectPrimitive.ScrollDownButton
|
|
57
|
-
ref={ref}
|
|
58
|
-
className={cn(
|
|
59
|
-
"flex cursor-default items-center justify-center py-1",
|
|
60
|
-
className
|
|
61
|
-
)}
|
|
62
|
-
{...props}
|
|
63
|
-
>
|
|
64
|
-
<ChevronDown className="h-4 w-4" />
|
|
65
|
-
</SelectPrimitive.ScrollDownButton>
|
|
66
|
-
));
|
|
67
|
-
SelectScrollDownButton.displayName =
|
|
68
|
-
SelectPrimitive.ScrollDownButton.displayName;
|
|
69
|
-
|
|
70
|
-
const SelectContent = React.forwardRef<
|
|
71
|
-
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
72
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
73
|
-
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
74
|
-
<SelectPrimitive.Portal>
|
|
75
|
-
<SelectPrimitive.Content
|
|
76
|
-
ref={ref}
|
|
27
|
+
function SelectTrigger({
|
|
28
|
+
className,
|
|
29
|
+
size = "default",
|
|
30
|
+
children,
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
33
|
+
size?: "sm" | "default"
|
|
34
|
+
}) {
|
|
35
|
+
return (
|
|
36
|
+
<SelectPrimitive.Trigger
|
|
37
|
+
data-slot="select-trigger"
|
|
38
|
+
data-size={size}
|
|
77
39
|
className={cn(
|
|
78
|
-
"
|
|
79
|
-
position === "popper" &&
|
|
80
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
40
|
+
"flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
81
41
|
className
|
|
82
42
|
)}
|
|
83
|
-
position={position}
|
|
84
43
|
{...props}
|
|
85
44
|
>
|
|
86
|
-
|
|
87
|
-
<SelectPrimitive.
|
|
45
|
+
{children}
|
|
46
|
+
<SelectPrimitive.Icon asChild>
|
|
47
|
+
<CaretDown className="size-4 opacity-50" />
|
|
48
|
+
</SelectPrimitive.Icon>
|
|
49
|
+
</SelectPrimitive.Trigger>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function SelectContent({
|
|
54
|
+
className,
|
|
55
|
+
children,
|
|
56
|
+
position = "item-aligned",
|
|
57
|
+
align = "center",
|
|
58
|
+
...props
|
|
59
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
60
|
+
return (
|
|
61
|
+
<SelectPrimitive.Portal>
|
|
62
|
+
<SelectPrimitive.Content
|
|
63
|
+
data-slot="select-content"
|
|
88
64
|
className={cn(
|
|
89
|
-
"
|
|
65
|
+
"relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
90
66
|
position === "popper" &&
|
|
91
|
-
"
|
|
67
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
68
|
+
className
|
|
92
69
|
)}
|
|
70
|
+
position={position}
|
|
71
|
+
align={align}
|
|
72
|
+
{...props}
|
|
93
73
|
>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
))
|
|
100
|
-
|
|
74
|
+
<SelectScrollUpButton />
|
|
75
|
+
<SelectPrimitive.Viewport
|
|
76
|
+
className={cn(
|
|
77
|
+
"p-1",
|
|
78
|
+
position === "popper" &&
|
|
79
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
80
|
+
)}
|
|
81
|
+
>
|
|
82
|
+
{children}
|
|
83
|
+
</SelectPrimitive.Viewport>
|
|
84
|
+
<SelectScrollDownButton />
|
|
85
|
+
</SelectPrimitive.Content>
|
|
86
|
+
</SelectPrimitive.Portal>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
101
89
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
90
|
+
function SelectLabel({
|
|
91
|
+
className,
|
|
92
|
+
...props
|
|
93
|
+
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
94
|
+
return (
|
|
95
|
+
<SelectPrimitive.Label
|
|
96
|
+
data-slot="select-label"
|
|
97
|
+
className={cn("px-2 py-1.5 text-xs text-muted-foreground", className)}
|
|
98
|
+
{...props}
|
|
99
|
+
/>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
113
102
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
"
|
|
122
|
-
className
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
103
|
+
function SelectItem({
|
|
104
|
+
className,
|
|
105
|
+
children,
|
|
106
|
+
...props
|
|
107
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
108
|
+
return (
|
|
109
|
+
<SelectPrimitive.Item
|
|
110
|
+
data-slot="select-item"
|
|
111
|
+
className={cn(
|
|
112
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
113
|
+
className
|
|
114
|
+
)}
|
|
115
|
+
{...props}
|
|
116
|
+
>
|
|
117
|
+
<span
|
|
118
|
+
data-slot="select-item-indicator"
|
|
119
|
+
className="absolute right-2 flex size-3.5 items-center justify-center"
|
|
120
|
+
>
|
|
121
|
+
<SelectPrimitive.ItemIndicator>
|
|
122
|
+
<Check className="size-4" />
|
|
123
|
+
</SelectPrimitive.ItemIndicator>
|
|
124
|
+
</span>
|
|
125
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
126
|
+
</SelectPrimitive.Item>
|
|
127
|
+
)
|
|
128
|
+
}
|
|
131
129
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
130
|
+
function SelectSeparator({
|
|
131
|
+
className,
|
|
132
|
+
...props
|
|
133
|
+
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
134
|
+
return (
|
|
135
|
+
<SelectPrimitive.Separator
|
|
136
|
+
data-slot="select-separator"
|
|
137
|
+
className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
|
|
138
|
+
{...props}
|
|
139
|
+
/>
|
|
140
|
+
)
|
|
141
|
+
}
|
|
136
142
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
143
|
+
function SelectScrollUpButton({
|
|
144
|
+
className,
|
|
145
|
+
...props
|
|
146
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
147
|
+
return (
|
|
148
|
+
<SelectPrimitive.ScrollUpButton
|
|
149
|
+
data-slot="select-scroll-up-button"
|
|
150
|
+
className={cn(
|
|
151
|
+
"flex cursor-default items-center justify-center py-1",
|
|
152
|
+
className
|
|
153
|
+
)}
|
|
154
|
+
{...props}
|
|
155
|
+
>
|
|
156
|
+
<CaretUp className="size-4" />
|
|
157
|
+
</SelectPrimitive.ScrollUpButton>
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function SelectScrollDownButton({
|
|
162
|
+
className,
|
|
163
|
+
...props
|
|
164
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
165
|
+
return (
|
|
166
|
+
<SelectPrimitive.ScrollDownButton
|
|
167
|
+
data-slot="select-scroll-down-button"
|
|
168
|
+
className={cn(
|
|
169
|
+
"flex cursor-default items-center justify-center py-1",
|
|
170
|
+
className
|
|
171
|
+
)}
|
|
172
|
+
{...props}
|
|
173
|
+
>
|
|
174
|
+
<CaretDown className="size-4" />
|
|
175
|
+
</SelectPrimitive.ScrollDownButton>
|
|
176
|
+
)
|
|
177
|
+
}
|
|
148
178
|
|
|
149
179
|
export {
|
|
150
180
|
Select,
|
|
151
|
-
SelectGroup,
|
|
152
|
-
SelectValue,
|
|
153
|
-
SelectTrigger,
|
|
154
181
|
SelectContent,
|
|
155
|
-
|
|
182
|
+
SelectGroup,
|
|
156
183
|
SelectItem,
|
|
157
|
-
|
|
158
|
-
SelectScrollUpButton,
|
|
184
|
+
SelectLabel,
|
|
159
185
|
SelectScrollDownButton,
|
|
160
|
-
|
|
186
|
+
SelectScrollUpButton,
|
|
187
|
+
SelectSeparator,
|
|
188
|
+
SelectTrigger,
|
|
189
|
+
SelectValue,
|
|
190
|
+
}
|