@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,11 @@
|
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
4
|
+
|
|
5
|
+
//#region src/components/label.d.ts
|
|
6
|
+
declare function Label({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof LabelPrimitive.Root>): _$react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Label };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
5
|
+
//#region src/components/label.tsx
|
|
6
|
+
function Label({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(LabelPrimitive.Root, {
|
|
8
|
+
"data-slot": "label",
|
|
9
|
+
className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Label };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/pagination.d.ts
|
|
5
|
+
interface PaginationProps extends React.ComponentProps<"nav"> {
|
|
6
|
+
currentPage: number;
|
|
7
|
+
totalPages: number;
|
|
8
|
+
onPageChange: (page: number) => void;
|
|
9
|
+
}
|
|
10
|
+
declare function Pagination({
|
|
11
|
+
currentPage,
|
|
12
|
+
totalPages,
|
|
13
|
+
onPageChange,
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}: PaginationProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Pagination, type PaginationProps };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.mjs";
|
|
3
|
+
import { Button } from "./button.mjs";
|
|
4
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/pagination.tsx
|
|
7
|
+
function Pagination({ currentPage, totalPages, onPageChange, className, ...props }) {
|
|
8
|
+
if (totalPages <= 1) return null;
|
|
9
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
10
|
+
"data-slot": "pagination",
|
|
11
|
+
"aria-label": "Pagination",
|
|
12
|
+
className: cn("flex items-center justify-between", className),
|
|
13
|
+
...props,
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
16
|
+
variant: "secondary",
|
|
17
|
+
disabled: currentPage <= 1,
|
|
18
|
+
onClick: () => onPageChange(currentPage - 1),
|
|
19
|
+
"aria-label": "Previous page",
|
|
20
|
+
children: [/* @__PURE__ */ jsx(ChevronLeft, {}), "Previous"]
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ jsxs("span", {
|
|
23
|
+
className: "type-text-sm text-muted-foreground",
|
|
24
|
+
children: [
|
|
25
|
+
"Page ",
|
|
26
|
+
currentPage,
|
|
27
|
+
" of ",
|
|
28
|
+
totalPages
|
|
29
|
+
]
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
32
|
+
variant: "secondary",
|
|
33
|
+
disabled: currentPage >= totalPages,
|
|
34
|
+
onClick: () => onPageChange(currentPage + 1),
|
|
35
|
+
"aria-label": "Next page",
|
|
36
|
+
children: ["Next", /* @__PURE__ */ jsx(ChevronRight, {})]
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { Pagination };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
4
|
+
|
|
5
|
+
//#region src/components/popover.d.ts
|
|
6
|
+
declare function Popover({
|
|
7
|
+
...props
|
|
8
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Root>): _$react_jsx_runtime0.JSX.Element;
|
|
9
|
+
declare function PopoverTrigger({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Trigger>): _$react_jsx_runtime0.JSX.Element;
|
|
12
|
+
declare function PopoverAnchor({
|
|
13
|
+
...props
|
|
14
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Anchor>): _$react_jsx_runtime0.JSX.Element;
|
|
15
|
+
declare function PopoverContent({
|
|
16
|
+
className,
|
|
17
|
+
align,
|
|
18
|
+
sideOffset,
|
|
19
|
+
...props
|
|
20
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Content>): _$react_jsx_runtime0.JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
5
|
+
//#region src/components/popover.tsx
|
|
6
|
+
function Popover({ ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Root, {
|
|
8
|
+
"data-slot": "popover",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function PopoverTrigger({ ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, {
|
|
14
|
+
"data-slot": "popover-trigger",
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function PopoverAnchor({ ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Anchor, {
|
|
20
|
+
"data-slot": "popover-anchor",
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function PopoverContent({ className, align = "center", sideOffset = 4, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(PopoverPrimitive.Content, {
|
|
26
|
+
"data-slot": "popover-content",
|
|
27
|
+
align,
|
|
28
|
+
sideOffset,
|
|
29
|
+
className: cn("bg-popover text-popover-foreground", "z-50 w-72 rounded-md border border-border-secondary p-4 shadow-lg outline-hidden", "origin-(--radix-popover-content-transform-origin)", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "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", className),
|
|
30
|
+
...props
|
|
31
|
+
}) });
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4
|
+
|
|
5
|
+
//#region src/components/radio-group.d.ts
|
|
6
|
+
declare function RadioGroup({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Root>): _$react_jsx_runtime0.JSX.Element;
|
|
10
|
+
declare function RadioGroupItem({
|
|
11
|
+
className,
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Item>): _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
5
|
+
//#region src/components/radio-group.tsx
|
|
6
|
+
function RadioGroup({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, {
|
|
8
|
+
"data-slot": "radio-group",
|
|
9
|
+
className: cn("grid gap-2", className),
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function RadioGroupItem({ className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Item, {
|
|
15
|
+
"data-slot": "radio-group-item",
|
|
16
|
+
className: cn("peer size-4 shrink-0 rounded-full border border-border bg-background", "not-disabled:data-[state=checked]:border-primary not-disabled:data-[state=checked]:bg-primary not-disabled:data-[state=checked]:text-primary-foreground", "transition-colors", "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", "disabled:pointer-events-none disabled:bg-muted disabled:border-border disabled:text-border", className),
|
|
17
|
+
...props,
|
|
18
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, {
|
|
19
|
+
"data-slot": "radio-group-indicator",
|
|
20
|
+
className: "flex items-center justify-center",
|
|
21
|
+
children: /* @__PURE__ */ jsx("span", { className: "size-1.5 rounded-full bg-current" })
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
4
|
+
|
|
5
|
+
//#region src/components/scroll-area.d.ts
|
|
6
|
+
declare function ScrollArea({
|
|
7
|
+
className,
|
|
8
|
+
children,
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): _$react_jsx_runtime0.JSX.Element;
|
|
11
|
+
declare function ScrollBar({
|
|
12
|
+
className,
|
|
13
|
+
orientation,
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): _$react_jsx_runtime0.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.mjs";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
5
|
+
//#region src/components/scroll-area.tsx
|
|
6
|
+
function ScrollArea({ className, children, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsxs(ScrollAreaPrimitive.Root, {
|
|
8
|
+
"data-slot": "scroll-area",
|
|
9
|
+
className: cn("relative", className),
|
|
10
|
+
...props,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, {
|
|
13
|
+
"data-slot": "scroll-area-viewport",
|
|
14
|
+
className: "size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring",
|
|
15
|
+
children
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
18
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
|
|
19
|
+
]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function ScrollBar({ className, orientation = "vertical", ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, {
|
|
24
|
+
"data-slot": "scroll-area-scrollbar",
|
|
25
|
+
orientation,
|
|
26
|
+
className: cn("flex touch-none p-px transition-colors select-none", orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent", orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", className),
|
|
27
|
+
...props,
|
|
28
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, {
|
|
29
|
+
"data-slot": "scroll-area-thumb",
|
|
30
|
+
className: "bg-border relative flex-1 rounded-full"
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
2
|
+
|
|
3
|
+
//#region src/components/select-trigger-variants.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Shared trigger styles for Select and Combobox.
|
|
6
|
+
* Both components use the same visual treatment for their trigger buttons.
|
|
7
|
+
* Edit here to keep them in sync.
|
|
8
|
+
*/
|
|
9
|
+
declare const selectTriggerVariants: (props?: ({
|
|
10
|
+
size?: "sm" | "md" | null | undefined;
|
|
11
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { selectTriggerVariants };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
//#region src/components/select-trigger-variants.ts
|
|
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
|
+
const selectTriggerVariants = cva([
|
|
9
|
+
"flex w-full items-center gap-2 rounded-md border bg-background text-foreground shadow-xs outline-hidden",
|
|
10
|
+
"transition-colors",
|
|
11
|
+
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
12
|
+
"data-[state=open]:ring-2 data-[state=open]:ring-ring data-[state=open]:ring-offset-2 data-[state=open]:ring-offset-background",
|
|
13
|
+
"disabled:pointer-events-none disabled:bg-disabled disabled:text-disabled-foreground disabled:border-disabled",
|
|
14
|
+
"[&_svg:not([class*='size-'])]:size-5 [&_svg]:shrink-0"
|
|
15
|
+
].join(" "), {
|
|
16
|
+
variants: { size: {
|
|
17
|
+
sm: "min-h-8 px-2 py-1.5 type-text-sm",
|
|
18
|
+
md: "min-h-10 px-3.5 type-text-md"
|
|
19
|
+
} },
|
|
20
|
+
defaultVariants: { size: "md" }
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { selectTriggerVariants };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { selectTriggerVariants } from "./select-trigger-variants.mjs";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
6
|
+
|
|
7
|
+
//#region src/components/select.d.ts
|
|
8
|
+
declare function Select({
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof SelectPrimitive.Root>): _$react_jsx_runtime0.JSX.Element;
|
|
11
|
+
declare function SelectGroup({
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<typeof SelectPrimitive.Group>): _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
declare function SelectValue({
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof SelectPrimitive.Value>): _$react_jsx_runtime0.JSX.Element;
|
|
17
|
+
declare function SelectTrigger({
|
|
18
|
+
className,
|
|
19
|
+
size,
|
|
20
|
+
children,
|
|
21
|
+
...props
|
|
22
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & VariantProps<typeof selectTriggerVariants>): _$react_jsx_runtime0.JSX.Element;
|
|
23
|
+
declare function SelectContent({
|
|
24
|
+
className,
|
|
25
|
+
children,
|
|
26
|
+
position,
|
|
27
|
+
...props
|
|
28
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>): _$react_jsx_runtime0.JSX.Element;
|
|
29
|
+
declare function SelectLabel({
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<typeof SelectPrimitive.Label>): _$react_jsx_runtime0.JSX.Element;
|
|
33
|
+
declare function SelectItem({
|
|
34
|
+
className,
|
|
35
|
+
children,
|
|
36
|
+
...props
|
|
37
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item>): _$react_jsx_runtime0.JSX.Element;
|
|
38
|
+
declare function SelectSeparator({
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}: React.ComponentProps<typeof SelectPrimitive.Separator>): _$react_jsx_runtime0.JSX.Element;
|
|
42
|
+
declare function SelectScrollUpButton({
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): _$react_jsx_runtime0.JSX.Element;
|
|
46
|
+
declare function SelectScrollDownButton({
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): _$react_jsx_runtime0.JSX.Element;
|
|
50
|
+
//#endregion
|
|
51
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, selectTriggerVariants };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.mjs";
|
|
3
|
+
import { selectTriggerVariants } from "./select-trigger-variants.mjs";
|
|
4
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
7
|
+
//#region src/components/select.tsx
|
|
8
|
+
function Select({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Root, {
|
|
10
|
+
"data-slot": "select",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function SelectGroup({ ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Group, {
|
|
16
|
+
"data-slot": "select-group",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function SelectValue({ ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Value, {
|
|
22
|
+
"data-slot": "select-value",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function SelectTrigger({ className, size = "md", children, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
28
|
+
"data-slot": "select-trigger",
|
|
29
|
+
className: cn(selectTriggerVariants({ size }), "justify-between data-[placeholder]:text-placeholder", "*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2", className),
|
|
30
|
+
...props,
|
|
31
|
+
children: [children, /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
|
|
32
|
+
asChild: true,
|
|
33
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-5 shrink-0 text-muted-foreground" })
|
|
34
|
+
})]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function SelectContent({ className, children, position = "popper", ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
|
|
39
|
+
"data-slot": "select-content",
|
|
40
|
+
className: cn("bg-popover text-popover-foreground", "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", "origin-(--radix-select-content-transform-origin)", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "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", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
41
|
+
position,
|
|
42
|
+
...props,
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
45
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
|
|
46
|
+
className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
|
|
47
|
+
children
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
50
|
+
]
|
|
51
|
+
}) });
|
|
52
|
+
}
|
|
53
|
+
function SelectLabel({ className, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Label, {
|
|
55
|
+
"data-slot": "select-label",
|
|
56
|
+
className: cn("px-2.5 py-1.5 type-text-xs font-medium text-subtle-foreground", className),
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function SelectItem({ className, children, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
62
|
+
"data-slot": "select-item",
|
|
63
|
+
className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-2 pr-8 pl-2.5 outline-hidden select-none", "type-text-md font-medium text-foreground mx-1 my-px", "[@media(hover:hover)]:hover:bg-background-hover", "focus:bg-background-hover", "data-[disabled]:pointer-events-none data-[disabled]:text-disabled-foreground", "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
64
|
+
...props,
|
|
65
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
66
|
+
className: "absolute right-2 flex size-4 items-center justify-center",
|
|
67
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4 text-primary" }) })
|
|
68
|
+
}), /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function SelectSeparator({ className, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Separator, {
|
|
73
|
+
"data-slot": "select-separator",
|
|
74
|
+
className: cn("bg-border-secondary -mx-1 my-1 h-px", className),
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function SelectScrollUpButton({ className, ...props }) {
|
|
79
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, {
|
|
80
|
+
"data-slot": "select-scroll-up-button",
|
|
81
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
82
|
+
...props,
|
|
83
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function SelectScrollDownButton({ className, ...props }) {
|
|
87
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, {
|
|
88
|
+
"data-slot": "select-scroll-down-button",
|
|
89
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
90
|
+
...props,
|
|
91
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, selectTriggerVariants };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
|
+
|
|
5
|
+
//#region src/components/separator.d.ts
|
|
6
|
+
declare function Separator({
|
|
7
|
+
className,
|
|
8
|
+
orientation,
|
|
9
|
+
decorative,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof SeparatorPrimitive.Root>): _$react_jsx_runtime0.JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Separator };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
5
|
+
//#region src/components/separator.tsx
|
|
6
|
+
function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(SeparatorPrimitive.Root, {
|
|
8
|
+
"data-slot": "separator",
|
|
9
|
+
decorative,
|
|
10
|
+
orientation,
|
|
11
|
+
className: cn("shrink-0 bg-border-secondary", "data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full", "data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Separator };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
|
|
5
|
+
//#region src/components/sheet.d.ts
|
|
6
|
+
declare function Sheet({
|
|
7
|
+
...props
|
|
8
|
+
}: React.ComponentProps<typeof SheetPrimitive.Root>): _$react_jsx_runtime0.JSX.Element;
|
|
9
|
+
declare function SheetTrigger({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof SheetPrimitive.Trigger>): _$react_jsx_runtime0.JSX.Element;
|
|
12
|
+
declare function SheetClose({
|
|
13
|
+
...props
|
|
14
|
+
}: React.ComponentProps<typeof SheetPrimitive.Close>): _$react_jsx_runtime0.JSX.Element;
|
|
15
|
+
declare function SheetPortal({
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof SheetPrimitive.Portal>): _$react_jsx_runtime0.JSX.Element;
|
|
18
|
+
declare function SheetContent({
|
|
19
|
+
className,
|
|
20
|
+
children,
|
|
21
|
+
side,
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
24
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
25
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
26
|
+
declare function SheetHeader({
|
|
27
|
+
className,
|
|
28
|
+
...props
|
|
29
|
+
}: React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
|
|
30
|
+
declare function SheetFooter({
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
|
+
}: React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
|
|
34
|
+
declare function SheetTitle({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: React.ComponentProps<typeof SheetPrimitive.Title>): _$react_jsx_runtime0.JSX.Element;
|
|
38
|
+
declare function SheetDescription({
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}: React.ComponentProps<typeof SheetPrimitive.Description>): _$react_jsx_runtime0.JSX.Element;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetPortal, SheetTitle, SheetTrigger };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.mjs";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
5
|
+
//#region src/components/sheet.tsx
|
|
6
|
+
function Sheet({ ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Root, {
|
|
8
|
+
"data-slot": "sheet",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function SheetTrigger({ ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, {
|
|
14
|
+
"data-slot": "sheet-trigger",
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function SheetClose({ ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Close, {
|
|
20
|
+
"data-slot": "sheet-close",
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function SheetPortal({ ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Portal, {
|
|
26
|
+
"data-slot": "sheet-portal",
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function SheetOverlay({ className, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Overlay, {
|
|
32
|
+
"data-slot": "sheet-overlay",
|
|
33
|
+
className: cn("fixed inset-0 z-50 bg-overlay", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className),
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function SheetContent({ className, children, side = "right", ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [/* @__PURE__ */ jsx(SheetOverlay, {}), /* @__PURE__ */ jsx(SheetPrimitive.Content, {
|
|
39
|
+
"data-slot": "sheet-content",
|
|
40
|
+
className: cn("bg-background fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:duration-300 data-[state=open]:duration-500", side === "right" && "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", side === "left" && "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", side === "top" && "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", side === "bottom" && "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", className),
|
|
41
|
+
...props,
|
|
42
|
+
children
|
|
43
|
+
})] });
|
|
44
|
+
}
|
|
45
|
+
function SheetHeader({ className, ...props }) {
|
|
46
|
+
return /* @__PURE__ */ jsx("div", {
|
|
47
|
+
"data-slot": "sheet-header",
|
|
48
|
+
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function SheetFooter({ className, ...props }) {
|
|
53
|
+
return /* @__PURE__ */ jsx("div", {
|
|
54
|
+
"data-slot": "sheet-footer",
|
|
55
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function SheetTitle({ className, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Title, {
|
|
61
|
+
"data-slot": "sheet-title",
|
|
62
|
+
className: cn("type-text-md font-semibold text-foreground", className),
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function SheetDescription({ className, ...props }) {
|
|
67
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Description, {
|
|
68
|
+
"data-slot": "sheet-description",
|
|
69
|
+
className: cn("type-text-sm text-subtle-foreground", className),
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetPortal, SheetTitle, SheetTrigger };
|