@blips/ui 0.0.1

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.
Files changed (53) hide show
  1. package/dist/index.cjs +2675 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +514 -0
  4. package/dist/index.d.ts +514 -0
  5. package/dist/index.js +2418 -0
  6. package/dist/index.js.map +1 -0
  7. package/package.json +153 -0
  8. package/src/components/accordion.tsx +56 -0
  9. package/src/components/alert-dialog.tsx +138 -0
  10. package/src/components/alert.tsx +59 -0
  11. package/src/components/aspect-ratio.tsx +5 -0
  12. package/src/components/avatar.tsx +50 -0
  13. package/src/components/badge.tsx +36 -0
  14. package/src/components/breadcrumb.tsx +115 -0
  15. package/src/components/button.tsx +56 -0
  16. package/src/components/calendar.tsx +216 -0
  17. package/src/components/card.tsx +86 -0
  18. package/src/components/carousel.tsx +259 -0
  19. package/src/components/checkbox.tsx +28 -0
  20. package/src/components/collapsible.tsx +11 -0
  21. package/src/components/command.tsx +150 -0
  22. package/src/components/context-menu.tsx +198 -0
  23. package/src/components/dialog.tsx +122 -0
  24. package/src/components/drawer.tsx +116 -0
  25. package/src/components/dropdown-menu.tsx +200 -0
  26. package/src/components/hover-card.tsx +27 -0
  27. package/src/components/input-otp.tsx +69 -0
  28. package/src/components/input.tsx +22 -0
  29. package/src/components/label.tsx +26 -0
  30. package/src/components/menubar.tsx +254 -0
  31. package/src/components/navigation-menu.tsx +128 -0
  32. package/src/components/pagination.tsx +116 -0
  33. package/src/components/popover.tsx +29 -0
  34. package/src/components/progress.tsx +28 -0
  35. package/src/components/radio-group.tsx +42 -0
  36. package/src/components/resizable.tsx +45 -0
  37. package/src/components/scroll-area.tsx +46 -0
  38. package/src/components/select.tsx +160 -0
  39. package/src/components/separator.tsx +29 -0
  40. package/src/components/sheet.tsx +140 -0
  41. package/src/components/skeleton.tsx +15 -0
  42. package/src/components/slider.tsx +26 -0
  43. package/src/components/sonner.tsx +45 -0
  44. package/src/components/switch.tsx +27 -0
  45. package/src/components/table.tsx +117 -0
  46. package/src/components/tabs.tsx +53 -0
  47. package/src/components/textarea.tsx +22 -0
  48. package/src/components/toggle-group.tsx +60 -0
  49. package/src/components/toggle.tsx +43 -0
  50. package/src/components/tooltip.tsx +30 -0
  51. package/src/globals.css +77 -0
  52. package/src/index.ts +322 -0
  53. package/src/lib/utils.ts +6 -0
@@ -0,0 +1,56 @@
1
+ import * as AccordionPrimitive from "@radix-ui/react-accordion";
2
+ import { ChevronDown } from "lucide-react";
3
+ import * as React from "react";
4
+
5
+ import { cn } from "../lib/utils";
6
+
7
+ const Accordion = AccordionPrimitive.Root;
8
+
9
+ const AccordionItem = React.forwardRef<
10
+ React.ElementRef<typeof AccordionPrimitive.Item>,
11
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
12
+ >(({ className, ...props }, ref) => (
13
+ <AccordionPrimitive.Item
14
+ ref={ref}
15
+ className={cn("border-b", className)}
16
+ {...props}
17
+ />
18
+ ));
19
+ AccordionItem.displayName = "AccordionItem";
20
+
21
+ const AccordionTrigger = React.forwardRef<
22
+ React.ElementRef<typeof AccordionPrimitive.Trigger>,
23
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
24
+ >(({ className, children, ...props }, ref) => (
25
+ <AccordionPrimitive.Header className="flex">
26
+ <AccordionPrimitive.Trigger
27
+ ref={ref}
28
+ className={cn(
29
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
30
+ className
31
+ )}
32
+ {...props}
33
+ >
34
+ {children}
35
+ <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
36
+ </AccordionPrimitive.Trigger>
37
+ </AccordionPrimitive.Header>
38
+ ));
39
+ AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
40
+
41
+ const AccordionContent = React.forwardRef<
42
+ React.ElementRef<typeof AccordionPrimitive.Content>,
43
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
44
+ >(({ className, children, ...props }, ref) => (
45
+ <AccordionPrimitive.Content
46
+ ref={ref}
47
+ className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
48
+ {...props}
49
+ >
50
+ <div className={cn("pb-4 pt-0", className)}>{children}</div>
51
+ </AccordionPrimitive.Content>
52
+ ));
53
+
54
+ AccordionContent.displayName = AccordionPrimitive.Content.displayName;
55
+
56
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
@@ -0,0 +1,138 @@
1
+ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
2
+ import * as React from "react";
3
+ import { buttonVariants } from "./button";
4
+ import { cn } from "../lib/utils";
5
+
6
+ const AlertDialog = AlertDialogPrimitive.Root;
7
+
8
+ const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
9
+
10
+ const AlertDialogPortal = AlertDialogPrimitive.Portal;
11
+
12
+ const AlertDialogOverlay = React.forwardRef<
13
+ React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
14
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
15
+ >(({ className, ...props }, ref) => (
16
+ <AlertDialogPrimitive.Overlay
17
+ className={cn(
18
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
19
+ className
20
+ )}
21
+ {...props}
22
+ ref={ref}
23
+ />
24
+ ));
25
+ AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
26
+
27
+ const AlertDialogContent = React.forwardRef<
28
+ React.ElementRef<typeof AlertDialogPrimitive.Content>,
29
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
30
+ >(({ className, ...props }, ref) => (
31
+ <AlertDialogPortal>
32
+ <AlertDialogOverlay />
33
+ <AlertDialogPrimitive.Content
34
+ ref={ref}
35
+ className={cn(
36
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
37
+ className
38
+ )}
39
+ {...props}
40
+ />
41
+ </AlertDialogPortal>
42
+ ));
43
+ AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
44
+
45
+ const AlertDialogHeader = ({
46
+ className,
47
+ ...props
48
+ }: React.HTMLAttributes<HTMLDivElement>) => (
49
+ <div
50
+ className={cn(
51
+ "flex flex-col space-y-2 text-center sm:text-left",
52
+ className
53
+ )}
54
+ {...props}
55
+ />
56
+ );
57
+ AlertDialogHeader.displayName = "AlertDialogHeader";
58
+
59
+ const AlertDialogFooter = ({
60
+ className,
61
+ ...props
62
+ }: React.HTMLAttributes<HTMLDivElement>) => (
63
+ <div
64
+ className={cn(
65
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
66
+ className
67
+ )}
68
+ {...props}
69
+ />
70
+ );
71
+ AlertDialogFooter.displayName = "AlertDialogFooter";
72
+
73
+ const AlertDialogTitle = React.forwardRef<
74
+ React.ElementRef<typeof AlertDialogPrimitive.Title>,
75
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
76
+ >(({ className, ...props }, ref) => (
77
+ <AlertDialogPrimitive.Title
78
+ ref={ref}
79
+ className={cn("text-lg font-semibold", className)}
80
+ {...props}
81
+ />
82
+ ));
83
+ AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
84
+
85
+ const AlertDialogDescription = React.forwardRef<
86
+ React.ElementRef<typeof AlertDialogPrimitive.Description>,
87
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
88
+ >(({ className, ...props }, ref) => (
89
+ <AlertDialogPrimitive.Description
90
+ ref={ref}
91
+ className={cn("text-sm text-muted-foreground", className)}
92
+ {...props}
93
+ />
94
+ ));
95
+ AlertDialogDescription.displayName =
96
+ AlertDialogPrimitive.Description.displayName;
97
+
98
+ const AlertDialogAction = React.forwardRef<
99
+ React.ElementRef<typeof AlertDialogPrimitive.Action>,
100
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
101
+ >(({ className, ...props }, ref) => (
102
+ <AlertDialogPrimitive.Action
103
+ ref={ref}
104
+ className={cn(buttonVariants(), className)}
105
+ {...props}
106
+ />
107
+ ));
108
+ AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
109
+
110
+ const AlertDialogCancel = React.forwardRef<
111
+ React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
112
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
113
+ >(({ className, ...props }, ref) => (
114
+ <AlertDialogPrimitive.Cancel
115
+ ref={ref}
116
+ className={cn(
117
+ buttonVariants({ variant: "outline" }),
118
+ "mt-2 sm:mt-0",
119
+ className
120
+ )}
121
+ {...props}
122
+ />
123
+ ));
124
+ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
125
+
126
+ export {
127
+ AlertDialog,
128
+ AlertDialogPortal,
129
+ AlertDialogOverlay,
130
+ AlertDialogTrigger,
131
+ AlertDialogContent,
132
+ AlertDialogHeader,
133
+ AlertDialogFooter,
134
+ AlertDialogTitle,
135
+ AlertDialogDescription,
136
+ AlertDialogAction,
137
+ AlertDialogCancel,
138
+ };
@@ -0,0 +1,59 @@
1
+ import { cva, type VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+
4
+ import { cn } from "../lib/utils";
5
+
6
+ const alertVariants = cva(
7
+ "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-background text-foreground",
12
+ destructive:
13
+ "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
14
+ },
15
+ },
16
+ defaultVariants: {
17
+ variant: "default",
18
+ },
19
+ }
20
+ );
21
+
22
+ const Alert = React.forwardRef<
23
+ HTMLDivElement,
24
+ React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
25
+ >(({ className, variant, ...props }, ref) => (
26
+ <div
27
+ ref={ref}
28
+ role="alert"
29
+ className={cn(alertVariants({ variant }), className)}
30
+ {...props}
31
+ />
32
+ ));
33
+ Alert.displayName = "Alert";
34
+
35
+ const AlertTitle = React.forwardRef<
36
+ HTMLParagraphElement,
37
+ React.HTMLAttributes<HTMLHeadingElement>
38
+ >(({ className, ...props }, ref) => (
39
+ <h5
40
+ ref={ref}
41
+ className={cn("mb-1 font-medium leading-none tracking-tight", className)}
42
+ {...props}
43
+ />
44
+ ));
45
+ AlertTitle.displayName = "AlertTitle";
46
+
47
+ const AlertDescription = React.forwardRef<
48
+ HTMLParagraphElement,
49
+ React.HTMLAttributes<HTMLParagraphElement>
50
+ >(({ className, ...props }, ref) => (
51
+ <div
52
+ ref={ref}
53
+ className={cn("text-sm [&_p]:leading-relaxed", className)}
54
+ {...props}
55
+ />
56
+ ));
57
+ AlertDescription.displayName = "AlertDescription";
58
+
59
+ export { Alert, AlertTitle, AlertDescription };
@@ -0,0 +1,5 @@
1
+ import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
2
+
3
+ const AspectRatio = AspectRatioPrimitive.Root;
4
+
5
+ export { AspectRatio };
@@ -0,0 +1,50 @@
1
+ "use client";
2
+
3
+ import * as AvatarPrimitive from "@radix-ui/react-avatar";
4
+ import * as React from "react";
5
+
6
+ import { cn } from "../lib/utils";
7
+
8
+ const Avatar = React.forwardRef<
9
+ React.ElementRef<typeof AvatarPrimitive.Root>,
10
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
11
+ >(({ className, ...props }, ref) => (
12
+ <AvatarPrimitive.Root
13
+ ref={ref}
14
+ className={cn(
15
+ "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
16
+ className
17
+ )}
18
+ {...props}
19
+ />
20
+ ));
21
+ Avatar.displayName = AvatarPrimitive.Root.displayName;
22
+
23
+ const AvatarImage = React.forwardRef<
24
+ React.ElementRef<typeof AvatarPrimitive.Image>,
25
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
26
+ >(({ className, ...props }, ref) => (
27
+ <AvatarPrimitive.Image
28
+ ref={ref}
29
+ className={cn("aspect-square h-full w-full", className)}
30
+ {...props}
31
+ />
32
+ ));
33
+ AvatarImage.displayName = AvatarPrimitive.Image.displayName;
34
+
35
+ const AvatarFallback = React.forwardRef<
36
+ React.ElementRef<typeof AvatarPrimitive.Fallback>,
37
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
38
+ >(({ className, ...props }, ref) => (
39
+ <AvatarPrimitive.Fallback
40
+ ref={ref}
41
+ className={cn(
42
+ "flex h-full w-full items-center justify-center rounded-full bg-muted",
43
+ className
44
+ )}
45
+ {...props}
46
+ />
47
+ ));
48
+ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
49
+
50
+ export { Avatar, AvatarImage, AvatarFallback };
@@ -0,0 +1,36 @@
1
+ import { cva, type VariantProps } from "class-variance-authority";
2
+ import type * as React from "react";
3
+
4
+ import { cn } from "../lib/utils";
5
+
6
+ const badgeVariants = cva(
7
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default:
12
+ "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
13
+ secondary:
14
+ "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
15
+ destructive:
16
+ "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
17
+ outline: "text-foreground",
18
+ },
19
+ },
20
+ defaultVariants: {
21
+ variant: "default",
22
+ },
23
+ }
24
+ );
25
+
26
+ export interface BadgeProps
27
+ extends React.HTMLAttributes<HTMLDivElement>,
28
+ VariantProps<typeof badgeVariants> {}
29
+
30
+ function Badge({ className, variant, ...props }: BadgeProps) {
31
+ return (
32
+ <div className={cn(badgeVariants({ variant }), className)} {...props} />
33
+ );
34
+ }
35
+
36
+ export { Badge, badgeVariants };
@@ -0,0 +1,115 @@
1
+ import { Slot } from "@radix-ui/react-slot";
2
+ import { ChevronRight, MoreHorizontal } from "lucide-react";
3
+ import * as React from "react";
4
+
5
+ import { cn } from "../lib/utils";
6
+
7
+ const Breadcrumb = React.forwardRef<
8
+ HTMLElement,
9
+ React.ComponentPropsWithoutRef<"nav"> & {
10
+ separator?: React.ReactNode;
11
+ }
12
+ >(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />);
13
+ Breadcrumb.displayName = "Breadcrumb";
14
+
15
+ const BreadcrumbList = React.forwardRef<
16
+ HTMLOListElement,
17
+ React.ComponentPropsWithoutRef<"ol">
18
+ >(({ className, ...props }, ref) => (
19
+ <ol
20
+ ref={ref}
21
+ className={cn(
22
+ "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
23
+ className
24
+ )}
25
+ {...props}
26
+ />
27
+ ));
28
+ BreadcrumbList.displayName = "BreadcrumbList";
29
+
30
+ const BreadcrumbItem = React.forwardRef<
31
+ HTMLLIElement,
32
+ React.ComponentPropsWithoutRef<"li">
33
+ >(({ className, ...props }, ref) => (
34
+ <li
35
+ ref={ref}
36
+ className={cn("inline-flex items-center gap-1.5", className)}
37
+ {...props}
38
+ />
39
+ ));
40
+ BreadcrumbItem.displayName = "BreadcrumbItem";
41
+
42
+ const BreadcrumbLink = React.forwardRef<
43
+ HTMLAnchorElement,
44
+ React.ComponentPropsWithoutRef<"a"> & {
45
+ asChild?: boolean;
46
+ }
47
+ >(({ asChild, className, ...props }, ref) => {
48
+ const Comp = asChild ? Slot : "a";
49
+
50
+ return (
51
+ <Comp
52
+ ref={ref}
53
+ className={cn("transition-colors hover:text-foreground", className)}
54
+ {...props}
55
+ />
56
+ );
57
+ });
58
+ BreadcrumbLink.displayName = "BreadcrumbLink";
59
+
60
+ const BreadcrumbPage = React.forwardRef<
61
+ HTMLSpanElement,
62
+ React.ComponentPropsWithoutRef<"span">
63
+ >(({ className, ...props }, ref) => (
64
+ <span
65
+ ref={ref}
66
+ role="link"
67
+ aria-disabled="true"
68
+ aria-current="page"
69
+ className={cn("font-normal text-foreground", className)}
70
+ {...props}
71
+ />
72
+ ));
73
+ BreadcrumbPage.displayName = "BreadcrumbPage";
74
+
75
+ const BreadcrumbSeparator = ({
76
+ children,
77
+ className,
78
+ ...props
79
+ }: React.ComponentProps<"li">) => (
80
+ <li
81
+ role="presentation"
82
+ aria-hidden="true"
83
+ className={cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)}
84
+ {...props}
85
+ >
86
+ {children ?? <ChevronRight />}
87
+ </li>
88
+ );
89
+ BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
90
+
91
+ const BreadcrumbEllipsis = ({
92
+ className,
93
+ ...props
94
+ }: React.ComponentProps<"span">) => (
95
+ <span
96
+ role="presentation"
97
+ aria-hidden="true"
98
+ className={cn("flex h-9 w-9 items-center justify-center", className)}
99
+ {...props}
100
+ >
101
+ <MoreHorizontal className="h-4 w-4" />
102
+ <span className="sr-only">More</span>
103
+ </span>
104
+ );
105
+ BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
106
+
107
+ export {
108
+ Breadcrumb,
109
+ BreadcrumbList,
110
+ BreadcrumbItem,
111
+ BreadcrumbLink,
112
+ BreadcrumbPage,
113
+ BreadcrumbSeparator,
114
+ BreadcrumbEllipsis,
115
+ };
@@ -0,0 +1,56 @@
1
+ import { Slot } from "@radix-ui/react-slot";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+ import * as React from "react";
4
+
5
+ import { cn } from "../lib/utils";
6
+
7
+ const buttonVariants = cva(
8
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
13
+ destructive:
14
+ "bg-destructive text-destructive-foreground hover:bg-destructive/90",
15
+ outline:
16
+ "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
17
+ secondary:
18
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19
+ ghost: "hover:bg-accent hover:text-accent-foreground",
20
+ link: "text-primary underline-offset-4 hover:underline",
21
+ },
22
+ size: {
23
+ default: "h-10 px-4 py-2",
24
+ sm: "h-9 rounded-md px-3",
25
+ lg: "h-11 rounded-md px-8",
26
+ icon: "h-10 w-10",
27
+ },
28
+ },
29
+ defaultVariants: {
30
+ variant: "default",
31
+ size: "default",
32
+ },
33
+ }
34
+ );
35
+
36
+ export interface ButtonProps
37
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
38
+ VariantProps<typeof buttonVariants> {
39
+ asChild?: boolean;
40
+ }
41
+
42
+ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
43
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
44
+ const Comp = asChild ? Slot : "button";
45
+ return (
46
+ <Comp
47
+ className={cn(buttonVariants({ variant, size, className }))}
48
+ ref={ref}
49
+ {...props}
50
+ />
51
+ );
52
+ }
53
+ );
54
+ Button.displayName = "Button";
55
+
56
+ export { Button, buttonVariants };