@alpic-ai/ui 0.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/components/accordion-card.d.mts +41 -0
- package/dist/components/accordion-card.mjs +61 -0
- package/dist/components/accordion.d.mts +29 -0
- package/dist/components/accordion.mjs +48 -0
- package/dist/components/alert.d.mts +40 -0
- package/dist/components/alert.mjs +63 -0
- package/dist/components/attachment-tile.d.mts +26 -0
- package/dist/components/attachment-tile.mjs +35 -0
- package/dist/components/avatar.d.mts +52 -0
- package/dist/components/avatar.mjs +81 -0
- package/dist/components/badge.d.mts +20 -0
- package/dist/components/badge.mjs +36 -0
- package/dist/components/breadcrumb.d.mts +42 -0
- package/dist/components/breadcrumb.mjs +79 -0
- package/dist/components/button.d.mts +29 -0
- package/dist/components/button.mjs +67 -0
- package/dist/components/card.d.mts +37 -0
- package/dist/components/card.mjs +54 -0
- package/dist/components/checkbox.d.mts +11 -0
- package/dist/components/checkbox.mjs +26 -0
- package/dist/components/collapsible.d.mts +16 -0
- package/dist/components/collapsible.mjs +24 -0
- package/dist/components/combobox.d.mts +86 -0
- package/dist/components/combobox.mjs +207 -0
- package/dist/components/command.d.mts +38 -0
- package/dist/components/command.mjs +68 -0
- package/dist/components/copyable.d.mts +22 -0
- package/dist/components/copyable.mjs +33 -0
- package/dist/components/description-list.d.mts +22 -0
- package/dist/components/description-list.mjs +34 -0
- package/dist/components/dialog.d.mts +61 -0
- package/dist/components/dialog.mjs +110 -0
- package/dist/components/dropdown-menu.d.mts +72 -0
- package/dist/components/dropdown-menu.mjs +122 -0
- package/dist/components/input-group.d.mts +25 -0
- package/dist/components/input-group.mjs +43 -0
- package/dist/components/input.d.mts +27 -0
- package/dist/components/input.mjs +90 -0
- package/dist/components/label.d.mts +11 -0
- package/dist/components/label.mjs +14 -0
- package/dist/components/pagination.d.mts +18 -0
- package/dist/components/pagination.mjs +42 -0
- package/dist/components/popover.d.mts +22 -0
- package/dist/components/popover.mjs +34 -0
- package/dist/components/radio-group.d.mts +15 -0
- package/dist/components/radio-group.mjs +26 -0
- package/dist/components/scroll-area.d.mts +17 -0
- package/dist/components/scroll-area.mjs +35 -0
- package/dist/components/select-trigger-variants.d.mts +13 -0
- package/dist/components/select-trigger-variants.mjs +23 -0
- package/dist/components/select.d.mts +51 -0
- package/dist/components/select.mjs +95 -0
- package/dist/components/separator.d.mts +13 -0
- package/dist/components/separator.mjs +16 -0
- package/dist/components/sheet.d.mts +43 -0
- package/dist/components/sheet.mjs +74 -0
- package/dist/components/sidebar.d.mts +163 -0
- package/dist/components/sidebar.mjs +378 -0
- package/dist/components/skeleton.d.mts +16 -0
- package/dist/components/skeleton.mjs +21 -0
- package/dist/components/sonner.d.mts +29 -0
- package/dist/components/sonner.mjs +76 -0
- package/dist/components/spinner.d.mts +30 -0
- package/dist/components/spinner.mjs +46 -0
- package/dist/components/status-dot.d.mts +19 -0
- package/dist/components/status-dot.mjs +34 -0
- package/dist/components/switch.d.mts +11 -0
- package/dist/components/switch.mjs +18 -0
- package/dist/components/table.d.mts +38 -0
- package/dist/components/table.mjs +65 -0
- package/dist/components/tabs.d.mts +58 -0
- package/dist/components/tabs.mjs +119 -0
- package/dist/components/tag.d.mts +35 -0
- package/dist/components/tag.mjs +65 -0
- package/dist/components/textarea.d.mts +21 -0
- package/dist/components/textarea.mjs +44 -0
- package/dist/components/toggle-group.d.mts +28 -0
- package/dist/components/toggle-group.mjs +72 -0
- package/dist/components/tooltip-icon-button.d.mts +12 -0
- package/dist/components/tooltip-icon-button.mjs +27 -0
- package/dist/components/tooltip.d.mts +23 -0
- package/dist/components/tooltip.mjs +35 -0
- package/dist/hooks/use-copy-to-clipboard.d.mts +11 -0
- package/dist/hooks/use-copy-to-clipboard.mjs +24 -0
- package/dist/hooks/use-mobile.d.mts +4 -0
- package/dist/hooks/use-mobile.mjs +16 -0
- package/dist/lib/cn.d.mts +6 -0
- package/dist/lib/cn.mjs +8 -0
- package/package.json +88 -0
- package/src/components/accordion-card.tsx +103 -0
- package/src/components/accordion.tsx +63 -0
- package/src/components/alert.tsx +74 -0
- package/src/components/attachment-tile.tsx +68 -0
- package/src/components/avatar.tsx +127 -0
- package/src/components/badge.tsx +41 -0
- package/src/components/breadcrumb.tsx +98 -0
- package/src/components/button.tsx +106 -0
- package/src/components/card.tsx +62 -0
- package/src/components/checkbox.tsx +35 -0
- package/src/components/collapsible.tsx +18 -0
- package/src/components/combobox.tsx +393 -0
- package/src/components/command.tsx +112 -0
- package/src/components/copyable.tsx +47 -0
- package/src/components/description-list.tsx +36 -0
- package/src/components/dialog.tsx +161 -0
- package/src/components/dropdown-menu.tsx +234 -0
- package/src/components/input-group.tsx +97 -0
- package/src/components/input.tsx +145 -0
- package/src/components/label.tsx +20 -0
- package/src/components/pagination.tsx +53 -0
- package/src/components/popover.tsx +49 -0
- package/src/components/radio-group.tsx +33 -0
- package/src/components/scroll-area.tsx +48 -0
- package/src/components/select-trigger-variants.ts +28 -0
- package/src/components/select.tsx +186 -0
- package/src/components/separator.tsx +30 -0
- package/src/components/sheet.tsx +112 -0
- package/src/components/sidebar.tsx +682 -0
- package/src/components/skeleton.tsx +24 -0
- package/src/components/sonner.tsx +91 -0
- package/src/components/spinner.tsx +62 -0
- package/src/components/status-dot.tsx +33 -0
- package/src/components/switch.tsx +33 -0
- package/src/components/table.tsx +89 -0
- package/src/components/tabs.tsx +226 -0
- package/src/components/tag.tsx +82 -0
- package/src/components/textarea.tsx +70 -0
- package/src/components/toggle-group.tsx +96 -0
- package/src/components/tooltip-icon-button.tsx +33 -0
- package/src/components/tooltip.tsx +54 -0
- package/src/hooks/use-copy-to-clipboard.ts +27 -0
- package/src/hooks/use-mobile.ts +17 -0
- package/src/lib/cn.ts +6 -0
- package/src/styles/tokens.css +352 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
4
|
+
import type * as React from "react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../lib/cn";
|
|
7
|
+
import { Button } from "./button";
|
|
8
|
+
|
|
9
|
+
interface PaginationProps extends React.ComponentProps<"nav"> {
|
|
10
|
+
currentPage: number;
|
|
11
|
+
totalPages: number;
|
|
12
|
+
onPageChange: (page: number) => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function Pagination({ currentPage, totalPages, onPageChange, className, ...props }: PaginationProps) {
|
|
16
|
+
if (totalPages <= 1) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<nav
|
|
22
|
+
data-slot="pagination"
|
|
23
|
+
aria-label="Pagination"
|
|
24
|
+
className={cn("flex items-center justify-between", className)}
|
|
25
|
+
{...props}
|
|
26
|
+
>
|
|
27
|
+
<Button
|
|
28
|
+
variant="secondary"
|
|
29
|
+
disabled={currentPage <= 1}
|
|
30
|
+
onClick={() => onPageChange(currentPage - 1)}
|
|
31
|
+
aria-label="Previous page"
|
|
32
|
+
>
|
|
33
|
+
<ChevronLeft />
|
|
34
|
+
Previous
|
|
35
|
+
</Button>
|
|
36
|
+
<span className="type-text-sm text-muted-foreground">
|
|
37
|
+
Page {currentPage} of {totalPages}
|
|
38
|
+
</span>
|
|
39
|
+
<Button
|
|
40
|
+
variant="secondary"
|
|
41
|
+
disabled={currentPage >= totalPages}
|
|
42
|
+
onClick={() => onPageChange(currentPage + 1)}
|
|
43
|
+
aria-label="Next page"
|
|
44
|
+
>
|
|
45
|
+
Next
|
|
46
|
+
<ChevronRight />
|
|
47
|
+
</Button>
|
|
48
|
+
</nav>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type { PaginationProps };
|
|
53
|
+
export { Pagination };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
4
|
+
import type * as React from "react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../lib/cn";
|
|
7
|
+
|
|
8
|
+
function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
9
|
+
return <PopoverPrimitive.Root data-slot="popover" {...props} />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
13
|
+
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
17
|
+
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function PopoverContent({
|
|
21
|
+
className,
|
|
22
|
+
align = "center",
|
|
23
|
+
sideOffset = 4,
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
26
|
+
return (
|
|
27
|
+
<PopoverPrimitive.Portal>
|
|
28
|
+
<PopoverPrimitive.Content
|
|
29
|
+
data-slot="popover-content"
|
|
30
|
+
align={align}
|
|
31
|
+
sideOffset={sideOffset}
|
|
32
|
+
className={cn(
|
|
33
|
+
"bg-popover text-popover-foreground",
|
|
34
|
+
"z-50 w-72 rounded-md border border-border-secondary p-4 shadow-lg outline-hidden",
|
|
35
|
+
"origin-(--radix-popover-content-transform-origin)",
|
|
36
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
37
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
38
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
39
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
40
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
41
|
+
className,
|
|
42
|
+
)}
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
</PopoverPrimitive.Portal>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4
|
+
import type * as React from "react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../lib/cn";
|
|
7
|
+
|
|
8
|
+
function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
|
|
9
|
+
return <RadioGroupPrimitive.Root data-slot="radio-group" className={cn("grid gap-2", className)} {...props} />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
|
|
13
|
+
return (
|
|
14
|
+
<RadioGroupPrimitive.Item
|
|
15
|
+
data-slot="radio-group-item"
|
|
16
|
+
className={cn(
|
|
17
|
+
"peer size-4 shrink-0 rounded-full border border-border bg-background",
|
|
18
|
+
"not-disabled:data-[state=checked]:border-primary not-disabled:data-[state=checked]:bg-primary not-disabled:data-[state=checked]:text-primary-foreground",
|
|
19
|
+
"transition-colors",
|
|
20
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
21
|
+
"disabled:pointer-events-none disabled:bg-muted disabled:border-border disabled:text-border",
|
|
22
|
+
className,
|
|
23
|
+
)}
|
|
24
|
+
{...props}
|
|
25
|
+
>
|
|
26
|
+
<RadioGroupPrimitive.Indicator data-slot="radio-group-indicator" className="flex items-center justify-center">
|
|
27
|
+
<span className="size-1.5 rounded-full bg-current" />
|
|
28
|
+
</RadioGroupPrimitive.Indicator>
|
|
29
|
+
</RadioGroupPrimitive.Item>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
4
|
+
import type * as React from "react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../lib/cn";
|
|
7
|
+
|
|
8
|
+
function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
|
|
9
|
+
return (
|
|
10
|
+
<ScrollAreaPrimitive.Root data-slot="scroll-area" className={cn("relative", className)} {...props}>
|
|
11
|
+
<ScrollAreaPrimitive.Viewport
|
|
12
|
+
data-slot="scroll-area-viewport"
|
|
13
|
+
className="size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring"
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</ScrollAreaPrimitive.Viewport>
|
|
17
|
+
<ScrollBar />
|
|
18
|
+
<ScrollAreaPrimitive.Corner />
|
|
19
|
+
</ScrollAreaPrimitive.Root>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function ScrollBar({
|
|
24
|
+
className,
|
|
25
|
+
orientation = "vertical",
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
|
|
28
|
+
return (
|
|
29
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
30
|
+
data-slot="scroll-area-scrollbar"
|
|
31
|
+
orientation={orientation}
|
|
32
|
+
className={cn(
|
|
33
|
+
"flex touch-none p-px transition-colors select-none",
|
|
34
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
35
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
36
|
+
className,
|
|
37
|
+
)}
|
|
38
|
+
{...props}
|
|
39
|
+
>
|
|
40
|
+
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
41
|
+
data-slot="scroll-area-thumb"
|
|
42
|
+
className="bg-border relative flex-1 rounded-full"
|
|
43
|
+
/>
|
|
44
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared trigger styles for Select and Combobox.
|
|
5
|
+
* Both components use the same visual treatment for their trigger buttons.
|
|
6
|
+
* Edit here to keep them in sync.
|
|
7
|
+
*/
|
|
8
|
+
export const selectTriggerVariants = cva(
|
|
9
|
+
[
|
|
10
|
+
"flex w-full items-center gap-2 rounded-md border bg-background text-foreground shadow-xs outline-hidden",
|
|
11
|
+
"transition-colors",
|
|
12
|
+
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
13
|
+
"data-[state=open]:ring-2 data-[state=open]:ring-ring data-[state=open]:ring-offset-2 data-[state=open]:ring-offset-background",
|
|
14
|
+
"disabled:pointer-events-none disabled:bg-disabled disabled:text-disabled-foreground disabled:border-disabled",
|
|
15
|
+
"[&_svg:not([class*='size-'])]:size-5 [&_svg]:shrink-0",
|
|
16
|
+
].join(" "),
|
|
17
|
+
{
|
|
18
|
+
variants: {
|
|
19
|
+
size: {
|
|
20
|
+
sm: "min-h-8 px-2 py-1.5 type-text-sm",
|
|
21
|
+
md: "min-h-10 px-3.5 type-text-md",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
size: "md",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
);
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
|
+
import type { VariantProps } from "class-variance-authority";
|
|
5
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
6
|
+
import type * as React from "react";
|
|
7
|
+
|
|
8
|
+
import { cn } from "../lib/cn";
|
|
9
|
+
import { selectTriggerVariants } from "./select-trigger-variants";
|
|
10
|
+
|
|
11
|
+
function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
12
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
16
|
+
return <SelectPrimitive.Group data-slot="select-group" {...props} />;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
20
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* ── Trigger ──────────────────────────────────────────────────────────────── */
|
|
24
|
+
|
|
25
|
+
function SelectTrigger({
|
|
26
|
+
className,
|
|
27
|
+
size = "md",
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & VariantProps<typeof selectTriggerVariants>) {
|
|
31
|
+
return (
|
|
32
|
+
<SelectPrimitive.Trigger
|
|
33
|
+
data-slot="select-trigger"
|
|
34
|
+
className={cn(
|
|
35
|
+
selectTriggerVariants({ size }),
|
|
36
|
+
"justify-between data-[placeholder]:text-placeholder",
|
|
37
|
+
"*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2",
|
|
38
|
+
className,
|
|
39
|
+
)}
|
|
40
|
+
{...props}
|
|
41
|
+
>
|
|
42
|
+
{children}
|
|
43
|
+
<SelectPrimitive.Icon asChild>
|
|
44
|
+
<ChevronDownIcon className="size-5 shrink-0 text-muted-foreground" />
|
|
45
|
+
</SelectPrimitive.Icon>
|
|
46
|
+
</SelectPrimitive.Trigger>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* ── Content ──────────────────────────────────────────────────────────────── */
|
|
51
|
+
|
|
52
|
+
function SelectContent({
|
|
53
|
+
className,
|
|
54
|
+
children,
|
|
55
|
+
position = "popper",
|
|
56
|
+
...props
|
|
57
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
58
|
+
return (
|
|
59
|
+
<SelectPrimitive.Portal>
|
|
60
|
+
<SelectPrimitive.Content
|
|
61
|
+
data-slot="select-content"
|
|
62
|
+
className={cn(
|
|
63
|
+
"bg-popover text-popover-foreground",
|
|
64
|
+
"relative z-50 max-h-[min(var(--radix-select-content-available-height),300px)] min-w-[8rem] overflow-hidden rounded-md border border-border-secondary py-1 shadow-lg",
|
|
65
|
+
"origin-(--radix-select-content-transform-origin)",
|
|
66
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
67
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
68
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
69
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
70
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
71
|
+
position === "popper" &&
|
|
72
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
73
|
+
className,
|
|
74
|
+
)}
|
|
75
|
+
position={position}
|
|
76
|
+
{...props}
|
|
77
|
+
>
|
|
78
|
+
<SelectScrollUpButton />
|
|
79
|
+
<SelectPrimitive.Viewport
|
|
80
|
+
className={cn(
|
|
81
|
+
"p-1",
|
|
82
|
+
position === "popper" &&
|
|
83
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1",
|
|
84
|
+
)}
|
|
85
|
+
>
|
|
86
|
+
{children}
|
|
87
|
+
</SelectPrimitive.Viewport>
|
|
88
|
+
<SelectScrollDownButton />
|
|
89
|
+
</SelectPrimitive.Content>
|
|
90
|
+
</SelectPrimitive.Portal>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* ── Label ────────────────────────────────────────────────────────────────── */
|
|
95
|
+
|
|
96
|
+
function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
97
|
+
return (
|
|
98
|
+
<SelectPrimitive.Label
|
|
99
|
+
data-slot="select-label"
|
|
100
|
+
className={cn("px-2.5 py-1.5 type-text-xs font-medium text-subtle-foreground", className)}
|
|
101
|
+
{...props}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* ── Item ─────────────────────────────────────────────────────────────────── */
|
|
107
|
+
|
|
108
|
+
function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
109
|
+
return (
|
|
110
|
+
<SelectPrimitive.Item
|
|
111
|
+
data-slot="select-item"
|
|
112
|
+
className={cn(
|
|
113
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-sm py-2 pr-8 pl-2.5 outline-hidden select-none",
|
|
114
|
+
"type-text-md font-medium text-foreground mx-1 my-px",
|
|
115
|
+
"[@media(hover:hover)]:hover:bg-background-hover",
|
|
116
|
+
"focus:bg-background-hover",
|
|
117
|
+
"data-[disabled]:pointer-events-none data-[disabled]:text-disabled-foreground",
|
|
118
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
119
|
+
className,
|
|
120
|
+
)}
|
|
121
|
+
{...props}
|
|
122
|
+
>
|
|
123
|
+
<span className="absolute right-2 flex size-4 items-center justify-center">
|
|
124
|
+
<SelectPrimitive.ItemIndicator>
|
|
125
|
+
<CheckIcon className="size-4 text-primary" />
|
|
126
|
+
</SelectPrimitive.ItemIndicator>
|
|
127
|
+
</span>
|
|
128
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
129
|
+
</SelectPrimitive.Item>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* ── Separator ────────────────────────────────────────────────────────────── */
|
|
134
|
+
|
|
135
|
+
function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
136
|
+
return (
|
|
137
|
+
<SelectPrimitive.Separator
|
|
138
|
+
data-slot="select-separator"
|
|
139
|
+
className={cn("bg-border-secondary -mx-1 my-1 h-px", className)}
|
|
140
|
+
{...props}
|
|
141
|
+
/>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* ── Scroll buttons ──────────────────────────────────────────────────────── */
|
|
146
|
+
|
|
147
|
+
function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
148
|
+
return (
|
|
149
|
+
<SelectPrimitive.ScrollUpButton
|
|
150
|
+
data-slot="select-scroll-up-button"
|
|
151
|
+
className={cn("flex cursor-default items-center justify-center py-1", className)}
|
|
152
|
+
{...props}
|
|
153
|
+
>
|
|
154
|
+
<ChevronUpIcon className="size-4" />
|
|
155
|
+
</SelectPrimitive.ScrollUpButton>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function SelectScrollDownButton({
|
|
160
|
+
className,
|
|
161
|
+
...props
|
|
162
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
163
|
+
return (
|
|
164
|
+
<SelectPrimitive.ScrollDownButton
|
|
165
|
+
data-slot="select-scroll-down-button"
|
|
166
|
+
className={cn("flex cursor-default items-center justify-center py-1", className)}
|
|
167
|
+
{...props}
|
|
168
|
+
>
|
|
169
|
+
<ChevronDownIcon className="size-4" />
|
|
170
|
+
</SelectPrimitive.ScrollDownButton>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export {
|
|
175
|
+
Select,
|
|
176
|
+
SelectContent,
|
|
177
|
+
SelectGroup,
|
|
178
|
+
SelectItem,
|
|
179
|
+
SelectLabel,
|
|
180
|
+
SelectScrollDownButton,
|
|
181
|
+
SelectScrollUpButton,
|
|
182
|
+
SelectSeparator,
|
|
183
|
+
SelectTrigger,
|
|
184
|
+
SelectValue,
|
|
185
|
+
selectTriggerVariants,
|
|
186
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
|
+
import type * as React from "react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../lib/cn";
|
|
7
|
+
|
|
8
|
+
function Separator({
|
|
9
|
+
className,
|
|
10
|
+
orientation = "horizontal",
|
|
11
|
+
decorative = true,
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
14
|
+
return (
|
|
15
|
+
<SeparatorPrimitive.Root
|
|
16
|
+
data-slot="separator"
|
|
17
|
+
decorative={decorative}
|
|
18
|
+
orientation={orientation}
|
|
19
|
+
className={cn(
|
|
20
|
+
"shrink-0 bg-border-secondary",
|
|
21
|
+
"data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full",
|
|
22
|
+
"data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
23
|
+
className,
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { Separator };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import type * as React from "react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../lib/cn";
|
|
7
|
+
|
|
8
|
+
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
9
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
13
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
17
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
21
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
25
|
+
return (
|
|
26
|
+
<SheetPrimitive.Overlay
|
|
27
|
+
data-slot="sheet-overlay"
|
|
28
|
+
className={cn(
|
|
29
|
+
"fixed inset-0 z-50 bg-overlay",
|
|
30
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
31
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
32
|
+
className,
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function SheetContent({
|
|
40
|
+
className,
|
|
41
|
+
children,
|
|
42
|
+
side = "right",
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
45
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
46
|
+
}) {
|
|
47
|
+
return (
|
|
48
|
+
<SheetPortal>
|
|
49
|
+
<SheetOverlay />
|
|
50
|
+
<SheetPrimitive.Content
|
|
51
|
+
data-slot="sheet-content"
|
|
52
|
+
className={cn(
|
|
53
|
+
"bg-background fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out",
|
|
54
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
55
|
+
"data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
56
|
+
side === "right" &&
|
|
57
|
+
"inset-y-0 right-0 h-full w-3/4 border-l border-border sm:max-w-sm data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",
|
|
58
|
+
side === "left" &&
|
|
59
|
+
"inset-y-0 left-0 h-full w-3/4 border-r border-border sm:max-w-sm data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",
|
|
60
|
+
side === "top" &&
|
|
61
|
+
"inset-x-0 top-0 h-auto border-b border-border data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
62
|
+
side === "bottom" &&
|
|
63
|
+
"inset-x-0 bottom-0 h-auto border-t border-border data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
64
|
+
className,
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
>
|
|
68
|
+
{children}
|
|
69
|
+
</SheetPrimitive.Content>
|
|
70
|
+
</SheetPortal>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
75
|
+
return <div data-slot="sheet-header" className={cn("flex flex-col gap-1.5 p-4", className)} {...props} />;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
79
|
+
return <div data-slot="sheet-footer" className={cn("mt-auto flex flex-col gap-2 p-4", className)} {...props} />;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
83
|
+
return (
|
|
84
|
+
<SheetPrimitive.Title
|
|
85
|
+
data-slot="sheet-title"
|
|
86
|
+
className={cn("type-text-md font-semibold text-foreground", className)}
|
|
87
|
+
{...props}
|
|
88
|
+
/>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>) {
|
|
93
|
+
return (
|
|
94
|
+
<SheetPrimitive.Description
|
|
95
|
+
data-slot="sheet-description"
|
|
96
|
+
className={cn("type-text-sm text-subtle-foreground", className)}
|
|
97
|
+
{...props}
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export {
|
|
103
|
+
Sheet,
|
|
104
|
+
SheetClose,
|
|
105
|
+
SheetContent,
|
|
106
|
+
SheetDescription,
|
|
107
|
+
SheetFooter,
|
|
108
|
+
SheetHeader,
|
|
109
|
+
SheetPortal,
|
|
110
|
+
SheetTitle,
|
|
111
|
+
SheetTrigger,
|
|
112
|
+
};
|